libgroboutils-java-5.orig/0000755000175000017500000000000011271425773015663 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/0000755000175000017500000000000011271425773020266 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/deployed.ant-inc.xml0000644000175000017500000000032707547162334024151 0ustar drazzibdrazzib libgroboutils-java-5.orig/testing-mbtf/build.xml0000644000175000017500000001121307610642317022102 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/testing-mbtf/TODO.txt0000644000175000017500000000402607521071657021577 0ustar drazzibdrazzibTODO for MBTF (in approximate order of priority): 1. Redo path following to allow for better memory usage and removal of duplicate path generation. a. For state iterator nodes, we don't need to keep previously visited inner-transition objects, as they will be regenerated when the iterator flips back. b. If we examine when a duplicate path can occur, we notice that at depth X, if every path has a depth of X, then they are all guaranteed to be unique (I should hard prove this, or find a proof for it). However, if at depth X+1, some paths have a depth of X+1, and some have a depth of X (due to terminating nodes). Those paths at depth X are duplicates of depth X paths, due to the fact that depth X generated *all possible paths* for paths with depth X. Solution: we can optimize our search by expanding the return value of path addition: 0 = did not flip over to another path, 1 = did flip over to another path, and 2 = reached terminating node. Parent nodes will behave identically as before, except that: i. immediately after getting the return value, check if it is 2. If so, then remove that transition from the list of transitions searchable - all later investigations of that path will cause duplicates to occur. ii. check for our action. if the value is non-zero, act as if the child node flipped itself, and advance the parent's next transition to the next one. If there are 0 next transitions remaining, then return 2. If this node flipped over in its advance of the next node, then return 1.libgroboutils-java-5.orig/testing-mbtf/log4j.properties0000644000175000017500000000050507521071657023424 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.testing.mbtf=DEBUG libgroboutils-java-5.orig/testing-mbtf/sources/0000755000175000017500000000000010011472755021742 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ait/0000755000175000017500000000000011271425773022526 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ait/about.txt0000644000175000017500000000021007521071657024373 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/testing-mbtf/sources/dev/0000755000175000017500000000000011271425773022527 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/0000755000175000017500000000000010011472753023304 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/0000755000175000017500000000000010011472753025627 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472753030020 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/0000755000175000017500000000000010011472754030751 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/0000755000175000017500000000000011271425773031307 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/0000755000175000017500000000000011271425773032554 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathIteratorImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathIte0000644000175000017500000000713707622026452034041 0ustar drazzibdrazzib/* * @(#)PathIteratorImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import java.util.Enumeration; import java.util.NoSuchElementException; import net.sourceforge.groboutils.mbtf.v1.IPathIterator; import net.sourceforge.groboutils.mbtf.v1.ITransition; import org.apache.log4j.Logger; /** * An iterator to allow the tracing of the transitions through a state machine. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class PathIteratorImpl implements IPathIterator { private static final Logger LOG = Logger.getLogger( PathIteratorImpl.class ); private int index = 0; private ITransition[] trans; public PathIteratorImpl( ITransition[] trans ) { if (trans == null) { LOG.debug("no transitions"); this.trans = new ITransition[0]; } else { int len = trans.length; ITransition[] t = new ITransition[ len ]; for (int i = 0; i < len; ++i) { if (trans[i] == null) { throw new IllegalArgumentException( "no nulls allowed in ITransition array"); } // else LOG.debug("transition "+i+"="+trans[i]); t[i] = trans[i]; } this.trans = t; } } public boolean hasMoreElements() { return hasNext(); } public Object nextElement() { return nextTransition(); } /** * Performs same functionality as hasMoreElements(). */ public boolean hasNext() { return (this.index < trans.length); } /** * The same as nextElement()(), but without the required cast. * * @exception NoSuchElementException if the iterator is at the end. */ public synchronized ITransition nextTransition() { if (!hasMoreElements()) { throw new NoSuchElementException("end of list"); } ITransition t = this.trans[ this.index ]; ++this.index; LOG.debug("nextTranstion() = "+t); return t; } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/package.htmllibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/package0000644000175000017500000000014107576730241034070 0ustar drazzibdrazzibnet.sourceforge.groboutils.mbtf.v1.engine ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/StateImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/StateIm0000644000175000017500000001117207622026452034043 0ustar drazzibdrazzib/* * @(#)StateImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ITransition; /** * Immutable IState implementation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class StateImpl implements IState { private String name; private ITransition[] trans; private IValidate[] validate; public StateImpl( String name, ITransition[] t, IValidate[] v ) { if (name == null) { throw new IllegalArgumentException("no null name"); } if (t == null) { t = new ITransition[0]; } else { int len = t.length; ITransition[] tt = new ITransition[ len ]; for (int i = len; --i >= 0;) { if (t[i] == null) { throw new IllegalArgumentException( "no nulls allowed in ITransition array (index "+i+")"); } // else tt[i] = t[i]; } t = tt; } if (v == null) { v = new IValidate[0]; } else { int len = v.length; IValidate[] vv = new IValidate[ len ]; for (int i = len; --i >= 0;) { if (v[i] == null) { throw new IllegalArgumentException( "no nulls allowed in IValidate array (index "+i+")"); } // else vv[i] = v[i]; } v = vv; } this.name = name; this.trans = t; this.validate = v; } /** * Retrieves the name for the state. This should be unique for * state-machine assembly purposes, but it does not have to be. * * @return a non-null name for this state. */ public String getName() { return this.name; } /** * Retrieves the list of transitions leading from this state. * * @return a non-null list of all transitions from this state. If the * length of the list is 0, then this is a terminal state. */ public ITransition[] getTransitions() { int len = this.trans.length; ITransition t[] = new ITransition[ len ]; System.arraycopy( this.trans, 0, t, 0, len ); return t; } /** * Retrieves the list of all validation instances used to assert that * the current state is valid. * * @return a non-null list of all validation instances for this state. * An empty list will cause a warning on all but the first * (initial) state. This list should not include the included * Transitions' validates. */ public IValidate[] getValidates() { int len = this.validate.length; IValidate v[] = new IValidate[ len ]; System.arraycopy( this.validate, 0, v, 0, len ); return v; } public String toString() { return "[State "+getName()+"]"; } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/ErrorsImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/ErrorsI0000644000175000017500000002413707622026452034067 0ustar drazzibdrazzib/* * @(#)ErrorsImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; import net.sourceforge.groboutils.mbtf.v1.TestFailRuntimeException; import java.util.Vector; /** * Default implementation of IErrors. Designed so that the same object can * be reused. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class ErrorsImpl implements IErrors { private Vector errors = new Vector(); private Vector warnings = new Vector(); private boolean haltTests = false; private boolean haltPath = false; private IPathHistory ph; /* * Reset the implementation for reuse. public void reset() { this.errors.removeAllElements(); this.warnings.removeAllElements(); this.haltTests = false; this.haltPath = false; this.ph = null; } */ public void setCurrentPathHistory( IPathHistory ph ) { this.ph = ph.copy(); } /** * Immediately stop the path processing, and do not continue other paths * for processing. This will throw a RuntimeException. *

* Halts should be a last-recourse to indicate that the system cannot be * used for further testing. * * @param msg a human-readable error message. * @exception TestHaltRuntimeException will always be generated. */ public void halt( String msg ) { addErrorType( msg, null ); this.haltPath = true; this.haltTests = true; throw new TestHaltRuntimeException( this, msg ); } /** * Add a failure to the list of current errors. Validation methods that * register failures will halt the current path's testing. This method * will not throw an exception, so validation processing must leave the * method on its own. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. */ public void addFailure( String msg ) { addFailure( msg, null ); } /** * Add a failure associated with a Throwable to the list of current errors. * Validation methods that register failures will halt the current path's * testing. This method will not throw an exception, so validation * processing must leave the method on its own. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. * @param t the exception associated with the error. */ public void addFailure( String msg, Throwable t ) { addErrorType( msg, t ); this.haltPath = true; } /** * Add a failure to the list of current errors. Validation methods that * register failures will halt the current path's testing. This method * will not throw a TestFailRuntimeException, so validation * processing must leave the method on its own. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. * @exception TestFailRuntimeException allows for easy exiting of a * burried method call stack. */ public void fail( String msg ) throws TestFailRuntimeException { addFailure( msg ); throw new TestFailRuntimeException( this, msg ); } /** * Add a failure associated with a Throwable to the list of current errors. * Validation methods that register failures will halt the current path's * testing. This method will throw a TestFailRuntimeException to * allow for an easy exit from a burried method call stack. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. * @param t the exception associated with the error. * @exception TestFailRuntimeException allows for easy exiting of a * burried method call stack. */ public void fail( String msg, Throwable t ) throws TestFailRuntimeException { addFailure( msg, t ); throw new TestFailRuntimeException( this, msg ); } /** * Add an error to the list of current errors. Validation methods that * register errors will not halt the current path's testing, but the error * will be listed in the report with the associated path where the error * condition occured. *

* Errors should be registered when an error occurs in the system, but * the system can continue processing the path. * * @param msg a human-readable error message. */ public void addError( String msg ) { addError( msg, null ); } /** * Add an error associated with a Throwable to the list of current errors. * Validation methods that register errors will halt the current path's * testing. *

* Errors should be registered when an error occurs in the system, but * the system can continue processing the path. * * @param msg a human-readable error message. * @param t the exception associated with the error. */ public void addError( String msg, Throwable t ) { addErrorType( msg, t ); } /** * Add a warning to the list of current warnings. Warnings will not * halt the testing process, and will not register an error. *

* Warnings should be used when a questionable system state occurs, or if * the tester wants to perform debugging. * * @param msg a human-readable message. */ public void addWarning( String msg ) { addMessage( this.warnings, msg, null ); } /** * Retrieve all registered errors. */ public IError[] getErrors() { IError e[] = new IError[ this.errors.size() ]; this.errors.copyInto( e ); return e; } //------------------------------------------------------------------------- public IError[] getWarnings() { IError e[] = new IError[ this.warnings.size() ]; this.warnings.copyInto( e ); return e; } public boolean isHaltPath() { return this.haltPath; } public boolean isHaltTests() { return this.haltTests; } public String toString() { IError[] e = getErrors(); StringBuffer sb = new StringBuffer("[ Registered Errors:\n"); for (int i = 0; i < e.length; ++i) { sb.append( e[i] ); } sb.append("Registered Warnings:\n"); e = getWarnings(); for (int i = 0; i < e.length; ++i) { sb.append( e[i] ); } sb.append( "\n]" ); return sb.toString(); } //------------------------------------------------------------------------- public void addErrors( IErrors e ) { addErrors( e.getErrors() ); if (e instanceof ErrorsImpl) { ErrorsImpl ei = (ErrorsImpl)e; addWarnings( ei.getWarnings() ); if (ei.isHaltPath()) { this.haltPath = true; } if (ei.isHaltTests()) { this.haltTests = true; } } } public void addErrors( IError[] r ) { if (r != null) { for (int i = 0; i < r.length; ++i) { this.errors.addElement( r[i] ); } } } public void addWarnings( IError[] r ) { if (r != null) { for (int i = 0; i < r.length; ++i) { this.warnings.addElement( r[i] ); } } } //------------------------------------------------------------------------- protected void addErrorType( String msg, Throwable t ) { addMessage( this.errors, msg, t ); } protected void addMessage( Vector v, String msg, Throwable t ) { IError err = new ErrorImpl( msg, t, this.ph ); v.addElement( err ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/BreadthPathGenerator.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/Breadth0000644000175000017500000004061207622026452034047 0ustar drazzibdrazzib/* * @(#)BreadthPathGenerator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import java.util.Vector; import java.util.Stack; import java.util.Hashtable; import net.sourceforge.groboutils.mbtf.v1.IPath; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IPathGenerator; import org.apache.log4j.Logger; /** * Implements breadth-first path generation. *

* @todo Complete the discover end-state transition paths for states. * @todo Add in depth-related-terminal-node ability to add in end-state * paths. Q: how should it handle multiple end-state paths, in * the case of multiple end-states? * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class BreadthPathGenerator implements IPathGenerator { private static final Logger LOG = Logger.getLogger( BreadthPathGenerator.class ); /** * Parsed form of an IState instance. This is a self-populating list. * It will also populate the constructor hashtable with all enterable * states from this node. */ static class InnerState { private IState state; private InnerTransition[] dest; private Vector sources = new Vector(); private Vector endStatePaths = new Vector(); public InnerState( IState s, Hashtable stateHash ) { if (s == null || stateHash == null) { throw new IllegalArgumentException("no null args"); } LOG.debug("Adding state '"+s.getName()+"' to inner set"); this.state = s; // add ourself to the hash BEFORE parsing the transitions. stateHash.put( s, this ); // generate the transition table using pre-generated states ITransition t[] = s.getTransitions(); if (t == null) { throw new IllegalStateException("state "+s+ " getTransitions() returned null."); } int len = t.length; this.dest = new InnerTransition[ len ]; for (int i = len; --i >= 0;) { if (t[i] == null) { throw new IllegalStateException("Transition "+i+ " for state "+s.getName()+" is null."); } IState nextState = t[i].getDestinationState(); if (nextState == null) { throw new IllegalStateException("Transition "+i+ " for state "+s.getName()+ " has null destination state."); } InnerState ns = (InnerState)stateHash.get( nextState ); if (ns == null) { ns = new InnerState( nextState, stateHash ); } LOG.debug("Adding transition "+t[i]+" from "+this+" to "+ns); this.dest[i] = new InnerTransition( t[i], ns, this ); // we link to that state, so add ourself as a source transition ns.addSourceTransition( this.dest[i] ); } } public InnerStatePath createStatePath() { return new InnerStatePath( this ); } public InnerTransition[] getDestinations() { return this.dest; } public InnerTransition[] getSources() { InnerTransition[] t = new InnerTransition[ this.sources.size() ]; this.sources.copyInto( t ); return t; } public IState getState() { return this.state; } private void addSourceTransition( InnerTransition it ) { if (it != null && !this.sources.contains( it )) { this.sources.addElement( it ); } } public String toString() { if (getState() != null) { return getState().toString(); } return "[initial state]"; } } private static class InnerTransition { private ITransition trans; private InnerState nextState; private InnerState prevState; public InnerTransition( ITransition trans, InnerState next, InnerState prev ) { this.trans = trans; this.nextState = next; this.prevState = prev; } public ITransition getTransition() { return this.trans; } public InnerState getNextState() { return this.nextState; } public InnerState getSourceState() { return this.prevState; } public String toString() { return "["+this.trans+" from "+getSourceState()+" to "+ getNextState()+"]"; } } /** * A path-generation state for a state which: * 1. knows how to generate all sub-paths * 2. keeps the current next-transition position */ private static class InnerStatePath { private InnerState is; private InnerTransition[] trans; private InnerStatePath[] nextPaths; private int currentIndex; protected InnerStatePath( InnerState is ) { this.is = is; // ensure we keep the same ordering of the transitions this.trans = is.getDestinations(); if (this.trans == null) { this.trans = new InnerTransition[0]; } reset(); } // only used for the very first pseudo-node protected InnerStatePath( InnerState[] states ) { this.is = null; int len = states.length; this.trans = new InnerTransition[ len ]; for (int i = len; --i >= 0;) { this.trans[i] = new InnerTransition( null, states[i], null ); } reset(); } public InnerStatePath getCurrentPath() { if (this.nextPaths.length <= 0) { return null; } int index = this.currentIndex; // integrity assertion - should never be true if (index >= this.nextPaths.length) { throw new IllegalStateException( "Inner index is outside expected range." ); } if (this.nextPaths[ index ] == null) { this.nextPaths[ index ] = getCurrentTransition(). getNextState().createStatePath(); } LOG.debug("current path index = "+(index+1)+" / "+ this.nextPaths.length); return this.nextPaths[ index ]; } public InnerTransition getCurrentTransition() { if (this.trans.length <= 0) { return null; } // integrity assertion - should never be true if (this.currentIndex >= this.trans.length) { throw new IllegalStateException( "Inner index is outside expected range." ); } return this.trans[ this.currentIndex ]; } /** * Logic for advancing to the next transition item. If the advance * causes a reset in the loop, then this returns true, otherwise * false. */ public boolean advanceTransition() { boolean ret = false; ++this.currentIndex; if (this.currentIndex >= this.trans.length) { // reset our list to correctly start from 0 again. reset(); // we flipped over back to the beginning again. ret = true; } if (this.currentIndex < this.trans.length) { LOG.debug("advanced path to "+getCurrentTransition()); } return ret; } /** * This is the core logic for breadth-first searching. The other * piece required is current depth handling. * * @return true if no paths were added or if the current state node * encountered the end of its list (that is, added the last trans * in its list, then reset its list pointer). */ public boolean addPath( int remainingDepth, Vector path ) { // keep our current index until the child's addPath returns true. // test if we're a terminating node if (this.trans.length <= 0) { return true; } LOG.debug("Entering addPath with state "+this.is); boolean ret = false; InnerTransition it = getCurrentTransition(); ITransition trans = it.getTransition(); int nextDepth = remainingDepth; // this condition only really covers the very first pseudo-node if (trans != null) { path.addElement( trans ); --nextDepth; } // if the depth allows it, add another transition to the path if (remainingDepth > 0) { if (getCurrentPath().addPath( nextDepth, path )) { // child said it reached its end, so increment our // index LOG.debug("addPath state "+this.is+ " advancing Transition"); ret = advanceTransition(); } } else { // for this depth, this node acts as a terminating node. LOG.debug( "no remaining depth to enter" ); ret = true; // XXXXXXXXXXXXXXXXXXXXXXXXX // TODO: add in path-to-end node. } LOG.debug("Leaving addPath with state "+this.is+ " and return code "+ret); return ret; } protected void reset() { int len = this.trans.length; // keep the state path list empty - these are // only created on an as-needed basis this.nextPaths = new InnerStatePath[ len ]; this.currentIndex = 0; } } // translated all the IState start states into our InnerState format private InnerState startStates[]; // this will contain all start states as children, and dummy transitions // to them. private InnerStatePath startNode; // the current max-depth to search private int currentDepth; /** * Capable of generating all paths from the set of all startStates to the * set of all endStates. If there are no endStates, then the generated * paths are not required to end on at least one. If there is at least * one endState, then each path will be guaranteed to terminate with * an endState. If there is no possible path between any startState and * at least one endState, then an error is generated. * * @param startStates list of all possible starting states. This cannot * be empty. * @param endStates list of all possible end states. This may be empty * or null. */ public BreadthPathGenerator( IState startStates[], IState endStates[] ) { // check easy-to-check parts first if (startStates == null) { throw new IllegalArgumentException("no null start states allowed"); } if (endStates == null) { endStates = new IState[0]; } // Create all reachable InnerState objects in the hashtable. Hashtable knownStates = new Hashtable(); int startLen = startStates.length; this.startStates = new InnerState[ startLen ]; for (int i = startLen; --i >= 0;) { this.startStates[i] = new InnerState( startStates[i], knownStates ); } // ensure that all end-states are reachable, somehow int endLen = endStates.length; for (int i = endLen; --i >= 0;) { if (!knownStates.contains( endStates[i] )) { throw new IllegalArgumentException("End state "+ endStates[i].getName()+" is unreachable."); } } // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // TODO: // create paths in all known states to the endStates, where possible. } /** * Return the next path in the generator's sequence. */ public IPath getNextPath() { LOG.debug( "enter getNextPath()" ); if (this.startNode == null) { reset(); } // capture the next transition before it is incremented InnerTransition it = this.startNode.getCurrentTransition(); if (it == null) { throw new IllegalStateException( "No known start states." ); } InnerState is = it.getNextState(); if (is == null) { throw new IllegalStateException( "Transition destination state is null." ); } Vector v = new Vector( this.currentDepth ); LOG.debug( "forming path" ); if (this.startNode.addPath( this.currentDepth, v )) { // the node reset itself, so we must increment our depth ++this.currentDepth; } ITransition t[] = new ITransition[ v.size() ]; v.copyInto( t ); LOG.debug( "creating IPath" ); IPath p = new PathImpl( is.getState(), t ); LOG.debug( "leaving getNextPath()" ); return p; } /** * Reset the generator's sequence. There is no guarantee that the * order of returned IPath instances will be identical as the previous * generation sequence. */ public void reset() { LOG.debug("Entering reset()"); this.startNode = new InnerStatePath( startStates ); // there needs to be at least one transition. Just testing the // start states doesn't really do anything. // Perhaps this should be configurable. this.currentDepth = 1; LOG.debug("Leaving reset()"); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/TransitionImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/Transit0000644000175000017500000001306207622026452034121 0ustar drazzibdrazzib/* * @(#)TransitionImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ITransition; /** * Nearly-Immutable implementation of ITransition. As an immutable, transitions * cannot be created if there are cycles in the state machine. Therefore, * there needs to be a way to post-creation correctly populate the Transition's * destination state. Thus, the destination state may be set once. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class TransitionImpl implements ITransition { private String name; private IState destination; private IAction action; private IValidate[] validate; public TransitionImpl( String name, IState dest, IAction a, IValidate[] v ) { // allow destination to be null if (name == null || a == null) { throw new IllegalArgumentException("no null args"); } if (v == null) { v = new IValidate[0]; } else { int len = v.length; IValidate[] vv = new IValidate[ len ]; for (int i = len; --i >= 0;) { if (v[i] == null) { throw new IllegalArgumentException( "no nulls allowed in IValidate array"); } // else vv[i] = v[i]; } v = vv; } this.name = name; setDestinationState( dest ); this.action = a; this.validate = v; } /** * Retrieves the name for the transition. This should be unique for * state-machine assembly purposes, but it does not have to be. * * @return a non-null name for this transition. */ public String getName() { return this.name; } /** * Returns the next state if the corresponding action is executed. * * @return destination state, which can never be null. */ public IState getDestinationState() { if (isDestinationStateSet()) { return this.destination; } // else throw new IllegalStateException("Destination was never set."); } /** * Returns the action used to transition to the destination state. * * @return transition's action, which can never be null. */ public IAction getAction() { return this.action; } /** * Returns all validation methods used to assert that the system can * perform this transition. * * @return a list of associated validation instances. */ public IValidate[] getValidates() { int len = this.validate.length; IValidate v[] = new IValidate[ len ]; System.arraycopy( this.validate, 0, v, 0, len ); return v; } //------------------------------------------------------------------------- /** * Allows for post-creation setting of the destination. The destination * may only be set to a non-null value once. If there is an * attempt to pull the destination through getDestinationState() * and it has not been set yet, then an IllegalStateException will * be thrown. */ public void setDestinationState( IState dest ) { if (isDestinationStateSet()) { throw new IllegalStateException( "Destination has already been set."); } else { this.destination = dest; } } /** * Allows for a builder system to detect if the destination state has * been set or not, without causing the IllegalStateException through * the getDestinationState(). */ public boolean isDestinationStateSet() { return (this.destination != null); } public String toString() { return "[Transition "+getName()+"]"; } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathImp0000644000175000017500000001047307622026452034042 0ustar drazzibdrazzib/* * @(#)PathImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import net.sourceforge.groboutils.mbtf.v1.IPath; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IPathIterator; import org.apache.log4j.Logger; /** * An immutable implementation of IPath * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class PathImpl implements IPath { private static final Logger LOG = Logger.getLogger( PathImpl.class ); private ITransition[] trans; private IState start; public PathImpl( IState startState, ITransition[] trans ) { if (startState == null) { throw new IllegalArgumentException("no null args"); } LOG.debug("Path starting at "+startState); if (trans == null) { LOG.debug("-- Path has no transitions"); this.trans = new ITransition[0]; } else { int len = trans.length; ITransition[] t = new ITransition[ len ]; for (int i = 0; i < len; ++i) { if (trans[i] == null) { throw new IllegalArgumentException( "no nulls allowed in ITransition array"); } // else LOG.debug("-- transition "+i+"="+trans[i]); t[i] = trans[i]; } this.trans = t; } this.start = startState; } /** * Generate an iterator for this path. The iterator will only return * transition elements. * * @return a new iterator for the path. */ public IPathIterator iterator() { return new PathIteratorImpl( this.trans ); } /** * Retrieve the starting state for this path. * * @return the start state for the path, which can never be null. */ public IState getStartState() { return this.start; } /** * Returns the number of transitions in the path. This is named "size" to * correspond to the java.util * container classes terminology. * * @return the path transition count. */ public int size() { return this.trans.length; } /** * Returns the number of states visited in the path, which should * always equal size() + 2, due to the start and final states, * unless there are no transitions, in which case the depth is 1 * (there must always be a start state). * * @return the depth of the path. */ public int getDepth() { int size = size(); int depth; if (size == 0) { depth = 1; } else { depth = size + 2; } return depth; } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathParserImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathPar0000644000175000017500000001523107622026452034034 0ustar drazzibdrazzib/* * @(#)PathParserImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import net.sourceforge.groboutils.mbtf.v1.IPath; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IPathParser; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.IPathIterator; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; import net.sourceforge.groboutils.mbtf.v1.TestFailRuntimeException; import org.apache.log4j.Logger; /** * Knows how to parse an IPath instance, and correctly follow the transitions * and record errors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class PathParserImpl implements IPathParser { private static final Logger LOG = Logger.getLogger( PathParserImpl.class ); /** * @exception TestHaltRuntimeException if the path validation reports * a halt() to errors. */ public IErrors parsePath( IPath path, ISystem sys ) { ErrorsImpl ei = createErrors(); PathHistoryImpl phi = createPathHistory(); IState currentState = path.getStartState(); IPathIterator pi = path.iterator(); while (currentState != null && !ei.isHaltPath()) { ErrorsImpl testErrs = createErrors(); try { testErrs.setCurrentPathHistory( phi ); LOG.debug( "Entering state "+currentState ); phi.addState( currentState ); LOG.debug( "Validating state "+currentState ); validate( currentState, testErrs, phi, sys ); currentState = null; if (!testErrs.isHaltPath() && pi.hasNext()) { ITransition trans = pi.nextTransition(); phi.addTransition( trans ); LOG.debug( "Vaidatling transition "+trans ); validate( trans, testErrs, phi, sys ); if (!testErrs.isHaltPath()) { IAction act = trans.getAction(); LOG.debug( "Start Performing action "+act ); act.performAction( sys, testErrs ); LOG.debug( "End Performing action "+act ); currentState = trans.getDestinationState(); } } } catch (TestHaltRuntimeException thre) { // should have already been caught throw thre; } catch (ThreadDeath td) { // never catch these. never. throw td; } catch (TestFailRuntimeException tfre) { // The error was already added to the error set. // This exception ends this path, but the exception is // not propigated. } catch (Throwable t) { testErrs.addError( "Uncaught exception", t ); if (t instanceof RuntimeException) { throw (RuntimeException)t; } t.printStackTrace(); throw new IllegalStateException( t.toString() ); } finally { ei.addErrors( testErrs ); } } return ei; } protected void validate( IState state, ErrorsImpl ei, PathHistoryImpl phi, ISystem sys ) throws CloneNotSupportedException { IValidate[] v = state.getValidates(); if (v.length <= 0) { ei.setCurrentPathHistory( phi ); ei.addError( "No validations for state '"+state.getName()+"'" ); return; } for (int i = 0; i < v.length && !ei.isHaltPath(); ++i) { ei.setCurrentPathHistory( phi ); v[i].validate( sys, ei ); phi.addValidate( v[i], state, ei ); ei.setCurrentPathHistory( phi ); } } protected void validate( ITransition trans, ErrorsImpl ei, PathHistoryImpl phi, ISystem sys ) throws CloneNotSupportedException { IValidate[] v = trans.getValidates(); if (v.length <= 0) { ei.setCurrentPathHistory( phi ); ei.addError( "No validations for transition '"+ trans.getName()+"'" ); return; } for (int i = 0; i < v.length && !ei.isHaltPath(); ++i) { ei.setCurrentPathHistory( (IPathHistory)phi.clone() ); v[i].validate( sys, ei ); phi.addValidate( v[i], trans, ei ); ei.setCurrentPathHistory( (IPathHistory)phi.clone() ); } } protected ErrorsImpl createErrors() { return new ErrorsImpl(); } protected PathHistoryImpl createPathHistory() { return new PathHistoryImpl(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathHistoryImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/PathHis0000644000175000017500000001661407622026452034043 0ustar drazzibdrazzib/* * @(#)PathHistoryImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.IErrors; import java.util.Vector; import org.apache.log4j.Logger; /** * Records the states and transition history during a path traversal. * The instance can be cloned for the cases of errors and warnings needing to * store the path history when they occured. The instance should also support * a toString() method for easy debugging and logging. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class PathHistoryImpl implements IPathHistory, Cloneable { private static final Logger LOG = Logger.getLogger( PathHistoryImpl.class ); private static interface IHistoryPart { public String toString(); } private static class StateHistoryPart implements IHistoryPart { private IState state; public StateHistoryPart( IState s ) { this.state = s; } public String toString() { if (this.state == null) { return " finished terminal state.\n"; } return " entered state '"+this.state.getName()+"'\n"; } } private static class TransHistoryPart implements IHistoryPart { private ITransition trans; public TransHistoryPart( ITransition t ) { this.trans = t; } public String toString() { return " followed transition '"+this.trans.getName()+"'\n"; } } private static abstract class ValidHistoryPart implements IHistoryPart { protected String err; public ValidHistoryPart( IValidate v, IErrors e ) { if (e != null && e.getErrors().length > 0) { this.err = e.toString(); } else { this.err = "No errors."; } } } private static class StateValidHistoryPart extends ValidHistoryPart { private IState state; public StateValidHistoryPart( IValidate v, IState s, IErrors e ) { super( v, e ); this.state = s; } public String toString() { return " validated state '" + this.state.getName() + "': " + this.err + "\n"; } } private static class TransValidHistoryPart extends ValidHistoryPart { private ITransition trans; public TransValidHistoryPart( IValidate v, ITransition t, IErrors e ) { super( v, e ); this.trans = t; } public String toString() { return " validated transition '" + this.trans.getName() + "': " + this.err + "\n"; } } private int errorCount = 0; private Vector history = new Vector(); /** * When the current state changes, add the new state here. This should * be called for the start state, and once at the end of every successful * transition. */ public void addState( IState s ) { LOG.debug( "addState( "+s+" )" ); this.history.addElement( new StateHistoryPart( s ) ); LOG.debug( " - History is now: "+toString() ); } /** * When a transition is about to occur, it should be added here. */ public void addTransition( ITransition t ) { LOG.debug( "addTransition( "+t+" )" ); this.history.addElement( new TransHistoryPart( t ) ); } /** * After a validation call, the error results should be added here. */ public void addValidate( IValidate val, IState owningState, IErrors errors ) { LOG.debug( "addValidate( "+val+", "+owningState+", "+errors+" )" ); if (errors != null) { this.errorCount += errors.getErrors().length; } this.history.addElement( new StateValidHistoryPart( val, owningState, errors ) ); } /** * After a validation call, the error results should be added here. */ public void addValidate( IValidate val, ITransition owningTransition, IErrors errors ) { LOG.debug( "addValidate( "+val+", "+owningTransition+", "+errors+" )" ); if (errors != null) { this.errorCount += errors.getErrors().length; } this.history.addElement( new TransValidHistoryPart( val, owningTransition, errors ) ); } /** * Returns the total number of errors (halts, failures, and errors) * registered during validation and transitions. */ public int getErrorCount() { return this.errorCount; } public String toString() { IHistoryPart hp[] = new IHistoryPart[ this.history.size() ]; this.history.copyInto( hp ); if (hp.length <= 0) { return "[no history]"; } StringBuffer sb = new StringBuffer("[Path History:\n"); for (int i = 0; i < hp.length; ++i) { sb.append( hp[i] ); } sb.append("\n]"); return sb.toString(); } protected Object clone() throws CloneNotSupportedException { PathHistoryImpl phi = (PathHistoryImpl)super.clone(); phi.errorCount = this.errorCount; phi.history = (Vector)this.history.clone(); return phi; } public IPathHistory copy() { try { return (IPathHistory)clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( e.toString() ); } } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/ErrorImpl.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/engine/ErrorIm0000644000175000017500000000705607622026452034062 0ustar drazzibdrazzib/* * @(#)ErrorImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import java.io.StringWriter; import java.io.PrintWriter; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; /** * Immutible IError implementation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 12, 2002 */ public class ErrorImpl implements IError { private IPathHistory pathHistory; private Throwable err; private String msg; public ErrorImpl( String msg, Throwable err, IPathHistory ph ) { this.msg = msg; this.err = err; this.pathHistory = ph; } /** * The path history at the time of the error, if any history was known. * * @return the path history, or null. */ public IPathHistory getPathHistory() { return this.pathHistory; } /** * Returns the Throwable registered with the error report, if * any. * * @return the registered throwable, or null. */ public Throwable getThrowable() { return this.err; } /** * Returns the human-readable message associated with the error, if any. * * @return the human-readable message, or null. */ public String getMessage() { return this.msg; } public String toString() { String ls = System.getProperty("line.separator"); if (ls == null) { ls = "\n"; } StringBuffer sb = new StringBuffer( "ERROR: " ); if (getMessage() != null) { sb.append( getMessage() ); sb.append( ":" ); } sb.append( ls ); if (getThrowable() != null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter( sw ); getThrowable().printStackTrace( pw ); sb.append( sw.toString() ); } if (getPathHistory() != null) { sb.append("at").append( ls ).append( getPathHistory() ); } return sb.toString(); } } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/0000755000175000017500000000000011271425773033264 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/package.htmllibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/pack0000644000175000017500000000033707521071663034126 0ustar drazzibdrazzibnet.sourceforge.groboutils.mbtf.v1.assembler Simple implementation to assemble a MBTF state machine from a class structure that uses names instead of object pointers. ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/MultiAction.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Mult0000644000175000017500000000562207622026452034131 0ustar drazzibdrazzib/* * @(#)IAction.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.ISystem; import java.util.Vector; import java.util.Enumeration; /** * Performs a state-transition action on the system. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:26 $ * @since June 13, 2002 */ public class MultiAction implements IAction { private Vector actions = new Vector(); public MultiAction() { // do nothing } public MultiAction( IAction acts[] ) { addActions( acts ); } public void addActions( IAction acts[] ) { if (acts != null) { for (int i = 0; i < acts.length; ++i) { if (acts[i] != null) { this.actions.addElement( acts[i] ); } } } } /** * Execute a transition action on system, registering any * encountered errors in errors. * * @param system the system-under-test's current state. * @param errors container allowing registration of errors or warnings. */ public void performAction( ISystem system, IErrors errors ) { Enumeration enum = this.actions.elements(); while (enum.hasMoreElements()) { ((IAction)enum.nextElement()).performAction( system, errors ); } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblTransitionSet.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Asmb0000644000175000017500000000751607622026451034075 0ustar drazzibdrazzib/* * @(#)AsmblTransitionSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.engine.TransitionImpl; import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; /** * Contains the set of transitions in their pre-assembled state. Used for * accessing a collection of transitions. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class AsmblTransitionSet { private Hashtable nameToTrans = new Hashtable(); /** * */ public AsmblTransitionSet() { // do nothing } /** * */ public void addTransition( AsmblTransition trans ) { if (trans != null) { this.nameToTrans.put( trans.getName(), trans ); } } /** * */ public void addTransitions( AsmblTransition[] trans ) { if (trans != null) { for (int i = trans.length; --i >= 0;) { addTransition( trans[i] ); } } } /** * */ public AsmblTransition getTransition( String name ) { return (AsmblTransition)this.nameToTrans.get( name ); } /** * */ public AsmblTransition[] getTransitions() { AsmblTransition as[] = new AsmblTransition[ this.nameToTrans.size() ]; Enumeration enum = this.nameToTrans.elements(); for (int i = 0; enum.hasMoreElements(); ++i) { as[i] = (AsmblTransition)enum.nextElement(); } return as; } /** * Sets the destination state for every transition. If a transition's * destination state is not in the set, then an IllegalArgumentException * is thrown. */ public void setDestinationStates( Hashtable nameToIState ) { AsmblTransition[] ats = getTransitions(); for (int i = ats.length; --i >= 0;) { IState s = (IState)nameToIState.get( ats[i].getNextStateName() ); if (s == null) { throw new IllegalArgumentException("Transition '"+ ats[i].getName()+"' expects existing state '"+ ats[i].getNextStateName()+"'"); } ats[i].setDestinationState( s ); } } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblState.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Asmb0000644000175000017500000001033707622026451034070 0ustar drazzibdrazzib/* * @(#)AsmblState.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.engine.StateImpl; import java.util.Vector; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public class AsmblState { private String name; private Vector validates = new Vector(); private Vector transNames = new Vector(); private boolean startState; private boolean endState; /** * */ public AsmblState() { // do nothing } public void setName( String name ) { if (name == null) { throw new IllegalArgumentException("no null args"); } this.name = name; } public String getName() { return this.name; } public void addValidate( IValidate v ) { if (v != null) { this.validates.addElement( v ); } } public void addTransitionName( String n ) { if (n != null) { this.transNames.addElement( n ); } } public IValidate[] getValidates() { IValidate v[] = new IValidate[ this.validates.size() ]; this.validates.copyInto( v ); return v; } public String[] getTransitionNames() { String s[] = new String[ this.transNames.size() ]; this.transNames.copyInto( s ); return s; } public void setIsStartState( boolean on ) { this.startState = on; } public boolean isStartState() { return this.startState; } public void setIsFinalState( boolean on ) { this.endState = on; } public boolean isFinalState() { return this.endState; } /** * Use the given transition set to create this state. * * @exception IllegalArgumentException if one of the transition names in * this state is not in the transition set. */ public IState createState( AsmblTransitionSet set ) { // Find all the transitions String transNames[] = getTransitionNames(); int len = transNames.length; ITransition t[] = new ITransition[ len ]; for (int i = len; --i >= 0;) { AsmblTransition at = set.getTransition( transNames[i] ); if (at == null) { throw new IllegalArgumentException("expecting transition '"+ transNames[i]+"'"); } t[i] = at.getTransition(); } return new StateImpl( getName(), t, getValidates() ); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblStateSet.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Asmb0000644000175000017500000000550307622026451034067 0ustar drazzibdrazzib/* * @(#)Assembler.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; /** * Contains the set of states in their pre-assembled state. Used for * accessing a collection of states. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class AsmblStateSet { private Hashtable states = new Hashtable(); /** * */ public AsmblStateSet() { // do nothing } /** * */ public void addState( AsmblState state ) { if (state != null) { this.states.put( state.getName(), state ); } } /** * */ public void addStates( AsmblState[] states ) { if (states != null) { for (int i = states.length; --i >= 0;) { addState( states[i] ); } } } /** * */ public AsmblState getState( String name ) { return (AsmblState)this.states.get( name ); } /** * */ public AsmblState[] getStates() { AsmblState as[] = new AsmblState[ this.states.size() ]; Enumeration enum = this.states.elements(); for (int i = 0; enum.hasMoreElements(); ++i) { as[i] = (AsmblState)enum.nextElement(); } return as; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Assembler.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Asse0000644000175000017500000001104607622026451034077 0ustar drazzibdrazzib/* * @(#)Assembler.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.engine.StateImpl; import net.sourceforge.groboutils.mbtf.v1.engine.TransitionImpl; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; /** * Helper class which transforms the AsmblState and AsmblTransition instances * into a coherent IState machine. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class Assembler { private Hashtable nameToIState; private Vector startStates; private Vector finalStates; /** * */ public Assembler( AsmblTransitionSet trans, AsmblStateSet states ) { if (trans == null || states == null) { throw new IllegalArgumentException("no null args"); } parseStates( trans, states ); } /** * Returns a list of all States passed in to the constructor. */ public IState[] getStates() { IState s[] = new IState[ this.nameToIState.size() ]; Enumeration enum = this.nameToIState.elements(); for (int i = 0; enum.hasMoreElements(); ++i) { s[i] = (IState)enum.nextElement(); } return s; } /** * */ public IState[] getStartStates() { IState s[] = new IState[ this.startStates.size() ]; this.startStates.copyInto( s ); return s; } /** * */ public IState[] getFinalStates() { IState s[] = new IState[ this.finalStates.size() ]; this.finalStates.copyInto( s ); return s; } //------------------------------------------------------------------------- protected void parseStates( AsmblTransitionSet trans, AsmblStateSet stateSet ) { populateIStates( trans, stateSet.getStates() ); // Now load all the transitions destination states correctly trans.setDestinationStates( this.nameToIState ); } protected void populateIStates( AsmblTransitionSet trans, AsmblState[] as ) { this.nameToIState = new Hashtable(); this.startStates = new Vector(); this.finalStates = new Vector(); for (int i = as.length; --i >= 0;) { addAsmblState( as[i], as[i].createState( trans ) ); } } protected void addAsmblState( AsmblState as, IState s ) { this.nameToIState.put( s.getName(), s ); if (as.isStartState()) { this.startStates.addElement( s ); } if (as.isFinalState()) { this.finalStates.addElement( s ); } } //------------------------------------------------------------------------- protected IState getState( String name ) { return (IState)this.nameToIState.get( name ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblTransition.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/assembler/Asmb0000644000175000017500000001155007622026451034066 0ustar drazzibdrazzib/* * @(#)AsmblTransition.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.engine.TransitionImpl; import java.util.Vector; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public class AsmblTransition { private String name; private Vector validates = new Vector(); private IAction action; private String nextState; private TransitionImpl iTrans; /** * */ public AsmblTransition() { // do nothing } public void setName( String name ) { if (name == null) { throw new IllegalArgumentException("no null args"); } // invalidates our transition resetTransition( true ); this.name = name; } public String getName() { return this.name; } public void setNextStateName( String name ) { if (name == null) { throw new IllegalArgumentException("no null args"); } // invalidates our transition, and its state (if any) resetTransition( false ); this.nextState = name; } public String getNextStateName() { return this.nextState; } public void addValidate( IValidate v ) { if (v != null) { // invalidates our transition resetTransition( true ); this.validates.addElement( v ); } } public void setAction( IAction a ) { if (a == null) { throw new IllegalArgumentException("no null args"); } // invalidates our transition resetTransition( true ); this.action = a; } public IValidate[] getValidates() { IValidate v[] = new IValidate[ this.validates.size() ]; this.validates.copyInto( v ); return v; } public IAction getAction() { return this.action; } public ITransition getTransition() { if (this.iTrans == null) { this.iTrans = new TransitionImpl( getName(), null, getAction(), getValidates() ); } return this.iTrans; } public void setDestinationState( IState state ) { // ensure the transition is created... getTransition(); // make sure the state is correct if (state == null) { throw new IllegalArgumentException("no null args"); } if (!state.getName().equals( getNextStateName() )) { throw new IllegalArgumentException("Invalid state name"); } // only set the destination if we can. if (!this.iTrans.isDestinationStateSet()) { this.iTrans.setDestinationState( state ); } } protected void resetTransition( boolean saveState ) { if (saveState && this.iTrans != null && this.iTrans.isDestinationStateSet()) { throw new IllegalStateException("Cannot reset transition"); } else { this.iTrans = null; } } } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IError.java0000644000175000017500000000452107622026450033350 0ustar drazzibdrazzib/* * @(#)IError.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Contains all information relating to when an error (or warning) was * reported to IErrors. Implementations should have toString() * for aid in IErrors outputs. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:24 $ * @since June 12, 2002 */ public interface IError { /** * The path history at the time of the error, if any history was known. * * @return the path history, or null. */ public IPathHistory getPathHistory(); /** * Returns the Throwable registered with the error report, if * any. * * @return the registered throwable, or null. */ public Throwable getThrowable(); /** * Returns the human-readable message associated with the error, if any. * * @return the human-readable message, or null. */ public String getMessage(); } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IValidate.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IValidate.java0000644000175000017500000000402107622026451034004 0ustar drazzibdrazzib/* * @(#)IValidate.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Performs a validation on a system, to ensure that the associated item * (IState or ITransition) can be processed. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public interface IValidate { /** * Validate system is in the correct state. Register all errors * and warnings through errors. * * @param system the system-under-test's current state. * @param errors container allowing registration of errors or warnings. */ public void validate( ISystem system, IErrors errors ); } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/package.html0000644000175000017500000000470707576730241033602 0ustar drazzibdrazzibnet.sourceforge.groboutils.mbtf.v1 The Model-Based Testing Framework. Currently, the MBTF is a simple state machine engine that is able to generate cyclic paths through the various transitions presented by the state machine model, combined with a Path Parser that knows the correct procedure in iterating though a path, and executing the correct validation steps.

Implementation

Model-Based Testing allows for testing the various routes of computation though a system to ensure system integrity. Traditional testing methodologies requires the tester to calculate and manually generate these paths.

The logic goes something like this: the tester models the system in a state-machine, using a minimalistic model where possible. At each state, the tester creates validation tests to ensure the system is indeed in that state. Also, each state has an associated set of transitions; each transition has both a validation (to ensure the transition can occur), and an action which moves the current state to another state. The MBTF then takes this model and generates combinations of paths through the states. At each state, the state itself is verified, and all transitions are verified. Any error discovered causes the path to be recorded and stamped with the error for future evaluation.

Useage

A direct user of the MBTF needs to first define an implementation of ISystem. This class contains the necessary information and actions to perform state validation and transition actions for the system in question. Also, the user needs to define an ISystemFactory, which knows how to create an ISystem in the correct initial state.

I'd recommend for your particular System, creating an abstract IVerifiy implementation which allows for reducing the casting problem inherit in a generic system such as this:

    public abstract class MyVerify implements IVerify
    {
        public final void verify( ISystem ss, IErrors errors )
        {
            myVerify( (MySystem)ss, errors );
        }
        
        public abstract void myVerify( MySystem mss, IErrors errors );
    }

Then, it's a matter of defining the system's set of states and transitions.

References

././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ITransition.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ITransition.ja0000644000175000017500000000517707622026451034073 0ustar drazzibdrazzib/* * @(#)ITransition.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Corresponds to a state-machine transition from one state to another. * Transitions must verify that their associated action can be performed * on the current system's state. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public interface ITransition { /** * Retrieves the name for the transition. This should be unique for * state-machine assembly purposes, but it does not have to be. * * @return a non-null name for this transition. */ public String getName(); /** * Returns the next state if the corresponding action is executed. * * @return destination state, which can never be null. */ public IState getDestinationState(); /** * Returns the action used to transition to the destination state. * * @return transition's action, which can never be null. */ public IAction getAction(); /** * Returns all validation methods used to assert that the system can * perform this transition. * * @return a list of associated validation instances. */ public IValidate[] getValidates(); } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPath.java0000644000175000017500000000527407622026450033161 0ustar drazzibdrazzib/* * @(#)IPath.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * An ordered set of transitions plus a start state, which can be iterated * through to discover a state-machine transition path. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:24 $ * @since June 12, 2002 */ public interface IPath { /** * Generate an iterator for this path. The iterator will only return * transition elements. * * @return a new iterator for the path. */ public IPathIterator iterator(); /** * Retrieve the starting state for this path. * * @return the start state for the path, which can never be null. */ public IState getStartState(); /** * Returns the number of transitions in the path. This is named "size" to * correspond to the java.util * container classes terminology. * * @return the path transition count. */ public int size(); /** * Returns the number of states visited in the path, which should * always equal size() + 2, due to the start and final states, * unless there are no transitions, in which case the depth is 1 * (there must always be a start state). * * @return the depth of the path. */ public int getDepth(); } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/0000755000175000017500000000000011271425773032071 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/ValidateJavaType.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/ValidateJa0000644000175000017500000001644007622026451034020 0ustar drazzibdrazzib/* * @(#)ValidateJavaType.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Definer; import org.apache.tools.ant.taskdefs.Property; import org.apache.tools.ant.types.Reference; import java.util.Vector; import java.util.Enumeration; import java.io.File; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.ISystem; import org.apache.log4j.Logger; /** * A specific IValidate instance, which is Ant compatible, that instantiates * a set of Classes using the default constructor, and iterates through them * as though they each were IValidate instances. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class ValidateJavaType extends Definer implements IValidate, IAction { private static final Logger LOG = Logger.getLogger( ValidateJavaType.class ); // intended to be an imbedded task, but can be defined outside // the state iterator. public static final String DEFAULT_ANT_NAME = "mbtf.validatejava"; private Vector validators = new Vector(); private Vector properties = new Vector(); public void execute() throws BuildException { if (project == null) { throw new BuildException("ValidateJavaType project is null"); } // clean out the old classes, if any remain this.validators = new Vector(); try { super.execute(); } catch (BuildException e) { // allow for the name to be empty setName( "ignore" ); super.execute(); } } protected void addDefinition(String name, Class c) throws BuildException { LOG.debug("added "+c); addClass( c ); } public void addClass( Class c ) throws BuildException { try { Object o = c.newInstance(); this.validators.addElement( o ); } catch (Exception e) { throw new BuildException("Could not instantiate "+c.getName(), e, location ); } } public void addParam( Property prop ) { if (prop != null) { this.properties.addElement( prop ); } } public void validate( ISystem system, IErrors errors ) { LOG.debug(this+": Entering validate()"); try { execute(); } catch (BuildException e) { LOG.info("execute() caused exception", e); errors.addError("Failed to correctly process Ant structure.", e ); LOG.debug(this+": Leaving validate() due to build exception"); return; } Enumeration enum = this.validators.elements(); int count = 0; while (enum.hasMoreElements()) { Object o = enum.nextElement(); if (o instanceof IValidate) { ++count; setupObject( o ); LOG.debug(this+": Start Validate "+o); ((IValidate)o).validate( system, errors ); LOG.debug(this+": End Validate "+o); } } LOG.debug(this+": Leaving validate() ["+count+" validators]"); } public void performAction( ISystem system, IErrors errors ) { LOG.debug( this+": Entering performAction()" ); try { execute(); } catch (BuildException e) { LOG.info("execute() caused exception", e); errors.addError("Failed to correctly process Ant structure.", e ); LOG.debug(this+": Leaving performAction() due to build exception"); return; } Enumeration enum = this.validators.elements(); int count = 0; while (enum.hasMoreElements()) { Object o = enum.nextElement(); if (o instanceof IAction) { ++count; setupObject( o ); LOG.debug(this+": Start Perform action on "+o); ((IAction)o).performAction( system, errors ); LOG.debug(this+": End perform action on "+o); } } LOG.debug(this+": Leaving performAction() ["+count+" actions]"); } protected void setupObject( Object o ) { if (o != null && o instanceof IUsesProperties) { IUsesProperties iup = (IUsesProperties)o; iup.setProject( project ); Enumeration enum = this.properties.elements(); while (enum.hasMoreElements()) { Property p = (Property)enum.nextElement(); String name = p.getName(); String value = p.getValue(); File file = p.getFile(); Reference refid = p.getRefid(); String resource = p.getResource(); String env = p.getEnvironment(); if (value != null) { iup.addProperty( name, value ); } if (file != null) { iup.addFile( name, file ); } if (refid != null) { LOG.debug("Adding reference '"+name+"' to '"+refid+"'"); iup.addReference( name, refid ); } if (resource != null) { iup.addResource( name, resource ); } if (env != null) { iup.addEnvironment(name, env ); } } } } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/StateType.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/StateType.0000644000175000017500000001170007622026451034006 0ustar drazzibdrazzib/* * @(#)StateType.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.Task; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.taskdefs.Definer; import java.util.Vector; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblState; /** * An ant datatype encapsulating the IState instance. This includes an * execute() method to allow for this to be defined in a * <typedef> declaration, rather than inside a target as a * <datatype> declaration. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class StateType extends AbstractStateMachineType { public static final String DEFAULT_ANT_NAME = "mbtf.state"; private Vector transitions = new Vector(); private boolean startState = false; private boolean finalState = false; public static class RefTransitionType { private String name; public void setName( String name ) { this.name = name; } public String getName() { return this.name; } } public void addTransition( RefTransitionType trans ) { if (trans != null) { this.transitions.addElement( trans ); } } public String[] getTransitionNames() { if (isReference()) { return ((StateType)getCheckedRef( StateType.class, DEFAULT_ANT_NAME )). getTransitionNames(); } String[] s = new String[ this.transitions.size() ]; for (int i = s.length; --i >= 0;) { s[i] = ((RefTransitionType)this.transitions.elementAt( i )). getName(); } return s; } public void setStartState( boolean on ) { this.startState = on; } public boolean getStartState() { if (isReference()) { return ((StateType)getCheckedRef( StateType.class, DEFAULT_ANT_NAME )). getStartState(); } return this.startState; } public void setFinalState( boolean on ) { this.finalState = on; } public boolean getFinalState() { if (isReference()) { return ((StateType)getCheckedRef( StateType.class, DEFAULT_ANT_NAME )). getFinalState(); } return this.finalState; } public AsmblState createState() throws BuildException { if (isReference()) { return ((StateType)getCheckedRef( StateType.class, DEFAULT_ANT_NAME )). createState(); } verifySettings(); AsmblState as = new AsmblState(); as.setName( getName() ); as.setIsStartState( getStartState() ); as.setIsFinalState( getFinalState() ); IValidate v[] = getValidates(); for (int i = 0; i < v.length; ++i) { as.addValidate( v[i] ); } String names[] = getTransitionNames(); for (int i = 0; i < names.length; ++i) { as.addTransitionName( names[i] ); } return as; } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/package.htmllibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/package.ht0000644000175000017500000000202007563743646034026 0ustar drazzibdrazzibnet.sourceforge.groboutils.mbtf.v1.ant Ant tasks and data-types for creating and executing state machines from Ant. It provides Ant type versions for each of the main MBTF types: states, transitions, validators, and a state iterator.

The primary owning task is <mbtf.stateiterator>, which contains all the states, and defines the System that will be tested. It can contain references to the states, so that the states can be defined outside the iterator.

The key part is that your ISystem instance must be registered as a Reference in the ant Project.

What the Tester Needs To Write

The Java class for the system, the validators, transitions, and so on.

What's Left To Do

There should be a validator and transition that contains an ant task. Note that the "refid" doesn't work right on tasks for our purposes: if a task has an id, then the task must have executed. So, we need to add task containers for these types.

././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/ReferenceType.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/ReferenceT0000644000175000017500000001043607622026451034035 0ustar drazzibdrazzib/* * @(#)ReferenceType.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Location; import org.apache.tools.ant.taskdefs.Definer; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.Task; import java.lang.reflect.Method; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * Use the "refid" attribute to set the reference task/target. * Set the "sysid" to set the ID to register the "system" variable in the * project. The execute() method will execute the referenced object. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class ReferenceType extends DataType { private String sysRefId; protected Location location = Location.UNKNOWN_LOCATION; /** * Sets the file location where this task was defined. */ public void setLocation(Location location) { this.location = location; } public void setSysId( String id ) { this.sysRefId = id; } public void setSystem( ISystem sys ) { if (this.sysRefId != null && sys != null) { project.addReference( this.sysRefId, sys ); } } /** * Execute the referenced object */ public void execute() throws BuildException { // get the referenced object if (!isReference()) { throw new BuildException( "does not have a reference", location ); } Object o = getCheckedRef( Object.class, "task or target" ); // use reflection to find the execute() method. Class c = o.getClass(); Method m; try { m = c.getMethod( "execute", new Class[0] ); } catch (Exception e) { throw new BuildException("No 'execute' method for "+c.getName(), e, location ); } try { m.invoke( o, new Object[0] ); } catch (BuildException be) { throw be; } catch (TestHaltRuntimeException thre) { throw thre; } catch (Exception e) { throw new BuildException( "Unexpected exception", e, location ); } } public void execute( ISystem system, IErrors errors ) { setSystem( system ); try { execute(); } catch (TestHaltRuntimeException thre) { throw thre; } catch (Exception e) { errors.addError( e.getMessage(), e ); } } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/ValidateTaskType.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/ValidateTa0000644000175000017500000000560307622026451034031 0ustar drazzibdrazzib/* * @(#)ValidateTaskType.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Definer; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.Task; import java.lang.reflect.Method; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * A specific IValidate instance, which is Ant compatible, that executes an * ant Task/Target (via Reference), and registers an error if the "build" * fails. Use the "refid" attribute to set the reference task/target. * Set the "sysid" to set the ID to register the "system" variable in the * project. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class ValidateTaskType extends ReferenceType implements IValidate, IAction { // intended to be an imbedded task, but can be defined outside // the state iterator. public static final String DEFAULT_ANT_NAME = "mbtf.validateant"; public void validate( ISystem system, IErrors errors ) { execute( system, errors ); } public void performAction( ISystem system, IErrors errors ) { execute( system, errors ); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/StateIteratorTask.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/StateItera0000644000175000017500000001650307622026451034061 0ustar drazzibdrazzib/* * @(#)StateIteratorTask.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.Task; import org.apache.tools.ant.TaskAdapter; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.taskdefs.Definer; import java.util.Vector; import java.util.Enumeration; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystemFactory; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IPathGenerator; import net.sourceforge.groboutils.mbtf.v1.IPath; import net.sourceforge.groboutils.mbtf.v1.IPathParser; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; import net.sourceforge.groboutils.mbtf.v1.engine.PathParserImpl; import net.sourceforge.groboutils.mbtf.v1.engine.BreadthPathGenerator; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblState; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblStateSet; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblTransition; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblTransitionSet; import net.sourceforge.groboutils.mbtf.v1.assembler.Assembler; /** * An ant datatype encapsulating the IState instance. This includes an * execute() method to allow for this to be defined in a * <typedef> declaration, rather than inside a target as a * <datatype> declaration. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class StateIteratorTask extends Task { public static final String DEFAULT_ANT_NAME = "mbtf.stateiterator"; private Vector transitions = new Vector(); private Vector states = new Vector(); private Reference systemFactory; private int maxDepth = 4; public void setSystemFactoryRef( Reference ref ) { this.systemFactory = ref; } public ISystemFactory getSystemFactory() throws BuildException { ISystemFactory sys = null; if (this.systemFactory != null) { Object o = this.systemFactory.getReferencedObject( project ); if (o != null) { if (o instanceof TaskAdapter) { o = ((TaskAdapter)o).getProxy(); } if (!( o instanceof ISystemFactory )) { throw new BuildException( "referenced object not of type ISystemFactory", location ); } sys = (ISystemFactory)o; } } return sys; } public void setMaxDepth( int depth ) throws BuildException { if (depth <= 0) { throw new BuildException("invalid value for maximum depth: "+ depth, location ); } this.maxDepth = depth; } public int getMaxDepth() { return this.maxDepth; } public void addState( StateType state ) { if (state != null) { this.states.addElement( state ); } } public AsmblStateSet getStates() throws BuildException { Enumeration enum = this.states.elements(); AsmblStateSet ass = new AsmblStateSet(); while (enum.hasMoreElements()) { ass.addState( ((StateType)enum.nextElement()).createState() ); } return ass; } public void addTransition( TransitionType trans ) { if (trans != null) { this.transitions.addElement( trans ); } } public AsmblTransitionSet getTransitions() throws BuildException { Enumeration enum = this.transitions.elements(); AsmblTransitionSet ats = new AsmblTransitionSet(); while (enum.hasMoreElements()) { ats.addTransition( ((TransitionType)enum.nextElement()). createTransition() ); } return ats; } public void execute() throws BuildException { IPathGenerator gen = createPathGenerator(); IPathParser parser = createPathParser(); ISystemFactory sysFactory = getSystemFactory(); try { IPath path = gen.getNextPath(); while (path.getDepth() <= getMaxDepth()) { ISystem sys = sysFactory.createSystem(); if (sys == null) { throw new BuildException( "System factory returned a null factory.", location ); } IErrors err = parser.parsePath( path, sys ); } } catch (TestHaltRuntimeException thre) { throw new BuildException( thre.getMessage(), thre, location ); } } public IPathGenerator createPathGenerator() throws BuildException { try { Assembler asm = new Assembler( getTransitions(), getStates() ); IState startStates[] = asm.getStartStates(); IState finalStates[] = asm.getFinalStates(); return new BreadthPathGenerator( startStates, finalStates ); } catch (Exception e) { throw new BuildException( e.getMessage(), e ); } } protected IPathParser createPathParser() throws BuildException { return new PathParserImpl(); } protected void processErrors( IErrors err ) { log( err.toString(), Project.MSG_WARN ); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/TransitionType.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/Transition0000644000175000017500000001447107622026451034150 0ustar drazzibdrazzib/* * @(#)TransitionType.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.Task; import org.apache.tools.ant.TaskAdapter; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.taskdefs.Definer; import java.util.Vector; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblTransition; import org.apache.log4j.Logger; /** * An ant datatype encapsulating the IState instance. This includes an * execute() method to allow for this to be defined in a * <typedef> declaration, rather than inside a target as a * <datatype> declaration. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public class TransitionType extends AbstractStateMachineType { private static final Logger LOG = Logger.getLogger( TransitionType.class ); public static final String DEFAULT_ANT_NAME = "mbtf.transition"; private Vector transitions = new Vector(); private String nextState; private IAction action; public void setNextState( String name ) { this.nextState = name; } public String getNextState() { if (isReference()) { return ((TransitionType)getCheckedRef( TransitionType.class, DEFAULT_ANT_NAME )). getNextState(); } return this.nextState; } public void addAntAction( ValidateTaskType action ) throws BuildException { if (this.action != null) { throw new BuildException( "too many action elements: only one allowed" ); } this.action = action; } public void addJavaAction( ValidateJavaType action ) throws BuildException { if (this.action != null) { throw new BuildException( "too many action elements: only one allowed" ); } LOG.debug("Adding ValidateJavaType"); this.action = action; } public void setAntActionRef( Reference ref ) { ValidateTaskType vtt = new ValidateTaskType(); vtt.setProject( project ); vtt.setRefid( ref ); addAntAction( vtt ); } public void setJavaActionRef( Reference ref ) { Object o = ref.getReferencedObject( project ); if (o != null && o instanceof TaskAdapter) { ((TaskAdapter)o).execute(); o = ((TaskAdapter)o).getProxy(); } addJavaAction( (ValidateJavaType)o ); } public IAction getAction() { if (isReference()) { return ((TransitionType)getCheckedRef( TransitionType.class, DEFAULT_ANT_NAME )). getAction(); } if (project != null) { if (this.action instanceof ProjectComponent) { LOG.debug("Setting action "+this.action+"'s project to "+ getProject()); ((ProjectComponent)this.action).setProject( getProject() ); } else { LOG.debug("Action "+this.action+ " is not a ProjectComponent, but "+this.action.getClass(). getName()); } } else { LOG.debug("Transition "+getName()+" has null project"); } return this.action; } public AsmblTransition createTransition() { if (isReference()) { return ((TransitionType)getCheckedRef( TransitionType.class, DEFAULT_ANT_NAME )). createTransition(); } verifySettings(); AsmblTransition at = new AsmblTransition(); at.setName( getName() ); at.setNextStateName( getNextState() ); at.setAction( getAction() ); IValidate v[] = getValidates(); for (int i = 0; i < v.length; ++i) { at.addValidate( v[i] ); } return at; } protected void verifySettings() throws BuildException { if (isReference()) { ((TransitionType)getCheckedRef( TransitionType.class, DEFAULT_ANT_NAME )). verifySettings(); return; } super.verifySettings(); if (this.nextState == null) { throw new BuildException( "next state name not set", location ); } if (this.action == null) { throw new BuildException( "next state name not set", location ); } } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/IUsesProperties.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/IUsesPrope0000644000175000017500000000434307622026451034051 0ustar drazzibdrazzib/* * @(#)IUsesProperties.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Property; import org.apache.tools.ant.types.Reference; import java.io.File; /** * Used by classes created in ValidateJavaType, which can have * external properties set. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 17, 2002 */ public interface IUsesProperties { public void setProject( Project proj ); public void addProperty( String name, String value ); public void addReference( String name, Reference ref ); public void addFile( String name, File file ); public void addEnvironment( String name, String env ); public void addResource( String name, String resource ); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/AbstractStateMachineType.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ant/AbstractSt0000644000175000017500000001244307622026451034065 0ustar drazzibdrazzib/* * @(#)AbstractStateMachineType.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.Location; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.taskdefs.Definer; import java.util.Vector; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.assembler.AsmblState; import org.apache.log4j.Logger; /** * An ant datatype encapsulating the IState instance. This includes an * execute() method to allow for this to be defined in a * <typedef> declaration, rather than inside a target as a * <datatype> declaration. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 13, 2002 */ public abstract class AbstractStateMachineType extends DataType { private static final Logger LOG = Logger.getLogger( AbstractStateMachineType.class ); public void execute() throws BuildException { // do nothing } protected Location location = Location.UNKNOWN_LOCATION; /** * Sets the file location where this task was defined. */ public void setLocation(Location location) { this.location = location; } private Vector validates = new Vector(); private String name; public void setName( String name ) { this.name = name; } public String getName() { if (isReference()) { return ((AbstractStateMachineType)getCheckedRef( AbstractStateMachineType.class, "state machine type" )). getName(); } return this.name; } public IValidate[] getValidates() { if (isReference()) { return ((AbstractStateMachineType)getCheckedRef( AbstractStateMachineType.class, "state machine type" )). getValidates(); } IValidate[] v = new IValidate[ this.validates.size() ]; this.validates.copyInto( v ); if (getProject() != null) { for (int i = 0; i < v.length; ++i) { IValidate vv = v[i]; if (vv instanceof ProjectComponent) { LOG.debug("Setting project of "+vv); ((ProjectComponent)vv).setProject( getProject() ); } else { LOG.debug("Validator "+vv+" not a ProjectComponent, but "+ vv.getClass().getName()); } } } else { LOG.debug("Ant type "+this+" never had project set"); } return v; } public void addConfiguredValidateJava( ValidateJavaType type ) { if (type != null) { LOG.debug("Adding ValidateJavaType "+type); this.validates.addElement( type ); } } public void addConfiguredValidateAnt( ValidateTaskType type ) { if (type != null) { this.validates.addElement( type ); } } protected void verifySettings() throws BuildException { if (isReference()) { ((AbstractStateMachineType)getCheckedRef( AbstractStateMachineType.class, "state machine type" )). verifySettings(); return; } if (this.name == null) { throw new BuildException( "name not set", location ); } if (this.validates.size() <= 0) { throw new BuildException( "no validation types registered", location ); } } } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IState.java0000644000175000017500000000526607622026451033347 0ustar drazzibdrazzib/* * @(#)IState.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Associates a system state with the transitions leading out of the state, * and with the validation of the state. The state object should be immutable * once the path generation begins. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public interface IState { /** * Retrieves the name for the state. This should be unique for * state-machine assembly purposes, but it does not have to be. * * @return a non-null name for this state. */ public String getName(); /** * Retrieves the list of transitions leading from this state. * * @return a non-null list of all transitions from this state. If the * length of the list is 0, then this is a terminal state. */ public ITransition[] getTransitions(); /** * Retrieves the list of all validation instances used to assert that * the current state is valid. * * @return a non-null list of all validation instances for this state. * An empty list will cause a warning on all but the first * (initial) state. This list should not include the included * Transitions' validates. */ public IValidate[] getValidates(); } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IAction.java0000644000175000017500000000371307622026450033476 0ustar drazzibdrazzib/* * @(#)IAction.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Performs a state-transition action on the system. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:24 $ * @since June 12, 2002 */ public interface IAction { /** * Execute a transition action on system, registering any * encountered errors in errors. * * @param system the system-under-test's current state. * @param errors container allowing registration of errors or warnings. */ public void performAction( ISystem system, IErrors errors ); } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ISystem.java0000644000175000017500000000400307622026451033537 0ustar drazzibdrazzib/* * @(#)ISystem.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * A marker interface to indicate the current state of the system being * modeled. The implemented classes must provide enough information and * actions from this instance to perform all necessary state and transition * validations, and transition actions. *

* Common implementations create a class that contains all necessary instances * for querying and manipulating the system. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public interface ISystem { // This is a marker interface - there are no members. } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathGenerator.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathGenerator0000644000175000017500000000403207622026450034077 0ustar drazzibdrazzib/* * @(#)IPathGenerator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Creates different sets of paths through the state machine. Common * techniques include breadth-first and random generation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:24 $ * @since June 12, 2002 */ public interface IPathGenerator { /** * Return the next path in the generator's sequence. */ public IPath getNextPath(); /** * Reset the generator's sequence. There is no guarantee that the * order of returned IPath instances will be identical as the previous * generation sequence. */ public void reset(); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/TestFailRuntimeException.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/TestFailRuntim0000644000175000017500000000403107622026451034135 0ustar drazzibdrazzib/* * @(#)TestHaltRuntimeException.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Generating this exception during a test will cause only the current path * to halt. Other paths will continue. This allows for an "easy out" for * deeply burried method call stacks. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since November 9, 2002 */ public class TestFailRuntimeException extends RuntimeException { private IErrors err; public TestFailRuntimeException( IErrors err, String msg ) { super( msg ); this.err = err; } public IErrors getErrors() { return this.err; } } libgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IErrors.java0000644000175000017500000001441007622026450033531 0ustar drazzibdrazzib/* * @(#)IErrors.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * A container for registering errors or warnings caused by invalid * validation of a state or transition. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:24 $ * @since June 12, 2002 */ public interface IErrors { /** * Immediately stop the path processing, and do not continue other paths * for processing. This will throw a RuntimeException. *

* Halts should be a last-recourse to indicate that the system cannot be * used for further testing. * * @param msg a human-readable error message. * @exception TestHaltRuntimeException will always be generated. */ public void halt( String msg ) throws TestHaltRuntimeException; /** * Add a failure to the list of current errors. Validation methods that * register failures will halt the current path's testing. This method * will not throw an exception, so validation processing must leave the * method on its own. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. */ public void addFailure( String msg ); /** * Add a failure associated with a Throwable to the list of current errors. * Validation methods that register failures will halt the current path's * testing. This method will not throw an exception, so validation * processing must leave the method on its own. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. * @param t the exception associated with the error. */ public void addFailure( String msg, Throwable t ); /** * Add a failure to the list of current errors. Validation methods that * register failures will halt the current path's testing. This method * will not throw a TestFailRuntimeException, so validation * processing must leave the method on its own. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. * @exception TestFailRuntimeException allows for easy exiting of a * burried method call stack. */ public void fail( String msg ) throws TestFailRuntimeException; /** * Add a failure associated with a Throwable to the list of current errors. * Validation methods that register failures will halt the current path's * testing. This method will throw a TestFailRuntimeException to * allow for an easy exit from a burried method call stack. *

* Failures should be registered when a non-recoverable error occurs in the * system. The framework may still process other paths, though. * * @param msg a human-readable error message. * @param t the exception associated with the error. * @exception TestFailRuntimeException allows for easy exiting of a * burried method call stack. */ public void fail( String msg, Throwable t ) throws TestFailRuntimeException; /** * Add an error to the list of current errors. Validation methods that * register errors will not halt the current path's testing, but the error * will be listed in the report with the associated path where the error * condition occured. *

* Errors should be registered when an error occurs in the system, but * the system can continue processing the path. * * @param msg a human-readable error message. */ public void addError( String msg ); /** * Add an error associated with a Throwable to the list of current errors. * Validation methods that register errors will halt the current path's * testing. *

* Errors should be registered when an error occurs in the system, but * the system can continue processing the path. * * @param msg a human-readable error message. * @param t the exception associated with the error. */ public void addError( String msg, Throwable t ); /** * Add a warning to the list of current warnings. Warnings will not * halt the testing process, and will not register an error. *

* Warnings should be used when a questionable system state occurs, or if * the tester wants to perform debugging. * * @param msg a human-readable message. */ public void addWarning( String msg ); /** * Retrieve all registered errors. */ public IError[] getErrors(); } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ISystemFactory.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/ISystemFactory0000644000175000017500000000422307622026451034153 0ustar drazzibdrazzib/* * @(#)ISystemFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Each new path should correspondingly have a new ISystem to interact * with, to ensure that the system has been properly reset. The initial states * may setup the System to be in different contexts, but they still require * the system to be based on an expected startup state. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since November 9, 2002 */ public interface ISystemFactory { /** * Create a new System in an expected initial state. This will be * invoked once per new path generation and execution. * * @return the new system that will be tested. Must never return * null. */ public ISystem createSystem(); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathIterator.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathIterator.0000644000175000017500000000371307622026451034026 0ustar drazzibdrazzib/* * @(#)IPathIterator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; import java.util.Enumeration; /** * An iterator to allow the tracing of the transitions through a state machine. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public interface IPathIterator extends Enumeration { /** * Performs same functionality as hasMoreElements(). */ public boolean hasNext(); /** * The same as nextElement()(), but without the required cast. */ public ITransition nextTransition(); } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathHistory.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathHistory.j0000644000175000017500000000570407622026450034051 0ustar drazzibdrazzib/* * @(#)IPathHistory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Records the states and transition history during a path traversal. * The instance can be cloned for the cases of errors and warnings needing to * store the path history when they occured. The instance should also support * a toString() method for easy debugging and logging. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:24 $ * @since June 12, 2002 */ public interface IPathHistory { /** * When the current state changes, add the new state here. This should * be called for the start state, and once at the end of every successful * transition. */ public void addState( IState s ); /** * When a transition is about to occur, it should be added here. */ public void addTransition( ITransition t ); /** * After a validation call, the error results should be added here. */ public void addValidate( IValidate val, IState owningState, IErrors errors ); /** * After a validation call, the error results should be added here. */ public void addValidate( IValidate val, ITransition owningTransition, IErrors errors ); /** * Returns the total number of errors (halts, failures, and errors) * registered during validation and transitions. */ public int getErrorCount(); /** * Returns a copy of this instance. The copied instance must not change * when the parent copy changes. */ public IPathHistory copy(); } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathParser.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/IPathParser.ja0000644000175000017500000000356207622026451034006 0ustar drazzibdrazzib/* * @(#)IPathParser.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Knows how to parse an IPath instance, and correctly follow the transitions * and record errors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public interface IPathParser { /** * @exception TestHaltRuntimeException if the path validation reports * a halt() to errors. */ public IErrors parsePath( IPath path, ISystem sys ); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/TestHaltRuntimeException.javalibgroboutils-java-5.orig/testing-mbtf/sources/dev/net/sourceforge/groboutils/mbtf/v1/TestHaltRuntim0000644000175000017500000000405707622026451034162 0ustar drazzibdrazzib/* * @(#)TestHaltRuntimeException.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; /** * Generating this exception during a test will cause all testing, current path * and future paths included, to halt. This indicates that the system under * test has no way to recover from an encountered error. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:25 $ * @since June 12, 2002 */ public class TestHaltRuntimeException extends RuntimeException { private IErrors err; public TestHaltRuntimeException( IErrors err, String msg ) { super( msg ); this.err = err; } public IErrors getErrors() { return this.err; } } libgroboutils-java-5.orig/testing-mbtf/sources/dev/about.txt0000644000175000017500000000015207521071657024401 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/testing-mbtf/sources/ut/0000755000175000017500000000000011271425773022401 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/0000755000175000017500000000000010011472755023160 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/0000755000175000017500000000000010011472755025503 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472755027674 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/0000755000175000017500000000000010011472755030624 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/0000755000175000017500000000000011271425773031161 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/0000755000175000017500000000000011271425773032426 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathIteratorImplUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathIter0000644000175000017500000001242107622026454034067 0ustar drazzibdrazzib/* * @(#)PathIteratorImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IAction; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; import java.util.NoSuchElementException; /** * Tests the PathIteratorImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class PathIteratorImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = PathIteratorImplUTest.class; public PathIteratorImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests private static class MyAction implements IAction { public void performAction( ISystem s, IErrors e ) {} } public void testNextTransition1() { try { (new PathIteratorImpl( null )).nextTransition(); fail("Did not throw NoSuchElementException"); } catch (NoSuchElementException e) { // check exception } } public void testNextTransition2() { TransitionImpl trans = new TransitionImpl( "trans", null, new MyAction(), null ); PathIteratorImpl pii = new PathIteratorImpl( new ITransition[] { trans } ); assertEquals( "did not return correct transition.", trans, pii.nextTransition() ); } //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/ErrorImplJDK13UTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/ErrorImp0000644000175000017500000001151107622026454034105 0ustar drazzibdrazzib/* * @(#)ErrorImplJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; /** * Tests the ErrorImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class ErrorImplJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ErrorImplJDK13UTest.class; public ErrorImplJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup private MockControl phControl; private IPathHistory mockPH; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.phControl = EasyMock.controlFor( IPathHistory.class ); this.mockPH = (IPathHistory)this.phControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { ErrorImpl ei = new ErrorImpl( null, null, null ); assertNull( "didn't set path history right.", ei.getPathHistory() ); assertNull( "didn't set throwable right.", ei.getThrowable() ); assertNull( "didn't set message right.", ei.getMessage() ); } public void testConstructor2() { String msg = "blah"; Throwable t = new Throwable(); this.phControl.activate(); ErrorImpl ei = new ErrorImpl( msg, t, this.mockPH ); assertEquals( "didn't set path history right.", ei.getPathHistory(), this.mockPH ); assertEquals( "didn't set throwable right.", ei.getThrowable(), t ); assertEquals( "didn't set message right.", ei.getMessage(), msg ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/StateImplUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/StateImp0000644000175000017500000001031707622026454034077 0ustar drazzibdrazzib/* * @(#)StateImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * Tests the StateImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class StateImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = StateImplUTest.class; public StateImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/BreadthPathGeneratorUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/BreadthP0000644000175000017500000001454507622026454034051 0ustar drazzibdrazzib/* * @(#)BreadthPathGeneratorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.Hashtable; import net.sourceforge.groboutils.mbtf.v1.assembler.*; import net.sourceforge.groboutils.mbtf.v1.*; /** * Tests the BreadthPathGenerator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since June 17, 2002 */ public class BreadthPathGeneratorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = BreadthPathGeneratorUTest.class; public BreadthPathGeneratorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests private static class MyAction implements IAction { public void performAction( ISystem s, IErrors e ) {} } public void testInnerStateConstructor1() { try { new BreadthPathGenerator.InnerState( null, null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception } } public void testInnerStateConstructor2() { try { new BreadthPathGenerator.InnerState( null, new Hashtable() ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception } } public void testInnerStateConstructor3() { AsmblState state = new AsmblState(); state.setName( "state" ); AsmblTransitionSet ats = new AsmblTransitionSet(); try { new BreadthPathGenerator.InnerState( state.createState( ats ), null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception } } public void testConstructor1() { try { new BreadthPathGenerator( null, null ); fail("did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // check exception } } public void testStructure1() { AsmblState state1 = new AsmblState(); state1.setName( "state1" ); state1.addTransitionName( "trans1" ); AsmblStateSet ass = new AsmblStateSet(); ass.addState( state1 ); AsmblTransition trans1 = new AsmblTransition(); trans1.setName( "trans1" ); trans1.setNextStateName( "state1" ); trans1.setAction( new MyAction() ); AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransition( trans1 ); Assembler asm = new Assembler( ats, ass ); new BreadthPathGenerator( asm.getStates(), null ); } //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathParserImplUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathPars0000644000175000017500000001035007622026454034070 0ustar drazzibdrazzib/* * @(#)PathParserImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * Tests the PathParserImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class PathParserImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = PathParserImplUTest.class; public PathParserImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/ErrorsImplJDK13UTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/ErrorsIm0000644000175000017500000002531607665402663034127 0ustar drazzibdrazzib/* * @(#)ErrorsImplJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.*; /** * Tests the ErrorsImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:55 $ * @since March 21, 2002 */ public class ErrorsImplJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ErrorsImplJDK13UTest.class; public ErrorsImplJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup private MockControl phControl; private IPathHistory mockPH; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.phControl = EasyMock.controlFor( IPathHistory.class ); this.mockPH = (IPathHistory)this.phControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { ErrorsImpl ei = new ErrorsImpl(); assertEquals( "# of errors not zero", ei.getErrors().length, 0 ); assertEquals( "# of warnings not zero", ei.getWarnings().length, 0 ); assertTrue( "default path halt state wrong", !ei.isHaltPath() ); assertTrue( "default test halt state wrong", !ei.isHaltTests() ); } public void testHalt1() { ErrorsImpl ei = new ErrorsImpl(); String msg = "msg"; try { ei.halt( msg ); fail("did not throw exception"); } catch (TestHaltRuntimeException thre) { // check exception? } assertErrors( ei, msg, null, null ); assertTrue( "path halt not set right", ei.isHaltPath() ); assertTrue( "test halt not set right", ei.isHaltTests() ); } public void testHalt2() { String msg = "msg"; ErrorsImpl ei = new ErrorsImpl(); this.mockPH.copy(); this.phControl.setReturnValue( this.mockPH, 1 ); this.phControl.activate(); ei.setCurrentPathHistory( this.mockPH ); try { ei.halt( msg ); fail("did not throw exception"); } catch (TestHaltRuntimeException thre) { // check exception? } assertTrue( "path halt not set right", ei.isHaltPath() ); assertTrue( "test halt not set right", ei.isHaltTests() ); assertErrors( ei, msg, this.mockPH, null ); this.phControl.verify(); } public void testAddFailure1() { String msg = "msg 2"; ErrorsImpl ei = new ErrorsImpl(); ei.addFailure( msg ); assertTrue( "path halt not set right", ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, null, null ); } public void testAddFailure2() { String msg = "msg < >"; ErrorsImpl ei = new ErrorsImpl(); this.mockPH.copy(); this.phControl.setReturnValue( this.mockPH, 1 ); this.phControl.activate(); ei.setCurrentPathHistory( this.mockPH ); ei.addFailure( msg ); assertTrue( "path halt not set right", ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, this.mockPH, null ); this.phControl.verify(); } public void testAddFailure3() { String msg = "msg 2"; Throwable t = new Throwable("ignore"); ErrorsImpl ei = new ErrorsImpl(); ei.addFailure( msg, t ); assertTrue( "path halt not set right", ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, null, t ); } public void testAddFailure4() { String msg = "msg < >"; Throwable t = new Throwable("ignore"); ErrorsImpl ei = new ErrorsImpl(); this.mockPH.copy(); this.phControl.setReturnValue( this.mockPH, 1 ); this.phControl.activate(); ei.setCurrentPathHistory( this.mockPH ); ei.addFailure( msg, t ); assertTrue( "path halt not set right", ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, this.mockPH, t ); this.phControl.verify(); } public void testAddError1() { String msg = "msg 2"; ErrorsImpl ei = new ErrorsImpl(); ei.addError( msg ); assertTrue( "path halt not set right", !ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, null, null ); } public void testAddError2() { String msg = "msg < >"; ErrorsImpl ei = new ErrorsImpl(); this.mockPH.copy(); this.phControl.setReturnValue( this.mockPH, 1 ); this.phControl.activate(); ei.setCurrentPathHistory( this.mockPH ); ei.addError( msg ); assertTrue( "path halt not set right", !ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, this.mockPH, null ); this.phControl.verify(); } public void testAddError3() { String msg = "msg 2"; Throwable t = new Throwable("ignore"); ErrorsImpl ei = new ErrorsImpl(); ei.addError( msg, t ); assertTrue( "path halt not set right", !ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, null, t ); } public void testAddError4() { String msg = "msg < >"; Throwable t = new Throwable("ignore"); ErrorsImpl ei = new ErrorsImpl(); this.mockPH.copy(); this.phControl.setReturnValue( this.mockPH, 1 ); this.phControl.activate(); ei.setCurrentPathHistory( this.mockPH ); ei.addError( msg, t ); assertTrue( "path halt not set right", !ei.isHaltPath() ); assertTrue( "test halt not set right", !ei.isHaltTests() ); assertErrors( ei, msg, this.mockPH, t ); this.phControl.verify(); } //------------------------------------------------------------------------- // Helpers protected void assertErrors( ErrorsImpl ei, String msg, IPathHistory hist, Throwable t ) { IError e[] = ei.getErrors(); assertErrorType( e, msg, hist, t ); } protected void assertErrorType( IError[] e, String msg, IPathHistory hist, Throwable t ) { assertNotNull( "error array is null", e ); assertEquals( "did not add error correctly", e.length, 1 ); assertNotNull( "error contents are null", e[0] ); assertEquals( "path history is not correct", e[0].getPathHistory(), hist ); assertEquals( "throwable is not correct", e[0].getThrowable(), t ); assertEquals( "message not right.", e[0].getMessage(), msg ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IErrorsUTestI.suite(); // Test the implementation's interface conformity. suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ErrorsImpl(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathImplUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathImpl0000644000175000017500000001031207622026454034062 0ustar drazzibdrazzib/* * @(#)PathImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * Tests the PathImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class PathImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = PathImplUTest.class; public PathImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/TransitionImplUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/Transiti0000644000175000017500000001035007622026454034143 0ustar drazzibdrazzib/* * @(#)TransitionImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * Tests the TransitionImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class TransitionImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TransitionImplUTest.class; public TransitionImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathHistoryImplUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/engine/PathHist0000644000175000017500000001035507622026454034077 0ustar drazzibdrazzib/* * @(#)PathHistoryImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.engine; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IError; import net.sourceforge.groboutils.mbtf.v1.IPathHistory; import net.sourceforge.groboutils.mbtf.v1.TestHaltRuntimeException; /** * Tests the PathHistoryImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since March 21, 2002 */ public class PathHistoryImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = PathHistoryImplUTest.class; public PathHistoryImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers public void assertEquals( String msg, Object[] left, Object[] right ) { if (left == null) { assertNull( msg, right ); } else { assertNotNull( msg, right ); assertEquals( msg, left.length, right.length ); for (int i = left.length; ++i >= 0;) { assertEquals( msg, left[i], right[i] ); } } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/0000755000175000017500000000000011271425773033136 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblTransitionSetUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/Asmbl0000644000175000017500000001622107622026454034117 0ustar drazzibdrazzib/* * @(#)AsmblTransitionSetUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AsmblTransitionSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since June 17, 2002 */ public class AsmblTransitionSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AsmblTransitionUTest.class; public AsmblTransitionSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AsmblTransitionSet(); } public void testAddTransition1() { AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransition( null ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 0, v.length ); } public void testAddTransition2() { AsmblTransition at = new AsmblTransition(); AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransition( at ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 1, v.length ); assertEquals( "transitions inserted not returned.", at, v[0] ); } public void testAddTransitions1() { AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransitions( null ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 0, v.length ); } public void testAddTransitions2() { AsmblTransition[] at = new AsmblTransition[0]; AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransitions( at ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 0, v.length ); } public void testAddTransitions3() { AsmblTransition[] at = new AsmblTransition[1]; AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransitions( at ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 0, v.length ); } public void testAddTransitions4() { AsmblTransition at = new AsmblTransition(); AsmblTransition atlist[] = new AsmblTransition[1]; atlist[0] = at; AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransitions( atlist ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 1, v.length ); assertEquals( "transitions inserted not returned.", at, v[0] ); } public void testAddTransitions5() { AsmblTransition at = new AsmblTransition(); AsmblTransition atlist[] = new AsmblTransition[2]; atlist[0] = at; AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransitions( atlist ); AsmblTransition[] v = ats.getTransitions(); assertNotNull( "transitions returned null.", v ); assertEquals( "transitions size not right.", 1, v.length ); assertEquals( "transitions inserted not returned.", at, v[0] ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblStateUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/Asmbl0000644000175000017500000001715007622026454034121 0ustar drazzibdrazzib/* * @(#)AsmblStateUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IState; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.IAction; /** * Tests the AsmblState class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since June 17, 2002 */ public class AsmblStateUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AsmblStateUTest.class; public AsmblStateUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AsmblState(); } public void testAddValidate1() { AsmblState at = new AsmblState(); at.addValidate( null ); IValidate[] v = at.getValidates(); assertNotNull( "validates returned null.", v ); assertEquals( "validates size not right.", 0, v.length ); } private static class MyValidate implements IValidate { public void validate( ISystem s, IErrors e ) {} } private static class MyAction implements IAction { public void performAction( ISystem s, IErrors e ) {} } public void testAddValidate2() { IValidate ov = new MyValidate(); AsmblState at = new AsmblState(); at.addValidate( ov ); IValidate[] v = at.getValidates(); assertNotNull( "validates returned null.", v ); assertEquals( "validates size not right.", 1, v.length ); assertEquals( "validates inserted not returned.", ov, v[0] ); } public void testAddTransitionName1() { AsmblState at = new AsmblState(); at.addTransitionName( null ); String[] v = at.getTransitionNames(); assertNotNull( "trans names returned null.", v ); assertEquals( "trans names size not right.", 0, v.length ); } public void testAddTransitionName2() { String transName = "t1"; AsmblState at = new AsmblState(); at.addTransitionName( transName ); String[] v = at.getTransitionNames(); assertNotNull( "trans names returned null.", v ); assertEquals( "trans names size not right.", 1, v.length ); assertEquals( "not same name as passed into add.", transName, v[0] ); } public void testCreateState1() { AsmblState at = new AsmblState(); AsmblTransitionSet ats = new AsmblTransitionSet(); try { IState state = at.createState( ats ); fail("did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // check reason } } public void testCreateState2() { AsmblState as = new AsmblState(); as.setName( "state" ); AsmblTransitionSet ats = new AsmblTransitionSet(); IState state = as.createState( ats ); assertNotNull( "returned null.", state ); assertEquals( "wrong state name.", "state", as.getName() ); } public void testCreateState3() { AsmblState as = new AsmblState(); as.setName( "state" ); as.addTransitionName( "trans" ); AsmblTransition at = new AsmblTransition(); at.setName( "trans" ); at.setNextStateName( "state" ); at.setAction( new MyAction() ); AsmblTransitionSet ats = new AsmblTransitionSet(); ats.addTransition( at ); IState state = as.createState( ats ); assertNotNull( "returned null.", state ); assertEquals( "wrong name for state.", "state", state.getName() ); assertEquals( "wrong transition length.", 1, state.getTransitions().length ); assertEquals( "wrong validates length.", 0, state.getValidates().length ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblStateSetUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/Asmbl0000644000175000017500000001540607622026453034122 0ustar drazzibdrazzib/* * @(#)AsmblStateSetUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AsmblStateSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:27 $ * @since June 17, 2002 */ public class AsmblStateSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AsmblStateUTest.class; public AsmblStateSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AsmblStateSet(); } public void testAddState1() { AsmblStateSet ats = new AsmblStateSet(); ats.addState( null ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 0, v.length ); } public void testAddState2() { AsmblState at = new AsmblState(); AsmblStateSet ats = new AsmblStateSet(); ats.addState( at ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 1, v.length ); assertEquals( "states inserted not returned.", at, v[0] ); } public void testAddStates1() { AsmblStateSet ats = new AsmblStateSet(); ats.addStates( null ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 0, v.length ); } public void testAddStates2() { AsmblState[] at = new AsmblState[0]; AsmblStateSet ats = new AsmblStateSet(); ats.addStates( at ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 0, v.length ); } public void testAddStates3() { AsmblState[] at = new AsmblState[1]; AsmblStateSet ats = new AsmblStateSet(); ats.addStates( at ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 0, v.length ); } public void testAddStates4() { AsmblState at = new AsmblState(); AsmblState atlist[] = new AsmblState[1]; atlist[0] = at; AsmblStateSet ats = new AsmblStateSet(); ats.addStates( atlist ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 1, v.length ); assertEquals( "states inserted not returned.", at, v[0] ); } public void testAddStates5() { AsmblState at = new AsmblState(); AsmblState atlist[] = new AsmblState[2]; atlist[0] = at; AsmblStateSet ats = new AsmblStateSet(); ats.addStates( atlist ); AsmblState[] v = ats.getStates(); assertNotNull( "states returned null.", v ); assertEquals( "states size not right.", 1, v.length ); assertEquals( "states inserted not returned.", at, v[0] ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/AsmblTransitionUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/assembler/Asmbl0000644000175000017500000001427507622026454034126 0ustar drazzibdrazzib/* * @(#)AsmblTransitionUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.assembler; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.ITransition; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.IAction; /** * Tests the AsmblTransition class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:28 $ * @since June 17, 2002 */ public class AsmblTransitionUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AsmblTransitionUTest.class; public AsmblTransitionUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AsmblTransition(); } public void testAddValidate1() { AsmblTransition at = new AsmblTransition(); at.addValidate( null ); IValidate[] v = at.getValidates(); assertNotNull( "validates returned null.", v ); assertEquals( "validates size not right.", 0, v.length ); } private static class MyValidate implements IValidate { public void validate( ISystem s, IErrors e ) {} } private static class MyAction implements IAction { public void performAction( ISystem s, IErrors e ) {} } public void testAddValidate2() { IValidate ov = new MyValidate(); AsmblTransition at = new AsmblTransition(); at.addValidate( ov ); IValidate[] v = at.getValidates(); assertNotNull( "validates returned null.", v ); assertEquals( "validates size not right.", 1, v.length ); assertEquals( "validates inserted not returned.", ov, v[0] ); } public void testGetTransition1() { AsmblTransition at = new AsmblTransition(); try { at.getTransition(); fail("did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // test exception } } public void testGetTransition2() { AsmblTransition at = new AsmblTransition(); at.setName( "trans" ); at.setNextStateName( "state" ); IAction act = new MyAction(); at.setAction( act ); ITransition t = at.getTransition(); assertNotNull( "get transition returned null.", t ); assertEquals( "wrong name.", "trans", t.getName() ); assertEquals( "wrong action.", act, t.getAction() ); try { t.getDestinationState(); fail("did not throw IllegalStateException"); } catch (IllegalStateException e) { // test exception } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/ant/0000755000175000017500000000000011271425773031743 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/ant/TransitionTypeUTest.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/ant/TransitionT0000644000175000017500000001146307622026453034146 0ustar drazzibdrazzib/* * @(#)TransitionTypeUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1.ant; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.TaskAdapter; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.taskdefs.Definer; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.mbtf.v1.IValidate; import net.sourceforge.groboutils.mbtf.v1.ISystem; import net.sourceforge.groboutils.mbtf.v1.IErrors; import net.sourceforge.groboutils.mbtf.v1.IAction; /** * Tests the TransitionType class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:27 $ * @since June 17, 2002 */ public class TransitionTypeUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TransitionTypeUTest.class; public TransitionTypeUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { createTransitionType(); } public void testSetJavaActionRef1() { TransitionType tt = createTransitionType(); Reference r = new Reference( "javatype" ); TaskAdapter ta = new TaskAdapter(); ValidateJavaType vjt = new ValidateJavaType(); ta.setProxy( vjt ); this.project.addReference( "javatype", vjt ); tt.setJavaActionRef( r ); } //------------------------------------------------------------------------- // Helpers protected Project project; protected TransitionType createTransitionType() { this.project = new Project(); TransitionType tt = new TransitionType(); tt.setProject( this.project ); return tt; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/IErrorsUTestI.javalibgroboutils-java-5.orig/testing-mbtf/sources/ut/net/sourceforge/groboutils/mbtf/v1/IErrorsUTestI.j0000644000175000017500000003064107622026453034020 0ustar drazzibdrazzib/* * @(#)IErrorsUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.mbtf.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IErrors interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:27 $ */ public class IErrorsUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IErrorsUTestI.class; public IErrorsUTestI( String name, ImplFactory f ) { super( name, IErrors.class, f ); } public IErrors createIErrors() { return (IErrors)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testHalt1() { IErrors e = createIErrors(); try { e.halt( null ); fail( "Did not throw TestHaltRuntimeException." ); } catch (TestHaltRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testHalt2() { IErrors e = createIErrors(); try { e.halt( "" ); fail( "Did not throw TestHaltRuntimeException." ); } catch (TestHaltRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testHalt3() { IErrors e = createIErrors(); try { e.halt( "a" ); fail( "Did not throw TestHaltRuntimeException." ); } catch (TestHaltRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail1() { IErrors e = createIErrors(); try { e.fail( null ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail2() { IErrors e = createIErrors(); try { e.fail( "" ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail3() { IErrors e = createIErrors(); try { e.fail( "a" ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail4() { IErrors e = createIErrors(); try { e.fail( null, null ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail5() { IErrors e = createIErrors(); try { e.fail( "", null ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail6() { IErrors e = createIErrors(); try { e.fail( "a", null ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail7() { IErrors e = createIErrors(); try { e.fail( null, new Throwable() ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail8() { IErrors e = createIErrors(); try { e.fail( "", new Throwable() ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void testFail9() { IErrors e = createIErrors(); try { e.fail( "a", new Throwable() ); fail( "Did not throw TestFailRuntimeException." ); } catch (TestFailRuntimeException ex) { } assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure1() { IErrors e = createIErrors(); e.addFailure( null ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure2() { IErrors e = createIErrors(); e.addFailure( "" ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure3() { IErrors e = createIErrors(); e.addFailure( "a" ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure4() { IErrors e = createIErrors(); e.addFailure( null, null ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure5() { IErrors e = createIErrors(); e.addFailure( "", null ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure6() { IErrors e = createIErrors(); e.addFailure( "a", null ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure7() { IErrors e = createIErrors(); e.addFailure( null, new Throwable() ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure8() { IErrors e = createIErrors(); e.addFailure( "", new Throwable() ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } public void tstAddFailure9() { IErrors e = createIErrors(); e.addFailure( "a", new Throwable() ); assertNotNull( "Returned null error list.", e.getErrors() ); assertEquals( "Returned incorrect number of errors.", 1, e.getErrors().length ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-mbtf/sources/ut/about.txt0000644000175000017500000000012207521071665024247 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/testing-mbtf/sources/iut/0000755000175000017500000000000011271425773022552 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/iut/about.txt0000644000175000017500000000021107521071665024417 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/testing-mbtf/sources/eut/0000755000175000017500000000000011271425773022546 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/sources/eut/about.txt0000644000175000017500000000015307521071665024420 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/testing-mbtf/CHANGES.TXT0000644000175000017500000000413607622026450021735 0ustar drazzibdrazzib v1.0.0 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Isolated the 'testing.mbtf' hierarchy. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/testing-mbtf/xdocs/0000755000175000017500000000000011271425773021406 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-mbtf/xdocs/summary.xml0000644000175000017500000000132207655132715023625 0ustar drazzibdrazzib testing-mbtf net.sourceforge.groboutils.mbtf.v1 Model-Based Testing Framework. Allows for modeling the system under test through states and transitions, and executes all possible routes through the system, looking for combinations that cause error conditions. 08-Oct-2002: Need to integrate into the build. libgroboutils-java-5.orig/testing-mbtf/xdocs/about.xml0000644000175000017500000000102707655132715023244 0ustar drazzibdrazzib About $Date: 2003/05/04 06:40:13 $ Matt Albrecht Model-Based Testing Framework. Allows for modeling the system under test through states and transitions, and executes all possible routes through the system, looking for combinations that cause error conditions. See model-based-testing.org for more information on the topic. libgroboutils-java-5.orig/testing-mbtf/xdocs/algo-cpp.xml0000644000175000017500000000671307740247371023643 0ustar drazzibdrazzib Algorithm: Directed Chinese Postman Problem $Date: 2003/10/06 11:16:09 $ Matt Albrecht

About The Chinese Postman Problem

The Chinese Postman Problem (CPP) is one of those graph theory problems with a host of applications. Since it belongs in the realm of graph theory (and, thus, combinatorics), I shall explain the algorithm and the current implementation in graph theroy terminology.

The CPP resembles the Traveling Salesman Problem (TSP), but the postman in this problem must visit each road (edge) in the city (graph) to deliver the mail. Unlike TSP, CPP for either the directed or undirected case can be solved in polynomial time (mixed mode is NP-hard) .

Let G(E,V) be a directed graph, where V is the set of all verticies in the graph, and E is the set of all edges. We define each edge to be the set {label, (i, j), we}, where label is an identifier for the edge, the ordered pair (i, j) forms a directed edge from vertex i to vertex j (i and j ∈ V), and we is the weight of the edge (for our purposes, we ∈ ℝ). To aid us later, we also create a mapping fw(e) = weeE.

Mathematicians say that this graph is a multigraph since it allows multiple edges with the same ordered pair (i, j). I'll say that Eij is the set of all edges whose ordered pair of vertices match (i, j).

To solve the CPP, we must find a Chinese Postman Tour (CPT). A CPT is a circuit that includes every element of E. An optimal CPT must minimize the "cost" of the tour (I'll go into detail about the "cost" later).

Unlike an Euler circuit, in which each edge can only be traversed once, the CPP allows for multiple traversals of an edge. Let fij be the extra number of times the CPT traverses any directed edge from i to j; since every edge has to be traversed at least once, fij + 1 ≥ 1 is the number of times edge e is traversed in the CPT.

We write cij to mean the minimal weight value for all edges with vertices i to j, so that cij = min(fw(e)) ∀ eEij.

Thus, we can express the optimization of the CPT as minimizing the weight of the extra edge visits :

φ = ∑ cij fij

C. H. Papadimitriou, "On the Complexity of Edge Traversing," Journal of the ACM, 23:544-554, 1976. Harold Thimbleby, "The Directed Chinese Postman Problem," Middlesex University School of Computing Science Technical Report, October 2000. libgroboutils-java-5.orig/testing-mbtf/xdocs/requirements.xml0000644000175000017500000000027407655132715024660 0ustar drazzibdrazzib Requirements $Date: 2003/05/04 06:40:13 $ libgroboutils-java-5.orig/testing-mbtf/xdocs/design.xml0000644000175000017500000000034107740047473023402 0ustar drazzibdrazzib Design of MBTF $Date: 2003/10/05 17:04:59 $ Matt Albrecht libgroboutils-java-5.orig/testing-mbtf/xdocs/algo-sp.xml0000644000175000017500000000032207740047473023472 0ustar drazzibdrazzib Algorithm: Chinese Postman Problem $Date: 2003/10/05 17:04:59 $ libgroboutils-java-5.orig/testing-mbtf/xdocs/index.xml0000644000175000017500000000126107740047473023242 0ustar drazzibdrazzib Welcome $Date: 2003/10/05 17:04:59 $
  • About MBTF
  • Requirements
  • Design
    1. Algorithm - Directed Chinese Postman Problem
    2. Algorithm - Shortest Path
  • Using MBTF
  • libgroboutils-java-5.orig/testing-mbtf/xdocs/using.xml0000644000175000017500000000026507655132715023262 0ustar drazzibdrazzib Using $Date: 2003/05/04 06:40:13 $ libgroboutils-java-5.orig/util-states/0000755000175000017500000000000011271425773020141 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/deployed.ant-inc.xml0000644000175000017500000000032407547162336024023 0ustar drazzibdrazzib libgroboutils-java-5.orig/util-states/build.xml0000644000175000017500000001103707561622146021764 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/util-states/TODO.txt0000644000175000017500000000020607521071703021436 0ustar drazzibdrazzibList of items left todo (in relative order of priority): 1. Import all states classes from the 'java' module into this subproject.libgroboutils-java-5.orig/util-states/log4j.properties0000644000175000017500000000050407521071703023266 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.util.states=DEBUG libgroboutils-java-5.orig/util-states/sources/0000755000175000017500000000000010011473004021601 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/ait/0000755000175000017500000000000011271425773022401 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/ait/about.txt0000644000175000017500000000021007521071703024236 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/util-states/sources/dev/0000755000175000017500000000000011271425773022402 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/dev/net/0000755000175000017500000000000010011473004023145 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/0000755000175000017500000000000010011473004025470 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011473004027661 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/0000755000175000017500000000000010011473004030636 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/0000755000175000017500000000000010011473004032141 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/0000755000175000017500000000000011271425773032512 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/State.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/State.ja0000644000175000017500000000672707622026500034110 0ustar drazzibdrazzib/* * State.java - 0.9.0 01/07/2001 - 15:47:55 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; /** * The basic state object. * * @author Matt Albrecht * @version 0.9.0 Alpha */ public class State { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Protected Static Fields //--------------------------------------------------------------------- // Private Static Fields //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Protected Fields //--------------------------------------------------------------------- // Private Fields private int index; private int category; //--------------------------------------------------------------------- // Constructors /** * Default Constructor - protected */ protected State( int stateCategory, int stateIndex ) { this.index = stateIndex; this.category = stateCategory; } //--------------------------------------------------------------------- // Public Methods public boolean equals( Object o ) { if (o == null) return false; if (o == this) return true; if (o instanceof State) { State s = (State)o; if (s.index == this.index && s.category == this.category) { return true; } } return false; } public int hashcode() { return this.index + this.category; } protected boolean isSameCategory( State s ) { return (s.category == this.category); } //--------------------------------------------------------------------- // Protected Methods protected int getIndex() { return this.index; } protected int getCategory() { return this.category; } //--------------------------------------------------------------------- // Private Methods } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/package.htmllibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/package.0000644000175000017500000000243007521071703034076 0ustar drazzibdrazzibnet.groboclown.util.states.v1

    Philosophy of This State Design

    The purpose of the states package is to use a well designed state and state-machine system.

    The states are encapsulated in the State class. These can only be created by the StateSet or StateMachine classes. They are designed such that the outside managing class maintains the state objects in a well known place. This replaces the need for a String lookup, and creates a well-defined set of states which cause a better handling of in-bounds detection (compiler checked, not runtime checked).

    StateSet vs. StateMachine

    A StateSet is a simple mechanism for setting a state across multiple objects. It has no concept of transistions.

    A StateMachine, on the other hand, has a notion of transitions. In a state machine, the current state is handled internally. Outside forces send the machine a transition, which moves the current state to another based on a matrix. This allows for control over valid transition checking, and a better real-life correspondence.

    Therefore, one could say that a StateCategory is a StateMachine where the State to Transition relationship is 1-to-1, and there are no invalid transitions. ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/Stateful.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/Stateful0000644000175000017500000001303307622026500034212 0ustar drazzibdrazzib/* * Stateful.java - 0.9.0 01/13/2001 - 17:13:37 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; /** * * * @author Matt Albrecht * @version 0.9.0 Alpha */ public class Stateful { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Protected Static Fields //--------------------------------------------------------------------- // Private Static Fields //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Protected Fields //--------------------------------------------------------------------- // Private Fields private IStatefulListener listener; private StateCategory category; private Object[] actions = null; private int currentState = -1; private Object currentAction = null; //--------------------------------------------------------------------- // Constructors /** * Default Constructor */ public Stateful( IStatefulListener listener ) { if (listener == null) { throw new IllegalArgumentException("no null args" ); } this.listener = listener; } //--------------------------------------------------------------------- // Public Methods /** * */ public void addStateAction( State s, Object action ) { if (this.category == null) { throw new IllegalStateException( "Stateful never intialized - you must add it to a set "+ "before adding State Actions" ); } if (!this.category.isOfCategory( s )) { throw new IllegalStateException( "State object not of state category"); } this.actions[ s.getIndex() ] = action; if (s.getIndex() == this.currentState && action != this.currentAction) { // The current state's action has changed this.listener.setAction( action ); this.currentAction = action; } } /** * */ public void removeStateAction( State s ) { addStateAction( s, null ); } /** * Only calls the listener's setAction if the new state is different * than the current state, and the new state's action object is * different than the current action object. */ public void setState( State s ) { if (this.category == null) { throw new IllegalStateException( "Stateful never intialized - you must add it to a set "+ "before adding State Actions" ); } if (!this.category.isOfCategory( s )) { throw new IllegalStateException( "State object not of state category"); } // // perform a series of checks to see if we need to // set this state. // // check if the state is identical to the current state int si = s.getIndex(); if (si == this.currentState) { // do nothing - we're on the same state as we were return; } this.currentState = si; // now check if the new state's action object is identical // to the current action object. Object a = actions[ si ]; if (this.currentAction == a) { // do nothing - the state changed, but the action didn't return; } this.currentAction = a; // we can set the state this.listener.setAction( actions[ s.getIndex() ] ); } //--------------------------------------------------------------------- // Protected Methods protected void initialize( StateCategory s ) { if (this.actions != null) { throw new IllegalStateException("Stateful already initialized"); } this.actions = new Object[ s.getMaximumStateCount() ]; this.category = s; } //--------------------------------------------------------------------- // Private Methods } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/StateCategory.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/StateCat0000644000175000017500000001075307622026500034141 0ustar drazzibdrazzib/* * StateCategory.java - 0.9.0 01/13/2001 - 16:51:36 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; /** * Creates new categories for State collections. Does not save the * created state objects. To save time, this creates both * States and Transitions, though it should only be used for one or * the other. * * @author Matt Albrecht * @version 0.9.0 Alpha */ public class StateCategory { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Protected Static Fields //--------------------------------------------------------------------- // Private Static Fields private final static Object sync = new Object(); private static int categoryNum = 0; //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Protected Fields //--------------------------------------------------------------------- // Private Fields private int category; private int stateNum = 0; private int maxStates; private final Object m_sync = new Object(); //--------------------------------------------------------------------- // Constructors /** * Default Constructor */ public StateCategory( int maxStateCount ) { this.maxStates = maxStateCount; this.category = getNextCategoryInt(); } //--------------------------------------------------------------------- // Public Methods /** * Creates a new unique State instance for this category. */ public State getNextState() { State s = new State( this.category, getNextStateInt() ); return s; } /** * Creates a new unique Transition instance for this category. */ public Transition getNextTransition() { Transition s = new Transition( this.category, getNextStateInt() ); return s; } /** * Checks if the given state is of this category. */ public boolean isOfCategory( State s ) { return (s.getCategory() == this.category); } /** * */ public int getMaximumStateCount() { return this.maxStates; } //--------------------------------------------------------------------- // Protected Methods //--------------------------------------------------------------------- // Private Methods private final int getNextStateInt() { int val; synchronized( this.m_sync ) { val = this.stateNum++; } if (val >= this.maxStates) { throw new IllegalStateException("created too many states"); } return val; } //--------------------------------------------------------------------- // Private Static Methods private static final int getNextCategoryInt() { int val; synchronized (sync) { val = categoryNum++; } return val; } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/StateMachine.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/StateMac0000644000175000017500000000244707622026500034133 0ustar drazzibdrazzib/* * StateMachine.java - 0.9.0 01/13/2001 - 17:04:04 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/StateSet.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/StateSet0000644000175000017500000000753407622026500034170 0ustar drazzibdrazzib/* * StateSet.java - 0.9.0 01/13/2001 - 16:51:36 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; import java.util.Vector; /** * A simple StateMachine where the transition to state mapping is 1-to-1. * * @author Matt Albrecht * @version 0.9.0 Alpha */ public class StateSet { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Protected Static Fields //--------------------------------------------------------------------- // Private Static Fields //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Protected Fields //--------------------------------------------------------------------- // Private Fields private StateCategory states = new StateCategory(); private Vector statefuls = new Vector(); private State currentState = null; //--------------------------------------------------------------------- // Constructors /** * Default Constructor */ public StateSet() { // do nothing } //--------------------------------------------------------------------- // Public Methods /** * */ public State createNextState() { return this.states.getNextState(); } /** * */ public void addStateful( Stateful s ) { if (s == null) { throw new IllegalArgumentException( "no null args" ); } s.initialize( this.states ); this.statefuls.addElement( s ); } /** * */ public void removeStateful( Stateful s ) { if (s == null) { throw new IllegalArgumentException( "no null args" ); } this.statefuls.removeElement( s ); } /** * */ public void setState( State s ) { if (!this.states.isOfCategory( s )) { throw new IllegalStateException("wrong state category"); } this.currentState = s; for (int i = this.statefuls.size(); --i >= 0;) { ((Stateful)this.statefuls.elementAt(i)).setState( s ); } } //--------------------------------------------------------------------- // Protected Methods //--------------------------------------------------------------------- // Private Methods } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/Transition.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/Transiti0000644000175000017500000000360407622026500034223 0ustar drazzibdrazzib/* * Transition.java - 0.9.0 01/13/2001 - 17:01:34 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; /** * A specific subclass of State so that the StateMachine can tell the * difference between the states and the Transitions, and the applications * will get compiler errors, instead of runtime errors. * * @author Matt Albrecht * @version 0.9.0 Alpha */ public class Transition extends State { //--------------------------------------------------------------------- // Constructors /** * Default Constructor - protected */ protected Transition( int stateCategory, int stateIndex ) { super( stateCategory, stateIndex ); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/IStateListener.javalibgroboutils-java-5.orig/util-states/sources/dev/net/sourceforge/groboutils/util/states/v1/IStateLi0000644000175000017500000000356207622026500034107 0ustar drazzibdrazzib/* * IStateListener.java - 0.9.0 01/13/2001 - 17:25:37 * * Copyright (C) 2000,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.groboclown.util.states.v1; /** * Listens to Stateful instances who have their state changed, which * triggers a new action to be set. * * @author Matt Albrecht * @version 0.9.0 Alpha */ public interface IStateListener { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Public Abstract Methods public void setAction( Object action ); } libgroboutils-java-5.orig/util-states/sources/dev/about.txt0000644000175000017500000000015207521071703024244 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/util-states/sources/ut/0000755000175000017500000000000011271425773022254 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/ut/about.txt0000644000175000017500000000012207521071703024113 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/util-states/sources/iut/0000755000175000017500000000000011271425773022425 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/iut/about.txt0000644000175000017500000000021107521071703024263 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/util-states/sources/eut/0000755000175000017500000000000011271425773022421 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/sources/eut/about.txt0000644000175000017500000000015307521071703024264 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/util-states/CHANGES.TXT0000644000175000017500000000432707622026477021623 0ustar drazzibdrazzib v1.0.0 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Created two primary javac structures - one for jdk 1.1, and one for jdk1.2+. * Integrated the GroboUtils 'util.states' hierarchy into this hierarchy. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/util-states/xdocs/0000755000175000017500000000000011271425773021261 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-states/xdocs/summary.xml0000644000175000017500000000106007655132717023501 0ustar drazzibdrazzib util-states net.sourceforge.groboutils.util.states.v1 Framework for a state machine, which is optimized for an internal integer matrix. 03-May-2003: Needs to be deleted. libgroboutils-java-5.orig/util-states/xdocs/about.xml0000644000175000017500000000045207655132717023122 0ustar drazzibdrazzib About $Date: 2003/05/04 06:40:15 $ Matt Albrecht Framework for a state machine, which is optimized for an internal integer matrix. libgroboutils-java-5.orig/util-states/xdocs/requirements.xml0000644000175000017500000000027407655132717024535 0ustar drazzibdrazzib Requirements $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/util-states/xdocs/design.xml0000644000175000017500000000026607655132717023264 0ustar drazzibdrazzib Design $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/util-states/xdocs/index.xml0000644000175000017500000000070107655132717023114 0ustar drazzibdrazzib Welcome $Date: 2003/05/04 06:40:15 $

  • About Util-States
  • Requirements
  • Design
  • Using
  • libgroboutils-java-5.orig/util-states/xdocs/using.xml0000644000175000017500000000026507655132717023137 0ustar drazzibdrazzib Using $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/_projects/0000755000175000017500000000000011271425773017653 5ustar drazzibdrazziblibgroboutils-java-5.orig/_projects/build.xml0000644000175000017500000005157710040546712021501 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc.javadoc.ant.1_6beta; &inc.javadoc.bcel.5_1; &inc.javadoc.easymock.0_8; &inc.javadoc.jdk.1_4; &inc.javadoc.junit.3_8_1; &inc.javadoc.log4j.1_2_8; &inc.javadoc.mockobjects.0_4rc1; &inc.javadoc.sax.2_0_1; &inc.javadoc.xalan.2_5_1; &inc.javadoc.xerces.2_4_0; --------------------------------------------------------------------- GroboUtils Project: ${changes.project} --------------------------------------------------------------------- GroboTestingJUnit: ${changes.testing-junit} --------------------------------------------------------------------- GroboUtilClasses: ${changes.util-classes} --------------------------------------------------------------------- GroboTestingAutodoc: ${changes.testing-autodoc} --------------------------------------------------------------------- GroboUtilXML: ${changes.util-xml} --------------------------------------------------------------------- GroboPMTI: ${changes.pmti} --------------------------------------------------------------------- GroboTestingTP: ${changes.testing-tp} --------------------------------------------------------------------- GroboUtilIO: ${changes.util-io} --------------------------------------------------------------------- GroboUtilDatastruct: ${changes.util-datastruct} --------------------------------------------------------------------- GroboCodeCoverage: ${changes.codecoverage} --------------------------------------------------------------------- GroboUICapture: ${changes.uicapture} --------------------------------------------------------------------- GroboUtilThread: ${changes.util-thread} *** Not done yet *** libgroboutils-java-5.orig/pmake.sh0000644000175000017500000000121607624464236017320 0ustar drazzibdrazzib#! /bin/bash if [ -z $1 ]; then echo "You must specify the project as argument 1." exit 1 fi _HERE=`dirname $0` echo "_HERE = $_HERE" if [ -z $_HERE -o "$_HERE" = "." ]; then _HERE=`pwd` fi if [ ! -f "$_HERE/$1/build.xml" ]; then echo "$1 is not a known/valid project." exit 1 fi _PROJECT="$_HERE/$1" shift _ARGS="$*" # OS specific support. $var _must_ be set to either true or false. case "`uname`" in CYGWIN*) _PROJECT=`cygpath --windows "$_PROJECT"` ;; esac if [ ! -f $_HERE/make.sh ]; then echo "Bad directory?" $_HERE=`dirname $_HERE/make.sh` fi . $_HERE/make.sh -f "$_PROJECT/build.xml" "-Dbasedir=$_PROJECT" $_ARGS libgroboutils-java-5.orig/testing-junit/0000755000175000017500000000000011271425773020467 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/deployed.ant-inc.xml0000644000175000017500000000032407777607732024362 0ustar drazzibdrazzib libgroboutils-java-5.orig/testing-junit/build.xml0000644000175000017500000001557307777607732022340 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; import net.sourceforge.groboutils.junit.v1.*; import junit.framework.*; import java.util.*; public class A1 { public static class ItcTest extends IntegrationTestCase { /** * @param name */ public ItcTest(String name) { super(name); } public void testSimple() { softAssertEquals("testSimple", "1001", "1001"); softAssertEquals("Where is my message?", "1002", "9999"); softAssertEquals("testSimple", "1003", "1003"); } } public static void main( String args[] ) { Test t; /* this seems to work AssertTestFactory atf = new AssertTestFactory(); t = atf.createAssertEquals( "Where's my message?", "9999", "1002" ); */ t = new ItcTest("testSimple"); TestResult tr = new TestResult(); t.run( tr ); Enumeration enum = tr.failures(); while (enum.hasMoreElements()) { TestFailure tf = (TestFailure)enum.nextElement(); tf.thrownException().printStackTrace(); } } } libgroboutils-java-5.orig/testing-junit/log4j.properties0000644000175000017500000000047607521071654023631 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.junit=DEBUG libgroboutils-java-5.orig/testing-junit/sources/0000755000175000017500000000000010011472751022137 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ait/0000755000175000017500000000000011271425773022727 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ait/junit/0000755000175000017500000000000011271425773024060 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ait/junit/build.xml0000644000175000017500000000000007521071654025665 0ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ait/about.txt0000644000175000017500000000021007521071654024571 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/testing-junit/sources/dev/0000755000175000017500000000000011271425773022730 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/dev/net/0000755000175000017500000000000010011472746023507 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/0000755000175000017500000000000010011472746026032 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472746030223 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/0000755000175000017500000000000010011472746031354 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/0000755000175000017500000000000011271425773031711 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/SysPropertiesUtil.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/SysPropertie0000644000175000017500000000731507706770542034317 0ustar drazzibdrazzib/* * @(#)SysPropertiesUtil.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import java.util.Properties; import java.util.Vector; import java.util.Enumeration; //import java.lang.reflect.Method; //import java.lang.reflect.InvocationTargetException; /** * Utility that allows for easy setting and reseting of System properties. * Some classes that need testing may depend upon a System property setting, * and this class will help testing that. This is JDK 1.1 and above * compatible. *

    * Each instance of this utility should be created in the setUp() * method of the test case, then the utility should have its reset() * method called in the tearDown() method. This ensures that the * standard system properties have been set correctly. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/07/21 13:57:54 $ * @since December 26, 2002 */ public class SysPropertiesUtil { private Properties originals; private Properties newProps; /** * Each instance should be an instance variable for a test class, and * it should be created in the setUp() method. */ public SysPropertiesUtil() { this.originals = System.getProperties(); restoreProps(); } /** * Sets the system property. If the new value is null, then * the property, if it exists, will be removed. If the key is * null, then an IllegalArgumentException will be thrown. */ public void setValue( String key, String newVal ) { if (key == null) { throw new IllegalArgumentException( "No null keys." ); } synchronized( this ) { if (newVal == null) { this.newProps.remove( key ); } else { this.newProps.setProperty( key, newVal ); } setSystemProperties( this.newProps ); } } /** * Resets the system properties to the way they were when this class was * created. */ public synchronized void reset() { setSystemProperties( this.originals ); restoreProps(); } private void setSystemProperties( Properties props ) { System.setProperties( props ); } private void restoreProps() { this.newProps = (Properties)this.originals.clone(); } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/package.htmllibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/package.html0000644000175000017500000000446107561622145034176 0ustar drazzibdrazzibnet.sourceforge.groboutils.junit.v1 The GroboUtils JUnit Extention: classes to help in the creation and execution of JUnit tests.

    Overview

    This package has been designed to follow the JUnit extention patterns (see my article in the documentation). Instead of creating direct TestCase subclasses to add functionality to actual TestCases, test extentions have been refactored for ease-of-use.

    Utility Testing Classes

    The classes listed here follow the JUnit Utility Functionality pattern. They give more testing functionality to unit tests through a separate instance, rather than requiring the tests to subclass to gain the functionality.

    AssertTestFactory & IntegrationTestCase

    There are two kinds of "validations" a test can generate: soft and hard. A hard validation must be true - any inconsistency will result in the whole test to fail. A soft validation will still cause a test error, but the test may continue. Soft validations are less useful than hard validations for unit tests, since the point of unit tests is to make sure a small part of an application has the absolute correct behavior. However, for integration tests, this becomes less a necessity. An integration test may take great efforts setting up a scenario, then runs a battery of validations against the setup. A hard validation in these situations does not expose all the issues which may lie in the source.

    Hard validations are supported in JUnit with the Assert class. The IntegrationTestCase class in this framework allows for better support of soft validations by executing the soft asserts as a seperate test. This allows for proper reporting of the failure without stopping the flow of the test.

    MultiThreadedTestRunner

    It can be very difficult to test code which requires inter-thread communication, or which may encounter synchronization problems. This class allows a TestCase to create runner inner classes to perform a bit of functionality for a thread, then pass those instances to a MultiThreadedTestRunner instance to allow them to run in parallel. In situations where a dead-lock may occur, a timer is provided which will interrupt (not kill) the running threads and report a failure.

    ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/MultiThreadedTestRunner.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/MultiThreade0000644000175000017500000004605207737303445034235 0ustar drazzibdrazzib/* * @(#)MultiThreadedTestRunner.java * * The basics are taken from an article by Andy Schneider * andrew.schneider@javaworld.com * The article is "JUnit Best Practices" * http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.apache.log4j.Logger; import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.AssertionFailedError; import junit.framework.Assert; import java.lang.reflect.Method; /** * A framework which allows for an array of tests to be * run asynchronously. TestCases should reference this class in a test * method. *

    * Update for July 9, 2003: now, you can also register * TestRunner instances as monitors (request 771008); these run * parallel with the standard TestRunner instances, but they only quit * when all of the standard TestRunner instances end. *

    * Fixed bugs 771000 and 771001: spawned threads are now Daemon threads, * and all "wild threads" (threads that just won't stop) are * Thread.stop()ed. *

    * All these changes have made this class rather fragile, as there are * many threaded timing issues to deal with. Expect future refactoring * with backwards compatibility. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 14, 2002 * @version $Date: 2003/10/03 14:26:45 $ */ public class MultiThreadedTestRunner { private static final Class THIS_CLASS = MultiThreadedTestRunner.class; private static final String THIS_CLASS_NAME = THIS_CLASS.getName(); private static final Logger LOG = Logger.getLogger( THIS_CLASS ); private static final long DEFAULT_MAX_FINAL_JOIN_TIME = 30l * 1000l; private static final long DEFAULT_MAX_WAIT_TIME = 24l * 60l * 60l * 1000l; private static final long MIN_WAIT_TIME = 10l; private Object synch = new Object(); private boolean threadsFinished = false; private ThreadGroup threadGroup; private Thread coreThread; private Throwable exception; private TestRunnable runners[]; private TestRunnable monitors[]; private long maxFinalJoinTime = DEFAULT_MAX_FINAL_JOIN_TIME; private long maxWaitTime = DEFAULT_MAX_WAIT_TIME; private boolean performKills = true; /** * Create a new utility instance with the given set of parallel runners. * All runners passed into this method must end on their own, else it's * an error. */ public MultiThreadedTestRunner( TestRunnable tr[] ) { this( tr, null ); } /** * Create a new utility instance with the given set of parallel runners * and a set of monitors. The runners must end on their own, but the * monitors can run until told to stop. * * @param runners a non-null, non-empty collection of test runners. * @param monitors a list of monitor runners, which may be null or * empty. */ public MultiThreadedTestRunner( TestRunnable runners[], TestRunnable monitors[] ) { if (runners == null) { throw new IllegalArgumentException("no null runners"); } int len = runners.length; if (len <= 0) { throw new IllegalArgumentException( "must have at least one runnable"); } this.runners = new TestRunnable[ len ]; System.arraycopy( runners, 0, this.runners, 0, len ); if (monitors != null) { len = monitors.length; this.monitors = new TestRunnable[ len ]; System.arraycopy( monitors, 0, this.monitors, 0, len ); } else { this.monitors = new TestRunnable[ 0 ]; } } /** * Run each test given in a separate thread. Wait for each thread * to finish running, then return. *

    * As of July 9, 2003, this method will not wait forever, but rather * will wait for the internal maximum run time, which is by default * 24 hours; for most unit testing scenarios, this is more than * sufficient. * * @exception Throwable thrown on a test run if a threaded task * throws an exception. */ public void runTestRunnables() throws Throwable { runTestRunnables( -1 ); } /** * Runs each test given in a separate thread. Waits for each thread * to finish running (possibly killing them), then returns. * * @param runnables the list of TestCaseRunnable objects to run * asynchronously * @param maxTime the maximum amount of milliseconds to wait for * the tests to run. If the time is <= 0, then the tests * will run until they are complete. Otherwise, any threads that * don't complete by the given number of milliseconds will be killed, * and a failure will be thrown. * @exception Throwable thrown from the underlying tests if they happen * to cause an error. */ public void runTestRunnables( long maxTime ) throws Throwable { // Ensure we aren't interrupted. // This can happen from one test execution to the next, if an // interrupt was poorly timed on the core thread. Calling // Thread.interrupted() will clear the interrupted status flag. Thread.interrupted(); // initialize the data. this.exception = null; this.coreThread = Thread.currentThread(); this.threadGroup = new ThreadGroup( THIS_CLASS_NAME ); this.threadsFinished = false; // start the monitors before the runners Thread monitorThreads[] = setupThreads( this.threadGroup, this.monitors ); Thread runnerThreads[] = setupThreads( this.threadGroup, this.runners ); // catch the IE exception outside the loop so that an exception // thrown in a thread will kill all the other threads. boolean threadsStillRunning; try { threadsStillRunning = joinThreads( runnerThreads, maxTime ); } catch (InterruptedException ie) { // Thread join interrupted: some runner or monitor caused an // exception. Note that this is NOT a timeout! threadsStillRunning = true; } finally { synchronized (this.synch) { if (!this.threadsFinished) { interruptThreads(); } else { LOG.debug( "All threads finished within timeframe." ); } } } if (threadsStillRunning) { LOG.debug( "Halting the test threads." ); // threads are still running. If no exception was generated, // then set a timeout error to indicate some threads didn't // end in time. setTimeoutError( maxTime ); // kill any remaining threads try { // but give them one last chance! joinThreads( runnerThreads, maxFinalJoinTime ); } catch (InterruptedException ie) { // someone caused a real exception. This is NOT a timeout! } int killCount = killThreads( runnerThreads ); if (killCount > 0) { LOG.fatal( killCount+" thread(s) did not stop themselves." ); setTimeoutError( maxFinalJoinTime ); } } // Stop the monitor threads - they have a time limit! LOG.debug("Halting the monitor threads."); try { joinThreads( monitorThreads, maxFinalJoinTime ); } catch (InterruptedException ex) { // don't cause a timeout error with monitor threads. } killThreads( monitorThreads ); if (this.exception != null) { // an exception/error occurred during the test, so throw // the exception so it is reported by the owning test // correctly. LOG.debug( "Exception occurred during testing.", this.exception ); throw this.exception; } LOG.debug( "No exceptions caused during execution." ); } /** * Handles an exception by sending them to the test results. Called by * runner or monitor threads. */ void handleException( Throwable t ) { LOG.warn( "A test thread caused an exception.", t ); synchronized( this.synch ) { if (this.exception == null) { LOG.debug("Setting the exception to:",t); this.exception = t; } if (!this.threadsFinished) { interruptThreads(); } } if (t instanceof ThreadDeath) { // rethrow ThreadDeath after they have been registered // and the threads have been signaled to halt. throw (ThreadDeath)t; } } /** * Stops all running test threads. Called by runner or monitor threads. */ void interruptThreads() { LOG.debug("Forcing all test threads to stop."); synchronized (this.synch) { // interrupt the core thread (that might be doing a join) // first, so that it doesn't accidentally do a join on // other threads that were interrupted. if (Thread.currentThread() != this.coreThread) { this.coreThread.interrupt(); } this.threadsFinished = true; int count = this.threadGroup.activeCount(); Thread t[] = new Thread[ count ]; this.threadGroup.enumerate( t ); for (int i = t.length; --i >= 0;) { if (t[i] != null && t[i].isAlive()) { t[i].interrupt(); } } } } /** * Used by the TestRunnable instances to tell if the parallel execution * has stopped or is stopping. */ boolean areThreadsFinished() { return this.threadsFinished; } /** * Sets up the threads for the given runnables and starts them. */ private Thread[] setupThreads( ThreadGroup tg, TestRunnable tr[] ) { int len = tr.length; Thread threads[] = new Thread[ len ]; for (int i = 0; i < len; ++i) { tr[i].setTestRunner( this ); threads[i] = new Thread( tg, tr[i] ); threads[i].setDaemon( true ); } for (int i = 0; i < len; ++i) { threads[i].start(); // wait for the threads to actually start. If we wait 10 // times and still no dice, I expect the test already started // and finished. int count = 0; while (!threads[i].isAlive() && count < 10) { LOG.debug("Waiting for thread at index "+i+" to start."); Thread.yield(); ++count; } if (count >= 10) { LOG.debug("Assuming thread at index "+i+" already finished."); } } return threads; } /** * This joins all the threads together. If the max time is exceeded, * then true is returned. This method is only called by the core * thread. The thread array will be altered at return time to only contain * threads which are still active (all other slots will be null). *

    * This routine allows us to attempt to collect all the halted threads * together, while not waiting forever on threads that poorly don't * respond to outside stimuli (and thus require a stop() on the * thread). */ private boolean joinThreads( Thread t[], long waitTime ) throws InterruptedException { // check the arguments if (t == null) { return false; } int len = t.length; if (len <= 0) { return false; } if (waitTime < 0 || waitTime > maxWaitTime) { waitTime = DEFAULT_MAX_WAIT_TIME; } // slowly halt the threads. boolean threadsRunning = true; InterruptedException iex = null; long finalTime = System.currentTimeMillis() + waitTime; while (threadsRunning && System.currentTimeMillis() < finalTime && iex == null) { LOG.debug("Time = "+System.currentTimeMillis()+"; final = "+finalTime); threadsRunning = false; // There might be circumstances where // the time between entering the while loop and entering the // for loop exceeds the final time, which can cause an incorrect // threadsRunning value. That's why this boolean exists. Note // that since we put in the (len <= 0) test above, we don't // have to worry about another edge case where the length prevents // the loop from being entered. boolean enteredLoop = false; for (int i = 0; i < len && System.currentTimeMillis() < finalTime; ++i) { enteredLoop = true; if (t[i] != null) { try { // this will yield our time, so we don't // need any explicit yield statement. t[i].join( MIN_WAIT_TIME ); } catch (InterruptedException ex) { LOG.debug("Join for thread at index "+i+ " was interrupted."); iex = ex; } if (!t[i].isAlive()) { LOG.debug("Joined thread at index "+i); t[i] = null; } else { LOG.debug("Thread at index "+i+" still running."); threadsRunning = true; } } } // If the threadsRunning is true, it remains true. If // the enteredLoop is false, this will be true. threadsRunning = threadsRunning || !enteredLoop; } if (iex != null) { throw iex; } return threadsRunning; } /** * This will execute a stop() on all non-null, alive threads in the list. * * @return the number of threads killed */ private int killThreads( Thread[] t ) { int killCount = 0; for (int i = 0; i < t.length; ++i) { if (t[i] != null && t[i].isAlive()) { LOG.debug("Stopping thread at index "+i); ++killCount; if (this.performKills) { // Yes, this is deprecated API, but we give the threads // "sufficient" warning to stop themselves. int count = 0; boolean isAlive = t[i].isAlive(); while (isAlive && count < 10) { // send an InterruptedException, as this is handled // specially in the TestRunnable. t[i].stop( new TestDeathException( "Thread "+i+" did not die on its own" ) ); LOG.debug( "Waiting for thread at index "+i+ " to stop."); Thread.yield(); isAlive = t[i].isAlive(); if (isAlive) { // it may have been in a sleep state, so // make it shake a leg! t[i].interrupt(); } ++count; } if (count >= 10) { LOG.fatal("Thread at index "+i+" did not stop!" ); } t[i] = null; } else { LOG.fatal( "Did not stop thread "+t[i] ); } } } return killCount; } private void setTimeoutError( long maxTime ) { Throwable t = createTimeoutError( maxTime ); synchronized (this.synch) { if (this.exception == null) { LOG.debug("Setting the exception to a timeout exception."); this.exception = t; } } } private Throwable createTimeoutError( long maxTime ) { Throwable ret = null; // need to set the exception to a timeout try { Assert.fail( "Threads did not finish within " + maxTime + " milliseconds."); } catch (ThreadDeath td) { // never trap these throw td; } catch (Throwable t) { t.fillInStackTrace(); ret = t; } return ret; } /** * An exception that declares that the test has been stop()ed. */ public static final class TestDeathException extends RuntimeException { private TestDeathException( String msg ) { super( msg ); } } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/TestRunnable.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/TestRunnable0000644000175000017500000001700207737303445034245 0ustar drazzibdrazzib/* * @(#)TestRunnable.java * * The basics are taken from an article by Andy Schneider * andrew.schneider@javaworld.com * The article is "JUnit Best Practices" * http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.apache.log4j.Logger; import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.AssertionFailedError; import junit.framework.Assert; /** * Instances of this class only execute in the * runTestRunnables method of * the MultiThreadedTestRunner class. * TestCases should define inner classes as a subclass of this, * implement the runTest() method, and pass in the * instantiated class as part of an array to the * runTestRunnables method. Call delay( long ) * to easily include a waiting period. This class allows for * all assertions to be invoked, so that subclasses can be static or * defined outside a TestCase. If an exception is thrown from the * runTest() method, then all other test threads will * terminate due to the error. *

    * The runTest() method needs to be responsive to * InterruptedException, resulting from the owning * MultiThreadedTestRunner interrupting the thread in order to * signal the early termination of the threads. The * InterruptedExceptions may be propigated outside the * runTest() implementation with no harmful effects. Note that * this means that InterruptedExceptions are part of the * framework, and as such carry information that your runTest() * implementations cannot override; in other words, don't let your test * propigate an InterruptedException to indicate an error. *

    * Tests which perform a set of monitoring checks on the object-under-test * should extend TestMonitorRunnable, since monitors run until * told to stop. The Thread.stop() command will be sent with a * MultiThreadedTestRunner.TestDeathException. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/10/03 14:26:45 $ * @since March 28, 2002 */ public abstract class TestRunnable extends Assert implements Runnable { private static final Class THIS_CLASS = TestRunnable.class; protected static final Logger LOG = Logger.getLogger( THIS_CLASS ); private static int testCount = 0; private MultiThreadedTestRunner mttr; private int testIndex; private boolean ignoreStopErrors = false; public TestRunnable() { synchronized( THIS_CLASS ) { this.testIndex = testCount++; } } TestRunnable( boolean ignoreStopErrors ) { this(); this.ignoreStopErrors = ignoreStopErrors; } /** * Performs the set of processing or checks on the object-under-test, * which will be in parallel with other TestRunnable * instances. *

    * The implementation should be responsive to * InterruptedException exceptions or to the status of * Thread.isInterrupted(), as that is the signal used to tell * running TestRunnable instances to halt their processing; * instances which do not stop within a reasonable time frame will * have Thread.stop() called on them. *

    * Non-monitor instances must have this method implemented such that * it runs in a finite time; if any instance executes over the * MultiThreadedTestRunner instance maximum time limit, then * the MultiThreadedTestRunner instance assumes that a * test error occurred. * * @exception Throwable any exception may be thrown and will be * reported as a test failure, except for * InterruptedExceptions, which will be ignored. */ public abstract void runTest() throws Throwable; /** * Sleep for millis milliseconds. A convenience method. * * @exception InterruptedException if an interrupt occured during the 8 sleep. */ public void delay( long millis ) throws InterruptedException { Thread.sleep( millis ); } /** * Unable to make this a "final" method due to JDK 1.1 compatibility. * However, implementations should not override this method. */ public void run() { if (this.mttr == null) { throw new IllegalStateException( "Owning runner never defined. The runnables should only be "+ "started through the MultiThreadedTestRunner instance." ); } LOG.info( "Starting test thread "+this.testIndex ); try { runTest(); } catch (InterruptedException ie) { // ignore these exceptions - they represent the MTTR // interrupting the tests. } catch (MultiThreadedTestRunner.TestDeathException tde) { // ignore these exceptions as they relate to thread-related // exceptions. These represent the MTTR stopping us. // Our response is to actually rethrow the exception. if (!this.ignoreStopErrors) { LOG.info( "Aborted test thread "+this.testIndex ); throw tde; } } catch (Throwable t) { // for any exception, handle it and interrupt the // other threads // Note that ThreadDeath exceptions must be re-thrown after // the interruption has occured. this.mttr.handleException( t ); } LOG.info( "Ended test thread "+this.testIndex ); } /** * Returns the status of the owning MultiThreadedTestRunner * instance: true means that the tests have completed (monitors * may still be active), and false means that the tests are * still running. * * @return true if the tests have completed their run, * otherwise false. */ public boolean isDone() { return this.mttr.areThreadsFinished(); } void setTestRunner( MultiThreadedTestRunner mttr ) { this.mttr = mttr; } } libgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/0000755000175000017500000000000011271425773032636 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/InterfaceTestSuite.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/Interfa0000644000175000017500000003045507622026444034155 0ustar drazzibdrazzib/* * @(#)InterfaceTestSuite.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; import junit.framework.Test; import junit.framework.TestSuite; import java.util.Enumeration; import java.util.Vector; import java.lang.reflect.Method; import java.lang.reflect.Constructor; import net.sourceforge.groboutils.junit.v1.parser.TestClassParser; import net.sourceforge.groboutils.junit.v1.parser.TestClassCreator; import net.sourceforge.groboutils.junit.v1.parser.ITestCreator; import net.sourceforge.groboutils.junit.v1.parser.DelegateTestCreator; import net.sourceforge.groboutils.junit.v1.parser.JUnitOrigCreator; import net.sourceforge.groboutils.junit.v1.parser.JUnit3_8Creator; import net.sourceforge.groboutils.junit.v1.parser.IftcOrigCreator; import org.apache.log4j.Logger; /** * Allows for tests to be written on interfaces or abstract classes. These * must be run through an InterfaceTestSuite to have the implemented object * be set correctly. *

    * This class extends TestSuite only for the purpose of being a testing * repository. The act of parsing TestCase classes is delegated to * new TestSuite instances. A new instance will be created for each * test method (just as TestSuite does), If a TestCase class * has a constructor which is of the form ( String, ImplFactory ), * then each test method instance will be created * once for each known ImplFactory object; these will be * stored and executed through the ImplFactory class. All other * classes will be added just as TestSuite does (the standard method). *

    * The creation of test instances is delayed until the tests are actually * retrieved via the testAt(), tests(), and * testCount() methods. Therefore, adding new Classes and * ImplFactory instances after the creation time will cause an error, due to * problems with addTest() (they cannot be removed). *

    * Currently, this class is slow: it does not do smart things like cache * results from inspection on the same class object. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:20 $ * @since March 2, 2002 * @see InterfaceTestCase * @see ImplFactory * @see junit.framework.TestSuite */ public class InterfaceTestSuite extends TestSuite { private static final Logger LOG = Logger.getLogger( InterfaceTestSuite.class ); // these are not private for test-case usage. Vector creators = new Vector(); Vector classes = new Vector(); /** * Constructs a TestSuite from the given class, and sets the initial * set of creators. Adds all the methods * starting with "test" as test cases to the suite. */ public InterfaceTestSuite() { // do nothing } /** * Constructs a TestSuite from the given class, and sets the initial * set of creators. Adds all the methods * starting with "test" as test cases to the suite. * * @param theClass the class under inspection */ public InterfaceTestSuite( Class theClass ) { addTestSuite( theClass ); } /** * Constructs a TestSuite from the given class, and sets the initial * set of creators. Adds all the methods * starting with "test" as test cases to the suite. * * @param theClass the class under inspection * @param f a factory to add to this suite. */ public InterfaceTestSuite( Class theClass, ImplFactory f ) { addTestSuite( theClass ); addFactory( f ); } /** * Add a new Implementation factory to the suite. This should only be * called before any tests are extracted from this suite. If it is * called after, then an IllegalStateException will be generated. * * @param f a factory to add to this suite. * @exception IllegalArgumentException if f is null * @exception IllegalStateException if the tests have already been generated */ public void addFactory( ImplFactory f ) { if (f == null) { throw new IllegalArgumentException("no null args"); } if (creators == null) { throw new IllegalStateException("Already created TestSuites."); } this.creators.addElement( f ); } /** * Add an array of new Implementation factories to the suite. * This should only be * called before any tests are extracted from this suite. * * @param f a set of factories to add to this suite. * @exception IllegalArgumentException if f is null, or * any element in the list is null * @exception IllegalStateException if the tests have already been generated */ public void addFactories( ImplFactory f[] ) { if (f == null) { throw new IllegalArgumentException("no null args"); } for (int i = 0; i < f.length; ++i) { addFactory( f[i] ); } } /** * Add an InterfaceTestSuite to this suite. If an interface extends * another interface, it should add it's super interface's test suite * through this method. The same goes for any abstract or base class. * Adding the parent suite through this method will cause both suites to * share creators. In fact, the parent suite cannot have any * factories when passed into this method, because they will be ignored. *

    * This allows for the flexibility of determining whether to add a full * test suite, without sharing factories, or not. * * @param t a test to add to the suite. It can be null. */ public void addInterfaceTestSuite( InterfaceTestSuite t ) { if (t != null) { if (t.creators != null && t.classes != null && t.classes.size() > 0) { if (t.creators.size() > 0) { LOG.warn( "Passed in InterfaceTestSuite "+t+ " with factories registered. This is a no-no. "+ "You need to pass it in through addTest(), or not add "+ "factories to it." ); } else { Enumeration enum = t.classes.elements(); while (enum.hasMoreElements()) { addTestSuite( (Class)enum.nextElement() ); } } } } } /** * Add an array of tests to the suite. * * @param t a set of tests to add to this suite. * @param IllegalArgumentException if t is null */ public void addTests( Test[] t ) { if (t == null) { throw new IllegalArgumentException("no null arguments"); } for (int i = 0; i < t.length; ++i) { addTest( t[i] ); } } /** * Adds all the methods * starting with "test" as test cases to the suite. *

    * Overrides the parent implementation to allow for InterfaceTests. * * @param theClass the class under inspection * @exception IllegalArgumentException if theClass is null * @exception IllegalStateException if the tests have already been generated */ public void addTestSuite( Class theClass ) { if (theClass == null) { throw new IllegalArgumentException("no null arguments"); } if (this.classes == null) { throw new IllegalStateException("Class "+theClass.getName()+ " added after the load time. See JavaDoc for proper usage."); } this.classes.addElement( theClass ); } // from parent public Test testAt(int index) { loadTestSuites(); return super.testAt( index ); } // from parent public int testCount() { loadTestSuites(); return super.testCount(); } // from parent public Enumeration tests() { loadTestSuites(); return super.tests(); } /** * Load all the tests from the cache of classes and factories. */ protected void loadTestSuites() { // if either of these Vectors are null, then the loading has // already been done. if (this.creators == null || this.classes == null) { return; } ITestCreator tc = createTestCreator( this.creators ); TestClassCreator tcc = new TestClassCreator( tc ); for (Enumeration enum = this.classes.elements(); enum.hasMoreElements();) { Class c = (Class)enum.nextElement(); loadTestSuite( c, tcc ); } // tell the instance to not load test suites again, and not allow // new factories to be registered. this.creators = null; this.classes = null; } /** * Load all the tests and warnings from the class and the creator * type into this instance's suite of tests. * * @param testClass the class being inspected for test instance * creation. * @param tcc the creator type that will be used to create new tests. */ protected void loadTestSuite( Class testClass, TestClassCreator tcc ) { TestClassParser tcp = new TestClassParser( testClass ); // ensure that all unwanted warnings are removed. tcc.clearWarnings(); Test t[] = tcc.createTests( tcp ); if (t == null || t.length <= 0) { // no discovered tests, so create an error test LOG.info( "No tests for class discovered." ); addTest( TestClassCreator.createWarningTest( "No tests found in test class " + testClass.getName() ) ); } else { addTests( t ); } addTests( tcc.createWarningTests( tcp ) ); // be a nice citizen and clean up after ourself. tcc.clearWarnings(); } /** * Create a TestCreator that contains the knowledge of how to properly * parse and generate tests for all types of supported test classes. * * @param factories a vector of ImplFactory instances to load Interface * test class instances. * @return the new creator. */ protected ITestCreator createTestCreator( Vector vf ) { ImplFactory factories[] = new ImplFactory[ vf.size() ]; vf.copyInto( factories ); // Order matters!!! // // Use the original version before the new technique for backwards // compatibility. ITestCreator tc = new DelegateTestCreator( new ITestCreator[] { new IftcOrigCreator( factories ), //new Iftc3_8Creator( factories ), new JUnitOrigCreator(), new JUnit3_8Creator() } ); return tc; } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/package.htmllibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/package0000644000175000017500000000515307562054254034160 0ustar drazzibdrazzibnet.sourceforge.groboutils.testing.junit.v1 Classes to aid in testing interfaces, abstract classes, and base classes for "contract tests".

    Interface Testing

    The Sun Java Tutorial indicates that classes which implement an interface "[sign] a contract" [1]. In some cases the contract has meta-data beyond the API declared in the interface source-code, such as "must never return null", usually declared in the JavaDoc. Forcing each implemented class to test this on its own is both poor coding practice and unenforcable. Instead, what we need is a way to write test cases for the interface, and each implemented class can execute an instance of that class against the tests. This framework eases this practice by extending the JUnit framework.

    The interface creator creates a TestCase which extends InterfaceTest, commonly through InterfaceTestCase. The class to test need not be only an interface: in can be any kind of class.

    Implemented classes need to use something like the following to test through an interface test:

    import net.sourceforge.groboutils.junit.v1.iftc.*;
    import junit.framework.*;
    
    public MyClassTest extends TestCase {
        public MyClassTest( String name ) {
            super( name );
        }
    
        public static Test suite() {
            TestSuite suite = new TestSuite( MyClassTest.class )
            InterfaceTestSuite its = MyInterfaceTest.suite();
            its.addFactory( new CxFactory( "A" ) {
                public Object createImplObject() {
                    return new MyClass( "string" );
                }
            } );
            its.addFactory( new CxFactory( "B" ) {
                public Object createImplObject() {
                    return new MyClass( null );
                }
            } );
            suite.addTest( its );
            
            return suite;
        }
        ...
    }
    
    The interface test would then look something like:
    import net.sourceforge.groboutils.junit.v1.iftc.*;
    import junit.framework.*;
    
    public MyInterfaceTest extends InterfaceTestCase {
        public MyInterfaceTest( String name, ImplFactory f ) {
            super( name, MyInterface.class, f );
        }
    
        public static InterfaceTestSuite suite() {
            InterfaceTestSuite suite = new InterfaceTestSuite(
                MyInterfaceTest.class );
            
            return suite;
        }
        
        ...
    }
    

    References

    1. Various. The Java Tutorial. Online at http://java.sun.com/docs/books/tutorial/java/interpack/usinginterface.html .
    ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/InterfaceTestCase.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/Interfa0000644000175000017500000003072707622026444034157 0ustar drazzibdrazzib/* * @(#)InterfaceTestCase.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; import junit.framework.TestCase; import java.io.StringWriter; import java.io.PrintWriter; import java.util.Stack; /** * A subclass of TestCase to ease the requirements of creating an * interface test. The tests should be thought of as "contract tests". * Subclasses can call createImplObject() to create a new instance * of a subclass of interfaceClass, which is generated from the * ImplFactory passed into the constructor. *

    * Subclasses that want to use the InterfaceTestSuite helper class will need * to specify a constructor similar to: *

     *      public MyClassTest( String name, ImplFactory f )
     *      {
     *          super( name, MyClass.class, f );
     *      }
     * 
    * where MyClass is the interface or base class under test. *

    * As of October 30, 2002, the InterfaceTestCase has a slightly different * behavior when the factory instance is an implementation of ICxFactory. * In this scenario, it will store all the instantiated objects in the stack, * and each instantiated object will be passed to the ICxFactory instance * during the test's normal tearDown. If the ICxFactory throws an exception * during any of the tearDown calls, they will be stored up and reported * in a single exception. Therefore, if you want this functionality, then * you will need to ensure that your tearDown() method calls the * super tearDown(). *

    * Even though JUnit 3.8+ allows for a TestCase to have a default (no-arg) * constructor, the InterfaceTestCase does not support this. The * benefits simply aren't there for interface tests: they will still have to * create a constructor which passes InterfaceTestCase which class * is being tested. Since a constructor is required anyway, the little extra * effort to add two arguments to the constructor and call to the super * is trivial compared to not needing the constructor at all. *

    * As of 08-Dec-2002, the returned name of the test can include the class's * name, without the package, to improve traceability. This will allow * the user to be able to see in which specific test class an error occured * through the Ant JUnit report mechanism. This is enabled by default, but * can be disabled by setting the Java system-wide property * "net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase.no-classname" * to true, * which is dynamically checked at runtime at each call. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:20 $ * @since March 2, 2002 * @see ImplFactory * @see ICxFactory * @see InterfaceTestSuite */ public abstract class InterfaceTestCase extends TestCase { // package protected for test-case use. static final String DONT_USE_CLASSNAME = InterfaceTestCase.class.getName() + ".no-classname"; private ImplFactory factory; private Class interfaceClass; // Due to possible memory-leak, this stack will only contain // instantiated objects when the factory is of type ICxFactory. private Stack instantiatedObjects = new Stack(); // As a slight optimization, we will cache the check if the // factory is an instance of ICxFactory or not. private boolean isICxFactory = false; // allows for manual setting of the classname display in the output name private Boolean useClassInName = null; /** * The standard constructor used by JUnit up to version 3.7. * * @param name the name of the test to execute. * @param interfaceClass the class which this test case tests. * @param f the factory which will create specific subclass instances. */ public InterfaceTestCase( String name, Class interfaceClass, ImplFactory f ) { super( name ); if (interfaceClass == null || f == null) { throw new IllegalArgumentException("no null arguments"); } // need to ensure that a common test coding error didn't occur... assertTrue( "Interface under test argument ("+interfaceClass.getName()+ ") is the same as the current test's class ("+ getClass().getName()+ "). The correct usage is to pass in the Class object which "+ "corresponds to the superclass or interface all instance methods "+ "tested must extend.", !getClass().equals( interfaceClass ) ); // the class can be an interface, an abstract class, or just // a regular class. We don't care as long as it isn't null. this.interfaceClass = interfaceClass; this.factory = f; // cache the assertion for if the factory is an ICxFactory instance. if (f instanceof ICxFactory) { this.isICxFactory = true; } } /** * Sets whether the classname is put in the output or not. If you don't * set this value here, it will use the value of the * system property described above. * * @since 03-Dec-2002 */ public void setUseClassInName( boolean use ) { this.useClassInName = new Boolean( use ); } /** * Calls the stored factory to create an implemented object. Subclasses * should make their own method, say getObject(), which returns * this method's result, but casted to the right class. *

    * This method makes an assertion that the factory's created object is not * null, so that the system state is ensured. Therefore, * this method will never return null. Also, this method asserts * that the created object is of the correct type (as passed in through * the constructor), so that it can be correctly cast without errors. * * @return the object created by the factory. */ public Object createImplObject() { // ensure the factory was set. assertNotNull( "The factory instance was never set.", this.factory ); Object o; try { o = this.factory.createImplObject(); } catch (Exception ex) { // allow for the factory creation to throw exceptions. fail( "Factory "+this.factory.toString()+ " threw exception "+ex+" during creation: "+ exceptionToString( ex ) ); // the above call will always exit, but the compiler doesn't // know that. So to make it happy the next line has been added. o = null; } assertNotNull( "The implementation factory "+this.factory+" created a null.", o ); // Since the generated object is non-null, we will store it in our // stack, even if the next assert fails. This allows for correct // deconstruction of *every* non-null generated object. if (this.isICxFactory) { this.instantiatedObjects.push( o ); } assertTrue( "The implementation factory did not create a valid class: created "+ o.getClass().getName()+", but should have been of type "+ getInterfaceClass().getName()+".", getInterfaceClass().isInstance( o ) ); return o; } /** * Return the interface or abstract class this test covers. * * @return the interface under test. */ public Class getInterfaceClass() { return this.interfaceClass; } /** * Override the TestCase default getName so that the factory names are * returned as well. * * @return the method name being tested, along with the factory's * name. */ public String getName() { return getNamePrefix() + super.getName() + "[" + this.factory.toString() +"]"; } /** * Ensure, for JUnit 3.7 support, that the original name() method is * still supported. * * @return getName(). */ public String name() { return getName(); } /** * Send each instantiated object to the factory for cleanup. * * @exception Exception thrown if the super's tearDown throws an * exception, or if any exceptions are thrown during the tear-down * of the factory generated instances. */ protected void tearDown() throws Exception { if (this.isICxFactory) { int errorCount = 0; StringBuffer sb = new StringBuffer( "Encountered factory tearDown exceptions: " ); ICxFactory cf = (ICxFactory)this.factory; while (!this.instantiatedObjects.isEmpty()) { try { cf.tearDown( this.instantiatedObjects.pop() ); } catch (ThreadDeath td) { // never swallow thread death exceptions throw td; } catch (Throwable t) { // catch all factory exceptions, and sum them up into // a single exception at the end. if (errorCount > 0) { sb.append( "; " ); } sb.append( t.toString() ); ++errorCount; // Tell the user about this exception. t.printStackTrace(); } } // only do the assertion *after* all the generated objects have // been torn down. assertTrue( sb.toString(), errorCount <= 0 ); } // tell the super-class to tear itself down. super.tearDown(); } /** * Allow for easy translation of exceptions to strings, including * stack traces. * * @param t the exception to translate into a string. * @return the exception + stack trace as a string. */ private String exceptionToString( Throwable t ) { if (t == null) { return ""; } StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter( sw ); t.printStackTrace( pw ); pw.flush(); return sw.toString(); } /** * Generate the prefix for the name of this test class. * * @return the prefix string * @since 08-Dec-2002 */ private String getNamePrefix() { boolean usePrefix; if (this.useClassInName != null) { usePrefix = this.useClassInName.booleanValue(); } else { usePrefix = !Boolean.getBoolean( DONT_USE_CLASSNAME ); } String ret = ""; if (usePrefix) { // get the classname of the current test, without the package. ret = this.getClass().getName(); int pos = ret.lastIndexOf( '.' ); if (pos >= 0) { ret = ret.substring( pos+1 ); } ret = ret + '.'; } return ret; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/CxFactory.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/CxFacto0000644000175000017500000001501207663720345034112 0ustar drazzibdrazzib/* * @(#)CxFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; /** * Helper abstract class that aids in the setting of a unique and * distinguishable name for a test case's factory. *

    * As of 08-Dec-2002, the original constructor will NOT add the owning * class's name to the factory toString() output. Since the * Ant JUnit report is setup such that the concrete class's tests are * organized under it, this is redundant information, and clutters the * report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/24 16:42:13 $ * @since October 30, 2002 */ public abstract class CxFactory implements ICxFactory { private String id; /** * Specify a unique identifier for this specific factory within the * context of the concrete test that is providing the factory. The * CxFactory constructor will not add the test's class name to * this string to create a distinguishable string to help debug the * source of any errors caused by a factory's particular setup. If you * want the owning class's name to appear in the id, use the alternate * constructor. * * @param name the unique identifier within the context of the * factory's owning test class. This cannot be null. * @exception IllegalArgumentException thrown if name * is null. */ public CxFactory( String name ) { this( name, false ); } /** * Specify a unique identifier for this specific factory within the * context of the concrete test that is providing the factory. The * CxFactory constructor may add the test's class name to * this string to create a distinguishable string to help debug the * source of any errors caused by a factory's particular setup, * depending on the value of addClassName. * * @param name the unique identifier within the context of the * factory's owning test class. This cannot be null. * @param addClassName true if the owning class's name should * be added to the id, and false if the name should be * the ID itself. * @exception IllegalArgumentException thrown if name * is null. * @since 07-Dec-2002 */ public CxFactory( String name, boolean addClassName ) { if (name == null) { throw new IllegalArgumentException( "factory name cannot be null." ); } // If this factory is within another class (i.e. an inner class // or an anonymous class), then the owning class's name will be // used instead, which is normally the test class's name. if (addClassName) { Class c = this.getClass(); String className = getOwningClassName( c ); this.id = className + "-" + name; } else { this.id = name; } /* post condition - this can never happen. Commented out for coverage numberes. if (this.id == null) { throw new IllegalStateException( "internal coding error: generated ID was null." ); } */ } /** * Override the Java-default toString, and provide our distinguishable * name. * * @return the generated distinguishable name. */ public String toString() { /* Pre-condition - this should never happen. Commented out for coverage numberes. if (this.id == null) { throw new IllegalStateException( "The internal id is null. "+ "An internal API coding mistake was made." ); } */ return this.id; } /** * Most factories have no need for a tearDown method, so a default * (do-nothing) implementation has been provided here. */ public void tearDown( Object implObject ) throws Exception { // do nothing } // inherited from ImplFactory public abstract Object createImplObject() throws Exception; /** * Find the owning class name for the given class. For inner classes, * this will return the parent class. * * @param c the class to find the owner * @return the owning class' name. */ private String getOwningClassName( Class c ) { if (c == null) { throw new IllegalArgumentException( "No null args." ); } Class lastOwner = c; /* This part does not work as expected: see the corresponding enemy unit test for reasons. Class owner = c.getDeclaringClass(); while (owner != null) { lastOwner = owner; owner = owner.getDeclaringClass(); } */ String className = lastOwner.getName(); int pos = className.lastIndexOf( '$' ); if (pos > 0) { className = className.substring( 0, pos ); } pos = className.lastIndexOf( '.' ); if (pos > 0) { className = className.substring( pos+1 ); } return className; } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/ICxFactory.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/ICxFact0000644000175000017500000000566207622026444034050 0ustar drazzibdrazzib/* * @(#)ICxFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; /** * An ICxFactory is an extension of ImplFactory that has provisions for * cleaning up generated objects on test tear down. Generated objects could * either have a finalize() method (not recommended, especially for tests), * or the factory could implement this interface to allow proper, timely * clean-up. *

    * The clean-up is performed by InterfaceTestCase in the * tearDown() method. If the hierarchy tests do not use this, * but instead use a variation of junit.framework.Test, then * they will need to implement their own tearDown() functionality. *

    * A valid alternative is to use Mock-Objects * (www.mockobjects.org), which would * not need to be cleaned up like "live" objects do. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:20 $ * @since October 30, 2002 */ public interface ICxFactory extends ImplFactory { /** * Allows the implementation to clean-up the instantiated object. * implObject is guaranteed to have been generated by this exact * factory. Each object generated by this specific factory will be passed * to this method on the test's tearDown() method, in the * reverse order that they were created. * * @param implObject one of the objects created by this factory. * @exception Exception can be thrown when the deconstruction fails. * This will not disrupt the remaining objects' tear down * call. */ public void tearDown( Object implObject ) throws Exception; } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/ImplFactory.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/iftc/ImplFac0000644000175000017500000000654607622026444034104 0ustar drazzibdrazzib/* * @(#)ImplFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; /** * Allows for tests to be written on interfaces or abstract classes, by creating * a specific instance of the interface or abstract class. Test classes will * invoke this method to retrieve the specific instance for their tests. *

    * Since October 21, 2002, the createImplObject() method can now * throw any exception. Some construction implementations throw all kinds * of errors, such as IOException or SQLException. This * makes the task of creating factories a bit easier, since we no longer * need to worry about proper try/catch blocks. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:20 $ * @since March 2, 2002 */ public interface ImplFactory { /** * Create a new instance of the interface type for testing through * an InterfaceTest. *

    * As of 21-Oct-2002, this method can raise any exception, and it will be * correctly caught and reported as a failure by the * InterfaceTestCase.createImplObject() method, so that the * creation method can simplify its logic, and add any kind of * initialization without having to worry about the correct way to * handle exceptions. * * @return a new instance of the expected type that the corresponding * InterfaceTestCase(s) cover. * @exception Exception thrown under any unexpected condition that * results in the failure to properly create the instance. * @since October 21, 2002: Since this date, this method can now throw * exceptions to make creation a bit easier on us. */ public Object createImplObject() throws Exception; /** * All ImplFactory instances should specify a distinguishable name * to help in debugging failed tests due to a particular factory's * instance setup. * * @return a distinguishable name for the factory. * @see CxFactory CxFactory: a helper that simplifies this task for us. */ public String toString(); } libgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/0000755000175000017500000000000011271425773033205 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/JUnitOrigCreator.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/JUnit0000644000175000017500000001510307622026445034157 0ustar drazzibdrazzib/* * @(#)JUnitOrigCreator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import junit.framework.Test; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Constructor; /** * Emulates the construction mechanism for all JUnit versions. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:21 $ * @since November 3, 2002 */ public class JUnitOrigCreator implements ITestCreator { /** * Creates a new test, based on the given class and method of the class. * This calls createTest( Class, Object[] ) to create the new * class, which itself calls getConstructorArgTypes( Class ) to * determine which constructor to get. Also, * createTestArguments( Class, Method ) is called to generate the * constructor's arguments. * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. * @exception InstantiationException if there was a problem creating the * class. * @exception NoSuchMethodException if the method does not exist in the * class. * @see #createTest( Class, Object[] ) */ public Test createTest( Class theClass, Method method ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException { return createTest( theClass, createTestArguments( theClass, method ) ); } /** * Checks if the creator can be used on the given class. * * @param theClass the class to check if parsing is acceptable. */ public boolean canCreate( Class theClass ) { try { Constructor c = getConstructor( theClass ); return (c != null); } catch (Exception ex) { return false; } } /** * Discovers the constructor for the test class which will be used in * the instantiation of a new instance of the class. This constructor * will be discovered through a call to * getConstructorArgTypes. The returned constructor must be * callable through createTestArguments. * * @param theClass the class to parse for testing. * @return the constructor to create a new test instance with. * @exception NoSuchMethodException if the class does not have a * constructor with the arguments returned by * getConstructorArgTypes. * @see #getConstructorArgTypes( Class ) * @see #createTest( Class, Method ) * @see #createTestArguments( Class, Method ) */ protected Constructor getConstructor( final Class theClass ) throws NoSuchMethodException { return theClass.getConstructor( getConstructorArgTypes( theClass ) ); } /** * Allows for pluggable constructor types. The default action is to * return java.lang.String. * * @param theClass the class to parse for testing. * @return the set of classes which define the constructor to extract. */ protected Class[] getConstructorArgTypes( Class theClass ) { return new Class[] { String.class }; } /** * * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. */ protected Object[] createTestArguments( Class theClass, Method method ) { return new Object[] { method.getName() }; } /** * Creates a new test class instance. * * @param theClass the class to parse for testing. * @param constructorArgs arguments for the constructor retrieved through * getConstructor(). * @return the new Test. * @exception InstantiationException if a new instance could not be made * of the test class. * @exception NoSuchMethodException if the constructor could not be found. * @see #getConstructor( Class ) */ protected Test createTest( Class theClass, Object[] constructorArgs ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException { Constructor c = getConstructor( theClass ); Test t; try { t = (Test)c.newInstance( constructorArgs ); } catch (IllegalArgumentException iae) { StringBuffer args = new StringBuffer( "Arguments didn't match for constructor " ); args.append( c ).append( " in class " ).append( theClass.getName() ).append( ". Arguments = [" ); for (int i = 0; i < constructorArgs.length; ++i) { if (i > 0) { args.append( ", " ); } args.append( constructorArgs[i].getClass().getName() ). append( " = '" ). append( constructorArgs[i] ). append( "'" ); } args.append("]: ").append( iae ); throw new InstantiationException( args.toString() ); } return t; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/package.htmllibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/packa0000644000175000017500000000175307561622145034214 0ustar drazzibdrazzibnet.sourceforge.groboutils.junit.v1.parser The GroboUtils JUnit Extention: classes to help in the creation and execution of JUnit tests.

    Overview

    The TestClassParser combined with the TestClassCreator contains much of the logic that the JUnit class TestSuite contains. However, the parser is designed with extensibility in mind. Its sole purpose is to parse out test methods and create test instances.

    The TestClassParser knows how to extract the test methods from a test class, while TestClassCreator knows how to create test instances from the parsed test class.

    In order to support various means of instantiating test instances from a test class, the TestClassCreator depends upon instances of ITestCreator to perform the actual creation of the tests. The validation and TestSuite compilation is performed by the TestClassCreator.

    ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/DelegateTestCreator.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/Deleg0000644000175000017500000001205207622026444034145 0ustar drazzibdrazzib/* * @(#)DelegateTestCreator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import junit.framework.Test; import org.apache.log4j.Logger; /** * Allows for an ordered set of TestCreator instances to be queried for * generating instances. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:20 $ * @since November 4, 2002 */ public class DelegateTestCreator implements ITestCreator { private static final Logger LOG = Logger.getLogger( DelegateTestCreator.class ); private ITestCreator[] creators; /** * Create the delegation with an ordered array of creators. The * creators are searched from index 0 to the last index for a valid * creator. */ public DelegateTestCreator( ITestCreator[] tc ) { if (tc == null || tc.length <= 0) { throw new IllegalArgumentException("no null args"); } int len = tc.length; this.creators = new ITestCreator[ len ]; for (int i = len; --i >= 0;) { if (tc[i] == null) { throw new IllegalArgumentException("no null args"); } this.creators[i] = tc[i]; } } /** * Checks if the creator can be used on the given class. * * @param theClass the class to check if parsing is acceptable. * @return whether the creator can generate a test based on * theClass. */ public boolean canCreate( Class theClass ) { // order doesn't matter at this point for (int i = this.creators.length; --i >= 0;) { if (this.creators[i].canCreate( theClass )) { return true; } } return false; } /** * Creates a new test, based on the given class and method of the * class. * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. * @exception InstantiationException if there was a problem creating * the class. * @exception NoSuchMethodException if the method does not exist in the * class. */ public Test createTest( Class theClass, Method method ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException { // order matters here. for (int i = 0; i < this.creators.length; ++i) { ITestCreator tc = this.creators[i]; try { if (tc.canCreate( theClass )) { Test t = tc.createTest( theClass, method ); if (t != null) { return t; } } } catch (InstantiationException e) { LOG.info( "Failed to create test with creator "+tc+".", e ); } catch (NoSuchMethodException e) { LOG.info( "Failed to create test with creator "+tc+".", e ); } catch (InvocationTargetException e) { LOG.info( "Failed to create test with creator "+tc+".", e ); } catch (IllegalAccessException e) { LOG.info( "Failed to create test with creator "+tc+".", e ); } catch (ClassCastException e) { LOG.info( "Failed to create test with creator "+tc+".", e ); } } // did not find a valid test creator. return null; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/IftcOrigCreator.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/IftcO0000644000175000017500000002126407622026445034137 0ustar drazzibdrazzib/* * @(#)IftcOrigCreator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import junit.framework.Test; import junit.framework.TestSuite; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Constructor; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; /** * Creates Interface test cases based on the original JUnit construction * mechanism. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:21 $ * @since November 4, 2002 */ public class IftcOrigCreator implements ITestCreator { private ImplFactory factories[]; /** * Default constructor. * * @param f factory list used in generating the tests. If this is * null, or if any entries are null, then an * IllegalArgumentException will be thrown. */ public IftcOrigCreator( ImplFactory[] f ) { if (f == null) { throw new IllegalArgumentException("no null args"); } // allow for empty factory list int len = f.length; this.factories = new ImplFactory[ len ]; for (int i = len; --i >= 0;) { if (f[i] == null) { throw new IllegalArgumentException("no null args"); } this.factories[i] = f[i]; } } /** * Creates a new test, based on the given class and method of the class. * This calls createTest( Class, Object[] ) to create the new * class, which itself calls getConstructorArgTypes( Class ) to * determine which constructor to get. Also, * createTestArguments( Class, Method ) is called to generate the * constructor's arguments. * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. * @exception InstantiationException if there was a problem creating the * class. * @exception NoSuchMethodException if the method does not exist in the * class. * @see #createTest( Class, Object[] ) */ public Test createTest( Class theClass, Method method ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException { TestSuite suite = new TestSuite(); int goodTestCount = 0; for (int i = 0; i < this.factories.length; ++i) { Test t = createTest( theClass, createTestArguments( theClass, method, this.factories[i] ) ); if (t != null) { ++goodTestCount; suite.addTest( t ); } } if (goodTestCount <= 0) { suite.addTest( TestClassCreator.createWarningTest( "No factories or valid instances for test class "+ theClass.getName()+", method "+method.getName()+"." ) ); } return suite; } /** * Checks if the creator can be used on the given class. * * @param theClass the class to check if parsing is acceptable. */ public boolean canCreate( Class theClass ) { try { Constructor c = getConstructor( theClass ); return (c != null); } catch (Exception ex) { return false; } } /** * Discovers the constructor for the test class which will be used in * the instantiation of a new instance of the class. This constructor * will be discovered through a call to * getConstructorArgTypes. The returned constructor must be * callable through createTestArguments. * * @param theClass the class to parse for testing. * @return the constructor to create a new test instance with. * @exception NoSuchMethodException if the class does not have a * constructor with the arguments returned by * getConstructorArgTypes. * @see #getConstructorArgTypes( Class ) * @see #createTest( Class, Method ) * @see #createTestArguments( Class, Method, ImplFactory ) */ protected Constructor getConstructor( final Class theClass ) throws NoSuchMethodException { return theClass.getConstructor( getConstructorArgTypes( theClass ) ); } /** * Allows for pluggable constructor types. * * @param theClass the class to parse for testing. * @return the set of classes which define the constructor to extract. */ protected Class[] getConstructorArgTypes( Class theClass ) { /* return new Class[] { findClass( "java.lang.String" ), findClass( "net.sourceforge.groboutils.junit.v1.iftc.ImplFactory" ) }; */ return new Class[] { String.class, ImplFactory.class }; } /** * * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. */ protected Object[] createTestArguments( Class theClass, Method method, ImplFactory implf ) { return new Object[] { method.getName(), implf }; } /** * Creates a new test class instance. * * @param theClass the class to parse for testing. * @param constructorArgs arguments for the constructor retrieved through * getConstructor(). * @return the new Test. * @exception InstantiationException if a new instance could not be made * of the test class. * @exception NoSuchMethodException if the constructor could not be found. * @see #getConstructor( Class ) */ protected Test createTest( Class theClass, Object[] constructorArgs ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException { Constructor c = getConstructor( theClass ); Test t; try { t = (Test)c.newInstance( constructorArgs ); } catch (IllegalArgumentException iae) { StringBuffer args = new StringBuffer( "Arguments didn't match for constructor " ); args.append( c ).append( " in class " ).append( theClass.getName() ).append( ". Arguments = [" ); for (int i = 0; i < constructorArgs.length; ++i) { if (i > 0) { args.append( ", " ); } args.append( constructorArgs[i].getClass().getName() ). append( " = '" ). append( constructorArgs[i] ). append( "'" ); } args.append("]: ").append( iae ); throw new InstantiationException( args.toString() ); } return t; } /* * JDK 1.1 needs its own implementation of this, to avoid some hairy * situations. private static final Class findClass( String name ) { try { return Class.forName( name ); } catch (ClassNotFoundException cnfe) { throw new IllegalStateException( cnfe.getMessage() ); } } */ } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/JUnit3_8Creator.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/JUnit0000644000175000017500000000666307622026445034172 0ustar drazzibdrazzib/* * @(#)JUnit3_8Creator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import junit.framework.Test; import junit.framework.TestCase; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Constructor; /** * Emulates the JUnit 3.8+ construction mechanism. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:21 $ * @since November 3, 2002 */ public class JUnit3_8Creator implements ITestCreator { /** * Checks if the creator can be used on the given class. * * @param theClass the class to check if parsing is acceptable. */ public boolean canCreate( Class theClass ) { if (!TestCase.class.isAssignableFrom( theClass )) { return false; } try { Constructor c = theClass.getConstructor( new Class[0] ); return (c != null); } catch (Exception ex) { return false; } } /** * Creates a new test, based on the given class and method of the * class. * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. * @exception InstantiationException if there was a problem creating * the class. * @exception NoSuchMethodException if the method does not exist in the * class. */ public Test createTest( Class theClass, Method method ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException { TestCase tc; try { tc = (TestCase)theClass.newInstance(); } catch (IllegalArgumentException iae) { StringBuffer args = new StringBuffer( "Arguments didn't match for default constructor in class " ); args.append( theClass.getName() ).append( "." ); throw new InstantiationException( args.toString() ); } tc.setName( method.getName() ); return tc; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/TestClassCreator.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/TestC0000644000175000017500000002175407622026445034161 0ustar drazzibdrazzib/* * @(#)TestClassCreator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import java.util.Vector; import java.util.Enumeration; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import junit.framework.TestSuite; import junit.framework.TestCase; import junit.framework.Test; import org.apache.log4j.Logger; /** * Creates Test instances based on a TestClassParser. *

    * Ripped the test method discovery code out of junit.framework.TestSuite to * allow it to have usable logic. *

    * This is not covered under the GroboUtils license, but rather under the * JUnit license (IBM Public License). This heading may not be totally * in line with the license, so I'll change it when I find out what needs to * be changed. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:21 $ * @since November 4, 2002 */ public class TestClassCreator { private static final Logger LOG = Logger.getLogger( TestClassCreator.class ); private ITestCreator creator; private Vector warnings = new Vector(); /** * Creates an instance that creates test instances based on the given * creator. * * @exception IllegalArgumentException if theClass is * null. */ public TestClassCreator( final ITestCreator tc ) { if (tc == null) { throw new IllegalArgumentException("no null arguments"); } this.creator = tc; } //------------------------------------------------------------------------- // Public methods /** * Retrieve all warnings generated during the introspection of the class, * or test creation. If a clearWarnings() call was ever made, then * only those warnings that were encountered after the call will be * returned. * * @return an array of all warnings generated while creating the test * array. */ public String[] getWarnings() { String w[] = new String[ this.warnings.size() ]; this.warnings.copyInto( w ); return w; } /** * Remove all current warnings. */ public void clearWarnings() { this.warnings.removeAllElements(); } /** * This will create all test objects for the test registered with the * parser. Any errors reported during generation will be added to the * warnings list. * * @return all valid tests created through inspection. */ public Test[] createTests( TestClassParser tcp ) { Vector t = new Vector(); if (this.creator.canCreate( tcp.getTestClass() )) { Method m[] = tcp.getTestMethods(); for (int i = 0; i < m.length; ++i) { try { Test tt = this.creator.createTest( tcp.getTestClass(), m[i] ); if (tt != null) { t.addElement( tt ); } else { warning( "Could not create test for class " + tcp.getTestClass().getName() + " and method " + m[i].getName() + "." ); } } catch (InstantiationException ie) { warning( "Method " + m[i].getName() + " could not be added as a test: " + ie ); } catch (NoSuchMethodException nsme) { warning( "No valid constructor for " + tcp.getTestClass().getName() + ": " + nsme ); } catch (InvocationTargetException ite) { warning( "Construction of class " + tcp.getTestClass().getName() + " caused an exception: "+ ite.getTargetException() ); } catch (IllegalAccessException iae) { warning( "Protection on constructor for class "+ tcp.getTestClass().getName() + " was invalid: " + iae ); } catch (ClassCastException cce) { warning( "Class " + tcp.getTestClass().getName() + " is not of Test type." ); } } } else { warning( "TestCreator does not know how to handle class " + tcp.getTestClass().getName() + "." ); } Test tt[] = new Test[ t.size() ]; t.copyInto( tt ); return tt; } /** * For every warning currently known in this creator and the parser, * create a Test that fails with the warning's message. Note that after * creating a test with the warnings, this instance will still know about * the warnings. * * @return an array of tests that fail with a particular warning. */ public Test[] createWarningTests( TestClassParser tcp ) { String s1[] = getWarnings(); String s2[] = tcp.getWarnings(); Test t[] = new Test[ s1.length + s2.length ]; for (int i = 0; i < s1.length; ++i) { t[i] = createWarningTest( s1[i] ); } for (int i = 0; i < s2.length; ++i) { t[i+s1.length] = createWarningTest( s2[i] ); } return t; } /** * Create a new TestSuite, containing the tests returned by the call to * createTests(). No warning tests will be added. * * @return a new TestSuite with all the valid, discovered tests. */ public TestSuite createTestSuite( TestClassParser tcp ) { TestSuite ts = new TestSuite( tcp.getName() ); Test t[] = createTests( tcp ); for (int i = 0; i < t.length; ++i) { if (t[i] != null) { ts.addTest( t[i] ); } } return ts; } /** * Create a new TestSuite, containing the tests returned by the call to * createTests() and createWarningTests. * * @return a new TestSuite with all the valid, discovered tests, and the * warning tests. */ public TestSuite createAllTestSuite( TestClassParser tcp ) { TestSuite ts = createTestSuite( tcp ); Test t[] = createWarningTests( tcp ); for (int i = 0; i < t.length; ++i) { if (t[i] != null) { ts.addTest( t[i] ); } } return ts; } /** * Create a new Test that will fail with the given error message. * * @param message the text to report in the failure of the created * Test. * @return a test that will fail with the given message. */ public static Test createWarningTest( final String message ) { return new TestCase( "warning" ) { protected void runTest() { fail( message ); } }; } //------------------------------------------------------------------------- // Protected methods /** * Adds a warning message to the inner list of warnings. * * @param message the message describing the warning. */ protected void warning( final String message ) { LOG.info( "WARNING: "+message ); this.warnings.addElement( message ); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/TestClassParser.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/TestC0000644000175000017500000001613407561612633034157 0ustar drazzibdrazzib/* * @(#)TestClassParser.java */ package net.sourceforge.groboutils.junit.v1.parser; import java.util.Vector; import java.util.Enumeration; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import junit.framework.TestSuite; import junit.framework.TestCase; import junit.framework.Test; import org.apache.log4j.Logger; /** * Parses Test classes to discover the usable test methods. *

    * Ripped the test method discovery code out of junit.framework.TestSuite to * allow it to have usable logic. *

    * This is not covered under the GroboUtils license, but rather under the * JUnit license (IBM Public License). This heading may not be totally * in line with the license, so I'll change it when I find out what needs to * be changed. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2002/11/05 00:49:31 $ * @since March 28, 2002 */ public class TestClassParser { private static final Logger LOG = Logger.getLogger( TestClassParser.class ); private Class testClass; Vector testMethods = new Vector(); private Vector warnings = new Vector(); /** * The primary constructor, which will cause this instance to know how to * parse only the passed-in class. * * @param theClass the class to parse for testing. * @exception IllegalArgumentException if theClass is * null. */ public TestClassParser(final Class theClass) { if (theClass == null) { throw new IllegalArgumentException("no null arguments"); } this.testClass = theClass; if (testClass( theClass )) { discoverTestMethods( theClass ); } } //------------------------------------------------------------------------- // Public methods /** * Retrieve all warnings generated during the introspection of the class, * or test creation. If a clearWarnings() call was ever made, then * only those warnings that were encountered after the call will be * returned. * * @return an array of all warnings generated while creating the test * array. */ public String[] getWarnings() { String w[] = new String[ this.warnings.size() ]; this.warnings.copyInto( w ); return w; } /** * Remove all current warnings. */ public void clearWarnings() { this.warnings.removeAllElements(); } /** * Retrieve all public test methods discovered through inspection. * * @return all test methods. */ public Method[] getTestMethods() { Method m[] = new Method[ this.testMethods.size() ]; this.testMethods.copyInto( m ); return m; } /** * Get the name of the test suite. By default, this is the class name. * * @return the name of the test suite. */ public String getName() { return this.testClass.getName(); } /** * Get the class under test. This will never return null, and * will always match the class passed into the constructor. * * @return the class under test. */ public Class getTestClass() { return this.testClass; } //------------------------------------------------------------------------- // Parse methods /** * Discover if the given class is a valid testing class. * * @param theClass the class to parse for testing. * @return true if the class is a public test class, otherwise * false. */ protected boolean testClass( final Class theClass ) { boolean result = true; if (!Modifier.isPublic( theClass.getModifiers() )) { warning("Class " + theClass.getName() + " is not public."); result = false; } if (!Test.class.isAssignableFrom( theClass )) { warning("Class " + theClass.getName() + " does not implement "+Test.class.getName() ); result = false; } return result; } /** * Discover and record the test methods of the public test class * theClass. * * @param theClass the class to parse for testing. */ protected void discoverTestMethods( final Class theClass ) { Class superClass = theClass; Vector names = new Vector(); while (Test.class.isAssignableFrom( superClass )) { Method[] methods = superClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { addTestMethod( methods[i], names ); } superClass = superClass.getSuperclass(); } } /** * Adds the method m to the inner list of known test methods, * but only if it is a public test method. * * @param m the method to add. * @param names a list of method names that have already been inspected. */ protected void addTestMethod( Method m, Vector names ) { String name = m.getName(); if (names.contains(name) || this.testMethods.contains( m )) { return; } if (isPublicTestMethod(m)) { names.addElement(name); this.testMethods.addElement( m ); } else { // almost a test method if (isTestMethod(m)) { warning("Test method isn't public: "+m.getName()); } } } /** * Asserts that the method is public, and that it is also a test method. * * @param m the method under scrutiny. * @return true if m is a public test method, otherwise * false. * @see #isTestMethod( Method ) */ protected boolean isPublicTestMethod( Method m ) { return isTestMethod(m) && Modifier.isPublic(m.getModifiers()); } /** * Test if method m is a test method, which means it accepts * no parameters, returns void, and the name of the method * begins with test. * * @param m the method under scrutiny. * @return true if m is a public test method, otherwise * false. */ protected boolean isTestMethod( Method m ) { String name= m.getName(); Class[] parameters= m.getParameterTypes(); Class returnType= m.getReturnType(); return parameters.length == 0 && name.startsWith("test") && returnType.equals(Void.TYPE); } /** * Adds a warning message to the inner list of warnings. * * @param message the message describing the warning. */ protected void warning( final String message ) { LOG.debug( "WARNING: "+message ); this.warnings.addElement( message ); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/ITestCreator.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/parser/ITest0000644000175000017500000000560007622026445034157 0ustar drazzibdrazzib/* * @(#)ITestCreator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import junit.framework.Test; /** * Interface that can create test objects based on a class and a method from * within that class, using a specific method. Also provides means to check * the class object to see if the implementation can instantiate the test * class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:21 $ * @since November 3, 2002 */ public interface ITestCreator { /** * Creates a new test, based on the given class and method of the * class. * * @param theClass the class to parse for testing. * @param m the method that will be tested with the new class instance. * @return the generated test, or null if the test could not * be created. * @exception InstantiationException if there was a problem creating * the class. * @exception NoSuchMethodException if the method does not exist in the * class. */ public Test createTest( Class theClass, Method method ) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException; /** * Checks if the creator can be used on the given class. * * @param theClass the class to check if parsing is acceptable. * @return whether the creator can generate a test based on * theClass. */ public boolean canCreate( Class theClass ); } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/AssertTestFactory.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/AssertTestFa0000644000175000017500000006572607777607732034241 0ustar drazzibdrazzib/* * @(#)AssertTestFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.apache.log4j.Logger; import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.AssertionFailedError; import junit.framework.Assert; /** * A factory that creates test instances for the standard set of assert * methods. The created test instances should have their setName() * method invoked to properly set the name of the test. Alternatively, the * factory instance can have the name set so that all tests will have the * same name. *

    * To support JUnit 3.8 functionality, but remain backwards compatible with * earlier JUnit libraries, the names for the JUnit 3.8 methods will be * allowed, but they will call JUnit 3.7 compatible methods. *

    * As of Dec 8, 2002, the factory can uniquely (per instance) name each * generated test via an index. This can help traceability in identifying * each created test. Alternatively, the user can set the factory's name * before invoking a create method. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/01/09 20:32:26 $ * @since July 26, 2002 */ public class AssertTestFactory { /** * Inner test instance which specializes in generating a message with * the test's instance's specific name. */ public static abstract class InnerTest extends TestCase { private String message; /** * JUnit 3.8 allows for test constructors to not have to specify * a name in the super() call, but for JUnit 3.7 compatibility, * we will only support the original usage. */ public InnerTest( String name, String msg ) { super( name ); this.message = msg; } public void setMessage( String msg ) { this.message = msg; } public String getMessage() { return this.message; } public String getFullMessage() { String msg = getMessage(); String name = this.getName(); if (name != null) { msg = name + ": " + msg; } return msg; } protected final void runTest() { callAssert( getFullMessage() ); } public abstract void callAssert( String message ); } private String name; private int index = 0; private boolean useIndex = false; /** * Creates a new factory that can generate assertions as independent * test objects. */ public AssertTestFactory() { // do nothing } /** * Creates a new factory with a specific name for each generated test, * but will not add an index to each generated test's name. * * @param name default name shared by all generated assertion tests. */ public AssertTestFactory( String name ) { this( name, false ); } /** * Creates a new factory with a specific name for each generated test, * and can optionally add an index to each generated test's name. * * @param name default name shared by all generated assertion tests. * @param useIndexWithName true if indecies will be appended * to each generated test's name, or false if they * will use the passed-in name exactly. * @since 08-Dec-2002 */ public AssertTestFactory( String name, boolean useIndexWithName ) { setName( name ); setUseIndexWithName( useIndexWithName ); } /** * Sets the default test name. This will not reset the generated index. * * @param name default name shared by all generated assertion tests. */ public void setName( String name ) { this.name = name; } /** * Returns the default test name. If the name has never been set, then * this will return null. * * @return default name shared by all generated assertion tests. */ public String getName() { return this.name; } /** * Sets whether each generated test will add a unique (for this instance) * index to the test's name. Reseting this value will not affect the * index's value. * * @param useIndexWithName true if indecies will be appended * to each generated test's name, or false if they * will use the passed-in name exactly. * @since 08-Dec-2002 */ public void setUseIndexWithName( boolean useIndexWithName ) { this.useIndex = useIndexWithName; } /** * Returns whether each generated test will add a unique (for this * instance) index to the test's name. * * @return true if an index is appended to the name, or * false if the test's name is exactly the factory's name. * @since 08-Dec-2002 */ public boolean getUseIndexWithName() { return this.useIndex; } //----------------------------------------------------------------------- private static class AssertTrue1 extends InnerTest { boolean condition; public AssertTrue1( String n, String m, boolean c ) { super( n, m ); this.condition = c; } public void callAssert( String msg ) { Assert.assertTrue( msg, this.condition ); } } /** * Asserts that a condition is true. If it isn't it throws an * AssertionFailedError with the given message. * * @param message message that describes what failed if the assertion * fails. * @param condition boolean to check for failure */ public InnerTest createAssertTrue( String message, boolean condition ) { return new AssertTrue1( getNextTestName(), message, condition ); } /** * Asserts that a condition is true. If it isn't it throws an * AssertionFailedError. * * @param condition boolean to check for failure */ public InnerTest createAssertTrue( boolean condition ) { return createAssertTrue( null, condition ); } /** * Asserts that a condition is false. If it isn't it throws an * AssertionFailedError with the given message. * * @since 30-Oct-2002 * @param message message that describes what failed if the assertion * fails. * @param condition boolean to check for failure */ public InnerTest createAssertFalse( String message, boolean condition ) { return new AssertTrue1( getNextTestName(), message, !condition ); } /** * Asserts that a condition is true. If it isn't it throws an * AssertionFailedError. * * @since 30-Oct-2002 * @param condition boolean to check for failure */ public InnerTest createAssertFalse( boolean condition ) { // don't 'not' the condition here - it will be done in the // invoked method. return createAssertFalse( null, condition ); } //----------------------------------------------------------------------- private static class Fail1 extends InnerTest { public Fail1( String n, String m ) { super( n, m ); } public void callAssert( String msg ) { Assert.fail( msg ); } } /** * Fails a test with the given message. * * @param message message that describes what failed if the assertion * fails. */ public InnerTest createFail( String message ) { return new Fail1( getNextTestName(), message ); } /** * Fails a test with no message. */ public InnerTest createFail() { return createFail( null ); } //----------------------------------------------------------------------- private static class AssertEquals1 extends InnerTest { Object expected; Object actual; public AssertEquals1( String n, String m, Object e, Object a ) { super( n, m ); this.expected = e; this.actual = a; } public void callAssert( String msg ) { Assert.assertEquals( msg, this.expected, this.actual ); } } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, Object expected, Object actual ) { return new AssertEquals1( getNextTestName(), message, expected, actual ); } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( Object expected, Object actual ) { return createAssertEquals(null, expected, actual); } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @since 30-Oct-2002 * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, String expected, String actual ) { return new AssertEquals1( getNextTestName(), message, expected, actual ); } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @since 30-Oct-2002 * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String expected, String actual ) { return createAssertEquals( null, expected, actual ); } //----------------------------------------------------------------------- private static class AssertEquals2 extends InnerTest { double expected; double actual; double delta; public AssertEquals2( String n, String m, double e, double a, double d ) { super( n, m ); this.expected = e; this.actual = a; this.delta = d; } public void callAssert( String msg ) { Assert.assertEquals( msg, this.expected, this.actual, this.delta ); } } /** * Asserts that two doubles are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. * @param delta maximum distance between expected and actual such that * the two values are considered equivalent. Necessary since * floating-point numbers on computers are approximations of their * equivalent values; that is, storing 1.1 may actually be * stored as 1.099999999999. */ public InnerTest createAssertEquals( String message, double expected, double actual, double delta ) { return new AssertEquals2( getNextTestName(), message, expected, actual, delta ); } /** * Asserts that two doubles are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. * @param delta maximum distance between expected and actual such that * the two values are considered equivalent. Necessary since * floating-point numbers on computers are approximations of their * equivalent values; that is, storing 1.1 may actually be * stored as 1.099999999999. */ public InnerTest createAssertEquals( double expected, double actual, double delta ) { return createAssertEquals( null, expected, actual, delta ); } //----------------------------------------------------------------------- private static class AssertEquals3 extends InnerTest { float expected; float actual; float delta; public AssertEquals3( String n, String m, float e, float a, float d ) { super( n, m ); this.expected = e; this.actual = a; this.delta = d; } public void callAssert( String msg ) { Assert.assertEquals( msg, this.expected, this.actual, this.delta ); } } /** * Asserts that two floats are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. * @param delta maximum distance between expected and actual such that * the two values are considered equivalent. Necessary since * floating-point numbers on computers are approximations of their * equivalent values; that is, storing 1.1 may actually be * stored as 1.099999999999. */ public InnerTest createAssertEquals( String message, float expected, float actual, float delta ) { return new AssertEquals3( getNextTestName(), message, expected, actual, delta ); } /** * Asserts that two floats are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. * @param delta maximum distance between expected and actual such that * the two values are considered equivalent. Necessary since * floating-point numbers on computers are approximations of their * equivalent values; that is, storing 1.1 may actually be * stored as 1.099999999999. */ public InnerTest createAssertEquals( float expected, float actual, float delta ) { return createAssertEquals( null, expected, actual, delta ); } /** * Asserts that two longs are equal. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, long expected, long actual ) { return createAssertEquals( message, new Long( expected ), new Long( actual ) ); } /** * Asserts that two longs are equal. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( long expected, long actual ) { return createAssertEquals( null, expected, actual ); } /** * Asserts that two booleans are equal. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, boolean expected, boolean actual ) { return createAssertEquals( message, new Boolean( expected ), new Boolean( actual ) ); } /** * Asserts that two booleans are equal. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( boolean expected, boolean actual ) { return createAssertEquals( null, expected, actual ); } /** * Asserts that two bytes are equal. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, byte expected, byte actual ) { return createAssertEquals( message, new Byte( expected ), new Byte( actual ) ); } /** * Asserts that two bytes are equal. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( byte expected, byte actual ) { return createAssertEquals( null, expected, actual ); } /** * Asserts that two chars are equal. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, char expected, char actual ) { return createAssertEquals( message, new Character( expected ), new Character( actual ) ); } /** * Asserts that two chars are equal. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( char expected, char actual ) { return createAssertEquals( null, expected, actual ); } /** * Asserts that two shorts are equal. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, short expected, short actual ) { return createAssertEquals( message, new Short( expected ), new Short( actual ) ); } /** * Asserts that two shorts are equal. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( short expected, short actual ) { return createAssertEquals( null, expected, actual ); } /** * Asserts that two ints are equal. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( String message, int expected, int actual ) { return createAssertEquals( message, new Integer( expected ), new Integer( actual ) ); } /** * Asserts that two ints are equal. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertEquals( int expected, int actual ) { return createAssertEquals( null, expected, actual ); } //----------------------------------------------------------------------- private static class AssertNotNull1 extends InnerTest { Object object; public AssertNotNull1( String n, String m, Object o ) { super( n, m ); this.object = o; } public void callAssert( String msg ) { Assert.assertNotNull( msg, this.object ); } } /** * Asserts that an object isn't null. * * @param message message that describes what failed if the assertion * fails. * @param object test object that must not be null. */ public InnerTest createAssertNotNull( String message, Object object ) { return new AssertNotNull1( getNextTestName(), message, object ); } /** * Asserts that an object isn't null. * * @param object test object that must not be null. */ public InnerTest createAssertNotNull( Object object ) { return createAssertNotNull( null, object ); } //----------------------------------------------------------------------- private static class AssertNull1 extends InnerTest { Object object; public AssertNull1( String n, String m, Object o ) { super( n, m ); this.object = o; } public void callAssert( String msg ) { Assert.assertNull( msg, this.object ); } } /** * Asserts that an object is null. * * @param message message that describes what failed if the assertion * fails. * @param object test object that must be null. */ public InnerTest createAssertNull( String message, Object object ) { return new AssertNull1( getNextTestName(), message, object ); } /** * Asserts that an object is null. * * @param object test object that must be null. */ public InnerTest createAssertNull( Object object ) { return createAssertNull( null, object ); } //----------------------------------------------------------------------- private static class AssertSame1 extends InnerTest { Object expected; Object actual; public AssertSame1( String n, String m, Object e, Object a ) { super( n, m ); this.expected = e; this.actual = a; } public void callAssert( String msg ) { Assert.assertSame( msg, this.expected, this.actual ); } } /** * Asserts that two objects refer to the same object. If they are not an * AssertionFailedError is thrown. * * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertSame( String message, Object expected, Object actual ) { return new AssertSame1( getNextTestName(), message, expected, actual ); } /** * Asserts that two objects refer to the same object. If they are not the * same an AssertionFailedError is thrown. * * @param expected value that the test expects to find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertSame( Object expected, Object actual ) { return createAssertSame(null, expected, actual); } /** * Asserts that two objects refer to the same object. If they are not an * AssertionFailedError is thrown. * * @since 30-Oct-2002 * @param message message that describes what failed if the assertion * fails. * @param expected value that the test expects to not find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertNotSame( String message, Object expected, Object actual ) { String str = "expected not same"; if (message != null) { str = message + ' ' + str; } // manual emulation of JUnit 3.8 functionality return new AssertTrue1( getNextTestName(), str, expected != actual ); } /** * Asserts that two objects refer to the same object. If they are not the * same an AssertionFailedError is thrown. * * @since 30-Oct-2002 * @param expected value that the test expects to not find from the tested * code. * @param actual actual value generated by tested code. */ public InnerTest createAssertNotSame( Object expected, Object actual ) { return createAssertNotSame( null, expected, actual ); } /** * Generates the next test's name. * * @return the next name for a generated test, possibly appending an * index value. * @since 08-Dec-2002 */ private String getNextTestName() { String n = getName(); if (this.useIndex) { synchronized( this ) { ++this.index; n += this.index; } } return n; } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/TestMonitorRunnable.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/TestMonitorR0000644000175000017500000000726707736117624034265 0ustar drazzibdrazzib/* * @(#)TestMonitorRunnable.java * * The basics are taken from an article by Andy Schneider * andrew.schneider@javaworld.com * The article is "JUnit Best Practices" * http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.apache.log4j.Logger; import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.AssertionFailedError; import junit.framework.Assert; /** * A helper class to more easily create monitors. TestRunnable monitors * do not have to extend this class, but it helps in becoming more * conformant to the requirements of the superclass. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/09/29 21:09:40 $ * @since July 12, 2003 */ public abstract class TestMonitorRunnable extends TestRunnable { public TestMonitorRunnable() { super( true ); } /** * Performs checks on the monitored object which is being subjected * to parallel processing. This method should not perform looping * over the check(s), since the runTest() method will * perform these. * * @exception Throwable any exception may be thrown and will be * reported as a test failure, except for * InterruptedExceptions, which will be ignored. */ public abstract void runMonitor() throws Throwable; /** * Performs all the necessary looping, end-of-threads, and interrupt * checking. The inner loop calls the runMonitor() * method. */ public void runTest() throws Throwable { while (!isDone() && !Thread.interrupted()) { runMonitor(); yieldProcessing(); } // perform one last pass, to ensure it's still valid runMonitor(); } /** * Instructs the thread to pause for a while. This method is called * by the runTest() method's loop, immediately after * each runMonitor() invocation. The default implementation * performs a Thread.yield() call, but by putting it into * this method, that behavior can be modified. * * @exception InterruptedException allows for overloading methods to * perform a delay( long ) call within their * implementation. */ protected void yieldProcessing() throws InterruptedException { Thread.yield(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/AssertConstructor.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/AssertConstr0000644000175000017500000007215407622026443034273 0ustar drazzibdrazzib/* * @(#)AssertConstructor.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import junit.framework.AssertionFailedError; import junit.framework.Assert; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; /** * A set of assert methods that test a class for implementation of specific * constructor types. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:19 $ * @since July 21, 2002 */ public class AssertConstructor { /** * Bit-mask that allows for the constructor to have public access. */ public static final int PUBLIC = 0x01; /** * Bit-mask that allows for the constructor to have protected access. */ public static final int PROTECTED = 0x02; /** * Bit-mask that allows for the constructor to have package-private access. */ public static final int PACKAGE = 0x04; /** * Bit-mask that allows for the constructor to have private access. */ public static final int PRIVATE = 0x08; /** * Bit-mask that allows the constructor to have any protection. */ public static final int ANY_PROTECTION = PUBLIC | PROTECTED | PACKAGE | PRIVATE; /** * Ensures that the class c has a default (no-arg), public * constructor. * * @param message message that describes what failed if the assertion * fails. * @param c the class check for a constructor. */ public static void assertHasDefaultConstructor( String message, Class c ) { assertHasSameConstructor( message, c, new Class[0] ); } /** * Ensures that the class c has a default (no-arg), public * constructor. * * @param c the class check for a constructor. */ public static void assertHasDefaultConstructor( Class c ) { assertHasSameConstructor( c, new Class[0] ); } /** * Ensures that the class for object o has a default (no-arg), * public constructor. * * @param message message that describes what failed if the assertion * fails. * @param o the object to check the class's constructor. */ public static void assertHasDefaultConstructor( String message, Object o ) { assertHasSameConstructor( message, o, new Class[0] ); } /** * Ensures that the class for object o has a default (no-arg), * public constructor. * * @param o the object to check the class's constructor. */ public static void assertHasDefaultConstructor( Object o ) { assertHasSameConstructor( o, new Class[0] ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param message message that describes what failed if the assertion * fails. * @param c the class check for a constructor. * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasConstructor( String, Class, Class[] ) * @see #assertHasConstructor( String, Object, Class[], int ) * @see #assertHasSameConstructor( String, Class, Class[], int ) */ public static void assertHasConstructor( String message, Class c, Class[] arguments, int protection ) { Assert.assertNotNull( "Null class argument.", c ); Assert.assertNotNull( message, getConstructor( c, arguments, protection ) ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasConstructor( Class, Class[] ) * @see #assertHasConstructor( Object, Class[], int ) * @see #assertHasSameConstructor( Class, Class[], int ) */ public static void assertHasConstructor( Class c, Class[] arguments, int protection ) { Assert.assertNotNull( "Null class argument.", c ); Assert.assertNotNull( getConstructor( c, arguments, protection ) ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasConstructor( String, Class, Class[], int ) * @see #assertHasConstructor( String, Object, Class[] ) * @see #assertHasSameConstructor( String, Class, Class[] ) */ public static void assertHasConstructor( String message, Class c, Class[] arguments ) { assertHasConstructor( message, c, arguments, PUBLIC ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasConstructor( Class, Class[], int ) * @see #assertHasConstructor( Object, Class[] ) * @see #assertHasSameConstructor( Class, Class[] ) */ public static void assertHasConstructor( Class c, Class[] arguments ) { assertHasConstructor( c, arguments, PUBLIC ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasConstructor( String, Object, Class[] ) * @see #assertHasConstructor( String, Class, Class[], int ) * @see #assertHasSameConstructor( String, Object, Class[], int ) */ public static void assertHasConstructor( String message, Object o, Class[] arguments, int protection ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasConstructor( message, o.getClass(), arguments, protection ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasConstructor( Object, Class[] ) * @see #assertHasConstructor( Class, Class[], int ) * @see #assertHasSameConstructor( Object, Class[], int ) */ public static void assertHasConstructor( Object o, Class[] arguments, int protection ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasConstructor( o.getClass(), arguments, protection ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasConstructor( String, Object, Class[], int ) * @see #assertHasConstructor( String, Class, Class[] ) * @see #assertHasSameConstructor( String, Object, Class[] ) */ public static void assertHasConstructor( String message, Object o, Class[] arguments ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasConstructor( message, o.getClass(), arguments ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasConstructor( Object, Class[], int ) * @see #assertHasConstructor( Class, Class[] ) * @see #assertHasSameConstructor( Object, Class[] ) */ public static void assertHasConstructor( Object o, Class[] arguments ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasConstructor( o.getClass(), arguments ); } //------------------------------------------------------------------------- /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasSameConstructor( String, Class, Class[] ) * @see #assertHasSameConstructor( String, Object, Class[], int ) * @see #assertHasConstructor( String, Class, Class[], int ) */ public static void assertHasSameConstructor( String message, Class c, Class[] arguments, int protection ) { Assert.assertNotNull( "Null class argument.", c ); Assert.assertNotNull( message, getSameConstructor( c, arguments, protection ) ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasSameConstructor( Class, Class[] ) * @see #assertHasSameConstructor( Object, Class[], int ) * @see #assertHasConstructor( Class, Class[], int ) */ public static void assertHasSameConstructor( Class c, Class[] arguments, int protection ) { Assert.assertNotNull( "Null class argument.", c ); Assert.assertNotNull( getSameConstructor( c, arguments, protection ) ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasSameConstructor( String, Class, Class[], int ) * @see #assertHasSameConstructor( String, Object, Class[] ) * @see #assertHasConstructor( String, Class, Class[] ) */ public static void assertHasSameConstructor( String message, Class c, Class[] arguments ) { assertHasSameConstructor( message, c, arguments, PUBLIC ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasSameConstructor( Class, Class[], int ) * @see #assertHasSameConstructor( Object, Class[] ) * @see #assertHasConstructor( Class, Class[] ) */ public static void assertHasSameConstructor( Class c, Class[] arguments ) { assertHasSameConstructor( c, arguments, PUBLIC ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasSameConstructor( String, Object, Class[] ) * @see #assertHasSameConstructor( String, Class, Class[], int ) * @see #assertHasConstructor( String, Object, Class[], int ) */ public static void assertHasSameConstructor( String message, Object o, Class[] arguments, int protection ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasSameConstructor( message, o.getClass(), arguments, protection ); } /** * Ensures that there exists a constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #assertHasSameConstructor( Object, Class[] ) * @see #assertHasSameConstructor( Class, Class[], int ) * @see #assertHasConstructor( Object, Class[], int ) */ public static void assertHasSameConstructor( Object o, Class[] arguments, int protection ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasSameConstructor( o.getClass(), arguments, protection ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasSameConstructor( String, Object, Class[], int ) * @see #assertHasSameConstructor( String, Class, Class[] ) * @see #assertHasConstructor( String, Object, Class[] ) */ public static void assertHasSameConstructor( String message, Object o, Class[] arguments ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasSameConstructor( message, o.getClass(), arguments ); } /** * Ensures that there exists a public constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @see #assertHasSameConstructor( Object, Class[], int ) * @see #assertHasSameConstructor( Class, Class[] ) * @see #assertHasConstructor( Object, Class[] ) */ public static void assertHasSameConstructor( Object o, Class[] arguments ) { Assert.assertNotNull( "Null object arguments.", o ); assertHasSameConstructor( o.getClass(), arguments ); } /** * Retrieves the first constructor in class c that * accepts the same number of arguments given in arguments, * and that the constructor has the same class or an instance of the * class in each position of the argument list, or null if * there is no such constructor. * * @param arguments list of classes which the constructor must have * as parameters, or subclasses of the arguments. A null * argument index indicates that any type is allowed (equivalent * to specifying Object.class in the argument). If * the array is null, then the argument list will only * match the default (no-argument) constructor (which is the * same as setting arguments to new Class[0]). * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see #getSameConstructor( Class, Class[], int ) */ public static Constructor getConstructor( Class c, Class[] arguments, int protection ) { Assert.assertNotNull( "Null class argument.", c ); Constructor[] cntrs = c.getConstructors(); for (int i = 0; i < cntrs.length; ++i) { if ( hasCorrectProtection( cntrs[i], protection ) && isInheritedParameters( cntrs[i], arguments ) ) { return cntrs[i]; } } return null; } /** * Retrieves the constructor in class c that * accepts the exact argument list given in arguments, or * null if there is no such constructor. * * @param protection a bitwise ORed value containing one or more of the * constants PUBLIC, PROTECTED, PACKAGE, * or PRIVATE. * @see Class#getConstructor( Class[] ) */ public static Constructor getSameConstructor( Class c, Class[] arguments, int protection ) { Assert.assertNotNull( "Null class argument.", c ); try { Constructor cntr = c.getConstructor( arguments ); if (cntr != null && hasCorrectProtection( cntr, protection )) { return cntr; } } catch (NoSuchMethodException nsme) { // ignore } return null; } protected static boolean isInheritedParameters( Constructor cntr, Class[] arguments ) { Class[] params = cntr.getParameterTypes(); if ( arguments == null ) { // Avoid NPEs later by returning immediately return ( params.length == 0 ); } if ( params.length != arguments.length ) { return false; } for (int i = 0; i < params.length; ++i) { // null argument == Object.class == anything if ( arguments[ i ] != null ) { if ( !arguments[ i ].isAssignableFrom( params[ i ] ) ) { return false; } } } // every argument passed. return true; } protected static boolean hasCorrectProtection( Constructor cntr, int protection ) { int modifiers = cntr.getModifiers(); boolean isPublic = Modifier.isPublic( modifiers ); if ( (protection & PUBLIC) != 0 && isPublic ) { return true; } boolean isProtected = Modifier.isProtected( modifiers ); if ( (protection & PROTECTED) != 0 && isProtected ) { return true; } boolean isPrivate = Modifier.isPrivate( modifiers ); if ( (protection & PRIVATE) != 0 && isPrivate ) { return true; } if ( (protection & PACKAGE) != 0 && !isPublic && !isProtected && !isPrivate ) { return true; } return false; } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/IntegrationTestCase.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/IntegrationT0000644000175000017500000003615707777607732034274 0ustar drazzibdrazzib/* * @(#)IntegrationTestCase.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.apache.log4j.Logger; import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.AssertionFailedError; import junit.framework.Assert; import java.util.Hashtable; /** * A TestCase specific for Integration tests. It has the additional * functionality of soft validation through the AssertTestFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/01/09 20:32:26 $ * @since March 28, 2002 */ public class IntegrationTestCase extends SubTestTestCase { private AssertTestFactory atf; /** * Standard JUnit format for test constructors (pre JUnit 3.8). * * @param name the name of the test case. */ public IntegrationTestCase( String name ) { super( name ); this.atf = new AssertTestFactory( getName(), true ); } //------------------------------------------------------------------------- // Soft assert calls /** * Asserts that a condtion is true. If it isn't it throws an * AssertionFailedError. * * @param message text reported during failure. * @param condition must be true or an exception is raised. */ public void softAssertTrue(String message, boolean condition) { addSubTest( this.atf.createAssertTrue( message, condition ) ); } /** * Asserts that a condition is true. If it isn't it throws an * AssertionFailedError. * * @param condition must be true or an exception is raised. */ public void softAssertTrue(boolean condition) { addSubTest( this.atf.createAssertTrue( condition ) ); } /** * Asserts that a condtion is false. If it isn't it throws an * AssertionFailedError. * * @since 03-Nov-2002 * @param message text reported during failure. * @param condition must be false or an exception is raised. */ public void softAssertFalse(String message, boolean condition) { addSubTest( this.atf.createAssertFalse( message, condition ) ); } /** * Asserts that a condition is false. If it isn't it throws an * AssertionFailedError. * * @since 03-Nov-2002 * @param condition must be false or an exception is raised. */ public void softAssertFalse(boolean condition) { addSubTest( this.atf.createAssertFalse( condition ) ); } /** * Fails a test with the given message. * * @param message text reported during failure. */ public void softFail(String message) { addSubTest( this.atf.createFail( message ) ); } /** * Fails a test with no message. */ public void softFail() { addSubTest( this.atf.createFail() ); } /** * Asserts that two objects are equal (.equals()). If they * are not an AssertionFailedError is thrown. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, Object expected, Object actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(Object expected, Object actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @since 03-Nov-2002 * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, String expected, String actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two objects are equal. If they are not an * AssertionFailedError is thrown. * * @since 03-Nov-2002 * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String expected, String actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two doubles are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. * @param delta Description of the Parameter */ public void softAssertEquals(String message, double expected, double actual, double delta) { addSubTest( this.atf.createAssertEquals( message, expected, actual, delta ) ); } /** * Asserts that two doubles are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param expected value expected from the test. * @param actual actual value generated by the test. * @param delta Description of the Parameter */ public void softAssertEquals(double expected, double actual, double delta) { addSubTest( this.atf.createAssertEquals( expected, actual, delta ) ); } /** * Asserts that two floats are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. * @param delta Description of the Parameter */ public void softAssertEquals(String message, float expected, float actual, float delta) { addSubTest( this.atf.createAssertEquals( message, expected, actual, delta ) ); } /** * Asserts that two floats are equal concerning a delta. If the expected * value is infinity then the delta value is ignored. * * @param expected value expected from the test. * @param actual actual value generated by the test. * @param delta Description of the Parameter */ public void softAssertEquals(float expected, float actual, float delta) { addSubTest( this.atf.createAssertEquals( expected, actual, delta ) ); } /** * Asserts that two longs are equal. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, long expected, long actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two longs are equal. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(long expected, long actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two booleans are equal. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, boolean expected, boolean actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two booleans are equal. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(boolean expected, boolean actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two bytes are equal. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, byte expected, byte actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two bytes are equal. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(byte expected, byte actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two chars are equal. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, char expected, char actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two chars are equal. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(char expected, char actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two shorts are equal. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, short expected, short actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two shorts are equal. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(short expected, short actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that two ints are equal. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(String message, int expected, int actual) { addSubTest( this.atf.createAssertEquals( message, expected, actual ) ); } /** * Asserts that two ints are equal. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertEquals(int expected, int actual) { addSubTest( this.atf.createAssertEquals( expected, actual ) ); } /** * Asserts that an object isn't null. * * @param message text reported during failure. * @param object Description of the Parameter */ public void softAssertNotNull(String message, Object object) { addSubTest( this.atf.createAssertNotNull( message, object ) ); } /** * Asserts that an object isn't null. * * @param object Description of the Parameter */ public void softAssertNotNull(Object object) { addSubTest( this.atf.createAssertNotNull( object ) ); } /** * Asserts that an object is null. * * @param message text reported during failure. * @param object Description of the Parameter */ public void softAssertNull(String message, Object object) { addSubTest( this.atf.createAssertNull( message, object ) ); } /** * Asserts that an object is null. * * @param object Description of the Parameter */ public void softAssertNull(Object object) { addSubTest( this.atf.createAssertNull( object ) ); } /** * Asserts that two objects refer to the same object. If they are not an * AssertionFailedError is thrown. * * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertSame(String message, Object expected, Object actual) { addSubTest( this.atf.createAssertSame( message, expected, actual ) ); } /** * Asserts that two objects refer to the same object. If they are not the * same an AssertionFailedError is thrown. * * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertSame(Object expected, Object actual) { addSubTest( this.atf.createAssertSame( expected, actual ) ); } /** * Asserts that two objects refer to the same object. If they are not an * AssertionFailedError is thrown. * * @since 03-Nov-2002 * @param message text reported during failure. * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertNotSame(String message, Object expected, Object actual) { addSubTest( this.atf.createAssertNotSame( message, expected, actual ) ); } /** * Asserts that two objects refer to the same object. If they are not the * same an AssertionFailedError is thrown. * * @since 03-Nov-2002 * @param expected value expected from the test. * @param actual actual value generated by the test. */ public void softAssertNotSame(Object expected, Object actual) { addSubTest( this.atf.createAssertNotSame( expected, actual ) ); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/SubTestTestCase.javalibgroboutils-java-5.orig/testing-junit/sources/dev/net/sourceforge/groboutils/junit/v1/SubTestTestC0000644000175000017500000001475107622026443034174 0ustar drazzibdrazzib/* * @(#)SubTestTestCase.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.apache.log4j.Logger; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestResult; import java.util.Hashtable; import java.util.Vector; import java.util.Enumeration; /** * A TestCase which enables tests to run a subset of tests from an active * test. Examples would include running unit tests associated with an * object returned from a creation method called on the class under test. *

    * Note that added sub-tests should be new Test instances, not the same test. * This is because these sub-tests will run after the registered instance * has tearDown() called on it. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:19 $ * @since July 26, 2002 */ public class SubTestTestCase extends TestCase { private static final Logger LOG = Logger.getLogger( SubTestTestCase.class ); private Hashtable perThreadTestList = new Hashtable(); /** * Creates a new test case with the given name. This allows for JUnit * 3.7 compatibility. */ public SubTestTestCase( String name ) { super( name ); } /** * Default constructor that uses the JUnit 3.8 version of setName() * for setting the test's name. * * @since December 28, 2002 */ public SubTestTestCase() { // do nothing } /** * Allows for execution of the given test instance from inside another * test. This will use the current test's TestResult, or if there * is no current TestResult, it will create a new one for the * test. Note that the list of tests will be run at the end of the current * test, after the tearDown() method has been called. This is for * legacy TestListener support. * * @param test the test object to add as a sub-test. */ public void addSubTest( Test test ) { // Since the vector will be pulled from a hashtable that stores the // vectors on a per thread basis, there is no chance that the same // vector will be requested from two different threads at the same time. // Hence, no need for synchronization. if (test != null) { Thread t = Thread.currentThread(); Vector v = (Vector)this.perThreadTestList.get( t ); if (v != null) { LOG.debug( "Adding test ["+test+"] to test ["+getName()+ "]" ); v.addElement( test ); } else { LOG.warn( "Attemted to add test ["+test+"] to test ["+ getName()+"] without calling the run() method." ); } } else { LOG.warn( "Attempted to add null test to test ["+getName()+"]" ); } } /** * Runs the test case and collects the results in TestResult. */ public void run(TestResult result) { // Note: it is 'bad form' for the test to store the result. It is // also very bad to store the result for the purpose of running the // requested sub-test when asked, as this will cause a recursive- // style event in the result listeners, which some listeners may // not support. Therefore, the tests are loaded into a list, and // executed at the end of the test run. Note that this causes the // added tests to run after the tearDown method. Thread t = Thread.currentThread(); Vector list = (Vector)this.perThreadTestList.get( t ); // shouldn't be re-entrant! // but we'll allow it, however the tests added in this run will // only be executed at the end of the recursive run calls. if (list == null) { this.perThreadTestList.put( t, new Vector() ); } super.run( result ); // if this method is not a reentrant method... if (list == null) { // run all the added tests list = (Vector)this.perThreadTestList.get( t ); if (list != null) { LOG.debug( "run method now executing all added tests (count="+ list.size()+"); current ran test count = "+ result.runCount() ); Enumeration enum = list.elements(); while (enum.hasMoreElements()) { Test test = (Test)enum.nextElement(); LOG.debug( "running test ["+test+"] from test ["+ getName()+"]" ); test.run( result ); LOG.debug( "run over for test ["+test+ "] from test ["+getName()+ "]; current ran test count = "+result.runCount() ); } // now remove the list from the hashtable, for future // reentrancy this.perThreadTestList.remove( t ); } } else { LOG.debug( "run method was re-entered. Ignoring added tests for now." ); } } } libgroboutils-java-5.orig/testing-junit/sources/dev/about.txt0000644000175000017500000000015207521071654024577 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/testing-junit/sources/ut/0000755000175000017500000000000011271425773022602 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ut/net/0000755000175000017500000000000010011472751023355 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/0000755000175000017500000000000010011472751025700 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472751030071 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/0000755000175000017500000000000010011472752031223 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/0000755000175000017500000000000011271425773031563 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/0000755000175000017500000000000011271425773032510 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/ImplFactoryUTestI.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/ImplFact0000644000175000017500000000711507622026447034136 0ustar drazzibdrazzib/* * @(#)ImplFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ImplFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:23 $ */ public class ImplFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ImplFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ImplFactoryUTestI( String name, ImplFactory f ) { super( name, ImplFactory.class, f ); } protected ImplFactory createImplFactory() { return (ImplFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateImplObject1() { ImplFactory implf = createImplFactory(); assertNotNull( "Returned null factory.", implf ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/CxFactorySample.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/CxFactor0000644000175000017500000000400607622026447034144 0ustar drazzibdrazzib/* * @(#)CxFactorySample.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Sample CxFactory used in CxFactoryUTest. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since October 30, 2002 * @version $Date: 2003/02/10 22:52:23 $ */ public class CxFactorySample extends CxFactory { public CxFactorySample( String s ) { super( s ); } public CxFactorySample( String s, boolean b ) { super( s, b ); } public Object createImplObject() { return ""; } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/ICxFactoryUTestI.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/ICxFacto0000644000175000017500000000725507622026447034104 0ustar drazzibdrazzib/* * @(#)ICxFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ICxFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since October 30, 2002 * @version $Date: 2003/02/10 22:52:23 $ */ public class ICxFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ICxFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ICxFactoryUTestI( String name, ImplFactory f ) { super( name, ICxFactory.class, f ); } protected ICxFactory createICxFactory() { return (ICxFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests // there is no real way to test the clean-up facility from here. public void testCreateICxObject1() { ICxFactory implf = createICxFactory(); assertNotNull( "Returned null factory.", implf ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = ImplFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/InterfaceTestSuiteUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/Interfac0000644000175000017500000002614707622026447034200 0ustar drazzibdrazzib/* * @(#)InterfaceTestSuiteUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.Enumeration; /** * Tests the InterfaceTestSuite class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:23 $ */ public class InterfaceTestSuiteUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = InterfaceTestSuiteUTest.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public InterfaceTestSuiteUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new InterfaceTestSuite(); } public void testConstructor2() { try { new InterfaceTestSuite( (Class)null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testConstructor3() { new InterfaceTestSuite( this.getClass() ); } public void testConstructor4() { try { new InterfaceTestSuite( (Class)null, (ImplFactory)null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public class ObjectFactory implements ImplFactory { public Object createImplObject() { return new Object(); } } public class NullFactory implements ImplFactory { public Object createImplObject() { return null; } } public class IAEFactory implements ImplFactory { public Object createImplObject() { return new IllegalArgumentException(); } } public void testConstructor5() { try { new InterfaceTestSuite( (Class)null, new ObjectFactory() ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testConstructor6() { try { new InterfaceTestSuite( this.getClass(), null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testConstructor7() { new InterfaceTestSuite( this.getClass(), new ObjectFactory() ); } public void testAddFactory1() { InterfaceTestSuite its = new InterfaceTestSuite(); try { its.addFactory( null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testAddFactory2() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addFactory( new ObjectFactory() ); assertEquals( "Not right number of factories.", 1, its.creators.size() ); } public void testAddFactories1() { InterfaceTestSuite its = new InterfaceTestSuite(); try { its.addFactories( null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testAddFactories2() { InterfaceTestSuite its = new InterfaceTestSuite(); try { its.addFactories( new ImplFactory[1] ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testAddFactories3() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addFactories( new ImplFactory[0] ); assertEquals( "Not right number of factories.", 0, its.creators.size() ); } public void testAddFactories4() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addFactories( new ImplFactory[] { new ObjectFactory(), new ObjectFactory() } ); assertEquals( "Not right number of factories.", 2, its.creators.size() ); } public void testAddTests1() { InterfaceTestSuite its = new InterfaceTestSuite(); try { its.addTests( null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception? } } public void testAddTests2() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addTests( new Test[0] ); } public void testAddTests3() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addTests( new Test[1] ); } public void testAddTests4() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addTests( new Test[] { new TestCase( "" ) {}, new TestCase( "" ) {} } ); } public void testAddTestSuite1() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addTestSuite( getClass() ); } public void testTestAt1() { InterfaceTestSuite its = new InterfaceTestSuite(); its.addTestSuite( getClass() ); its.testAt( 0 ); } public void testTestCount1() { InterfaceTestSuite its = new InterfaceTestSuite(); its.testCount(); } public void testTests1() { InterfaceTestSuite its = new InterfaceTestSuite(); its.tests(); } public static interface Intfc1 {} public static interface Intfc2 extends Intfc1 {} public static class Infc1TestCase extends InterfaceTestCase { public Infc1TestCase( String name, ImplFactory f ) { super( name, Intfc1.class, f ); } public void test1() {} public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( Infc1TestCase.class ); return suite; } } public static class Infc2TestCase extends InterfaceTestCase { public Infc2TestCase( String name, ImplFactory f ) { super( name, Intfc1.class, f ); } public void test2() {} public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( Infc2TestCase.class ); suite.addInterfaceTestSuite( Infc1TestCase.suite() ); return suite; } } public void testAddInnerITS() { InterfaceTestSuite its = Infc2TestCase.suite(); Enumeration enum = its.tests(); assertNotNull( "Must not return null", enum ); assertTrue( "Must have at least 1 test.", enum.hasMoreElements() ); assertNotNull( "Must have non-null first test.", enum.nextElement() ); assertTrue( "Must have 2 tests.", enum.hasMoreElements() ); assertNotNull( "Must have non-null second test.", enum.nextElement() ); assertTrue( "Must have exactly 2 tests.", !enum.hasMoreElements() ); } public static class JUnit3_8TestCase extends TestCase { public void test1() {} } public void testJUnit3_8Compat() { InterfaceTestSuite its = new InterfaceTestSuite( JUnit3_8TestCase.class ); Enumeration enum = its.tests(); assertNotNull( "Must not return null", enum ); assertTrue( "Must have at least 1 test.", enum.hasMoreElements() ); assertNotNull( "Must have non-null first test.", enum.nextElement() ); assertTrue( "Must have exactly 1 test.", !enum.hasMoreElements() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/CxFactoryUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/CxFactor0000644000175000017500000002127107665402660034151 0ustar drazzibdrazzib/* * @(#)CxFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the CxFactory class. Concrete test for an abstract class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since October 30, 2002 * @version $Date: 2003/05/29 13:05:52 $ */ public class CxFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CxFactoryUTest.class; private static final String TC = "CxFactoryUTest"; private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( THIS_CLASS ); public CxFactoryUTest( String name ) { super( name ); } // intentionally non-static inner class public class MyCxFactory extends CxFactory { public MyCxFactory( String n ) { super( n ); } public MyCxFactory( String n, boolean a ) { super( n, a ); } public Object createImplObject() { return ""; } } // intentionally static inner class public static class MyStaticCxFactory extends CxFactory { public MyStaticCxFactory( String n ) { super( n ); } public MyStaticCxFactory( String n, boolean a ) { super( n, a ); } public Object createImplObject() { return ""; } } //------------------------------------------------------------------------- // Tests public void testToString1() { // try with a named inner class. CxFactory cf = new MyCxFactory( "1" ); assertEquals( "Returned unexpected factory name.", "1", cf.toString() ); } public void testToString1b() { // try with a named inner class. CxFactory cf = new MyCxFactory( "1b", false ); assertEquals( "Returned unexpected factory name.", "1b", cf.toString() ); } public void testToString1a() { // try with a named inner class. CxFactory cf = new MyCxFactory( "1a", true ); assertEquals( "Returned unexpected factory name.", TC+"-1a", cf.toString() ); } public void testToString2() { // try with an anonymous inner class. // CxFactory should use the name of the owning class's name, // not the inner class's name. CxFactory cf = new MyCxFactory( "2" ) { }; assertEquals( "Returned unexpected factory name.", "2", cf.toString() ); } public void testToString2b() { // try with an anonymous inner class. // CxFactory should use the name of the owning class's name, // not the inner class's name. CxFactory cf = new MyCxFactory( "2b", false ) { }; assertEquals( "Returned unexpected factory name.", "2b", cf.toString() ); } public void testToString2a() { // try with an anonymous inner class. // CxFactory should use the name of the owning class's name, // not the inner class's name. CxFactory cf = new MyCxFactory( "2a", true ) { }; assertEquals( "Returned unexpected factory name.", TC+"-2a", cf.toString() ); } public void testToString3() { // try with a static inner class. // CxFactory should use the name of the owning class's name, // not the inner class's name. CxFactory cf = new MyStaticCxFactory( "3" ) { }; assertEquals( "Returned unexpected factory name.", "3", cf.toString() ); } public void testToString3b() { // try with a static inner class. // CxFactory should use the name of the owning class's name, // not the inner class's name. CxFactory cf = new MyStaticCxFactory( "3b", false ) { }; assertEquals( "Returned unexpected factory name.", "3b", cf.toString() ); } public void testToString3a() { // try with a static inner class. // CxFactory should use the name of the owning class's name, // not the inner class's name. CxFactory cf = new MyStaticCxFactory( "3a", true ) { }; assertEquals( "Returned unexpected factory name.", TC+"-3a", cf.toString() ); } public void testToString4() { // try with an outside, stand-alone class. LOG.debug( "Test4:" ); CxFactory cf = new CxFactorySample( "4" ); LOG.debug( "Returned Sample factory toString: ["+cf.toString()+"]" ); assertEquals( "Returned unexpected factory name.", "4", cf.toString() ); } public void testToString4b() { // try with an outside, stand-alone class. LOG.debug( "Test4:" ); CxFactory cf = new CxFactorySample( "4b", false ); LOG.debug( "Returned Sample factory toString: ["+cf.toString()+"]" ); assertEquals( "Returned unexpected factory name.", "4b", cf.toString() ); } public void testToString4a() { // try with an outside, stand-alone class. LOG.debug( "Test4:" ); CxFactory cf = new CxFactorySample( "4a", true ); LOG.debug( "Returned Sample factory toString: ["+cf.toString()+"]" ); assertEquals( "Returned unexpected factory name.", "CxFactorySample-4a", cf.toString() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = ImplFactoryUTestI.suite(); // yes, this is an inner class inside an inner class! // shudder - luckily, this is only for testing. suite.addFactory( new ImplFactory() { public Object createImplObject() { return new MyStaticCxFactory( "A-B" ); } public String toString() { return "CxFactory-A"; } } ); suite.addTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/InterfaceTestCaseUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/iftc/Interfac0000644000175000017500000003154107665402662034176 0ustar drazzibdrazzib/* * @(#)InterfaceTestCaseUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.AssertionFailedError; /** * Tests the InterfaceTestCase class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/05/29 13:05:54 $ */ public class InterfaceTestCaseUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = InterfaceTestCaseUTest.class; private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( InterfaceTestCaseUTest.class ); public InterfaceTestCaseUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyInterfaceTestCase extends InterfaceTestCase { public MyInterfaceTestCase( String name, Class interfaceClass, ImplFactory f ) { super( name, interfaceClass, f ); } } public void testConstructor1() { LOG.debug( "Entering testConstructor1" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return new Runnable() { public void run() {} }; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", Runnable.class, f ); assertEquals( "Did not store the interface class correctly.", Runnable.class, itc.getInterfaceClass() ); LOG.debug( "Leaving testConstructor1" ); } public void testConstructor2() { LOG.debug( "Entering testConstructor2" ); try { new MyInterfaceTestCase( "test", null, null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } LOG.debug( "Leaving testConstructor2" ); } public void testConstructor3() { LOG.debug( "Entering testConstructor3" ); try { new MyInterfaceTestCase( "test", Runnable.class, null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } LOG.debug( "Leaving testConstructor3" ); } public void testConstructor4() { LOG.debug( "Entering testConstructor4" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return new Runnable() { public void run() {} }; } }; try { new MyInterfaceTestCase( "test", null, f ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } LOG.debug( "Leaving testConstructor4" ); } public void testCreate1() { LOG.debug( "Entering testCreate1" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return "a string"; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", Runnable.class, f ); try { itc.createImplObject(); fail("Did not fail."); } catch (AssertionFailedError e) { // test error? } LOG.debug( "Leaving testCreate1" ); } public void testCreate2() { LOG.debug( "Entering testCreate2" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return null; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", Runnable.class, f ); try { itc.createImplObject(); fail("Did not fail."); } catch (AssertionFailedError e) { // test error? } LOG.debug( "Leaving testCreate2" ); } public void testCreate3() { LOG.debug( "Entering testCreate3" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { throw new IllegalArgumentException("IAE"); } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", Runnable.class, f ); try { itc.createImplObject(); fail("Did not throw exception."); } catch (AssertionFailedError e) { // test error assertTrue( "Does not contain the correct exception text.", e.getMessage().indexOf( " threw exception "+ "java.lang.IllegalArgumentException: IAE during "+ "creation:" ) > 0 ); } } final String teststring = "a string"; public void testCreate4() { LOG.debug( "Entering testCreate4" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return teststring; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", String.class, f ); Object o = itc.createImplObject(); assertSame( "Did not return the exact object we thought we returned.", teststring, o ); } final static String factoryname = "TestFactoryName"; public void testToString1() { LOG.debug( "Entering testToString1" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return ""; } public String toString() { return factoryname; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", String.class, f ); itc.setUseClassInName( false ); assertEquals( "Did not return the correct text.", "test["+factoryname+"]("+itc.getClass().getName()+")", itc.toString() ); } public void testGetName1() { LOG.debug( "Entering testGetName1" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return ""; } public String toString() { return factoryname; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", String.class, f ); itc.setUseClassInName( false ); assertEquals( "Did not return the correct text.", "test["+factoryname+"]", itc.getName() ); } public void testGetName2() { LOG.debug( "Entering testGetName1" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return ""; } public String toString() { return factoryname; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", String.class, f ); itc.setUseClassInName( true ); assertEquals( "Did not return the correct text.", "InterfaceTestCaseUTest$MyInterfaceTestCase.test["+factoryname+"]", itc.getName() ); } public void testName1() { LOG.debug( "Entering testName1" ); ImplFactory f = new ImplFactory() { public Object createImplObject() { return ""; } public String toString() { return factoryname; } }; InterfaceTestCase itc = new MyInterfaceTestCase( "test", String.class, f ); itc.setUseClassInName( false ); assertEquals( "Did not return the correct text.", itc.getName(), itc.name() ); } //--------- private static class MyCxFactory implements ICxFactory { public int createCount = 0; public int tearDownCount = 0; public Object createImplObject() { ++this.createCount; return new Integer( this.createCount ); } public void tearDown( Object o ) { int i = ((Integer)o).intValue(); assertEquals( "Did not tear down in the right order.", createCount - tearDownCount, i ); ++tearDownCount; } } public void testTearDown1() throws Exception { LOG.debug( "Entering testTearDown1()" ); MyCxFactory f = new MyCxFactory(); InterfaceTestCase itc = new MyInterfaceTestCase( "test", Integer.class, f ); int instantCount = 100; for (int i = 0; i < instantCount; ++i) { itc.createImplObject(); } itc.tearDown(); assertEquals( "Did not tear down all expected instantiated objects.", instantCount, f.tearDownCount ); } //--------- private static class MyCxFactory2 implements ICxFactory { public Object createImplObject() { return new Integer( 0 ); } public void tearDown( Object o ) throws Exception { throw new IllegalStateException(); } } public void testTearDown2() throws Exception { LOG.debug( "Entering testTearDown2()" ); MyCxFactory2 f = new MyCxFactory2(); InterfaceTestCase itc = new MyInterfaceTestCase( "test", Integer.class, f ); int instantCount = 100; for (int i = 0; i < instantCount; ++i) { itc.createImplObject(); } try { itc.tearDown(); fail( "tearDown did not propigate any exceptions to the top." ); } catch (AssertionFailedError ex) { String s = ex.toString(); int count = -1; int pos = 0; while (pos >= 0) { ++count; pos = s.indexOf( IllegalStateException.class.getName(), pos+1 ); } assertEquals( "Did not catch or report all exceptions.", instantCount, count ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/AssertConstructorUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/AssertConstru0000644000175000017500000001462707622026446034336 0ustar drazzibdrazzib/* * @(#)AssertConstructorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.AssertionFailedError; /** * Tests the AssertConstructor class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:22 $ */ public class AssertConstructorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AssertConstructorUTest.class; public AssertConstructorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testAssertHasDefaultConstructor1() { AssertConstructor.assertHasDefaultConstructor( Object.class ); } public void testAssertHasDefaultConstructor2() { boolean failed = true; try { AssertConstructor.assertHasDefaultConstructor( Integer.class ); } catch (AssertionFailedError e) { failed = false; } if (failed) { fail( "Did not cause an assertion failure." ); } } public void testAssertHasDefaultConstructor3() { AssertConstructor.assertHasDefaultConstructor( new Object() ); } public void testAssertHasDefaultConstructor4() { boolean failed = true; try { AssertConstructor.assertHasDefaultConstructor( new Integer( 1 ) ); } catch (AssertionFailedError e) { failed = false; } if (failed) { fail( "Did not cause an assertion failure." ); } } public void testAssertHasDefaultConstructor1a() { AssertConstructor.assertHasDefaultConstructor( "A", Object.class ); } public void testAssertHasDefaultConstructor2a() { boolean failed = true; try { AssertConstructor.assertHasDefaultConstructor( ":A:", Integer.class ); } catch (AssertionFailedError e) { assertTrue( "Did not throw an error with the message text.", e.getMessage().indexOf( ":A:" ) >= 0 ); failed = false; } if (failed) { fail( "Did not cause an assertion failure." ); } } public void testAssertHasDefaultConstructor3a() { AssertConstructor.assertHasDefaultConstructor( "A", new Object() ); } public void testAssertHasDefaultConstructor4a() { boolean failed = true; try { AssertConstructor.assertHasDefaultConstructor( ":A:", new Integer( 1 ) ); } catch (AssertionFailedError e) { assertTrue( "Did not throw an error with the message text.", e.getMessage().indexOf( ":A:" ) >= 0 ); failed = false; } if (failed) { fail( "Did not cause an assertion failure." ); } } public void testAssertHasConstructor1() { AssertConstructor.assertHasConstructor( Object.class, new Class[0], AssertConstructor.ANY_PROTECTION ); } public void testAssertHasConstructor2() { boolean failed = true; try { AssertConstructor.assertHasConstructor( Object.class, new Class[0], AssertConstructor.PRIVATE ); } catch (AssertionFailedError e) { failed = false; } if (failed) { fail( "Did not cause an assertion failure." ); } } public void testAssertHasConstructor3() { AssertConstructor.assertHasConstructor( Integer.class, new Class[] { Integer.TYPE }, AssertConstructor.PUBLIC ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/AssertTestFactoryUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/AssertTestFac0000644000175000017500000007355707777607732034257 0ustar drazzibdrazzib/* * @(#)AssertTestFactoryUTest.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import java.util.Enumeration; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestResult; import junit.framework.TestFailure; import junit.framework.AssertionFailedError; import junit.framework.Assert; /** * Tests the AssertTestFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 26, 2002 * @version $Date: 2004/01/09 20:32:26 $ */ public class AssertTestFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AssertTestFactoryUTest.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AssertTestFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AssertTestFactory( null ); } public void testConstructor2() { new AssertTestFactory( "help" ); } public void testSetName1() { AssertTestFactory atf = new AssertTestFactory(); assertNull( "Factory did not return a null name.", atf.getName() ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertNull( "InnerTest did not have name be set to null.", it.getName() ); } public void testSetName2() { AssertTestFactory atf = new AssertTestFactory( "a" ); assertEquals( "Factory did not return correct name.", "a", atf.getName() ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "a", it.getName() ); } public void testSetName3() { AssertTestFactory atf = new AssertTestFactory(); atf.setName( "b" ); assertEquals( "Factory did not return correct name.", "b", atf.getName() ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "b", it.getName() ); } public void testSetName4() { AssertTestFactory atf = new AssertTestFactory( "0" ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "0", it.getName() ); atf.setName( "c" ); assertEquals( "Factory did not return correct name.", "c", atf.getName() ); it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "c", it.getName() ); } // ---------- public void testNameIndex1() { AssertTestFactory atf = new AssertTestFactory( "aa", false ); assertEquals( "Factory did not return correct name.", "aa", atf.getName() ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "aa", it.getName() ); } public void testNameIndex2() { AssertTestFactory atf = new AssertTestFactory( "bb", true ); assertEquals( "Factory did not return correct name.", "bb", atf.getName() ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "bb1", it.getName() ); it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "bb2", it.getName() ); atf.setName( "cc" ); assertEquals( "Factory did not return correct name.", "cc", atf.getName() ); it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "cc3", it.getName() ); } public void testNameIndex3() { AssertTestFactory atf = new AssertTestFactory( "ca", false ); assertFalse( "Did not set the use-index value to false.", atf.getUseIndexWithName() ); AssertTestFactory.InnerTest it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name set correctly.", "ca", it.getName() ); atf.setUseIndexWithName( true ); assertTrue( "Did not set the use-index value to true.", atf.getUseIndexWithName() ); it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "ca1", it.getName() ); atf.setUseIndexWithName( false ); assertFalse( "Did not set the use-index value to false.", atf.getUseIndexWithName() ); it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "ca", it.getName() ); atf.setUseIndexWithName( true ); assertTrue( "Did not set the use-index value to true.", atf.getUseIndexWithName() ); it = atf.createAssertTrue( true ); assertEquals( "InnerTest did not have name be set correctly.", "ca2", it.getName() ); } // ---------- public void testCreateAssertTrue1() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertTrue( "message", true ) ); } public void testCreateAssertTrue2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertTrue( "message", false ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertTrue( "message", false ), assertError ); } public void testCreateAssertTrue3() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertTrue( true ) ); } public void testCreateAssertTrue4() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertTrue( false ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertTrue( false ), assertError ); } // ---------- public void testSoftFail1() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.fail( "message" ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createFail( "message" ), assertError ); } public void testSoftFail2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.fail(); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createFail(), assertError ); } // ---------- public void testCreateAssertEquals1() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", "a", "a" ) ); } public void testCreateAssertEquals2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", "a", "b" ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", "a", "b" ), assertError ); } public void testCreateAssertEquals3() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "a", "a" ) ); } public void testCreateAssertEquals4() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "a", "b" ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "a", "b" ), assertError ); } // ---------- public void testCreateAssertEquals5() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", 0.0, 0.1, 0.2 ) ); } public void testCreateAssertEquals6() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", 0.0, 0.2, 0.1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", 0.0, 0.2, 0.1 ), assertError ); } public void testCreateAssertEquals7() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( 0.0, 0.1, 0.2 ) ); } public void testCreateAssertEquals8() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( 0.0, 0.2, 0.1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( 0.0, 0.2, 0.1 ), assertError ); } // ---------- public void testCreateAssertEquals9() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", 0.0f, 0.1f, 0.2f ) ); } public void testCreateAssertEquals10() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", 0.0f, 0.2f, 0.1f ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", 0.0f, 0.2f, 0.1f ), assertError ); } public void testCreateAssertEquals11() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( 0.0f, 0.1f, 0.2f ) ); } public void testCreateAssertEquals12() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( 0.0f, 0.2f, 0.1f ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( 0.0f, 0.2f, 0.1f ), assertError ); } // ---------- public void testCreateAssertEquals13() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", 0L, 0L ) ); } public void testCreateAssertEquals14() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", 0L, 1L ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", 0L, 1L ), assertError ); } public void testCreateAssertEquals15() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( 0L, 0L ) ); } public void testCreateAssertEquals16() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( 0L, 1L ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( 0L, 1L ), assertError ); } // ---------- public void testCreateAssertEquals17() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", true, true ) ); } public void testCreateAssertEquals18() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", true, false ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", true, false ), assertError ); } public void testCreateAssertEquals19() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( false, false ) ); } public void testCreateAssertEquals20() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( false, true ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( false, true ), assertError ); } // ---------- public void testCreateAssertEquals21() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", (byte)0, (byte)0 ) ); } public void testCreateAssertEquals22() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", (byte)0, (byte)1 ); } catch (AssertionFailedError e) { assertError = e; } ; assertIsFailure( atf.createAssertEquals( "message", (byte)0, (byte)1 ), assertError ); } public void testCreateAssertEquals23() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( (byte)0, (byte)0 ) ); } public void testCreateAssertEquals24() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( (byte)0, (byte)1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( (byte)0, (byte)1 ), assertError ); } // ---------- public void testCreateAssertEquals25() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", 'a', 'a' ) ); } public void testCreateAssertEquals26() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", 'a', 'b' ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", 'a', 'b' ), assertError ); } public void testCreateAssertEquals27() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( 'a', 'a' ) ); } public void testCreateAssertEquals28() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( 'a', 'b' ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( 'a', 'b' ), assertError ); } // ---------- public void testCreateAssertEquals29() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", (short)0, (short)0 ) ); } public void testCreateAssertEquals30() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", (short)0, (short)1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", (short)0, (short)1 ), assertError ); } public void testCreateAssertEquals31() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( (short)0, (short)0 ) ); } public void testCreateAssertEquals32() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( (short)0, (short)1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( (short)0, (short)1 ), assertError ); } // ---------- public void testCreateAssertEquals33() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( "message", 0, 0 ) ); } public void testCreateAssertEquals34() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( "message", 0, 1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( "message", 0, 1 ), assertError ); } public void testCreateAssertEquals35() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertEquals( 0, 0 ) ); } public void testCreateAssertEquals36() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertEquals( 0, 1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertEquals( 0, 1 ), assertError ); } // ---------- public void testCreateAssertNotNull1() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertNotNull( "message", "a" ) ); } public void testCreateAssertNotNull2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertNotNull( "message", null ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertNotNull( "message", null ), assertError ); } public void testCreateAssertNotNull3() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertNotNull( "a" ) ); } public void testCreateAssertNotNull4() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertNotNull( null ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertNotNull( null ), assertError ); } // ---------- public void testCreateAssertNull1() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertNull( "message", null ) ); } public void testCreateAssertNull2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertNull( "message", "a" ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertNull( "message", "a" ), assertError ); } public void testCreateAssertNull3() { AssertTestFactory atf = createAssertTestFactory(); assertCleanResult( atf.createAssertNull( null ) ); } public void testCreateAssertNull4() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; try { Assert.assertNull( "a" ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertNull( "a" ), assertError ); } // ---------- public void testCreateAssertSame1() { AssertTestFactory atf = createAssertTestFactory(); Object a1 = new Object(); Object a2 = new Object(); assertCleanResult( atf.createAssertSame( "message", a1, a1 ) ); } public void testCreateAssertSame2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; Object a1 = new Object(); Object a2 = new Object(); try { Assert.assertSame( "message", a1, a2 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertSame( "message", a1, a2 ), assertError ); } public void testCreateAssertSame3() { AssertTestFactory atf = createAssertTestFactory(); Object a1 = new Object(); Object a2 = new Object(); assertCleanResult( atf.createAssertSame( a1, a1 ) ); } public void testCreateAssertSame4() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; Object a1 = new Object(); Object a2 = new Object(); try { Assert.assertSame( a1, a2 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertSame( a1, a2 ), assertError ); } // ---------- public void testCreateAssertNotSame1() { AssertTestFactory atf = createAssertTestFactory(); Object a1 = new Object(); Object a2 = new Object(); assertCleanResult( atf.createAssertNotSame( "message", a1, a2 ) ); } public void testCreateAssertNotSame2() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; Object a1 = new Object(); Object a2 = new Object(); try { Assert.assertNotSame( "message", a1, a1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertNotSame( "message", a1, a1 ), assertError ); } public void testCreateAssertNotSame3() { AssertTestFactory atf = createAssertTestFactory(); Object a1 = new Object(); Object a2 = new Object(); assertCleanResult( atf.createAssertNotSame( a1, a2 ) ); } public void testCreateAssertNotSame4() { AssertTestFactory atf = createAssertTestFactory(); AssertionFailedError assertError = null; Object a1 = new Object(); Object a2 = new Object(); try { Assert.assertNotSame( a1, a1 ); } catch (AssertionFailedError e) { assertError = e; } assertIsFailure( atf.createAssertNotSame( a1, a1 ), assertError ); } //------------------------------------------------------------------------- // Helpers protected TestResult createTestResult( Test t ) { TestResult tr = new TestResult(); t.run( tr ); return tr; } protected AssertTestFactory createAssertTestFactory() { return new AssertTestFactory( "name" ); } protected void assertIsFailure( Test t, AssertionFailedError orig ) { TestResult tr = createTestResult( t ); AssertionFailedError softError = getFailure( tr ); String origMsg = orig.getMessage(); String newMsg = softError.getMessage(); if (origMsg == null) { assertTrue( "From null message to named message ('"+newMsg+ "') didn't work right.", newMsg != null && ( newMsg.equals( "name: null" ) || newMsg.equals( "name: " ) ) ); return; } if (origMsg.equals( newMsg )) { return; } if (origMsg.startsWith( "<" )) { origMsg = origMsg.substring( 1 ); } if (newMsg.endsWith( origMsg )) { return; } fail( "Assert message ('"+orig.getMessage()+ "') doesn't look like soft message ('"+softError.getMessage()+ "')." ); } protected AssertionFailedError getFailure( TestResult tr ) { Enumeration enum = tr.failures(); assertNotNull( "Failure list is null", enum ); assertTrue( "Does not contain failures.", enum.hasMoreElements() ); TestFailure tf = (TestFailure)enum.nextElement(); AssertionFailedError afe = (AssertionFailedError)tf.thrownException(); assertTrue( "Has more than one failure.", !enum.hasMoreElements() ); assertNotNull( "Has null failure.", afe ); return afe; } protected void assertCleanResult( Test t ) { TestResult tr = createTestResult( t ); assertEquals( "Has errors.", 0, tr.errorCount() ); assertEquals( "Has failures.", 0, tr.failureCount() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/SubTestTestCaseUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/SubTestTestCa0000644000175000017500000001762507622026447034216 0ustar drazzibdrazzib/* * @(#)SubTestTestCaseUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestResult; import junit.framework.AssertionFailedError; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the SubTestTestCase class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 26, 2002 * @version $Date: 2003/02/10 22:52:23 $ */ public class SubTestTestCaseUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = SubTestTestCaseUTest.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public SubTestTestCaseUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyTestCase1 extends TestCase { public MyTestCase1( String name ) { super( name ); } public void testFail() { fail("this should fail."); } public static Test suite() { return new TestSuite( MyTestCase1.class ); } } public static class MyTestCase2 extends SubTestTestCase { public MyTestCase2( String name ) { super( name ); } public void testFailTwice() { addSubTest( MyTestCase1.suite() ); fail( "this should fail too." ); } public static Test suite() { return new TestSuite( MyTestCase2.class ); } } public static class MyTestCase3 extends SubTestTestCase { boolean enteredOnce = false; long createdTime = System.currentTimeMillis(); public MyTestCase3( String name ) { super( name ); } public void testReentryTwice() { try { System.out.println("Entering Created Time="+createdTime); if (!this.enteredOnce) { this.enteredOnce = true; System.out.println("Running again Created Time="+createdTime); run( new TestResult() ); System.out.println("Back from Created Time="+createdTime); } addSubTest( MyTestCase1.suite() ); System.out.println("Leaving Created Time="+createdTime); } catch (RuntimeException re) { re.printStackTrace(); throw re; } catch (Error e) { e.printStackTrace(); throw e; } } public static Test suite() { return new TestSuite( MyTestCase3.class ); } } public void testSameResult1() { // ensure the same TestResult object is used for both test instances. try { Test t = MyTestCase2.suite(); TestResult tr = new TestResult(); t.run( tr ); assertEquals( "Should have 2 failures now.", 2, tr.failureCount() ); assertEquals( "Should have no errors now.", 0, tr.errorCount() ); assertEquals( "Should have 2 tests now.", 2, tr.runCount() ); } catch (RuntimeException re) { re.printStackTrace(); throw re; } catch (Error e) { e.printStackTrace(); throw e; } } public void testReentry1() { try { // ensure the same TestResult object is used for both test instances. Test t = MyTestCase3.suite(); TestResult tr = new TestResult(); // this should: // 1. execute the testReentryTwice() method w/ tr // 2. execute the testReentryTwice() method w/ a new TestResult // 3. add a new fail test // 4. return from testReentryTwice() w/ a new TestResult // 5. add a new fail test // 6. execute 2 fail tests. // for a total of 2 fail tests and 1 testReentryTwice() for tr. t.run( tr ); assertEquals( "Should have 2 failures.", 2, tr.failureCount() ); assertEquals( "Should have no errors now.", 0, tr.errorCount() ); assertEquals( "Should have 3 tests now.", 3, tr.runCount() ); } catch (RuntimeException re) { re.printStackTrace(); throw re; } catch (Error e) { e.printStackTrace(); throw e; } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { try { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } catch (RuntimeException re) { re.printStackTrace(); throw re; } catch (Error e) { e.printStackTrace(); throw e; } } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/SysPropertiesUtilUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/SysProperties0000644000175000017500000002014407622026447034342 0ustar drazzibdrazzib/* * @(#)SysPropertiesUtilUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.Properties; import java.util.Enumeration; /** * Tests the TestRunnable class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:23 $ */ public class SysPropertiesUtilUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = SysPropertiesUtilUTest.class; public SysPropertiesUtilUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new SysPropertiesUtil(); } public void testSetValue1() { String uk = getUniqueKey(); spu.setValue( uk, "b" ); assertEquals( "Did not set unique value correctly.", "b", getValue( uk ) ); } public void testSetValue2() { try { spu.setValue( null, "a" ); fail( "Did not throw IllegalArgumentException for null value." ); } catch (IllegalArgumentException ex) { // test exception } } public void testSetValue3() { String uk = getUniqueKey(); spu.setValue( uk, null ); assertNull( "Did not set/do nothing with unique value.", getValue( uk ) ); } public void testSetValue4() { String ek = getExistingKey(); String val = getValue( ek ); assertNotNull( "The existing value in the set should NOT be null!", val ); String newVal = val + "-not real"; spu.setValue( ek, newVal ); assertEquals( "Did not set existing value correctly.", newVal, getValue( ek ) ); } public void testSetValue5() { String ek = getExistingKey(); spu.setValue( ek, null ); assertNull( "Did not remove key with existing value.", getValue( ek ) ); } public void testReset1() { String ek = getExistingKey(); String val = getValue( ek ); assertNotNull( "The existing value in the set should NOT be null!", val ); String newVal = val + "-not real"; spu.setValue( ek, newVal ); spu.reset(); assertEquals( "The existing value did not get reset.", val, getValue( ek ) ); } public void testReset2() { String ek = getExistingKey(); String val = getValue( ek ); assertNotNull( "The existing value in the set should NOT be null!", val ); spu.setValue( ek, null ); spu.reset(); assertEquals( "The existing value did not get reset.", val, getValue( ek ) ); } public void testReset3() { String uk = getUniqueKey(); String origVal = getValue( uk ); assertNull( "The unique key was not null, but '"+origVal+"'.", origVal ); spu.setValue( uk, "a" ); spu.reset(); String val = getValue( uk ); assertNull( "The unique key did not get reset to null, but was set to '"+ val+"'.", val ); } public void testReset4() { String ek = getExistingKey(); String val = getValue( ek ); String newVal = val + "-not real"; spu.setValue( ek, newVal ); spu.reset(); spu.setValue( ek, null ); spu.reset(); assertEquals( "The existing value did not get reset.", val, getValue( ek ) ); } public void testReset5() { String ek = getExistingKey(); String val = getValue( ek ); String newVal = val + "-not real"; spu.setValue( ek, newVal ); spu.reset(); spu.setValue( ek, newVal+"1" ); spu.reset(); assertEquals( "The existing key did not get reset.", val, getValue( ek ) ); } public void testReset6() { String uk = getUniqueKey(); spu.setValue( uk, "a" ); spu.reset(); spu.setValue( uk, "b" ); spu.reset(); assertNull( "The unique key did not get reset.", getValue( uk ) ); } public void testReset7() { spu.reset(); } //------------------------------------------------------------------------- // Helpers private String getValue( String key ) { return System.getProperty( key ); } private String getUniqueKey() { Enumeration enum = System.getProperties().keys(); String key = ""; if (enum.hasMoreElements()) { key = (String)enum.nextElement(); } int count = 0; String uk = key; while (getValue( uk ) != null) { ++count; uk = key + count; } return uk; } private String getExistingKey() { Enumeration enum = System.getProperties().keys(); if (enum.hasMoreElements()) { return (String)enum.nextElement(); } fail( "There are no existing system keys. Your JVM is wack." ); // never reachable throw new IllegalStateException( "Not reachable." ); } private SysPropertiesUtil spu; //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.spu = new SysPropertiesUtil(); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down this.spu.reset(); super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/IntegrationTestCaseUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/IntegrationTe0000644000175000017500000005520107777607732034302 0ustar drazzibdrazzib/* * @(#)IntegrationTestCaseUTest.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestResult; import junit.framework.TestFailure; import java.util.Enumeration; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the IntegrationTestCase class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2004/01/09 20:32:26 $ */ public class IntegrationTestCaseUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IntegrationTestCaseUTest.class; private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( THIS_CLASS ); public IntegrationTestCaseUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests private static final String MSG = "#$%-=!"; public void testSoftAssert1() { IntegrationTestCase itc = createIntegrationTestCase(); // ensure that adding a failing test doesn't cause failures in the // owning test. itc.softFail(); } public void testSoftAssert2() { IntegrationTestCase itc = createIntegrationTestCase(); // ensure that adding a passing test doesn't cause failures in owning // test. itc.softAssertTrue( true ); } //--------- public static class ITC_True1 extends IntegrationTestCase { public ITC_True1( String name ) { super( name ); } public void test1() { softAssertTrue( true ); } } public void testSoftAssertTrue1() { // Ensure that two tests run, and there is one failure. runITC( ITC_True1.class, 2, 0, 0, false ); } //--------- public static class ITC_True2 extends IntegrationTestCase { public ITC_True2( String name ) { super( name ); } public void test1() { softAssertTrue( MSG, true ); } } public void testSoftAssertTrue2() { // Ensure that two tests run, and there is one failure. runITC( ITC_True2.class, 2, 0, 0, true ); } //--------- public static class ITC_True3 extends IntegrationTestCase { public ITC_True3( String name ) { super( name ); } public void test1() { softAssertTrue( false ); } } public void testSoftAssertTrue3() { // Ensure that two tests run, and there is one failure. runITC( ITC_True3.class, 2, 1, 0, false ); } //--------- public static class ITC_True4 extends IntegrationTestCase { public ITC_True4( String name ) { super( name ); } public void test1() { softAssertTrue( MSG, false ); } } public void testSoftAssertTrue4() { // Ensure that two tests run, and there is one failure. runITC( ITC_True4.class, 2, 1, 0, true ); } //--------- public static class ITC_False1 extends IntegrationTestCase { public ITC_False1( String name ) { super( name ); } public void test1() { softAssertFalse( false ); } } public void testSoftAssertFalse1() { // Ensure that two tests run, and there is one failure. runITC( ITC_False1.class, 2, 0, 0, false ); } //--------- public static class ITC_False2 extends IntegrationTestCase { public ITC_False2( String name ) { super( name ); } public void test1() { softAssertFalse( MSG, false ); } } public void testSoftAssertFalse2() { // Ensure that two tests run, and there is one failure. runITC( ITC_False2.class, 2, 0, 0, true ); } //--------- public static class ITC_False3 extends IntegrationTestCase { public ITC_False3( String name ) { super( name ); } public void test1() { softAssertFalse( true ); } } public void testSoftAssertFalse3() { // Ensure that two tests run, and there is one failure. runITC( ITC_False3.class, 2, 1, 0, false ); } //--------- public static class ITC_False4 extends IntegrationTestCase { public ITC_False4( String name ) { super( name ); } public void test1() { softAssertFalse( MSG, true ); } } public void testSoftAssertFalse4() { // Ensure that two tests run, and there is one failure. runITC( ITC_False4.class, 2, 1, 0, true ); } //--------- public static class ITC_Fail1 extends IntegrationTestCase { public ITC_Fail1( String name ) { super( name ); } public void test1() { softFail(); } } public void testSoftFail1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Fail1.class, 2, 1, 0, false ); } //--------- public static class ITC_Fail2 extends IntegrationTestCase { public ITC_Fail2( String name ) { super( name ); } public void test1() { softFail( MSG ); } } public void testSoftFail2() { // Ensure that two tests run, and there is one failure. runITC( ITC_Fail2.class, 2, 1, 0, true ); } //--------- public static class ITC_NotNull_O1 extends IntegrationTestCase { public ITC_NotNull_O1( String name ) { super( name ); } public void test1() { softAssertNotNull( null ); } } public void testSoftAssertNotNull_O1() { // Ensure that two tests run, and there is one failure. runITC( ITC_NotNull_O1.class, 2, 1, 0, false ); } //--------- public static class ITC_NotNull_O2 extends IntegrationTestCase { public ITC_NotNull_O2( String name ) { super( name ); } public void test1() { softAssertNotNull( new Object() ); } } public void testSoftAssertNotNull_O2() { // Ensure that two tests run, and there are no failures. runITC( ITC_NotNull_O2.class, 2, 0, 0, false ); } //--------- public static class ITC_Equals_SJJ1 extends IntegrationTestCase { public ITC_Equals_SJJ1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, Long.MIN_VALUE, Long.MAX_VALUE ); } } public void testSoftAssertEquals_SJJ1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SJJ1.class, 2, 1, 0, true ); } //--------- public static class ITC_NotSame_SOO1 extends IntegrationTestCase { public ITC_NotSame_SOO1( String name ) { super( name ); } public void test1() { Object o = new Object(); softAssertNotSame( MSG, o, o ); } } public void testSoftAssertNotSame_SOO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_NotSame_SOO1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_SOO1 extends IntegrationTestCase { public ITC_Equals_SOO1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, new Object(), "check string" ); } } public void testSoftAssertEquals_SOO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SOO1.class, 2, 1, 0, true ); } //--------- public static class ITC_NotSame_OO1 extends IntegrationTestCase { public ITC_NotSame_OO1( String name ) { super( name ); } public void test1() { Object o = new Object(); softAssertNotSame( o, o ); } } public void testSoftAssertNotSame_OO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_NotSame_OO1.class, 2, 1, 0, false ); } //--------- public static class ITC_Null_SO1 extends IntegrationTestCase { public ITC_Null_SO1( String name ) { super( name ); } public void test1() { softAssertNull( MSG, new Object() ); } } public void testSoftAssertNull_SO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Null_SO1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_XX1 extends IntegrationTestCase { public ITC_Equals_XX1( String name ) { super( name ); } public void test1() { softAssertEquals( Short.MAX_VALUE, Short.MIN_VALUE ); } } public void testSoftAssertEquals_XX1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_XX1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_OO1 extends IntegrationTestCase { public ITC_Equals_OO1( String name ) { super( name ); } public void test1() { softAssertEquals( new Object(), "t2" ); } } public void testSoftAssertEquals_OO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_OO1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_SSS1 extends IntegrationTestCase { public ITC_Equals_SSS1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, "t1", "t2" ); } } public void testSoftAssertEquals_SSS1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SSS1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_BB1 extends IntegrationTestCase { public ITC_Equals_BB1( String name ) { super( name ); } public void test1() { softAssertEquals( Byte.MAX_VALUE, Byte.MIN_VALUE ); } } public void testSoftAssertEquals_BB1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_BB1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_SFFF1 extends IntegrationTestCase { public ITC_Equals_SFFF1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, Float.MIN_VALUE, Float.MAX_VALUE, 10.0f ); } } public void testSoftAssertEquals_SFFF1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SFFF1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_SCC1 extends IntegrationTestCase { public ITC_Equals_SCC1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, '1', '2' ); } } public void testSoftAssertEquals_SCC1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SCC1.class, 2, 1, 0, true ); } //--------- public static class ITC_Same_OO1 extends IntegrationTestCase { public ITC_Same_OO1( String name ) { super( name ); } public void test1() { softAssertSame( new Object(), new Object() ); } } public void testSoftAssertSame_OO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Same_OO1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_JJ1 extends IntegrationTestCase { public ITC_Equals_JJ1( String name ) { super( name ); } public void test1() { softAssertEquals( Long.MIN_VALUE, Long.MAX_VALUE ); } } public void testSoftAssertEquals_JJ1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_JJ1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_SZZ1 extends IntegrationTestCase { public ITC_Equals_SZZ1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, true, false ); } } public void testSoftAssertEquals_SZZ1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SZZ1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_DDD1 extends IntegrationTestCase { public ITC_Equals_DDD1( String name ) { super( name ); } public void test1() { softAssertEquals( Double.MAX_VALUE, Double.MIN_VALUE, 1.0 ); } } public void testSoftAssertEquals_DDD1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_DDD1.class, 2, 1, 0, false ); } //--------- public static class ITC_Same_SOO1 extends IntegrationTestCase { public ITC_Same_SOO1( String name ) { super( name ); } public void test1() { softAssertSame( MSG, new Object(), new Object() ); } } public void testSoftAssertSame_SOO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Same_SOO1.class, 2, 1, 0, true ); } //--------- public static class ITC_NotNull_SO1 extends IntegrationTestCase { public ITC_NotNull_SO1( String name ) { super( name ); } public void test1() { softAssertNotNull( MSG, null ); } } public void testSoftAssertNotNull_SO1() { // Ensure that two tests run, and there is one failure. runITC( ITC_NotNull_SO1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_SII1 extends IntegrationTestCase { public ITC_Equals_SII1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, Integer.MIN_VALUE, Integer.MAX_VALUE ); } } public void testSoftAssertEquals_SII1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SII1.class, 2, 1, 0, true ); } //--------- public static class ITC_Null_O1 extends IntegrationTestCase { public ITC_Null_O1( String name ) { super( name ); } public void test1() { softAssertNull( new Object() ); } } public void testSoftAssertNull_O1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Null_O1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_SDDD1 extends IntegrationTestCase { public ITC_Equals_SDDD1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, Double.MIN_VALUE, Double.MAX_VALUE, 1.0 ); } } public void testSoftAssertEquals_SDDD1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SDDD1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_CC1 extends IntegrationTestCase { public ITC_Equals_CC1( String name ) { super( name ); } public void test1() { softAssertEquals( 'a', 'b' ); } } public void testSoftAssertEquals_CC1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_CC1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_SXX1 extends IntegrationTestCase { public ITC_Equals_SXX1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, Short.MAX_VALUE, Short.MIN_VALUE ); } } public void testSoftAssertEquals_SXX1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SXX1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_ZZ1 extends IntegrationTestCase { public ITC_Equals_ZZ1( String name ) { super( name ); } public void test1() { softAssertEquals( true, false ); } } public void testSoftAssertEquals_ZZ1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_ZZ1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_SBB1 extends IntegrationTestCase { public ITC_Equals_SBB1( String name ) { super( name ); } public void test1() { softAssertEquals( MSG, Byte.MAX_VALUE, Byte.MIN_VALUE ); } } public void testSoftAssertEquals_SBB1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SBB1.class, 2, 1, 0, true ); } //--------- public static class ITC_Equals_SS1 extends IntegrationTestCase { public ITC_Equals_SS1( String name ) { super( name ); } public void test1() { softAssertEquals( "t1", "t2" ); } } public void testSoftAssertEquals_SS1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_SS1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_II1 extends IntegrationTestCase { public ITC_Equals_II1( String name ) { super( name ); } public void test1() { softAssertEquals( Integer.MAX_VALUE, Integer.MIN_VALUE ); } } public void testSoftAssertEquals_II1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_II1.class, 2, 1, 0, false ); } //--------- public static class ITC_Equals_FFF1 extends IntegrationTestCase { public ITC_Equals_FFF1( String name ) { super( name ); } public void test1() { softAssertEquals( Float.MAX_VALUE, Float.MIN_VALUE, 1.0f ); } } public void testSoftAssertEquals_FFF1() { // Ensure that two tests run, and there is one failure. runITC( ITC_Equals_FFF1.class, 2, 1, 0, false ); } //------------------------------------------------------------------------- // Helpers protected IntegrationTestCase createIntegrationTestCase() { return new IntegrationTestCase( "name" ); } protected TestResult runITC( Class itcClass, int runCount, int failureCount, int errorCount, boolean hasMessage ) { TestSuite suite = new TestSuite( itcClass ); TestResult tr = new TestResult(); LOG.info( "Running tests..." ); try { suite.run( tr ); } catch (RuntimeException re) { re.printStackTrace(); throw re; } catch (Error e) { e.printStackTrace(); throw e; } LOG.info( "Expected "+runCount+" runs, but found "+tr.runCount()+"." ); LOG.info( "Expected "+failureCount+" failures, but found "+ tr.failureCount()+"." ); LOG.info( "Expected "+errorCount+" errors, but found "+ tr.errorCount()+"." ); //LOG.info( tr.failures().nextElement().toString() ); assertEquals( "Did not have the correct number of failures.", failureCount, tr.failureCount() ); assertEquals( "Did not have the correct number of errors.", errorCount, tr.errorCount() ); assertEquals( "Did not have the correct number of test runs.", runCount, tr.runCount() ); Enumeration enum = tr.failures(); while (enum.hasMoreElements()) { TestFailure tf = (TestFailure)enum.nextElement(); String msg = tf.thrownException().getMessage(); assertEquals( "Message expectation not met (true = has message);", hasMessage, msg.indexOf( MSG ) >= 0 ); } return tr; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/0000755000175000017500000000000011271425773033057 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/TestClassParserUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/TestCl0000644000175000017500000002340007663724303034200 0ustar drazzibdrazzib/* * @(#)TestClassParserUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; import java.util.Vector; /** * Tests the TestClassParser class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/05/24 17:15:47 $ */ public class TestClassParserUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestClassParserUTest.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public TestClassParserUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new TestClassParser( null ); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor2() { new TestClassParser( getClass() ); } public static class TesterNoTestMethods implements Test { public int countTestCases() { return 0; } public void run( junit.framework.TestResult tr ) {} } public static class TesterOneTestMethod implements Test { public int countTestCases() { return 0; } public void run( junit.framework.TestResult tr ) {} public void testMyTest() {} } public static class TesterBadMethod implements Test { public int countTestCases() { return 0; } public void run( junit.framework.TestResult tr ) {} public void usedForTesting() { } protected void testUsedForTesting() {} } private class StaticClass {} public class InnerClass {} public void testGetTestMethods1() { TestClassParser tcp = new TestClassParser( String.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "String should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods2() { TestClassParser tcp = new TestClassParser( Runnable.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods3() { TestClassParser tcp = new TestClassParser( StaticClass.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods4() { TestClassParser tcp = new TestClassParser( InnerClass.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods5() { TestClassParser tcp = new TestClassParser( TesterNoTestMethods.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods6() { TestClassParser tcp = new TestClassParser( TesterOneTestMethod.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have one test method.", 1, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testClearWarnings1() { TestClassParser tcp = new TestClassParser( TesterOneTestMethod.class ); tcp.clearWarnings(); } public void testClearWarnings2() { TestClassParser tcp = new TestClassParser( Object.class ); tcp.clearWarnings(); } public void testGetName1() { TestClassParser tcp = new TestClassParser( TesterOneTestMethod.class ); String name = tcp.getName(); assertEquals( "Returned invalid test name.", TesterOneTestMethod.class.getName(), name ); } public void testGetName2() { TestClassParser tcp = new TestClassParser( Object.class ); String name = tcp.getName(); assertEquals( "Returned invalid test name.", Object.class.getName(), name ); } public void testAddTestMethod1() throws Exception { TestClassParser tcp = new TestClassParser( TesterOneTestMethod.class ); int warningCount = tcp.getWarnings().length; Vector v = new Vector(); Method m = THIS_CLASS.getMethod( "testAddTestMethod1", new Class[0] ); v.addElement( "testAddTestMethod1" ); tcp.addTestMethod( m, v ); // ensure that there are more warnings assertEquals( "Incorrectly changed the warnings.", warningCount, tcp.getWarnings().length ); } public void testAddTestMethod2() throws Exception { TestClassParser tcp = new TestClassParser( TesterBadMethod.class ); int warningCount = tcp.getWarnings().length; Vector v = new Vector(); Method m = TesterBadMethod.class.getMethod( "usedForTesting", new Class[0] ); tcp.addTestMethod( m, v ); // ensure that there are more warnings assertEquals( "Incorrectly changed the warnings.", warningCount, tcp.getWarnings().length ); } /* this is tested elsewhere. public void testAddTestMethod3() throws Exception { TestClassParser tcp = new TestClassParser( TesterBadMethod.class ); int warningCount = tcp.getWarnings().length; Vector v = new Vector(); Method m = TesterBadMethod.class.getMethod( "testUsedForTesting", new Class[0] ); tcp.addTestMethod( m, v ); // ensure that there are more warnings assertEquals( "Did not add an additional warning.", warningCount + 1, tcp.getWarnings().length ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/DelegateTestCreatorUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/Delega0000644000175000017500000002172307622026450034162 0ustar drazzibdrazzib/* * @(#)DelegateTestCreatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import net.sourceforge.groboutils.junit.v1.iftc.*; import java.lang.reflect.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the DelegateTestCreator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since November 4, 2002 * @version $Date: 2003/02/10 22:52:24 $ */ public class DelegateTestCreatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DelegateTestCreatorUTest.class; private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( THIS_CLASS ); public DelegateTestCreatorUTest( String name ) { super( name ); } // mock object! private static class MyTestCreator implements ITestCreator { int canCreateCount = 0; int createTestCount = 0; boolean canCreate = false; Test test = null; public Test createTest( Class theClass, Method method ) { ++this.createTestCount; return this.test; } public boolean canCreate( Class theClass ) { ++this.canCreateCount; return this.canCreate; } } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DelegateTestCreator( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor2() { try { new DelegateTestCreator( new ITestCreator[0] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception? } } public void testCanCreate1() { MyTestCreator tc1 = new MyTestCreator(); MyTestCreator tc2 = new MyTestCreator(); DelegateTestCreator dtc = new DelegateTestCreator( new ITestCreator[] { tc1, tc2 } ); boolean res = dtc.canCreate( null ); assertTrue( "Did not return correct result.", !res ); assertEquals( "Did not call canCreate correct number of times for first instance.", 1, tc1.canCreateCount ); assertEquals( "Did not call canCreate correct number of times for second instance.", 1, tc2.canCreateCount ); } public void testCanCreate2() { MyTestCreator tc1 = new MyTestCreator(); MyTestCreator tc2 = new MyTestCreator(); tc1.canCreate = true; DelegateTestCreator dtc = new DelegateTestCreator( new ITestCreator[] { tc1, tc2 } ); boolean res = dtc.canCreate( null ); assertTrue( "Did not return correct result.", res ); // order of checks shouldn't be dictated here. assertEquals( "Did not call canCreate correct number of times for first instance.", 1, tc1.canCreateCount ); assertEquals( "Did not call canCreate correct number of times for second instance.", 1, tc2.canCreateCount ); } public void testCanCreate3() { MyTestCreator tc1 = new MyTestCreator(); MyTestCreator tc2 = new MyTestCreator(); tc2.canCreate = true; DelegateTestCreator dtc = new DelegateTestCreator( new ITestCreator[] { tc1, tc2 } ); boolean res = dtc.canCreate( null ); assertTrue( "Did not return correct result.", res ); // order of checks shouldn't be dictated here. assertEquals( "Did not call canCreate correct number of times for first instance.", 0, tc1.canCreateCount ); assertEquals( "Did not call canCreate correct number of times for second instance.", 1, tc2.canCreateCount ); } public void testCanCreate4() { MyTestCreator tc1 = new MyTestCreator(); MyTestCreator tc2 = new MyTestCreator(); tc1.canCreate = true; tc2.canCreate = true; DelegateTestCreator dtc = new DelegateTestCreator( new ITestCreator[] { tc1, tc2 } ); boolean res = dtc.canCreate( null ); assertTrue( "Did not return correct result.", res ); // order of checks shouldn't be dictated here. assertEquals( "Did not call canCreate correct number of times for first instance.", 0, tc1.canCreateCount ); assertEquals( "Did not call canCreate correct number of times for second instance.", 1, tc2.canCreateCount ); } public void testCanCreate5() { MyTestCreator tc1 = new MyTestCreator(); DelegateTestCreator dtc = new DelegateTestCreator( new ITestCreator[] { tc1 } ); boolean res = dtc.canCreate( null ); assertTrue( "Did not return correct result.", !res ); assertEquals( "Did not call canCreate correct number of times for first instance.", 1, tc1.canCreateCount ); } public void testCanCreate6() { MyTestCreator tc1 = new MyTestCreator(); tc1.canCreate = true; DelegateTestCreator dtc = new DelegateTestCreator( new ITestCreator[] { tc1 } ); boolean res = dtc.canCreate( null ); assertTrue( "Did not return correct result.", res ); assertEquals( "Did not call canCreate correct number of times for first instance.", 1, tc1.canCreateCount ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestCreatorUTestI.suite(); // yes, this is an inner class inside an inner class! // shudder - luckily, this is only for testing. suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DelegateTestCreator( new ITestCreator[] { new MyTestCreator(), new MyTestCreator() } ); } } ); suite.addTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/TestClassCreatorUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/TestCl0000644000175000017500000002532007622026450034174 0ustar drazzibdrazzib/* * @(#)TestClassCreatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.AssertionFailedError; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the TestClassCreator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since November 4, 2002 * @version $Date: 2003/02/10 22:52:24 $ */ public class TestClassCreatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestClassCreatorUTest.class; public TestClassCreatorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new TestClassCreator( null ); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor2() { new TestClassCreator( new JUnitOrigCreator() ); } public void testWarnings1() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with elements.", 0, s.length ); } public void testWarnings2() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); tcc.warning( "a" ); String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with incorrect element count.", 1, s.length ); assertEquals( "Did not return warnings array with correct entry.", "a", s[0] ); } public void testWarnings3() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); tcc.warning( "a" ); tcc.warning( "b" ); String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with incorrect element count.", 2, s.length ); assertEquals( "Did not return warnings array with correct entry.", "a", s[0] ); assertEquals( "Did not return warnings array with correct entry.", "b", s[1] ); } public void testClearWarnings1() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); tcc.clearWarnings(); String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with elements.", 0, s.length ); } public void testClearWarnings2() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); tcc.warning( "a" ); tcc.clearWarnings(); String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with elements.", 0, s.length ); } public void testClearWarnings3() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); tcc.warning( "a" ); tcc.warning( "b" ); tcc.clearWarnings(); String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with elements.", 0, s.length ); } public void testCreateWarningTests1() { TestClassCreator tcc = new TestClassCreator( new JUnitOrigCreator() ); tcc.warning( "a" ); tcc.warning( "b" ); Test t[] = tcc.createWarningTests( new TestClassParser( THIS_CLASS ) ); assertNotNull( "Returned null warning test list.", t ); assertEquals( "Returned warnings test list with incorrect element count.", 2, t.length ); // need to test failures!!! // warnings should not have been cleared String s[] = tcc.getWarnings(); assertNotNull( "Returned null warnings array.", s ); assertEquals( "Returned warnings array with incorrect element count.", 2, s.length ); assertEquals( "Did not return warnings array with correct entry.", "a", s[0] ); assertEquals( "Did not return warnings array with correct entry.", "b", s[1] ); } /* public static class TesterNoTestMethods implements Test { public int countTestCases() { return 0; } public void run( junit.framework.TestResult tr ) {} } public static class TesterOneTestMethod implements Test { public int countTestCases() { return 0; } public void run( junit.framework.TestResult tr ) {} public void testMyTest() {} } private class StaticClass {} public class InnerClass {} public void testGetTestMethods1() { TestClassParser tcp = new TestClassParser( String.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "String should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods2() { TestClassParser tcp = new TestClassParser( Runnable.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods3() { TestClassParser tcp = new TestClassParser( StaticClass.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods4() { TestClassParser tcp = new TestClassParser( InnerClass.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods5() { TestClassParser tcp = new TestClassParser( TesterNoTestMethods.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have no test methods.", 0, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } public void testGetTestMethods6() { TestClassParser tcp = new TestClassParser( TesterOneTestMethod.class ); Method m[] = tcp.getTestMethods(); assertNotNull( "Must never return null.", m ); assertEquals( "Runnable should have one test method.", 1, m.length ); assertTrue( "Must never return the same array, but rather a copy.", m != tcp.getTestMethods() ); } */ //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/ITestCreatorUTestI.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/parser/ITestC0000644000175000017500000000711307622026450034131 0ustar drazzibdrazzib/* * @(#)ITestCreatorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.parser; import net.sourceforge.groboutils.junit.v1.iftc.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITestCreator interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since November 4, 2002 * @version $Date: 2003/02/10 22:52:24 $ */ public class ITestCreatorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITestCreatorUTestI.class; public ITestCreatorUTestI( String name, ImplFactory f ) { super( name, ITestCreator.class, f ); } protected ITestCreator createITestCreator() { return (ITestCreator)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCanCreate1() { ITestCreator tc = createITestCreator(); tc.canCreate( Object.class ); } public void testCanCreate2() { ITestCreator tc = createITestCreator(); assertTrue( !tc.canCreate( null ) ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/TestMonitorRunnableUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/TestMonitorRu0000644000175000017500000001073207705023465034306 0ustar drazzibdrazzib/* * @(#)TestMonitorRunnableUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the TestMonitorRunnable class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 12, 2003 * @version $Date: 2003/07/15 16:09:25 $ */ public class TestMonitorRunnableUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestMonitorRunnableUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public TestMonitorRunnableUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Inner classes private static class MyTestMonitorRunnable1 extends TestMonitorRunnable { Throwable t; public MyTestMonitorRunnable1( Throwable t ) { this.t = t; } public void runMonitor() throws Throwable { if (this.t != null) { throw this.t; } } } private static class MyTestRunnable extends TestRunnable { Throwable t; public MyTestRunnable( Throwable t ) { this.t = t; } public void runTest() throws Throwable { if (this.t != null) { throw this.t; } } } //------------------------------------------------------------------------- // Tests public void testRun1() { DOC.getLog().warn( "No tests for this class by itself: it is covered "+ "completely by the TestRunnable and MTTR tests." ); } //------------------------------------------------------------------------- // Helpers protected TestRunnable createTestRunnable( Throwable throwThis ) { return new MyTestRunnable( throwThis ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/TestRunnableUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/TestRunnableU0000644000175000017500000001350607704627023034244 0ustar drazzibdrazzib/* * @(#)TestRunnableUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the TestRunnable class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/07/14 22:26:27 $ */ public class TestRunnableUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestRunnableUTest.class; public TestRunnableUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests private static class MyTestRunnable extends TestRunnable { Throwable t; public MyTestRunnable( Throwable t ) { this.t = t; } public void runTest() throws Throwable { if (this.t != null) { throw this.t; } } } public void testDelay1() throws InterruptedException { // JVMs do not have to delay exactly the amount listed, hence the // error. long delay = 100L; long error = 10L; long minDelay = delay - error; TestRunnable tr = createTestRunnable( null ); long start = System.currentTimeMillis(); tr.delay( delay ); long end = System.currentTimeMillis(); assertTrue( "Did not delay for long enough (delayed "+(end - start)+ " ms, should have delayed at least "+delay+" ms).", (end - start) >= minDelay ); } public void testRun1() { TestRunnable tr = createTestRunnable( null ); try { tr.run(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception ??? } } public void testRun2() throws Throwable { TestRunnable tr = createTestRunnable( null ); MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr } ); try { tr.run(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception ??? } } public void testRun3() throws Throwable { TestRunnable tr = createTestRunnable( null ); MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr } ); mttr.runTestRunnables( 1000 ); } public void testRun4() { Throwable t = new Throwable( "Ignore" ); TestRunnable tr = createTestRunnable( t ); MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr } ); try { mttr.runTestRunnables( 1000 ); fail( "Did not throw an exception." ); } catch (Throwable actualT) { assertEquals( "Did not throw the intended exception.", actualT, t ); } } //------------------------------------------------------------------------- // Helpers protected TestRunnable createTestRunnable( Throwable throwThis ) { return new MyTestRunnable( throwThis ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/MultiThreadedTestRunnerUTest.javalibgroboutils-java-5.orig/testing-junit/sources/ut/net/sourceforge/groboutils/junit/v1/MultiThreaded0000644000175000017500000004530110037142375034235 0ustar drazzibdrazzib/* * @(#)MultiThreadedTestRunnerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; /** * Tests the MultiThreadedTestRunner class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2004/04/09 19:26:52 $ */ public class MultiThreadedTestRunnerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MultiThreadedTestRunnerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public MultiThreadedTestRunnerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { DOC.getLog().debug("testConstructor1"); try { new MultiThreadedTestRunner( null ); fail("did not throw an IllegalArgumentException."); } catch (IllegalArgumentException e) { // check exception text? } } public void testConstructor2() { DOC.getLog().debug("testConstructor2"); try { new MultiThreadedTestRunner( new TestRunnable[0] ); fail("did not throw an IllegalArgumentException."); } catch (IllegalArgumentException e) { // check exception text? } } static class RunValue1 { public int value; } public synchronized void testRun1() throws Throwable { DOC.getIT().testsIssue( 526710 ); DOC.getLog().debug("testRun1"); final RunValue1 runCount = new RunValue1(); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { DOC.getLog().debug("Running test testRun1"); ++runCount.value; } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); mttr.runTestRunnables(); assertEquals( "Did not run the runTest method enough times.", 1, runCount.value ); } public synchronized void testRun2() throws Throwable { DOC.getIT().testsIssue( 526710 ); DOC.getLog().debug("testRun2"); final RunValue1 runCount = new RunValue1(); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { ++runCount.value; } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); mttr.runTestRunnables( 1000 ); assertEquals( "Did not run the runTest method enough times.", 1, runCount.value ); } public synchronized void testRun3a() throws Throwable { DOC.getIT().testsIssue( 526710 ); DOC.getLog().debug("testRun3a"); DOC.getLog().warn( "****************\n"+ "This test may expose timing issues, where only one test is run.\n"+ "I've only seen this with JDK 1.1, but that may expose an underlying\n"+ "problem. This will require further investigation.\n"+ "****************" ); final RunValue1 runCount = new RunValue1(); TestRunnable tr1 = new TestRunnable() { public synchronized void runTest() throws Throwable { ++runCount.value; } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1, tr1 } ); mttr.runTestRunnables(); assertEquals( "Did not run the runTest method enough times.", 2, runCount.value ); } public synchronized void testRun3b() throws Throwable { DOC.getLog().debug("testRun3b"); final RunValue1 runCount = new RunValue1(); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { ++runCount.value; } }; int totalCount = 15; TestRunnable trList[] = new TestRunnable[ totalCount ]; for (int i = 0; i < totalCount; ++i) { trList[ i ] = tr1; } MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( trList ); mttr.runTestRunnables(); assertEquals( "Did not run the runTest method enough times.", totalCount, runCount.value ); } public void testRun4() throws Throwable { DOC.getLog().debug("testRun4"); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { throw new IOException("My exception"); } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); try { mttr.runTestRunnables(); fail("did not throw IOException."); } catch (IOException ioe) { // check message assertEquals( "IOException not the one we threw.", "My exception", ioe.getMessage() ); } } public void testRun5() throws Throwable { DOC.getLog().debug("testRun5"); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { Object o = new Object(); synchronized( o ) { o.wait(); } } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); boolean fail = false; try { // wait for 10 ms to ensure the join loop is not entered mttr.runTestRunnables( 10 ); fail = true; } catch (junit.framework.AssertionFailedError e) { // test failure? } if (fail) { fail("Did not throw an assertion failed error."); } } public void testRun5a() throws Throwable { DOC.getLog().debug("testRun5a"); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { Object o = new Object(); synchronized( o ) { o.wait(); } } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); boolean fail = false; try { // wait for 1 second to ensure the join section is entered mttr.runTestRunnables( 1000 ); fail = true; } catch (junit.framework.AssertionFailedError e) { // test failure? } if (fail) { fail("Did not throw an assertion failed error."); } } private static final int MAX_LOOP_COUNT = 20000; static abstract class TestRunnable6 extends TestRunnable { public Thread runningThread = null; public boolean wasInterrupted = false; public void runTest() throws Throwable { this.runningThread = Thread.currentThread(); runMyTest(); } public abstract void runMyTest() throws Throwable; } public void testRun6() throws Throwable { DOC.getIT().testsIssue( 771000 ); DOC.getLog().debug("testRun6"); TestRunnable6 tr1 = new TestRunnable6() { public void runMyTest() throws Throwable { DOC.getLog().warn("runMyTest 6 running forever"); // never exit! for (int i = 0; i < MAX_LOOP_COUNT; ++i) { //Thread.yield(); try { delay( 100 ); } catch (InterruptedException ie) { this.wasInterrupted = true; DOC.getLog().warn("runMyTest 6: interrupted!"); } DOC.getLog().warn("runMyTest 6: Loop!"); if (Thread.interrupted()) { this.wasInterrupted = true; DOC.getLog().warn("runMyTest 6: inerrupted!"); } } fail( "This line should NEVER be reached!" ); } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); boolean fail = false; try { mttr.runTestRunnables( 10 ); fail = true; } catch (junit.framework.AssertionFailedError e) { // test failure if (e.getMessage() != null && e.getMessage().indexOf( "This line should NEVER be reached!" ) >= 0) { fail("Did not kill the runnable." ); } } if (fail) { fail("Did not throw an assertion failed error."); } assertTrue( "Test was not interrupted.", tr1.wasInterrupted ); assertFalse( "Did not stop the test runnable.", tr1.runningThread.isAlive() ); } public void testRun7() throws Throwable { DOC.getIT().testsIssue( 771001 ); DOC.getLog().debug("testRun7"); TestRunnable6 tr1 = new TestRunnable6() { public void runMyTest() throws Throwable { assertTrue( "Did not create the thread as daemon.", this.runningThread.isDaemon() ); } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 } ); mttr.runTestRunnables(); } static class TesterClass { public int value; } public void testRun8() throws Throwable { DOC.getIT().testsIssue( 771008 ); // ensure the monitors catch an error DOC.getLog().debug("testRun8"); final TesterClass tc = new TesterClass(); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { for (int i = 0; i < 30; ++i) { tc.value = i; delay( 100 ); } tc.value = -1; } }; TestMonitorRunnable tm1 = new TestMonitorRunnable() { public void runMonitor() throws Throwable { assertTrue( "Value is < 0.", tc.value >= 0 ); } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 }, new TestRunnable[] { tm1 } ); boolean fail = false; try { mttr.runTestRunnables(); fail = true; } catch (junit.framework.AssertionFailedError e) { assertTrue( "Did not throw correct exception from monitor.", e.getMessage().indexOf( "Value is < 0." ) >= 0 ); } if (fail) { fail("Did not throw an assertion failed error."); } } static abstract class TestMonitorRunnable9 extends TestMonitorRunnable { public Thread runningThread = null; public void runTest() throws Throwable { this.runningThread = Thread.currentThread(); super.runTest(); } } public void testRun9() throws Throwable { DOC.getIT().testsIssue( 771008 ); // ensure the monitors quit DOC.getLog().debug("testRun9"); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { delay( 100 ); } }; TestMonitorRunnable9 tm1 = new TestMonitorRunnable9() { public void runMonitor() throws Throwable { // do nothing } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 }, new TestRunnable[] { tm1 } ); mttr.runTestRunnables(); assertFalse( "Did not stop the test monitor.", tm1.runningThread.isAlive() ); } public void testRun10() throws Throwable { DOC.getIT().testsIssue( 771008 ); // ensure the monitors quit DOC.getLog().debug("testRun10"); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { delay( 100 ); } }; TestRunnable6 tm1 = new TestRunnable6() { public void runMyTest() throws Throwable { DOC.getLog().warn("runMyTest 10 running forever"); for (int i = 0; i < MAX_LOOP_COUNT; ++i) { //Thread.yield(); try { delay( 100 ); } catch (InterruptedException ie) { this.wasInterrupted = true; DOC.getLog().warn("runMyTest 10: interrupted!"); } DOC.getLog().warn("runMyTest 10: Loop!"); if (Thread.interrupted()) { this.wasInterrupted = true; DOC.getLog().warn("runMyTest 10: interrupted!"); } } fail( "This line should NEVER be reached!" ); } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 }, new TestRunnable[] { tm1 } ); // monitor timeout should never cause an error. mttr.runTestRunnables(); assertTrue( "monitor was not interrupted.", tm1.wasInterrupted ); Thread.sleep( 100 ); assertFalse( "Did not stop the test monitor.", tm1.runningThread.isAlive() ); } public void testRun11() throws Throwable { DOC.getIT().testsIssue( 771008 ); // ensure the monitors catch an error (generated right away) DOC.getLog().debug("testRun11"); final TesterClass tc = new TesterClass(); TestRunnable tr1 = new TestRunnable() { public void runTest() throws Throwable { tc.value = -1; for (int i = 0; i < 30; ++i) { delay( 100 ); tc.value = i; } } }; TestMonitorRunnable tm1 = new TestMonitorRunnable() { public void runMonitor() throws Throwable { assertTrue( "Value is < 0.", tc.value >= 0 ); } }; MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( new TestRunnable[] { tr1 }, new TestRunnable[] { tm1 } ); boolean fail = false; try { mttr.runTestRunnables(); fail = true; } catch (junit.framework.AssertionFailedError e) { assertTrue( "Did not throw correct exception from monitor.", e.getMessage().indexOf( "Value is < 0." ) >= 0 ); } if (fail) { fail("Did not throw an assertion failed error."); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-junit/sources/ut/about.txt0000644000175000017500000000012207521071656024450 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/testing-junit/sources/iut/0000755000175000017500000000000011271425773022753 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/net/0000755000175000017500000000000010011472751023526 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/net/sourceforge/0000755000175000017500000000000010011472751026051 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/net/sourceforge/groboutils/0000755000175000017500000000000010011472751030242 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/net/sourceforge/groboutils/junit/0000755000175000017500000000000010011472751031373 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/net/sourceforge/groboutils/junit/v1/0000755000175000017500000000000010011472751031721 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/net/sourceforge/groboutils/junit/v1/iftc/0000755000175000017500000000000011271425773032661 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/iut/about.txt0000644000175000017500000000021107521071656024620 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/testing-junit/sources/eut/0000755000175000017500000000000011271425773022747 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/eut/net/0000755000175000017500000000000010011472750023521 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/0000755000175000017500000000000010011472750026044 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/0000755000175000017500000000000010011472750030235 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/0000755000175000017500000000000010011472750031366 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/0000755000175000017500000000000011271425773031730 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/InterruptEUTest.javalibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/InterruptEUT0000644000175000017500000001106510037142367034222 0ustar drazzibdrazzib/* * @(#)InterruptEUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the behavior of the Thread.interrupt() and InterruptedException * in threaded and non-threaded environments. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 15, 2003 * @version $Date: 2004/04/09 19:26:52 $ */ public class InterruptEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = InterruptEUTest.class; public InterruptEUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testNonThreadedInterrupt1() { Thread.currentThread().interrupt(); assertTrue( "Current thread is interrupted.", Thread.interrupted() ); assertFalse( "Interrupt was not cleared", Thread.interrupted() ); } public void testNonThreadedInterrupt2() { Thread.currentThread().interrupt(); try { Thread.sleep(1); fail("Did not throw interrupted exception."); } catch (InterruptedException e) { assertFalse( "Interrupt was not cleared", Thread.interrupted() ); } } private static class MyRunner implements Runnable { boolean doRun = true; public void run() { while (doRun) { Thread.yield(); } } } public void testKillThread1() throws Exception { MyRunner mr = new MyRunner(); Thread t = new Thread( mr ); t.setDaemon( true ); t.start(); try { t.stop( new RuntimeException( "we stopped!" ) ); Thread.sleep( 100 ); assertFalse( "Did not kill the thread", t.isAlive() ); } finally { mr.doRun = false; } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/iftc/0000755000175000017500000000000011271425773032655 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/iftc/AntJUnitEUTest.javalibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/iftc/AntJUni0000644000175000017500000002050107622026445034104 0ustar drazzibdrazzib/* * @(#)JUnitTestSuiteEUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; import org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter; import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Element; import java.io.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestResult; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the functionality of the Ant JUnit optional tasks for what is * expected in operation of the naming facilities. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since December 8, 2002 * @version $Date: 2003/02/10 22:52:21 $ */ public class AntJUnitEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AntJUnitEUTest.class; private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( THIS_CLASS ); private static class MyTest extends TestCase { public MyTest( String n ) { super( n ); } } public AntJUnitEUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testNoTests1() throws Exception { MyTest mt[] = {}; assertTestGroup( "abc", mt ); } public void testSet1() throws Exception { MyTest mt[] = { new MyTest( "t1" ), new MyTest( "t2" ), }; assertTestGroup( "q.w.e.r.t.y.abc", mt ); } public void testSet2() throws Exception { MyTest mt[] = { new MyTest( "A.t1[1]" ), new MyTest( "B.t2[1]" ), }; assertTestGroup( "q.w.e.r.t.y.abc", mt ); } public void testSet3() throws Exception { MyTest mt[] = { new MyTest( "A.t1[1]" ), new MyTest( "B.t2[1]" ), new MyTest( "A.t1[1]" ), // copy of first test name }; assertTestGroup( "q.w.e.r.t.y.abc", mt ); } //------------------------------------------------------------------------- // Helpers protected XMLJUnitResultFormatter createFormatter( ByteArrayOutputStream baos ) { assertNotNull( baos ); XMLJUnitResultFormatter rf = new XMLJUnitResultFormatter(); rf.setOutput( baos ); return rf; } protected Document parseXML( String xmlDoc ) throws Exception { LOG.info("Parsing XML: "+xmlDoc); InputStream is = new ByteArrayInputStream( xmlDoc.getBytes() ); Document doc = DocumentBuilderFactory.newInstance(). newDocumentBuilder().parse( is ); is.close(); return doc; } protected Element getTestsuiteElement( String xmlDoc ) throws Exception { Document doc = parseXML( xmlDoc ); NodeList nl = doc.getElementsByTagName( "testsuite" ); assertNotNull( "null node list.", nl ); assertTrue( "empty node list.", nl.getLength() > 0 ); Node node = nl.item( 0 ); assertNotNull( "null node 0.", node ); return (Element)node; } protected Element[] getTestcaseElements( Element suite ) throws Exception { NodeList testNodes = suite.getElementsByTagName( "testcase" ); if (testNodes == null) { LOG.warn( "Null node list of testcase elements." ); return new Element[0]; } int len = testNodes.getLength(); Element el[] = new Element[ len ]; for (int i = 0; i < len; ++i) { el[ i ] = (Element)testNodes.item( i ); LOG.debug( "Found testcase node "+el[i] ); } return el; } protected void assertTestGroup( String testsuite, MyTest t[] ) throws Exception { assertNotNull( "Null test array", t ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLJUnitResultFormatter rf = createFormatter( baos ); JUnitTest jt = new JUnitTest( testsuite ); rf.startTestSuite( jt ); for (int i = 0; i < t.length; ++i) { rf.startTest( t[i] ); rf.endTest( t[i] ); } rf.endTestSuite( jt ); String xml = new String( baos.toByteArray() ); baos.close(); Element suiteEl = getTestsuiteElement( xml ); assertEquals( "Incorrect test suite name in XML document.", testsuite, suiteEl.getAttribute( "name" ) ); Element cases[] = getTestcaseElements( suiteEl ); int casesFound = 0; for (int i = 0; i < t.length; ++i) { MyTest mt = t[i]; String mtName = mt.getName(); boolean found = false; for (int j = 0; j < cases.length; ++j) { if (cases[j] != null) { String name = cases[j].getAttribute( "name" ); LOG.debug( "Checking test '"+mtName+ "' against xml element named '"+name+"'." ); if (mtName.equals( name )) { cases[j] = null; found = true; ++casesFound; break; } } } assertTrue( "Did not find a testcase XML element for test '"+ t[i].getName()+"'.", found ); } // check that all cases were found assertEquals( "There were more testcases in the XML than were registered.", t.length, casesFound ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/iftc/InnerClassNameEUTest.javalibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/iftc/InnerCl0000644000175000017500000001331607622026446034135 0ustar drazzibdrazzib/* * @(#)JUnitTestSuiteEUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1.iftc; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the functionality of the JUnit TestSuite class for conformance to * expected behaviors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since October 31, 2002 * @version $Date: 2003/02/10 22:52:22 $ */ public class InnerClassNameEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = InnerClassNameEUTest.class; public InnerClassNameEUTest( String name ) { super( name ); } static boolean IS_JDK_12_COMPAT = true; static { try { Class.forName("java.lang.ThreadLocal"); } catch (ThreadDeath td) { throw td; } catch (Throwable t) { IS_JDK_12_COMPAT = false; } } //------------------------------------------------------------------------- // Tests /* * These tests show off very interesting behavior: * - JDK 1.1 always returns NULL for the "getDeclaringClass()" * call. * - JDK 1.2-1.4 correctly report the declared class for all classes * except anonymous inner classes. */ public void testGetDeclaringClass1() { Class owner = THIS_CLASS.getDeclaringClass(); assertNull( "Test class has a declaring class.", owner ); } private class MyClass1 {} public void testGetDeclaringClass2() { Class c = MyClass1.class; Class owner = c.getDeclaringClass(); if (IS_JDK_12_COMPAT) { assertNotNull( "Inner class has no declaring class.", owner ); assertEquals( "Did not return expected owning class.", THIS_CLASS, owner ); } else { assertNull( "Inner class's owner is not null.", owner ); } } private static class MyClass2 {} public void testGetDeclaringClass3() { Class c = MyClass2.class; Class owner = c.getDeclaringClass(); if (IS_JDK_12_COMPAT) { assertNotNull( "Static inner class has no declaring class.", owner ); assertEquals( "Did not return expected owning class.", THIS_CLASS, owner ); } else { assertNull( "Static inner class' owner is not null.", owner ); } } public void testGetDeclaringClass4() { /* The following test works on JDK 1.1.8 and JDK 1.4.0, but fails for JDK 1.2.2 (all on Windows). It's all so confusing!!! Object o = new MyClass2() {}; Class c = o.getClass(); Class owner = c.getDeclaringClass(); // Not really what you expect, is it? assertNull( "Anonymous inner class has a declaring class.", owner ); */ } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/JUnitTestCaseEUTest.javalibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/JUnitTestCas0000644000175000017500000001035307622026445034173 0ustar drazzibdrazzib/* * @(#)JUnitTestCaseEUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the functionality of the JUnit TestCase class for conformance to * expected behaviors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:21 $ */ public class JUnitTestCaseEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JUnitTestCaseEUTest.class; public JUnitTestCaseEUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyTestCase1 extends TestCase { String myName; public MyTestCase1() { // the name of our only test method. super( "test1" ); } public void test1() { // do nothing } public String getName() { return myName; } public String name() { return getName(); } public void runTest() throws Throwable { super.runTest(); } } /** * There are some dependencies on TestCase using the internal * "fName" field, as opposed to calling "getName()". You see, * Ant's JUnit reporter task calls "getName()" to make a fancy * printable name, whereas TestCase uses "fName" to reference which * method to call. */ public void testRunTestName1() throws Throwable { MyTestCase1 tc = new MyTestCase1(); tc.myName = "Just Another Test"; // make sure it still works with an overridden getName() method. tc.runTest(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/JUnitTestSuiteEUTest.javalibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/JUnitTestSui0000644000175000017500000001000207622026445034214 0ustar drazzibdrazzib/* * @(#)JUnitTestSuiteEUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the functionality of the JUnit TestSuite class for conformance to * expected behaviors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:21 $ */ public class JUnitTestSuiteEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JUnitTestSuiteEUTest.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public JUnitTestSuiteEUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new TestSuite( (Class)null ); fail( "Did not throw NullPointerException." ); } catch (NullPointerException e) { // test exception } } public void testGetTestAt1() { TestSuite ts = new TestSuite(); try { ts.testAt( 0 ); fail( "Did not throw ArrayIndexOutOfBoundsException." ); } catch (ArrayIndexOutOfBoundsException e) { // test exception } } public void testSetName1() { TestSuite ts = new TestSuite(); ts.setName( null ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/JUnitTestResultEUTest.javalibgroboutils-java-5.orig/testing-junit/sources/eut/net/sourceforge/groboutils/junit/v1/JUnitTestRes0000644000175000017500000000770207622026445034222 0ustar drazzibdrazzib/* * @(#)JUnitTestResultEUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.junit.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestResult; import java.io.IOException; import java.lang.reflect.Method; /** * Tests the functionality of the JUnit TestResult class for conformance to * expected behaviors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:21 $ */ public class JUnitTestResultEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JUnitTestResultEUTest.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public JUnitTestResultEUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testSetupErrorCount() { TestResult tr = new TestResult(); assertEquals( "Should have no errors now.", 0, tr.errorCount() ); } public void testSetupFailureCount() { TestResult tr = new TestResult(); assertEquals( "Should have no failures now.", 0, tr.failureCount() ); } public void testSetupRunCount() { TestResult tr = new TestResult(); assertEquals( "Should have no tests now.", 0, tr.runCount() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-junit/sources/eut/about.txt0000644000175000017500000000015307521071656024621 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/testing-junit/CHANGES.TXT0000644000175000017500000000754107777607732022164 0ustar drazzibdrazzibv1.2.1 * Fixed bug 873251: Message string doesn't appear on error. v1.2.0 * Changed build to reflect new version. * Request 771008: Added monitors to MultiThreadedTestRunner, which simplifies tests such as the datastruct package's SyncQueueUTest. * Fixed bug 771000: MTTR does not kill wild threads. * Fixed bug 771001: MTTR creates non-daemon threads. * Task 77156: completed documentation. * Added logging to the TestRunnable to allow for better tracing of started/stopped threads. v1.1.0 * Added SysPropertiesUtil to aid in testing classes that depend upon system properties being set or unset. * Corrected minor documentation errors. * Moved license from LGPL to MIT. v1.0.0 * Changed build to reflect new version. * Refactored the interface test suite to be a bit easier to implement, and to use factories instead of set objects. Also, interface tests do not *have* to extend InterfaceTestCase now, but it helps. * Changed APIs to be JDK 1.1 compatible. Some tests still require at least JDK 1.3, due to the usage of EasyMock. * Added a Bash/Borne-shell script for the make (only tested on bash). * Added xml-apis.jar for the Xalan support on pre-JDK 1.4 systems. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Added itegration unit tests to test a complex class hierarchy setup. Donated to public domain for use as code samples for the interface testing extentions to JUnit. * Moved the 'SoftAssert' class to the 'AssertTestFactory', and refactored the 'IntegrationTestCase' into the 'SubTestTestCase' and 'IntegrationTestCase' for better support of legacy JUnit test listeners. * Added ICxFactory to allow InterfaceTestCases the ability to tear down constructed objects. * Added CxFactory for easy naming of factories for improved traceability. * Refactored the way TestCaseParser works such that it is more pluggable. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/testing-junit/xdocs/0000755000175000017500000000000011271425773021607 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-junit/xdocs/art_eut.xml0000644000175000017500000000624607655132715024006 0ustar drazzibdrazzib Enemy Unit Tests $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    I've Never Heard Of That Before

    I've noticed that some projects depend on third-party packages, and an upgrade to the third-party package breaks the project's operation. In some cases, this can be inter-project dependencies. If the QA department is good, then these issues will be flushed out in integration tests. In other cases, a developer simply misunderstands what a foreign "unit" was designed to do, whether this is due to poor documentation or ignorance.

    As an example, Alaire's JRun version 2.3.3 worked just fine with JDK 1.2. However, when JRun was run with JDK 1.3, it broke due to a dependency on a functionality in java.util.StringTokenizer that changed between JDKs. JRun version 3 fixed the problem, but it shows a major deficiency in testing.

    I have elsewhere defined Integration Unit Tests, but this covers the testing the interactions of "units" (or in Java terms, classes) which depend upon one another. The QA team's integration tests may occur too late in the development process, and the cost of fixing such bugs at that time may be very expensive. I have identified here an opportunity for unit tests that ensure that the developer has a correct understanding of what she's interfacing with, and that those units don't change their functionality over time. I call these tests "enemy unit tests".

    That's Odd

    "Enemy" unit tests? I haven't really heard from research groups any kind of reference to tests that lie in this muddled-land. However, texts such as imply that in object-oriented programs, the logic of the design moves from the functions to the structure of the objects. In a way, these tests could be considered a kind of integration tests, sometimes referred to as dependency tests. I find it more useful to call them enemy tests, since it brings across the idea that these dependent units aren't dependable, unless we assert that they can be relied upon.

    One Man's Trash Is Another Man's Enemy Unit Test

    What about the dependent unit's unit tests? If we assume (or assert) that the dependent unit has sufficient unit tests, then why do enemy tests?

    For one thing, EUTs are a good place to experiment with an unknown API. A common developer's activity is to code directly for the API in the project source, and write unit tests to ensure that the project code is doing the right thing. I have found it easier to write "throw-away" Java classes to test out an API, to make sure that I know what I'm doing before actually codifying the project. EUTs are a good place to put this experimental code. Later, you can build on these tests to robustly ensure that what you expect from an API actually occurs.

    Imran Bashir and Amrit L. Goel. Testing Object-Oriented Software: Life Cycle Solutions. Springer, 1999. libgroboutils-java-5.orig/testing-junit/xdocs/art_hierarchy.xml0000644000175000017500000000617107655132715025164 0ustar drazzibdrazzib JUnit Tests for Class Hierarchies $Date: 2003/05/04 06:40:13 $ Matt Albrecht
    The Problem Of Interfaces

    The Sun Java Tutorial indicates that classes which implement an interface "[sign] a contract" . In some cases, the contract specifies terms for the contract beyond the API declared in the interface source-code, such as "must never return null", usually declared in the JavaDoc. Hence, the logic has moved from the code itself to the structure of the code .

    The JUnit testing framework's design encourages good testing habits by moving much of the menial bookkeeping to the automated system, but it falls short in helping developers test situations such as the interface problem above. A common solution involves a manual cut-n-paste effort that relies more on the developer's memory than on automation.

    The Problem of Antidecomposition

    D.E. Perry and G.E. Kaiser state in their not-so-obvious axiom of Antidecomposition that even if super-class methods are completely tested in the super-class, they still need to be retested in any subclasses, since the inherited methods exist in a different context.

    Again, JUnit encourages the use of cut-n-paste code for testing subclasses, or the tests are simply overlooked . Some developers attempt to subclass one test from another, but that solution does not scale when interfaces need tests as well. To develop robust tests, it seems the tests need a design just as much as the core software.

    A Solution

    This JUnit extension contains the net.sourceforge.groboutils.junit.iftc package which has the explicit purpose to help developers write tests for such inherited logic (the GJE). It also helps reflect the source structure in the tests: if a class extends a class and/or implements an interface, then so do its test suites.

    You can find out more about the GroboUtils JUnit hierarchy testing extention under the article on using the ITFC.

    Imran Bashir and Amrit L. Goel. Testing Object-Oriented Software: Life Cycle Solutions. Springer, 1999. William J. Brown, Raphael C. Malveau, Hays W. "Skip" McCormick III, and Thomas J. Mowbray. AntiPatterns. John Wiley & Sons, Inc, 1998. D.E. Perry and G.E. Kaiser. Adequate Testing and Object-Oriented programming. Journal of Object-Oriented Programming, 2:13-19, Jan. / Feb. 1990. Sun Microsystems, Inc. "Using Interfaces," on the Sun Java Tutorial web site, http://java.sun.com/docs/books/tutorial/java/interpack/usinginterface.html
    libgroboutils-java-5.orig/testing-junit/xdocs/using_iftc.xml0000644000175000017500000043527507655132715024505 0ustar drazzibdrazzib Using IFTC $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    This document will build a fairly complex and very contrived example application, along with simple sample tests to show how to use the IFTC in complicated and simple hierarchies.

    Our example app will attempt to find all CVS registered files in a path. CVS is a common Source Control Repository used in this project and many other open source projects, but the description of its files beyond what this document uses is beyond this document's scope. This app will not recurse directories, but rather scan a depth of directories, as if the user was navigating through them in a shell via the "chdir" command ala UN*X or DOS.

    I won't follow the XP methodology in this article. I'll present the project source code, then follow it up with the tests. One could just as easily show the tests first, then the code, but I feel that it makes the tests clearer by showing the code first. This is important to this article because the focus is on tests, not the project source it tests.

    The IFileVisitor Interface

    We start by creating an interface that does something with each discovered CVS file. We will, however, make it generic enough that the visitor pattern it represents can be used by any project.

       1:public interface IFileVisitor {
       2:    public void visitFile( String fileName );
       3:}
    
    We'll put a "contract" on this interface such that all implementations should throw an IllegalArgumentException whenever a null or invalid file name is encountered. Since this interface can be used by any application, not just our CVS application, we'll make our interface test be usable by any application that conforms to our contract.

       1:public class IFileVisitorTestI extends InterfaceTestCase {
       2:    private static final Class THIS_CLASS = IFileVisitorTestI.class;
       3:
       4:    public IFileVisitorTestI( String name, ImplFactory f ) {
    A  5:        super( name, IFileVisitor.class, f );
       6:    }
       7:
       8:    protected IFileVisitor createIFileVisitor(){
    B  9:        return (IFileVisitor)createImplObject();
      10:    }
      11:    
      12:    public void testVisitFile1() {
      13:        IFileVisitor fv = createIFileVisitor();
      14:        try {
      15:            fv.visitFile( "" );
      16:            fail( "Did not throw IllegalArgumentException." );
      17:        } catch (IllegalArgumentException iae) {}
      18:    }
      19:
      20:    public void testVisitFile2() {
      21:        IFileVisitor fv = createIFileVisitor();
      22:        try {
      23:            fv.visitFile( null );
      24:            fail( "Did not throw IllegalArgumentException." );
      25:        } catch (IllegalArgumentException iae) {}
      26:    }
      27:
      28:    public static InterfaceTestSuite suite() {
    C 29:        return new InterfaceTestSuite( THIS_CLASS );
      30:    }
      31:}
    
    There are three things to note about this test:
      The constructor must follow this signature. It calls to the super class' constructor with the passed-in information, along with the class of the interface or class that this test will expect from the createImplObject method. Usage of a helper method to perform casting on the owned factory. The new format of the suite() method may take any form the test writer likes, since interface tests cannot be directly instantiated and tested by JUnit. In this case, it makes sense to have the suite() method take the standard JUnit form, so that users can more easily use the familiar form. Also, the returned type is a InterfaceTestSuite, so that no unnecessary casting needs to be done.

    A Class To Help Debugging

    For the sake of example, we'll create a prototype visitor of the above interface to help users test and debug their code.

       1:public class LoggingFileVisitor implements IFileVisitor {
       2:    private PrintStream out;
       3:    public LoggingFileVisitor( PrintStream ps ) {
       4:        if (ps == null) throw new IllegalArgumentException();
       5:        this.out = ps;
       6:    }
       7:    
       8:    public void visitFile( String s ) {
       9:        if (s == null || s.length() <= 0) throw new IllegalArgumentException();
      10:        this.out.println( "Visited "+s );
      11:    }
      12:}
    

    The test for this code can use the interface's tests to aid in ensuring that the new class conforms to the interface's contract.

       1:public class LoggingFileVisitorTest extends TestCase {
       2:    private static final Class THIS_CLASS = LoggingFileVisitorTest.class;
       3:    public LoggingFileVisitorTest( String name ) {
       4:        super( name );
       5:    }
       6:    
       7:    public void testConstructor1() {
       8:        try {
       9:            new LoggingFileVisitor( null );
      10:            fail( "Did not throw IllegalArgumentException." );
      11:        } catch (IllegalArgumentException) {}
      12:    }
      13:    
      14:    public void testVisitFile1() {
      15:        StringWriter sw = new StringWriter();
      16:        LoggingFileVisitor fv = new LoggingFileVisitor( new PrintStream(
      17:            sw, true ) );
      18:        fv.visitFile( "a" );
      19:        assertEquals( sw.toString(), "Visited a" );
      20:    }
      21:    
      22:    public static Test suite() {
    A 23:        InterfaceTestSuite suite = IFileVisitorTestI.suite();
      24:        suite.addFactory( new ImplFactory() {
    B 25:            public Object createImplObject() {
      26:                return new LoggingFileVisitor( System.out );
      27:            } } );
    C 28:        suite.addTestSuite( THIS_CLASS );
      29:        return suite;
      30:    }
      31:}
    
    The three points of interest in this test class are:
      Since LoggingFileVisitor inherits from ("implements" technically) IFileVisitor, the concrete test "inherits" the tests from IFileVisitorTestI by pulling in its test suite. These inherited tests are executed in the context of LoggingFileVisitor by The tests defined in the concrete test class are added to the suite, and interpreted just like the standard JUnit TestSuite does.

    The IDirectoryVisitor Interface

    Now we'll create an interface to handle the visitor pattern for directories. Since CVS stores the listing of checked-out files locally in a file called "CVS/Entries" under each module directory, the final implementation will use this to check if the entered directory is a valid CVS module dir. Also, to add double-duty and bad design, this interface will handle the state of the current directory the user is in. Any non-null, non-empty directory can be pushed, put only the valid ones will be processed.

       1:public interface IDirectoryVisitor {
       2:    public void pushDir( Stirng name );
       3:    public void popDir();
       4:    public String getCurrentDirectory();
       5:    public void visitCurrentDir();
       6:}
    

    Here's the test:

       1:public class IDirectoryVisitorTestI extends InterfaceTestCase {
       2:    private static final THIS_CLASS = IDirectoryVisitorTestI.class;
       3:    public IDirectoryVisitorTestI( String name, ImplFactory f ) {
       4:        super( name, IDirectoryVisitor.class, f );
       5:    }
       6:    
       7:    protected IDirectoryVisitor createIDirectoryVisitor() {
       8:        return (IDirectoryVisitor)createImplObject();
       9:    }
      10:    
      11:    public void testPushDir1() {
      12:        IDirectoryVisitor dv = createIDirectoryVisitor();
      13:        try {
      14:            dv.pushDir( null );
      15:            fail( "Did not throw IllegalArgumentException." );
      16:        } catch (IllegalArgumentException e) {}
      17:    }
      18:    
      19:    public void testPushDir2() {
      20:        IDirectoryVisitor dv = createIDirectoryVisitor();
      21:        try {
      22:            dv.pushDir( "" );
      23:            fail( "Did not throw IllegalArgumentException." );
      24:        } catch (IllegalArgumentException e) {}
      25:    }
      26:    
      27:    public void testPopDir1() {
      28:        IDirectoryVisitor dv = createIDirectoryVisitor();
      29:        try {
      30:            dv.popDir();
      31:            fail( "Did not throw IllegalArgumentException." );
      32:        } catch (IllegalArgumentException e) {}
      33:    }
      34:    
      35:    public void testPopDir2() {
      36:        IDirectoryVisitor dv = createIDirectoryVisitor();
      37:        String s = dv.getCurrentDir();
      38:        dv.pushDir( "A" );
      39:        dv.popDir();
      40:        assertEquals( s, dv.getCurrentDir() );
      41:    }
      42:    
      43:    public static InterfaceTestSuite suite() {
      44:        return new InterfaceTestSuite( THIS_CLASS );
      45:    }
      46:}
    
    This class is very similar in structure to IFileVisitorTestI, but this test has more complex logic it can perform that allows for more interesting tests.

    IFileDirectoryVisitor Interface

    The next interface has a lot of assumptions about implementations. Since it combines a directory and file visitor together with a bad design, it expects visited directories to visit each file in that directory.

       1:public interface IFileDirectoryVisitor
       2:        extends IFileVisitor, IDirectoryVisitor {
       3:}
    

    Since this does not define any new explicit functionality, the tests are relatively simple. Again, remember that this design is contrived for the sake of example.

       1:public class IFileDirectoryVisitorTestI extends InterfaceTestCase {
       2:    private static final Class THIS_CLASS = IFileDirectoryVisitorTestI.class;
       3:    public IFileDirectoryVisitorTestI( String name, ImplFactory f ) {
       4:        super( name, IFileDirectoryVisitor.class, f );
       5:    }
       6:    
       7:    protected IFileDirectoryVisitor createIFileDirectoryVisitor() {
       8:        return (IFileDirectoryVisitor)createImplObject();
       9:    }
      10:    
    A 11:    public void testToString1() {
      12:        IFileDirectoryVisitor fdv = createIFileDirectoryVisitor();
      13:        assertNotNull( fdv.toString() );
      14:    }
      15:    
      16:    public static InterfaceTestSuite suite() {
      17:        InterfaceTestSuite suite = IFileVisitorTestI.suite();
    B 18:        suite.addTestSuite( IDirectoryVisitorTestI.suite() );
      19:        suite.addTestSuite( THIS_CLASS );
      20:        return suite;
      21:    }
      22:}
    
      If we did not add at least one test, then the IFTC would register this test class without tests as a failure. Here, since the interface extends two interfaces, we simply register each's test in turn to imitate the test "inheritance" language defined by the framework. The current test is registered, and the completed hierarchy suite is returned. Since both inherited tests define in their constructor that they test classes which complement the IFileDirectoryVisitorTestI's class-under-test, all suites can share the same registered ImplFactory instances.

    AbstractDirectoryParser

    Now, let's move to an abstract, common implementation of IDirectoryVisitor. This will parse the equivalent of the "chdir" command, translating it into a "push", "pop", or do-nothing. It will call out to an abstract method to see if the entered dir is "special", and will call the visit method if it is.

       1:public abstract class AbstractDirectoryParser implements IDirectoryVisitor {
       2:    private Stack stack = new Stack();
       3:    private String currDir, parentDir, sep;
       4:    
       5:    public AbstractDirectoryParser( String current, String parent,
       6:            String seperator ) {
       7:        if (current == null || parent == null || seperator == null ||
       8:            current.length() <= 0 || parent.length() <= 0 ||
       9:            seperator.length() <= 0 ) throw new IllegalArgumentException();
      10:        this.currDir = current;
      11:        this.parentDir = parent;
      12:        this.sep = seperator;
      13:    }
      14:    
      15:    public String getCurrentDir() {
      16:        StringBuffer sb = new StringBuffer();
      17:        Enumeration enum = this.stack.elements();
      18:        boolean isFirst = true;
      19:        while (enum.hasMoreElements()) {
      20:            if (isFirst) isFirst = false;
      21:            else sb.append( this.sep );
      22:            
      23:            sb.append( enum.nextElement() );
      24:        }
      25:        return sb.toString();
      26:    }
      27:    
      28:    public void enterDir( String s ) {
      29:        if (s == null || s.length() <= 0) throw IllegalArgumentException();
      30:        if (s.equals( this.parentDir )) popDir();
      31:        else if (!s.equals( this.currDir )) pushDir( s );
      32:        if (isSpecial( getCurrentDir() )) visitCurrentDir();
      33:    }
      34:    
      35:    public void pushDir( String s ) {
      36:        if (s == null || s.length() <= 0 || s.equals( this.parentDir ) ||
      37:            s.equals( this.currDir ) || s.equals( this.sep ))
      38:            throw new IllegalArgumentException();
      39:        
      40:        this.stack.push( s );
      41:    }
      42:    
      43:    public void popDir() {
      44:        if (this.stack.size() <= 0) throw new IllegalStateException();
      45:        this.stack.pop();
      46:    }
      47:    
      48:    public abstract boolean isSpecial( String aDir );
      49:}
    

    We can create two test classifications for this: one that performs "mock-object"-like testing, by creating an internal concrete class, and an inheritable test class. Let's start with the inheritable one.

       1:public class AbstractDirectoryParserTestI extends InterfaceTestClass {
       2:    private static final Class THIS_CLASS = AbstractDirectoryParserTestI.class;
       3:    
       4:    public interface AbstractDirectoryParserImplFactory {
       5:        public AbstractDirectoryParser createAbstractDirectoryParser(
       6:            String c, String p, String s );
       7:    }
       8:    
       9:    public AbstractDirectoryParserTestI( String name, ImplFactory f ) {
    A 10:        super( name, AbstractDirectoryParserImplFactory.class, f );
      11:    }
      12:    
      13:    protected AbstractDirectoryParser createAbstractDirectoryParser(
      14:            String curr, String parent, String sep ) {
    B 15:        return ((AbstractDirectoryParserImplFactory)createImplObject()).
      16:            createAbstractDirectoryParser( curr, parent, sep );
      17:    }
      18:    
      19:    public void testGetCurrentDir1() {
      20:        AbstractDirectoryParser adp = createAbstractDirectoryParser(
      21:            ".", "..", "_" );
      22:        assertEquals(
      23:            "",
      24:            adp.getCurrentDir() );
      25:    }
      26:    
      27:    public void testGetCurrentDir2() {
      28:        AbstractDirectoryParser adp = createAbstractDirectoryParser(
      29:            "1", "12", "123" );
      30:        adp.enterDir( "A" );
      31:        adp.enterDir( "B" );
      32:        adp.enterDir( "2" );
      33:        adp.enterDir( "12" );
      34:        adp.enterDir( "C" );
      35:        adp.enterDir( "1" );
      36:        adp.enterDir( "D" );
      37:        assertEquals( "A123B123C123D", adp.getCurrentDir() );
      38:    }
      39:    
      40:    public static void suite( InterfaceTestSuite stdFactorySuite,
      41:            InterfaceTestSuite adpFactorySuite ) {
    C 42:        stdFactorySuite.addTestSuite( IDirectoryVisitorTestI.suite() );
      43:        adpFactorySuite.addTestSuite( THIS_CLASS );
      44:    }
      45:}
    
    Like most of these tests, this one has three points of interest:
      Since the tests, to be "interesting", require additional knowledge of the starting state for the AbstractDirectoryParser under test, it requires subclass tests to construct an AbstractDirectoryParserImplFactory rather than an AbstractDirectoryParser directly. The method testGetCurrentDir2() shows why this can be powerful. Note that these factories may have multiple construction methods for different kinds of setup. Since the test uses a factory to create AbstractDirectoryParser instances, the helper builder method changes accordingly. Since AbstractDirectoryParser implements IDirectoryVisitor, AbstractDirectoryParserTestI should "inherit" the tests from IDirectoryVisitorTestI. And, AbstractDirectoryParserTestI is an interface test, so it merely constructs the suite to test, but does not add factories itself. However, IDirectoryVisitorTestI and AbstractDirectoryParserTestI use different implementation classes which are not directly related to each other, and as such they cannot share ImplFactory instances. So, AbstractDirectoryParserTestI resolves this by requiring the two different suites to be passed in, allowing the user of the suites to make the differentiation when adding the specialized factory implementations. Remember, since the Interface test classes are not directly run by the JUnit framework, we can form the suite method however we want.

    The mock-object version of the test follows. Note that both the above inheritable test and the below concrete test can co-exist in the same test class path due to the naming convention used in this document.

       1:public class AbstractDirectoryParserTest extends TestCase {
       2:    private static final Class THIS_CLASS = AbstractDirectoryParserTest.class;
       3:    public AbstractDirectoryParserTest( String name ) {
       4:        super( name );
       5:    }
       6:    
       7:    private class MyADP extends AbstractDirectoryParser {
       8:        String specialDirName = " ";
       9:        public boolean isSpecial( String name ) {
      10:            return name.endsWith( specialDirName );
      11:        }
      12:        
      13:        int visitCount = 0;
      14:        public void visitCurrentDir() {
      15:            ++visitCount;
      16:        }
      17:    }
      18:    
      19:    public void testVisit1() {
      20:        MyADP adp = new MyADP( ".", "..", "/" );
      21:        adp.enterDir( " " );
      22:        adp.enterDir( "." );
      23:        adp.enterDir( "A" );
      24:        adp.enterDir( ".." );
      25:        adp.enterDir( " " );
      26:        assertEquals( 4, adp.visitCount );
      27:    }
      28:    
      29:    private class MyADPImplFactory
      30:            implements AbstractDirectoryParserImplFactory {
      31:        public AbstractDirectoryParser createAbstractDirectoryParser(
      32:                String c, String p, String s ) {
    A 33:            return new MyADP( c, p, s );
      34:        }
      35:    }
      36:    
      37:    public static Test suite() {
    B 38:        InterfaceTestSuite std = new InterfaceTestSuite();
      39:        InterfaceTestSuite dif = new InterfaceTestSuite();
      40:        std.addFactory( new ImplFactory() {
      41:            public Object createImplObject() {
      42:                return new MyADP( ".", "..", "/" );
      43:            }
      44:        } } );
      45:        dif.addFactory( new ImplFactory() {
      46:            public Object createImplObject() {
      47:                return new MyADPImplFactory();
      48:        } } );
      49:        AbstractDirectoryParserTestI.suite( std, dif );
    C 50:        TestSuite ts = new TestSuite( THIS_CLASS );
      51:        ts.addTestSuite( std );
      52:        ts.addTestSuite( dif );
      53:        return ts;
      54:    }
      55:}
    
      We need to provide an AbstractDirectoryParserImplFactory instance, so this is the test's verson for the mock-object MyADP. We could have just as easily provided an anonymous innner class. We create two new InterfaceTestSuites, load each with its own factory type, then pass this into the AbstractDirectoryParserTestI suite so it can add its appropriate test suites. We join these two seperate suites inside a single TestSuite, then add the current test class to the suite, and return it. Since the two seperate InterfaceTestSuites remain seperate inside the TestSuite, they will not share factories, and there will be no test construction problems.

    libgroboutils-java-5.orig/testing-junit/xdocs/summary.xml0000644000175000017500000001021707777607733024045 0ustar drazzibdrazzib testing-junit JUnit helpers and extentions net.sourceforge.groboutils.junit.v1 JUnit extentions for easing test making. AssertConstructor Similar to the Assert class in JUnit, but allows for testing objects and classes for the existence of different constructors. AssertTestFactory Creates Test objects that execute a single assert. Used to create 'soft' (sub) tests during integration testing. SubTestTestCase Subclass of TestCase that allows for a test to dynamically register a sub-test, which will be run after the owning test finishes, and in new tests. IntegrationTestCase Subclass of TestCase designed for integration tests, which generally need 'soft' failures - a failure which does not need to stop the execution of the test. MultiThreadedTestRunner A utility class which executes a collection of small test methods in parallel. Capable of specifying a maximum run time to prevent dead-locks or infinite loops from hanging the test execution. Propigates all errors to the owning class. SysPropertiesUtil Utility that allows for easy setting and reseting of System properties. Some classes that need testing may depend upon a System property setting, and this class will help testing that. This is JDK 1.1 and above compatible. 17-Jul-2003: Updates to MultiThreadedTestRunner allow for monitors to check the status of runners without needing to quit, and added the ability to kill wild threads. The documentation for this has been updated as well. testing-junit Test Class Parsing net.sourceforge.groboutils.junit.v1.parser Extracted the functionality used by junit.framework.TestSuite to parse the Test classes, and enabled it for easy exension to support different construction mechanisms. 17-Jul-2003: This is fairly stable, but the code coverage reports show that it needs a bit more testing in some areas. testing-junit Hierarchial Unit Tests net.sourceforge.groboutils.junit.v1.iftc JUnit extention for helping in the creation of hierarchial test cases, also known as 'contract' or 'interface' test-cases. 10-Jan-2004: Found and fixed a minor bug with passing the message on an assert in IntegrationTestCase. libgroboutils-java-5.orig/testing-junit/xdocs/using_subtests.xml0000644000175000017500000001401407655132715025414 0ustar drazzibdrazzib Starting Other Tests In A Test $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    With the usage of the hierarchy tests, I have encountered situations where my unit test for a method in interface A returns an instance of interface B. I thought that my existing tests for interface B would be perfect for adding extra insurance on the returned instance.

    Fortunately, I had created the TestCase subclass SubTestTestCase which allows for a running test to add additional tests for execution. It allowed me to write a test in the following way:

       1:    A a = (A)createImplObject();
       2:    B b = a.getB()
       3:    InterfaceTestSuite its = BUTestI.suite();
       4:    its.addFactory( new CxFactory( testName ) {
       5:            public Object createImplObject() throws Exception
       6:            {
       7:                return b;
       8:            }
       9:        } );
      10:    addSubTest( its );
      11:
    The third line retrieves the InterfaceTestSuite instance from the interface test case for interface B. The following line adds a new factory to the interface test case that returns the newly discovered B instance. Finally, the test suite is added to the SubTestTestCase list of tests to run.

    The above method isn't perfect: if the tests modify the instance in any way, then all executed tests will be modifying the same instance, making error tracing difficult at best. However, for many situations, this helps in assuring that a returned object conforms to all required standards.

    libgroboutils-java-5.orig/testing-junit/xdocs/using_mtt.xml0000644000175000017500000017566107737303445024365 0ustar drazzibdrazzib Using Multi-Threaded Tests $Date: 2003/10/03 14:26:45 $ Matt Albrecht

    The GroboUtils class MultiThreadedTestRunner was based on the article "JUnit Best Practices" by Andy Schneider (andrew.schneider@javaworld.com), published online at http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html. Since GroboUtils first started using that implementation, many changes have occured in the code to make a more robust and stable testing environment. Due to these changes, the use of the class will be fully described in this document.

    Let's start by testing a sample application:

       1:import java.io.*;
       2:public class WriterCache
       3:{
       4:    public static interface IWriterFactory
       5:    {
       6:        public Writer createWriter( String location )
       7:            throws IOException;
       8:    }
       9:    
      10:    private String openLocation;
      11:    private Writer w;
      12:    private IWriterFactory factory;
      13:    private volatile int openCount = 0;
      14:    
      15:    public WriterCache( IWriterFactory wf )
      16:    {
      17:        if (wf == null)
      18:        {
      19:            throw new IllegalArgumentException( "factory cannot be null" );
      20:        }
      21:        this.factory = wf;
      22:    }
      23:    
      24:    public void writeToFile( String location, String text )
      25:        throws IOException
      26:    {
      27:        if (location == null) return;
      28:        if (!location.equals( this.openLocation ))
      29:        {
      30:            if (this.w != null)
      31:            {
      32:                --this.openCount;
      33:                this.w.close();
      34:            }
      35:            ++this.openCount;
      36:            this.w = this.factory.createWriter( location );
      37:        }
      38:        this.w.write( text );
      39:    }
      40:    
      41:    public int getNumberWritersOpen()
      42:    {
      43:        return this.openCount;
      44:    }
      45:}
    
    Obviously, this class isn't very thread safe - w could easily be closed in one thread when a thread execution switch causes another thread to run its write statement on the closed writer, or even writing to a different writer than what was created (this is data corruption, which is worse than a raised exception).

    Note that this class is designed for testing: we can easily create streams in our tests and note what gets written and to which stream. This follows a pattern of designing for mock objects.

    Beginning the Unit Test Class

    The test class starts off with the standard naming conventions and constructor, and all necessary imports:

     1:import net.sourceforge.groboutils.junit.v1.MultiThreadedTestRunner;
     2:import net.sourceforge.groboutils.junit.v1.TestRunnable;
     3:import junit.framework.TestCase;
     4:import junit.framework.TestSuite;
     5:import java.io.*;
     6:import java.util.*;
     7:
     8:public class WriterCacheUTest extends TestCase
     9:{
    10:    public WriterCacheUTest( String name )
    11:    {
    12:        super( name );
    13:    }
    
    Next, we need a way to archive the WriterCache created streams in our own IWriterFactory:
    15:    public static class MyWriterFactory implements WriterCache.IWriterFactory
    16:    {
    17:        Hashtable nameToStream = new Hashtable();
    18:        public Writer createWriter( String location )
    19:            throws IOException
    20:        {
    21:            StringWriter sw = (StringWriter)nameToStream.get( location );
    22:            if (sw == null)
    23:            {
    24:                sw = new StringWriter();
    25:                nameToStream.put( location, sw );
    26:            }
    27:            return sw;
    28:        }
    29:    }
    30:}
    
    It uses StringWriter instances so that the tests can examine what what written to which stream.

    Ignoring the standard non-threaded tests for such a class (for brevity's sake), we move onto the threaded tests. But before we can write the tests, we need to devise the different tests that we can perform.

    1. One thread can write to one location with a known text pattern, while another writes to a different location with a different text pattern. The test would check to make sure that each location contains only the expected text pattern, and exactly the number of text patterns actually written. Let's call this test "TextPattern"
    2. Use lots of writing threads (say 10), but this time we check for the number of opened writers to ensure it never becomes negative, and generate some kind of warning if it is not 0 or 1. Let's call this test "OpenWriterCount".

    Note: since this class uses a StringWriter instance as the returned Writer, the WriterCache calls to close() on the instance will be ignored, as this is the documented behavior of the StringWriter class. Thus, the same StringWriter instance can be sent to the WriterCache over and over.

    Creating a TestRunnable

    In order to support the above tests, we'll need a way to generate the text pattern for a given location, a given number of times. This is where the GroboUtil extension for multi-threaded testing comes into play. We create another inner class to generate the WriterCache calls by extending the TestRunnable class:

    31:    static class WriteText extends TestRunnable
    32:    {
    33:        private WriterCache wc;
    34:        private int count;
    35:        private String textPattern;
    36:        private String location;
    37:        private int sleepTime;
    38:        public WriteText( WriterCache wc, int count, String pattern,
    39:            String loc, int delay )
    40:        {
    41:            this.wc = wc;
    42:            this.count = count;
    43:            this.textPattern = pattern;
    44:            this.location = loc;
    45:            this.sleepTime = delay;
    46:        }
    47:        
    48:        public void runTest() throws Throwable
    49:        {
    50:            for (int i = 0; i < this.count; ++i)
    51:            {
    52:                Thread.sleep( this.sleepTime );
    53:                this.wc.writeToFile( this.location, this.textPattern );
    54:            }
    55:        }
    56:    }
    57:}
    
    The void runTest() method must be implemented by concrete subclasses of TestRunnable: this is the equivalent of the standard Java interface Runnable's void run() method, but properly wrapped for testing.

    Running Several Tasks In Parallel

    This allows us to begin writing the test for "TextPattern". This test says that we need to write to two different streams with different text in parallel. Then, we need to ensure that the correct amount of data was written to each, and that no inappropriate data was written. In this test, we'll have one WriteText instance write to location "0" with text "0" (we'll call this thread 0), and another write to location "1" with text "1" (we'll call this thread 1). To vary things up, thread 0 will write 10 times with a 50 millisecond wait, and thread 1 will write 12 times with a 20 millisecond wait. The test ends up looking like:

    59:    public void testTextPattern() throws Throwable
    60:    {
    61:        MyWriterFactor mwf = new MyWriterFactory();
    62:        WriterCache wc = new WriterCache( mwf );
    63:        TestRunnable tcs[] = {
    64:                new WriteText( wc, 10, "0", "0", 50 ),
    65:                new WriteText( wc, 12, "1", "1", 20 )
    66:            };
    67:        MultiThreadedTestRunner mttr =
    68:            new MultiThreadedTestRunner( tcs );
    69:        mttr.runTestRunnables( 2 * 60 * 1000 );
    70:        String s0 = mwf.nameToStream.get( "0" ).toString();
    71:        String s1 = mwf.nameToStream.get( "1" ).toString();
    72:        assertEquals( "Data corruption: stream 0", 10,
    73:            s0.length() );
    74:        assertEquals( "Data corruption: stream 1", 12,
    75:            s1.length() );
    76:        assertTrue( "Incorrect data written to stream 0.",
    77:            s0.indexOf( '1' ) < 0 );
    78:        assertTrue( "Incorrect data written to stream 1.",
    79:            s1.indexOf( '0' ) < 0 );
    80:    }
    81:
    
    Lines 61-62 initialize the WriterCache instance with our test factory. Line 63 creates our list of parallel tasks to execute, which are instances of our WriteText class above.

    Line 64 creates an instance of the MultiThreadedTestRunner class, a utility class which handles the creation, execution, and termination of the threads which run the TestRunnable instances. Line 65 invokes the utility method to run the tasks. The argument to this method specifies the maximum amount of time (in milliseconds) to let the threads run before killing them and marking the execution as a failure (through junit.famework.Assert). If any of the TestRunnable instances dies due to an exception (including an Assert failure), then all of the running threads are terminated, and the runTestRunnables method rethrows the underlying exception.

    The remainder of the test ensures that only the correct data was placed where it was intended to go.

    Parallel Monitoring of Threaded Access

    Now we can move on to the OpenWriterCount test. As of GroboTestingJUnit version 1.2.0, there is a very simple way to add a thread that monitors the status of the common object while other threads manipulate its state.

    The monitors are in a separate group from the runners, as the monitors are intended to loop over a set of checks until all the runners have completed. Before this functionality was added, the monitor runners had to communicate with the other runners to learn when the runners were finished. Now, the MultiThreadedTestRunner class handles this communication.

    We create another runnable class, but this time subclassing from TestMonitorRunnable. This frees the new class from having to perform the proper looping and detection of when the runners have completed. In order to use this added functionality, the subclasses overload the runMonitor() method instead of the runTest() method.

    83:    public static class WriterCountMonitor extends TestMonitorRunnable
    84:    {
    85:        private WriterCache wc;
    86:        public WriterCountMonitor( WriterCache wc )
    87:        {
    88:            this.wc = wc;
    89:        }
    90:        
    91:        public void runMonitor() throws Throwable
    92:        {
    93:            int open = this.wc.getNumberWritersOpen();
    94:            assertTrue(
    95:                "Invalid number of open writers.",
    96:                open == 0 || open == 1 );
    97:        }
    98:    }
    99:
    

    The monitors are added to the MultiThreadedTestRunner through a second argument in another constructor. For our test, in order to have high confidence that threading errors causing the writer open count to be invalid (not 1 or 0), we need to have a sufficient number of threaded access on the object-under-test. So, we generate 30 runners to iterate 500 times each over the writer.

    101:    public void testOpenWriterCount() throws Throwable
    102:    {
    103:        int runnerCount = 30;
    104:        int iterations = 500;
    105:        MyWriterFactor mwf = new MyWriterFactory();
    106:        WriterCache wc = new WriterCache( mwf );
    107:        TestRunnable tcs[] = new TestRunnable[ runnerCount ];
    108:        for (int i = 0; i < runnerCount; ++i)
    109:        {
    110:            tcs[i] = new WriteText( wc, 500, ""+(char)i,
    111:                ""+(char)i, 50 );
    112:        }
    113:        TestRunnable monitors[] = {
    114:                new WriterCountMonitor( wc );
    115:            };
    116:        MultiThreadedTestRunner mttr =
    117:            new MultiThreadedTestRunner( tcs, monitors );
    118:        mttr.runTestRunnables( 10 * 60 * 1000 );
    119:        
    120:        // verify streams
    121:        for (int i = 0; i < runnerCount; ++i)
    122:        {
    123:            String s = mwf.nameToString.get( ""+(char)i ).toString();
    124:            assertEquals( "Data corruption: stream "+i,
    125:                500, s.length() );
    126:        }
    127:    }
    128:
    

    So, while this test runs the 30 runners, each writing 500 times, the monitor runs concurrently, analyzing the status of the WriterCache instance to ensure its integrety.

    As one would expect, both of these tests expose serious synchronization flaws in the WriterCache implementation.

    Things To Look Out For

    This package isn't without its pitfalls. Here's a checklist to review to ensure that your tests comply with the MTTR caveats.

    1. Never directly run TestRunnable instances. They are designed to only be run in threads generated by the runTestRunnables() method inside the MultiThreadedTestRunner class.
    2. The TestRunnable subclasses need to have their runTest() methods be watchful of InterruptedException and Thread.currentThread().isInterrupted(). The MultiThreadedTestRunner prematurely halts the runner threads by calling Thread.interrupt() on them. If the threads don't terminate themselves within a certain time limit, then MultiThreadedTestRunner will perform the dangerous Thread.stop() operation, in order to prevent threads from going rogue. (Future versions may allow the Thread.stop() call to be disabled.)

    Alternatives

    One alternative design to this approach is Greg Vaughn's TestDecorator approach, which is located here. However, it forces the decorated Test instance to create the threads itself, and does nothing to manage runaway threads.

    libgroboutils-java-5.orig/testing-junit/xdocs/about.xml0000644000175000017500000000443607655132715023454 0ustar drazzibdrazzib About JUnit Test Extensions $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    The testing-junit sub-project of GroboUtils contains extensions to the JUnit testing framework.

    These are the major issues which this sub-project attempts to tackle:

      There's a series of classes with the purpose of aiding in running integration tests from within the JUnit test framework. There exists a conflict of interest between JUnit and integration (or functional) tests: JUnit considers any failure reason to terminate the test, while integration tests commonly can report failures while continuing with the test. This JUnit extension allows for an integration test to register a "soft" failure, which reports the failure but does not stop the test. As one of my professors once said, "the only area of computer programming that requires actual intelligence is thread safety." Several other projects have attempted to add multi-threaded testing into their JUnit extensions with varying degrees of success. This extention allows the user to create many routines to run at once. Though this does not allow for a rigourous assurance of thread safety, it allows the user many options, such as seeing how parts of a unit interact with each other in a multi-threaded environment, and attempting to detect errors in assumptions when a bit of code is executed many times within many threads. Several references show the need to test not only a base class, but also that same base class in the shared context of inherited classes. This includes both the contracts presented by interfaces and abstract methods, and the code contained in concrete methods. This framework allows for the developer to write shared tests once, which can be run in all necessary contexts.

    libgroboutils-java-5.orig/testing-junit/xdocs/art_iut.xml0000644000175000017500000000444107655132715024005 0ustar drazzibdrazzib Integration Unit Tests $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    In the terminology I present in this series of articles, unit tests assert that the smallest unit of code (classes for OOP) work as designed. System level tests verify that the whole application works as planned, and that outside forces do not cause unexpected errors.

    Integration unit tests (IUTs) reside in the middle ground between these two extremes. At the lowest level, IUTs ensure that two classes work together correctly. Note that unit tests may fall into this location as well, otherwise unit tests would be restricted to only using mock-objects to simulate any required interaction. At the highest level, IUTs check that large groups of components work or fail correctly when presented with a specific initial state, which can fall into the same area as system level tests.

    The Grobo Way

    I tend to view IUTs from the perspective of another application wanting to reuse the functionality presented by the set of classes under test. They have full access to the public methods and fields, as well as full access to any protected methods and fields for subclassed objects.

    The tests may try to use the classes in obscure ways, but any contract defined by the classes must be followed (otherwise, it's a class-user error, which should be tested in unit tests, not IUTs).

    Standards for Integration

    Libraries: Note that the IUTs test the "public", or "outside" usage of the library. The IUTs can be used as a litmus test to ensure that the library retains binary backwards compatability with earlier versions. My standard is that once a library is shipped as outside of beta, then the existing IUTs must not change. If an IUT fails, then binary compatiblity has broken. If the change is required for a new functionality, then the library enters a new major version. Due to the package naming convention of GroboUtils, the old major version (say, v3) will remain in the code base, while the revised version will enter a new package (in this example, v4).

    libgroboutils-java-5.orig/testing-junit/xdocs/art_ait.xml0000644000175000017500000000171207655132715023757 0ustar drazzibdrazzib Application Integration Tests $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    For the series of articles on this site that concern testing levels, I use the term system tests to refer to those tests that verify that the whole application works as planned, and that outside forces do not cause unexpected errors. One particular subset of system tests are Application Integration Tests, which I term to mean completely automated system tests.

    System level tests generally require much more interaction with the native platform than integration unit tests or unit tests. As such, it makes sense to implement this logic in a scriptable language, rather than Java. Personally, I choose Ant, since it is a Java native tool and has good cross-platform capabilities.

    libgroboutils-java-5.orig/testing-junit/xdocs/design_iftc.xml0000644000175000017500000000724507655132715024621 0ustar drazzibdrazzib Design of IFTC $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    The Interface / Hierarchial Test Classes (IFTC) creates inheritance extensions of the commonly used JUnit framework: TestSuite, Test, and TestCase.

    The InterfaceTestCase class is the IFTC extension to TestCase. It has provisions for allows concrete test classes to create factories that create instances for the InterfaceTestClass to test. These factories must be of type ImplFactory, and its creation method must return a non-null instance of the interface or class which the InterfaceTestClass is testing.

    The InterfaceTestSuite class extends the JUnit TestSuite, allowing for the registration of InterfaceTests and Tests, as well as ImplFactory instances for the association with registered InterfaceTests. These InterfaceTestSuite instances can be chained together, contain multiple InterfaceTests, and be contained within TestSuites to create complex test setups (see Using IFTC).

    ImplFactory implementations know how to generate an instance of a concrete class which an InterfaceTestCase subclass should test. Implementations of the subinterface ICxFactory can tear down instances which were created during InterfaceTestCase's tear down method.

    Traceability

    One goal of IFTC (see requirements and goals) is to provide an easy way for users to trace errors in the hierarchial tests. Without such traceability, the user has no way of telling which context / ImplFactory caused an error in a test; the error report will simply tell the user in which inherited class and method the error occured.

    As of version 1.0.0, IFTC supports reporting the name of the factory in the InterfaceTestCase's getName() method via the factory's own toString() method. The CxFactory class adds an ease-of-use functionality that helps generate a clear toString() descriptor for each new factory instance. Optionally, InterfaceTestCase's getName() method can also add in the its instance's class name (without the package) to further specify in which test class the test was executed.

    As current as Ant 1.5.1, Ant JUnit reporter task (specifically, XMLJUnitResultFormatter) does not use the toString() method to describe the tests that ran, but instead uses the TestSuite getName(), and TestCase getName() (or name() for backwards compatibility). Therefore, there exists a need to change getName(), as only changing toString() will not solve this traceability issue. If someone finds that this severely breaks something else that expects getName() to only return the method name, then contact the project.

    Effects of JUnit 3.8.1

    JUnit 3.8.1 includes a new feature that 3.7 and earlier versions did not include: the test constructor no longer requires taking a String argument, and instead the test name can be set through the setName() method. As a result, the GJE TestClassParser class needs to imitate the new TestSuite functionality.

    InterfaceTestCase still takes only the factory-expected instance in its constructor. See the JavaDoc for InterfaceTestCase as to why this route was taken.

    libgroboutils-java-5.orig/testing-junit/xdocs/requirements_iftc.xml0000644000175000017500000000165307655132715026070 0ustar drazzibdrazzib Goals/Requirements for IFTC $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    The JUnit Interface/Hierarchial Test Case (IFTC) extention has the following goals:

    1. Allow for users to write tests for interfaces, abstract classes, and any extensible class.
    2. Provide a framework extension to JUnit, with a similar approach to writing tests as standard JUnit.
    3. A concrete class's tests must be able to use the framework to "inherit" the tests of the concrete class' implemented interfaces and super-classes.
    4. Allow for multiple contexts of a concrete class to be tested by inherited tests.
    5. Allow for easy tracing of failed tests.

    libgroboutils-java-5.orig/testing-junit/xdocs/using_it.xml0000644000175000017500000000373307655132715024162 0ustar drazzibdrazzib Using Integration Tests $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    Integration tests, also known as system tests, pose a different problem to testers than the standard unit tests. JUnit was designed with unit tests in mind: if any part of the test fails, then the unit as a whole fails. Likewise, JUnit works best when the tests are broken into the smallest possible minutae for better granularity and clarity into where a unit breaks.

    On the other hand, integration tests lie in a different realm in testing. Each test generally takes some part of the application for a spin, examining how each part influences each other, and looking for places where this communication happens incorrectly. These tests can bring in user input and other outside events to the application.

    Failure Severity

    An integration test may fail at some point in the run, but that generally doesn't mean that the run itself needs to stop. Integration tests introduce the concept of failure severity. One can break failures into two general categories: failures that immediately stop the run, and those that allow the test to continue. The JUnit concept of failures falls into the former.

    The GroboUtils JUnit extention class net.sourceforge.groboutils.junit.v1.IntegrationTestCase introduces "soft" failures; those that are a failure, but don't stop the test. The underlying design creates a new test object that runs the specified test, but it is executed outside the context of the owning test run, so that the new test object's failure status will be recorded on its own. This also allows for a more accurate depiction of the number of tests actually executed, as opposed to the number of runs executed.

    libgroboutils-java-5.orig/testing-junit/xdocs/index.xml0000644000175000017500000000246007655132715023444 0ustar drazzibdrazzib JUnit Extensions $Date: 2003/05/04 06:40:13 $
  • About JUnit Extensions
  • Interface/Hierarchial Test Case (IFTC):
  • Goals/Requirements
  • Design
  • Using
  • Other Extensions:
  • Using Integration Tests
  • Using Multi-Threaded Tests
  • Starting Other Tests In A Test
  • Articles:
  • Naming JUnit Tests
  • JUnit Patterns
  • Hierarchy Tests
  • Enemy Unit Tests
  • Integration Unit Tests
  • Application Integration Tests
  • libgroboutils-java-5.orig/testing-junit/xdocs/art_naming.xml0000644000175000017500000002126007655132715024453 0ustar drazzibdrazzib Naming Your JUnit Tests $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    A critical component to starting off a project with good tests involves designing a robust set of conventions for segmenting and naming the automated tests. This article presents the conventions used in the GroboUtils project ( http://groboutils.sourceforge.net ) for Java tests based on the JUnit testing framework.

    Moving Tests Away From Development Code

    The GroboUtils project separates the development (API) code away from the tests into parallel directory trees (Figure 1). This helps to keep all the Java source code contained in one tree, while logically dividing the different kinds of tests and API source. Note that this places test classes in the same Java package as the classes which they purport to test.

    Since the test classes are now in the same Java package as the API code they test, the test classes can access protected and package-private members of all API classes in that package. This allows for the unit tests to act more like black-box tests without any special back-door access or special classloader extentions.

    Building and packaging the project becomes easier as well. Now that the project source files are separate from the tests, they can be easily compiled independent of one another, which allows JARring of tests separate from API. Having these two physically separated leads to smaller deployment files.

    This does lead to one problem related to Extreme Programming (XP) conformance. XP states that the tests should always be compiled with the project source, in order to guarantee that the tests are always up-to-date with the project. If we break the tests away from the projects, then it is difficult to make this guarantee. However, tools such as Ant (http://ant.apache.org) can help to rectify this problem by always building the two together.

    A Test Class For Every Project Class

    My personal test process involves creating a Unit Test for every project class. This tells me at a glance which classes I have tests for, and those that I don't. Also, putting all the unit tests for a class in a single JUnit class allows me to keep all of a project class's tests well contained and organized.

    Inside the test class, I usually start with at least one test method per accessible method in the project class. This allows me to ensure that each outside-accesible method works under all conditions I can think of. I can quickly tell which methods need tests by tools such as JBrowse for jEdit (jedit.org).

    Consistent Naming Convention

    Nothing helps keep tests organized like a consistent naming convention. For each test class that tests a project class, say class Xyz, I name the test class XyzTest. I put the 'Test' part at the end of the name, so that tools such as command-line name-completion can be more effectively used. Nothing's more annoying than having to type out 'vi TestX' before tab-completion becomes useful. One of my co-workers once went on a thirty minute rant about how there were 132 files in one directory, all starting with 'TestProjectNameSetup'.

    As for the test method names for each project class method, say getMno(), I create test methods named testGetMno1(), testGetMno2(), and so on.

    Test Categories

    I split my tests into four general categories, listed in order of execution:

      Ensures that the project's class's outside dependencies work as expected (see my article on the subject). focus on the verification of the smallest building blocks of software design - the class, ensuring that they work correctly in isolation. testing performed to catch errors when two or more components are combined to execute their functionalities (see my article on the subject). in this context, I use this phrase to mean tests that run the entire application. The tests usually are either very long lasting, or sometimes require user interation. In other scenarios, they may even include multi-process or multi-computer depedencies. There are too many books and research articles on the subject to list.

    Each one of these categories has a separate directory, all siblings to the project source directory. If you look at how the GroboUtils project organizes its files, it looks like:

        sub-project
           |
           +-- sources
                |
                +-- dev
                |
                +-- eut
                |
                +-- ut
                |
                +-- iut
                |
                +-- ait
    
    Each of these source directories are compiled separately.

    You don't have to know exactly how to divide up your tests. Some tests may go in integration unit tests or in unit tests. It doesn't matter where you put them, just as long as it makes sense. I generally follow these guidelines:

      Tests that the class operates correctly within itself. All public and protected methods are directly tested from UTs. Also, internal-state tests (multiple calls of the same instance or class) are performed here. Mock Objects can be used to simulate outside classes. Tests that each class within the project works well with others. This ensures the internal consistency of the package / project. In the case of GroboUtils, this involves testing only the classes within the same sub-project. Tests to ensure that the project classes work well with third-party libraries or classes outside the project, and that the developer's assumptions about the library are correct. Contains large scale tests that excercise the entire project, end-to-end.

    Inter-Test Dependencies

    I allow for tests to use other tests, even if from another category or another project.

    In order to avoid test naming colisions, which can happen often between categories of the same project, I give each test class a name dependent upon the class tested (or test description) and the test category. So, for UTs, I use ClassUTest; for EUTs, I use ClassEUTest; for IUTs, I use ClassIUTest. AITs tend to be in a package which is completely different than the rest of the project, so the class naming convention is not strictly followed, but I do try to name the main entry classes as ClassAITest.

    Hierarchy Tests

    If you implement any hierarchy tests in your project, you may encounter the same problem I did: since the tests can't be directly run (they rely upon a factory from a concrete class), tools such as the Ant <junit> task, with its <batch> capability, will discover and try to run the hierarchy tests, failing in the process.

    In response, I end all my hierarchy tests with an I, which stands for "interface". So a unit test for IMyInterface.java would be named IMyInterfaceUTestI.java. Then, tools such as the Ant <junit> task mentioned above can filter on *Test.java files, which will avoid the hierarchy tests completely.

    Imran Bashir and Amrit L. Goel. Testing Object-Oriented Software: Life Cycle Solutions. Springer, 1999. A. Parrish, R. Borie, and D. Cordes. Automated Flowgraph-Based Testing of Object-Oriented Software Modules. Journal of Systems and Software, Nov 1993. R.S. Pressman. Software Engineering A Practitioner's Approach. McGraw-Hill, 1997.
    libgroboutils-java-5.orig/testing-junit/xdocs/art_jf.xml0000644000175000017500000000406307655132715023603 0ustar drazzibdrazzib JUnit Patterns $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    Here's a list of problems presented during testing JUnit tests, and possible set of solutions.

    Subclass Anti-Pattern

    A common technique in writing JUnit tests goes like this. The developer writes a test that contains a lot of logic for a specific package. When the developer moves to the next class in the package, she finds that the same logic or data is shared between the two tests, so the tests are refactored, creating an abstract superclass for both tests.

    This subclassing pattern breaks down when some tests require the functionality from two orthogonal functionality sets. Since Java does not support multiple inheritance, the test must be split to artificially accomodate the two required functionalities, which also may lead to some tests that use both functionalities not being written.

    Instead, a suite utility class can be written for the purpose of aiding in tests. Not only does this break the tests away from the subclass anti-pattern, but it also isolates code that can be useful for outside projects. In this way, these utility classes can be moved from the tests to the production code if they are considered very useful.

    Testing Protected Code

    A developer will want to test the functionality of a class's protected or package-private members, and under most circumstances, this is not possible without the use of "backdoor" code.

    Tools such as the JUnitX package act as class loaders which change the signature of classes under test so that the protected members can be accessed by tests.

    Instead, put tests in the same package as the class files. Now, tests can access all outside accessible points of contact for assurance of correct behavior.

    See Naming Your JUnit Tests for more information on this technique.

    libgroboutils-java-5.orig/codecoverage/0000755000175000017500000000000011271425773020311 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/deployed.ant-inc.xml0000644000175000017500000000032210017255644024160 0ustar drazzibdrazzib libgroboutils-java-5.orig/codecoverage/reg-docs.xsl0000644000175000017500000002064310040164707022537 0ustar drazzibdrazzib WARNING: DO NOT EDIT THIS FILE This file was auto-generated. Please look at the .xml version of this file and edit that one instead. GroboCoverage - <xsl:value-of select="head/name/text()" />

    version

    Authors:Author:

    version:

    Copyright &copy; 2002-2004 GroboUtils Project.
    All rights reserved.
    , http://ant.apache.org/manual/ []
    
    
            

  • :
  • :
  • References

    []

    Description


    Examples


    Nested Elements



    Parameters

    Attribute Description Required

    libgroboutils-java-5.orig/codecoverage/build.xml0000644000175000017500000004074710073140107022126 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-io; &inc._shared.deployed.util-datastruct; <_coverage.compiler datadir="${dirs.test-output}/ait-1/data" outclassdir="${dirs.test-output}/ait-1/classes"> <_coverage.report datadir="${dirs.test-output}/ait-1/data" logdir="${dirs.test-output}/ait-1/logger" outdir="${dirs.test-output}/ait-1" reportfileprefix="coverage-" reportfileextension=".xml" /> <_coverage.report datadir="${dirs.test-output}/ait-1/data" logdir="${dirs.test-output}/ait-1/logger" outdir="${dirs.test-output}/ait-1" reportfileprefix="coverage-" reportfileextension=".xml" /> libgroboutils-java-5.orig/codecoverage/NOTICE0000644000175000017500000003060010040546655021210 0ustar drazzibdrazzib ========================================================================= == NOTICE file corresponding to the section 4 d of == == the Apache License, Version 2.0, == == in this case for the Apache Ant distribution. == ========================================================================= This product includes software developed by The Apache Software Foundation (http://www.apache.org/): - Log4J version 1.2.8: http://logging.apache.org/log4j/docs/index.html - BCEL version 5.1: http://jakarta.apache.org/bcel/index.html All are covered by the Apache License, Version 2.0: /* * Apache License * Version 2.0, January 2004 * http://www.apache.org/licenses/ * * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION * * 1. Definitions. * * "License" shall mean the terms and conditions for use, reproduction, * and distribution as defined by Sections 1 through 9 of this document. * * "Licensor" shall mean the copyright owner or entity authorized by * the copyright owner that is granting the License. * * "Legal Entity" shall mean the union of the acting entity and all * other entities that control, are controlled by, or are under common * control with that entity. For the purposes of this definition, * "control" means (i) the power, direct or indirect, to cause the * direction or management of such entity, whether by contract or * otherwise, or (ii) ownership of fifty percent (50%) or more of the * outstanding shares, or (iii) beneficial ownership of such entity. * * "You" (or "Your") shall mean an individual or Legal Entity * exercising permissions granted by this License. * * "Source" form shall mean the preferred form for making modifications, * including but not limited to software source code, documentation * source, and configuration files. * * "Object" form shall mean any form resulting from mechanical * transformation or translation of a Source form, including but * not limited to compiled object code, generated documentation, * and conversions to other media types. * * "Work" shall mean the work of authorship, whether in Source or * Object form, made available under the License, as indicated by a * copyright notice that is included in or attached to the work * (an example is provided in the Appendix below). * * "Derivative Works" shall mean any work, whether in Source or Object * form, that is based on (or derived from) the Work and for which the * editorial revisions, annotations, elaborations, or other modifications * represent, as a whole, an original work of authorship. For the purposes * of this License, Derivative Works shall not include works that remain * separable from, or merely link (or bind by name) to the interfaces of, * the Work and Derivative Works thereof. * * "Contribution" shall mean any work of authorship, including * the original version of the Work and any modifications or additions * to that Work or Derivative Works thereof, that is intentionally * submitted to Licensor for inclusion in the Work by the copyright owner * or by an individual or Legal Entity authorized to submit on behalf of * the copyright owner. For the purposes of this definition, "submitted" * means any form of electronic, verbal, or written communication sent * to the Licensor or its representatives, including but not limited to * communication on electronic mailing lists, source code control systems, * and issue tracking systems that are managed by, or on behalf of, the * Licensor for the purpose of discussing and improving the Work, but * excluding communication that is conspicuously marked or otherwise * designated in writing by the copyright owner as "Not a Contribution." * * "Contributor" shall mean Licensor and any individual or Legal Entity * on behalf of whom a Contribution has been received by Licensor and * subsequently incorporated within the Work. * * 2. Grant of Copyright License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * copyright license to reproduce, prepare Derivative Works of, * publicly display, publicly perform, sublicense, and distribute the * Work and such Derivative Works in Source or Object form. * * 3. Grant of Patent License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * (except as stated in this section) patent license to make, have made, * use, offer to sell, sell, import, and otherwise transfer the Work, * where such license applies only to those patent claims licensable * by such Contributor that are necessarily infringed by their * Contribution(s) alone or by combination of their Contribution(s) * with the Work to which such Contribution(s) was submitted. If You * institute patent litigation against any entity (including a * cross-claim or counterclaim in a lawsuit) alleging that the Work * or a Contribution incorporated within the Work constitutes direct * or contributory patent infringement, then any patent licenses * granted to You under this License for that Work shall terminate * as of the date such litigation is filed. * * 4. Redistribution. You may reproduce and distribute copies of the * Work or Derivative Works thereof in any medium, with or without * modifications, and in Source or Object form, provided that You * meet the following conditions: * * (a) You must give any other recipients of the Work or * Derivative Works a copy of this License; and * * (b) You must cause any modified files to carry prominent notices * stating that You changed the files; and * * (c) You must retain, in the Source form of any Derivative Works * that You distribute, all copyright, patent, trademark, and * attribution notices from the Source form of the Work, * excluding those notices that do not pertain to any part of * the Derivative Works; and * * (d) If the Work includes a "NOTICE" text file as part of its * distribution, then any Derivative Works that You distribute must * include a readable copy of the attribution notices contained * within such NOTICE file, excluding those notices that do not * pertain to any part of the Derivative Works, in at least one * of the following places: within a NOTICE text file distributed * as part of the Derivative Works; within the Source form or * documentation, if provided along with the Derivative Works; or, * within a display generated by the Derivative Works, if and * wherever such third-party notices normally appear. The contents * of the NOTICE file are for informational purposes only and * do not modify the License. You may add Your own attribution * notices within Derivative Works that You distribute, alongside * or as an addendum to the NOTICE text from the Work, provided * that such additional attribution notices cannot be construed * as modifying the License. * * You may add Your own copyright statement to Your modifications and * may provide additional or different license terms and conditions * for use, reproduction, or distribution of Your modifications, or * for any such Derivative Works as a whole, provided Your use, * reproduction, and distribution of the Work otherwise complies with * the conditions stated in this License. * * 5. Submission of Contributions. Unless You explicitly state otherwise, * any Contribution intentionally submitted for inclusion in the Work * by You to the Licensor shall be under the terms and conditions of * this License, without any additional terms or conditions. * Notwithstanding the above, nothing herein shall supersede or modify * the terms of any separate license agreement you may have executed * with Licensor regarding such Contributions. * * 6. Trademarks. This License does not grant permission to use the trade * names, trademarks, service marks, or product names of the Licensor, * except as required for reasonable and customary use in describing the * origin of the Work and reproducing the content of the NOTICE file. * * 7. Disclaimer of Warranty. Unless required by applicable law or * agreed to in writing, Licensor provides the Work (and each * Contributor provides its Contributions) on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied, including, without limitation, any warranties or conditions * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A * PARTICULAR PURPOSE. You are solely responsible for determining the * appropriateness of using or redistributing the Work and assume any * risks associated with Your exercise of permissions under this License. * * 8. Limitation of Liability. In no event and under no legal theory, * whether in tort (including negligence), contract, or otherwise, * unless required by applicable law (such as deliberate and grossly * negligent acts) or agreed to in writing, shall any Contributor be * liable to You for damages, including any direct, indirect, special, * incidental, or consequential damages of any character arising as a * result of this License or out of the use or inability to use the * Work (including but not limited to damages for loss of goodwill, * work stoppage, computer failure or malfunction, or any and all * other commercial damages or losses), even if such Contributor * has been advised of the possibility of such damages. * * 9. Accepting Warranty or Additional Liability. While redistributing * the Work or Derivative Works thereof, You may choose to offer, * and charge a fee for, acceptance of support, warranty, indemnity, * or other liability obligations and/or rights consistent with this * License. However, in accepting such obligations, You may act only * on Your own behalf and on Your sole responsibility, not on behalf * of any other Contributor, and only if You agree to indemnify, * defend, and hold each Contributor harmless for any liability * incurred by, or claims asserted against, such Contributor by reason * of your accepting any such warranty or additional liability. * * END OF TERMS AND CONDITIONS * * APPENDIX: How to apply the Apache License to your work. * * To apply the Apache License to your work, attach the following * boilerplate notice, with the fields enclosed by brackets "[]" * replaced with your own identifying information. (Don't include * the brackets!) The text should be enclosed in the appropriate * comment syntax for the file format. We also recommend that a * file or class name and description of purpose be included on the * same "printed page" as the copyright notice for easier * identification within third-party archives. * * Copyright [yyyy] [name of copyright owner] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ libgroboutils-java-5.orig/codecoverage/log4j.properties0000644000175000017500000000050507521071625023442 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.codecoverage=DEBUG libgroboutils-java-5.orig/codecoverage/sources/0000755000175000017500000000000010011472722021757 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ait/0000755000175000017500000000000010011472713022534 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ait/net/0000755000175000017500000000000010011472713023322 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ait/net/sourceforge/0000755000175000017500000000000010011472713025645 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ait/net/sourceforge/groboutils/0000755000175000017500000000000010011472713030036 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ait/net/sourceforge/groboutils/codecoverage/0000755000175000017500000000000010011472713032464 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ait/net/sourceforge/groboutils/codecoverage/v1/0000755000175000017500000000000011271425773033027 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/example2/0000755000175000017500000000000011271425773023511 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/dev/0000755000175000017500000000000011271425773022552 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/dev/net/0000755000175000017500000000000010011472713023323 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/0000755000175000017500000000000010011472713025646 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000011271425773030054 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/0000755000175000017500000000000010120240420032452 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/0000755000175000017500000000000011271425773033031 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/packag0000644000175000017500000000027707600160000034164 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2 This package contains all the standard interfaces for extending the code coverage framework. ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000755000175000017500000000000011271425773034235 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedMethod.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000001643310037421051034226 0ustar drazzibdrazzib/* * @(#)ModifiedMethod.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.InstructionList; import org.apache.bcel.generic.MethodGen; /** * Refers to a class file that has been modified with additional logging * statements. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 17, 2002 */ public class ModifiedMethod { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( ModifiedMethod.class ); private JavaClass origClass; private Method origMethod; private MethodGen modMethGen; private Method modMeth; private boolean closed = false; private ModifiedInstructionList modInstructions; /** * constant pool index for the name of the class's signature. */ private int classSigPoolIndex; /** * constant pool index for the method-ref for invoking the logger. */ private int staticMethodPoolIndex; /** * the original class file's checksum. */ private long checksum; /** * Reference to this method's index */ private final short methodIndex; /** * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ ModifiedMethod( short methodIndex, int classSigPoolIndex, int staticMethodPoolIndex, JavaClass origC, Method origM, MethodGen mg ) { if (mg == null || origC == null || origM == null) { throw new IllegalArgumentException("no null args"); } this.methodIndex = methodIndex; this.classSigPoolIndex = classSigPoolIndex; this.staticMethodPoolIndex = staticMethodPoolIndex; this.modMethGen = mg; this.origClass = origC; this.origMethod = origM; } public short getMethodIndex() { return this.methodIndex; } public String getMethodName() { return this.origMethod.getName() + this.origMethod.getSignature(); } /** * If the method cannot be modified, then this will return null. */ public ModifiedInstructionList getInstructionList() { checkClose(); if (this.modInstructions == null && canAddMarks()) { createInstructionList(); // the above call can create a null list if the generated list // is bad. } return this.modInstructions; } public JavaClass getOriginalClass() { return this.origClass; } public Method getOriginalMethod() { return this.origMethod; } /** * Returns true if the method can be modified, otherwise returns * false. A method can be modified only if it is not native, * not abstract, and it has a code attribute. */ public boolean canAddMarks() { return ModifiedClass.isMarkable( this.origMethod ); } //------------------------------------------------------------------------ /** * The modified method generator is only valid before a close. */ MethodGen getModifiedMethodGen() { checkClose(); return this.modMethGen; } /** * This should only be called *after* a close. */ Method getNewMethod() { if (!this.closed || this.modMeth == null) { throw new IllegalStateException( "ModifiedMethod has not been closed." ); } return this.modMeth; } void close() { checkClose(); this.closed = true; if (this.modInstructions != null) { LOG.debug( "Setting the modified instruction list." ); this.modInstructions.updateInstructionList(); this.modMethGen.setMaxLocals(); this.modMethGen.setMaxStack(); this.modMeth = this.modMethGen.getMethod(); this.modInstructions.close(); this.modInstructions = null; /* InstructionList finalList = this.modMethGen.getInstructionList(); LOG.debug( "Final modified method: ["+this.modMethGen+ "], instructions (size="+finalList.getLength()+") ["+finalList+ "]." ); */ this.modMethGen = null; } else if (this.modMeth == null) { this.modMeth = this.modMethGen.getMethod(); /* InstructionList finalList = this.modMethGen.getInstructionList(); LOG.debug( "Final modified method: ["+this.modMethGen+ "], instructions (size="+finalList.getLength()+") ["+finalList+ "]." ); */ this.modMethGen = null; } } //------------------------------------------------------------------------ /* * The class cannot be closed when this is called, or else an NPE will * be thrown. */ private void createInstructionList() { InstructionList list = getModifiedMethodGen().getInstructionList(); if (ModifiedInstructionList.isValidInstructionList( list )) { this.modInstructions = new ModifiedInstructionList( this.methodIndex, this.classSigPoolIndex, this.staticMethodPoolIndex, list, new ModifiedTargeters( this.modMethGen ) ); } else { LOG.warn( "Instruction list for method ["+getMethodName()+ "] in class ["+getOriginalClass().getClassName()+ "] is invalid." ); } // else the list is invalid. } private void checkClose() { if (this.closed) { throw new IllegalStateException("Method has been closed."); } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/PostCompileClass.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000001207110037421051034220 0ustar drazzibdrazzib/* * @(#)PostCompileClass.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.io.IOException; import java.io.OutputStream; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataWriter; /** * This is the main entry-point for performing the post-compilation of * class files. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 16, 2002 */ public class PostCompileClass { private IMetaDataWriter out; private AnalysisModuleSet amSet; private ParseCoverageLogger pcl; /** * @param writer meta-data output for the analysis generated for * class post-compiled; must not be null. * @param modules a list of all analysis modules to use when post-compiling * each class; must not be null. * @exception IllegalArgumentException if either writer or * modules is null. */ public PostCompileClass( IMetaDataWriter writer, IAnalysisModule[] modules ) { this( new ParseCoverageLogger(), writer, modules ); } /** * @param pcl the parser for a specific CoverageLogger (may be null). * @param writer meta-data output for the analysis generated for * class post-compiled; must not be null. * @param modules a list of all analysis modules to use when post-compiling * each class; must not be null. * @exception IllegalArgumentException if either writer or * modules is null. * * @since December 28, 2002 */ public PostCompileClass( ParseCoverageLogger pcl, IMetaDataWriter writer, IAnalysisModule[] modules ) { if (writer == null || modules == null || pcl == null) { throw new IllegalArgumentException("no null args"); } this.out = writer; this.amSet = new AnalysisModuleSet( modules ); this.pcl = pcl; } /** * Performs the post-compilation for the given class file for * all the internal analysis modules, and will write the new class file to * the given stream. */ public void postCompile( String filename, byte[] classFile, OutputStream classOut ) throws IOException { if (this.pcl == null) { throw new IllegalStateException( "pcl is null." ); } ModifiedClass mc = new ModifiedClass( this.pcl, filename, classFile ); int amCount = amSet.getAnalysisModuleCount(); ModifiedMethod[] mmL = mc.getMethods(); for (short moduleIndex = 0; moduleIndex < amCount; ++moduleIndex) { IAnalysisModule am = this.amSet.getAnalysisModuleAt( moduleIndex ); ClassRecord cr = mc.createClassRecord( this.amSet ); for (int methodI = 0; methodI < mmL.length; ++methodI) { DefaultMethodCode dmc = new DefaultMethodCode( moduleIndex, mmL[ methodI ], cr ); am.analyze( dmc ); } // record this class record IClassMetaDataWriter cmdw = this.out.getClassWriter( am ); try { cmdw.writeClassRecord( cr ); } finally { cmdw.close(); } } byte[] modClassFile = mc.getModifiedClass(); classOut.write( modClassFile ); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedInstructionList.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000001741210037421051034224 0ustar drazzibdrazzib/* * @(#)ModifiedInstructionList.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; /** * Refers to a class file that has been modified with additional logging * statements. *

    * As of January 22, 2003, the appending of probes to the end of the * instruction list is no longer supported; supporting it would mean that * instructions will be added to a method after the final "return" calls, * which might cause class file validation errors. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 17, 2002 */ public class ModifiedInstructionList { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( ModifiedInstructionList.class ); private boolean closed = false; private InstructionList modList; // this is the actual original list private List marked; /** * constant pool index for the name of the class's signature. */ private int classSigPoolIndex; /** * constant pool index for the method-ref for invoking the logger. */ private int staticMethodPoolIndex; /** * Reference to the owning method's index */ private short methodIndex; /** * Keep track of the original instructions vs. their replacement for * target heads and tails. */ private ModifiedTargeters targeters; /** * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ ModifiedInstructionList( short methodIndex, int classSigPoolIndex, int staticMethodPoolIndex, InstructionList list, ModifiedTargeters mt ) { if (list == null || mt == null) { throw new IllegalArgumentException("no null args"); } this.methodIndex = methodIndex; this.classSigPoolIndex = classSigPoolIndex; this.staticMethodPoolIndex = staticMethodPoolIndex; if (!isValidInstructionList( list )) { throw new IllegalArgumentException( "Instruction list contains "+ "unsupported instruction setup." ); } this.modList = list; this.targeters = mt; // there is a bug in the list.copy() that causes some // LOOKUPSWITCH instructions to become corrupted in the original! setupMarkList(); } //------------------------------------------------------------------------ public static boolean isValidInstructionList( InstructionList list ) { try { list.getByteCode(); } catch (Exception ex) { return false; } return true; } /** * This method can safely be called multiple times. * * Bug: We need to keep track of the original handle, and the corresponding * new handle that goes before it, so that we can go back and recreate the * CodeException objects for the method. */ void updateInstructionList() { checkClose(); LOG.debug( "********************************" ); Iterator iter = this.marked.iterator(); while (iter.hasNext()) { MarkedInstruction mi = (MarkedInstruction)iter.next(); InstructionList list = mi.getMarkedList(); if (list != null && list.getLength() > 0) { InstructionHandle instr = mi.getHandle(); LOG.debug( "Adding list (length = "+list.getLength()+ ", value='"+list+"') before handle '"+instr+"'." ); InstructionHandle probe; if (mi.getInstruction() instanceof NullInstruction) { // the null instruction will not add itself, but will // append its marks to the end of the method. /* LOG.debug( "Appending probe to end of instructions." ); probe = this.modList.append( list ); this.targeters.appendProbe( probe ); */ LOG.warn( "Appending probes to end of instructions is no longer allowed" ); } else { // normal instructions will insert their marks before // the instruction is executed. LOG.debug( "Inserting probe before ["+instr+"]" ); probe = this.modList.insert( instr, list ); this.targeters.insertProbe( instr, probe ); } } } this.targeters.update(); LOG.debug( "Final modified list = '"+this.modList+"'" ); } public int getInstructionCount() { checkClose(); // ignore the final NullInstruction return this.marked.size() - 1; } public MarkedInstruction getInstructionAt( int index ) { checkClose(); return (MarkedInstruction)this.marked.get( index ); } void close() { checkClose(); this.closed = true; this.modList.dispose(); this.marked = null; this.modList = null; } //------------------------------------------------------------------------ private void setupMarkList() { this.marked = new ArrayList(); //Iterator iter = this.instructions.iterator(); Iterator iter = this.modList.iterator(); while (iter.hasNext()) { InstructionHandle ih = (InstructionHandle)iter.next(); this.marked.add( new MarkedInstruction( this.methodIndex, this.classSigPoolIndex, this.staticMethodPoolIndex, ih ) ); } // add in the final instruction to allow for marking the end // of the method. InstructionList il = new InstructionList(); InstructionHandle ih = il.append( new NullInstruction() ); this.marked.add( new MarkedInstruction( this.methodIndex, this.classSigPoolIndex, this.staticMethodPoolIndex, ih ) ); } private void checkClose() { if (this.closed) { throw new IllegalStateException("Method has been closed."); } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/DefaultMethodCode.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000002023410041327106034221 0ustar drazzibdrazzib/* * @(#)DefaultMethodCode.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord; import org.apache.bcel.classfile.LineNumberTable; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Instruction; /** * Implements the per-module interface to the method's code and marking * the code. Controls the module's index and the current module's mark * index for this method. * * @author Matt Albrecht groboclown@users.sourceforge.net * @author Stefano Turri (stefano.turri AT it.ibm.com) * @version $Date: 2004/04/20 23:12:06 $ * @since December 17, 2002 */ public class DefaultMethodCode implements IMethodCode { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( DefaultMethodCode.class ); private final ModifiedMethod method; private final ModifiedInstructionList list; private final String className; private final String methodName; private final IAnalysisModule analysisModule; private final short measureIndex; private final ClassRecord cr; private short markCount = 0; DefaultMethodCode( short measureIndex, ModifiedMethod mm, ClassRecord cr ) { if (mm == null || cr == null) { throw new IllegalArgumentException("no null args"); } this.method = mm; this.list = mm.getInstructionList(); if (this.list == null) { throw new IllegalStateException("abstract method "+mm); } this.className = mm.getOriginalClass().getClassName(); this.methodName = mm.getMethodName(); this.measureIndex = measureIndex; this.cr = cr; this.analysisModule = this.cr.getAnalysisModuleSet(). getAnalysisModuleAt( measureIndex ); // ensure the class record is kosher if (!this.className.equals( cr.getClassName() )) { throw new IllegalArgumentException( "modified method class ("+this.className+ ") and class record class name ("+cr.getClassName()+ ") do not match: " ); } if (cr.getMethodIndex( this.methodName ) < 0) { throw new IllegalArgumentException( "method name ("+this.methodName+ ") and class record do not match" ); } } /** * Returns the original BCEL Method object. * * @return the original BCEL Method object */ public Method getOriginalMethod() { return this.method.getOriginalMethod(); } /** * Returns the line number table for the original BCEL method object. * * @return the LineNumberTable, or null if there isn't one * for this method. */ public LineNumberTable getLineNumberTable() { return getOriginalMethod().getLineNumberTable(); } /** * A helper to get the method name. * * @return the method name */ public String getMethodName() { return this.methodName; } /** * A helper to get the class name. * * @return the class name */ public String getClassName() { return this.className; } /** * Returns the number of bytecode instructions in the method. * * @return the number of bytecode instructions */ public int getInstructionCount() { return this.list.getInstructionCount(); } /** * Returns the bytecode instruction at the given index. If the index * is out of range (< 0 or >= getInstructionCount()), * then a IndexOutOfBoundsException is thrown. * * @param index the 0-based index of the method's instruction list * @return the instruction at index */ public Instruction getInstructionAt( int index ) { // even though the list allows us to get the "last" instruction, // don't allow the user to do this. if (index == getInstructionCount()) { throw new IndexOutOfBoundsException( "Even though you can put a mark at one more than the last "+ "instruction, you cannot retrieve any such instruction." ); } MarkedInstruction mi = this.list.getInstructionAt( index ); return mi.getInstruction(); } /** * Marks an instruction for coverage analysis. If the index * is out of range (< 0 or > getInstructionCount()), * then a IndexOutOfBoundsException is thrown. Marks are * added before the instruction at the given index is executed. Note that * to mark the end of the method, you should use index equal to * getInstructionCount() * * @param index the 0-based index of the method's instruction list * @param meta meta-data the analysis module records in association with * the mark. This cannot be null. */ public synchronized void markInstruction( int index, IAnalysisMetaData meta ) { if (meta == null) { throw new IllegalArgumentException("no null args"); } short count = this.markCount; ++this.markCount; LOG.debug( "Mark "+this+" at instruction "+index+"." ); // first, mark the instruction MarkedInstruction mi = this.list.getInstructionAt( index ); mi.addMark( this.measureIndex, count ); MarkRecord mr = new MarkRecord( meta, this.analysisModule.getMeasureName(), getMethodName(), count, getSourceLine( mi ) ); cr.addMark( mr ); } /** * Output a friendly version of the object. */ public String toString() { return getClassName() + "#" + getMethodName(); } private int getSourceLine( MarkedInstruction mi ) { int ret = -1; LineNumberTable lnt = getLineNumberTable(); if (lnt != null) { // see bug 938439 // Fix by Stefano Turri try { ret = lnt.getSourceLine( mi.getInstructionPosition() ); } catch (ArrayIndexOutOfBoundsException e) { ret = -1; } } return ret; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000022007600160000034205 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.compiler Handles the post-compilation engine. ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/MeasureMark.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000763410037421051034231 0ustar drazzibdrazzib/* * @(#)MeasureMark.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import net.sourceforge.groboutils.codecoverage.v2.logger.ICoverageLoggerConst; import org.apache.bcel.generic.INVOKESTATIC; import org.apache.bcel.generic.InstructionList; import org.apache.bcel.generic.LDC; import org.apache.bcel.generic.SIPUSH; /** * Exactly one mark for a specific measure on an instruction. This class is * tightly coupled with the ParseCoverageLogger class, in that the signatures * must match between the two. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 17, 2002 */ class MeasureMark { private static final Class COVERAGE_SIGNATURE[] = ICoverageLoggerConst.COVERAGE_SIGNATURE; /** * constant pool index for the name of the class's signature. */ private final int classSigPoolIndex; /** * constant pool index for the method-ref for invoking the logger. */ private final int staticMethodPoolIndex; /** * Reference to the owning method's index */ private final short methodIndex; private final short measureIndex; private final short markIndex; /* Java language code for logger: net.sourceforge.groboutils.codecoverage.v2.logger.CoverageLogger. cover( classSig, methodIndex, channel, markIndex ); Java bytecode calls for the logger: (this is why we use shorts, not ints!!!!) LDC [class sig constant pool index] SIPUSH [methodIndex] SIPUSH [channel] SIPUSH [markIndex] INVOKESTATIC ["net.sourceforge.groboutils.codecoverage.v2.logger. CoverageLogger.cover (Ljava.lang.String;SSS)V */ /** * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ MeasureMark( int classSigPoolIndex, int staticMethodPoolIndex, short methodIndex, short measureIndex, short markIndex ) { this.classSigPoolIndex = classSigPoolIndex; this.staticMethodPoolIndex = staticMethodPoolIndex; this.methodIndex = methodIndex; this.measureIndex = measureIndex; this.markIndex = markIndex; } public void addToInstructionList( InstructionList list ) { list.append( new LDC( this.classSigPoolIndex ) ); list.append( new SIPUSH( this.methodIndex ) ); list.append( new SIPUSH( this.measureIndex ) ); list.append( new SIPUSH( this.markIndex ) ); list.append( new INVOKESTATIC( this.staticMethodPoolIndex ) ); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/AlreadyPostCompiledException.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000355210037421051034224 0ustar drazzibdrazzib/* * @(#)AlreadyPostCompiledException.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; /** * Refers to a class file that has been modified with additional logging * statements. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since March 20, 2004 */ public class AlreadyPostCompiledException extends IllegalStateException { public AlreadyPostCompiledException() { super(); } public AlreadyPostCompiledException( String msg ) { super( msg ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedClass.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000003564710037421051034236 0ustar drazzibdrazzib/* * @(#)ModifiedClass.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil; import net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil; import org.apache.bcel.classfile.Attribute; import org.apache.bcel.classfile.ClassParser; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.classfile.SourceFile; import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.MethodGen; /** * Refers to a class file that has been modified with additional logging * statements. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 17, 2002 */ public class ModifiedClass { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( ModifiedClass.class ); // split these two strings apart so that this class itself can // be post-compiled. private static final String ALREADY_POST_COMPILED_FLAG_1 = "--..AlreadyPostCompiled"; private static final String ALREADY_POST_COMPILED_FLAG_2 = // had to switch this from a char 0 due to parsing errors in // java - it doesn't like finding a '0' in a class file string. "..--" + (char)1; private static final String ALREADY_POST_COMPILED_FLAG; static { // don't let a compiler optimization create this string in this // class, so that this class can be instrumented. StringBuffer sb = new StringBuffer( ALREADY_POST_COMPILED_FLAG_1 ); sb.append( ALREADY_POST_COMPILED_FLAG_2 ); ALREADY_POST_COMPILED_FLAG = new String( sb ); } private String className; private JavaClass origClass; //private ClassGen modClass; private ConstantPoolGen constantPool; private ModifiedMethod[] modMethods; private byte[] finalModifiedClass; /** * constant pool index for the name of the class's signature. */ private int classSigPoolIndex; /** * constant pool index for the method-ref for invoking the logger. */ private int staticMethodPoolIndex; /** * the original class file's checksum. */ private long checksum; /** * We can't allow coverage of every method: some shouldn't be allowed, * such as javac-generated methods like "class$". */ private static final String[] IGNORE_METHODS = { "class$(Ljava/lang/String;)Ljava/lang/Class;", }; /** * Uses the default settings for the ParseCoverageLogger * during the creation of the modified class. * * @param filename the name of the file the class file was pulled from. * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ public ModifiedClass( String filename, byte[] originalClassFile ) throws IOException { this( new ParseCoverageLogger(), filename, originalClassFile ); } /** * @param pcl the definition for the logger to create method references * for. This allows for easier testing and customizations of the * logger to compile for. * @param filename the name of the file the class file was pulled from. * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ public ModifiedClass( ParseCoverageLogger pcl, String filename, byte[] originalClassFile ) throws IOException { if (originalClassFile == null || filename == null || pcl == null) { throw new IllegalArgumentException( "No null args." ); } updateChecksum( originalClassFile ); updateClassGen( pcl, originalClassFile, filename ); } /** * */ public String getClassName() { return this.className; } /** * */ public long getClassCRC() { return this.checksum; } /** * */ public String getClassSignature() { return ClassSignatureUtil.getInstance(). createClassSignature( getClassName(), getClassCRC() ); } /** * */ public String getSourceFileName() { String ret = ""; Attribute attr[] = this.origClass.getAttributes(); for (int i = 0; i < attr.length; ++i) { if (attr[i] instanceof SourceFile) { ret = ((SourceFile)attr[i]).getSourceFileName(); break; } } return ret; } /** * */ public ClassRecord createClassRecord( AnalysisModuleSet ams ) { ModifiedMethod mmL[] = getMethods(); String methodSigs[] = new String[ mmL.length ]; for (int i = 0; i < mmL.length; ++i) { methodSigs[ mmL[i].getMethodIndex() ] = mmL[i].getMethodName(); } return new ClassRecord( getClassName(), getClassCRC(), getSourceFileName(), methodSigs, ams ); } /** * Return all modifiable methods owned by the class. This will not return * methods deemed non-modifiable, such as abstract or native methods, or * javac-generated methods. */ public ModifiedMethod[] getMethods() { if (this.modMethods == null) { checkClose(); Method mL[] = this.origClass.getMethods(); List methods = new ArrayList(); short methodIndex = 0; for (int i = 0; i < mL.length; ++i) { if (allowModification( mL[i] )) { ModifiedMethod mm = new ModifiedMethod( methodIndex, this.classSigPoolIndex, this.staticMethodPoolIndex, this.origClass, mL[i], new MethodGen( mL[i], this.className, this.constantPool ) ); methods.add( mm ); ++methodIndex; } } this.modMethods = (ModifiedMethod[])methods.toArray( new ModifiedMethod[ methods.size() ] ); } return this.modMethods; } /** * Returns the class in its current state, and closes off the modified * class from further modifications. */ public byte[] getModifiedClass() { if (this.finalModifiedClass == null) { checkClose(); // commit the current changes to the generated class updateClass(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { this.origClass.dump( baos ); } catch (IOException e) { throw new IllegalStateException("This should never be reached."); } // close off the modified class from further modification this.origClass = null; this.finalModifiedClass = baos.toByteArray(); } return this.finalModifiedClass; } /** * String that gets placed within class files to flag that they've * been post-compiled. */ public static final String getPostCompiledSignature() { return ALREADY_POST_COMPILED_FLAG; } //------------------------------------------------------------------------- // private members /** * This method commits any changes to the class file, and closes the * class off to any more changes. It can be called multiple times * without error. */ private void updateClass() { // update the methods ModifiedMethod mL[] = this.modMethods; if (mL == null) { // we've already committed the methods, or no modifications // were done to the methods. return; } // we're committing the methods, so close off our list this.modMethods = null; // create a map of all our modified methods. Map mLmap = new HashMap(); for (int i = 0; i < mL.length; ++i) { // commit the methods and remove them from our list. ModifiedMethod m = mL[i]; mL[i] = null; m.close(); mLmap.put( m.getMethodName(), m.getNewMethod() ); } // Replace the original methods with the modified methods. Method origMethods[] = this.origClass.getMethods(); for (int i = 0; i < origMethods.length; ++i) { Method m = (Method)mLmap.get( createSignature( origMethods[i] ) ); if (m != null) { LOG.debug( "replacing method ["+origMethods[i]+"]." ); origMethods[i] = m; } } this.origClass.setMethods( origMethods ); this.origClass.setConstantPool( this.constantPool.getFinalConstantPool() ); } /** * */ private void updateClassGen( ParseCoverageLogger pcl, byte[] code, String filename ) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream( code ); ClassParser cp = new ClassParser( bais, filename ); this.origClass = cp.parse(); this.className = this.origClass.getClassName(); //this.modClass = new ClassGen( this.origClass ); //this.modClass.setMajor( this.origClass.getMajor() ); //this.modClass.setMinor( this.origClass.getMinor() ); this.constantPool = new ConstantPoolGen( this.origClass.getConstantPool() ); addClassSignature( this.constantPool ); addMethodRef( pcl, this.constantPool ); } /** * Adds the class signature to the constant pool of the class. * * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ private void addClassSignature( ConstantPoolGen pool ) { if (pool == null) { throw new IllegalArgumentException( "No null args." ); } // check if the class signature has already been set // see bug 903837 if (pool.lookupUtf8( getPostCompiledSignature() ) != -1) { throw new AlreadyPostCompiledException( "Class '"+this.className+"' has already been modified." ); } // add constant pool name reference this.classSigPoolIndex = pool.addString( getClassSignature() ); LOG.debug( "Added pool index "+this.classSigPoolIndex+" pointing to '"+ getClassSignature() ); // and add the signature that the class has been post-compiled pool.addString( getPostCompiledSignature() ); } /** * */ private void addMethodRef( ParseCoverageLogger pcl, ConstantPoolGen pool ) { if (pool == null || pcl == null) { throw new IllegalArgumentException( "No null args." ); } LOG.debug( "Adding methodref to pool for method: "+ pcl.getClassName()+" # "+pcl.getMethodName() + ": "+ pcl.getMethodSignature() ); this.staticMethodPoolIndex = pool.addMethodref( pcl.getClassName(), pcl.getMethodName(), pcl.getMethodSignature() ); LOG.debug( "Methodref pool index = "+this.staticMethodPoolIndex ); } /** * */ private void updateChecksum( byte[] code ) { if (code == null) { throw new IllegalArgumentException("no null args"); } this.checksum = ChecksumUtil.getInstance().checksum( code ); } /** * */ private void checkClose() { if (this.origClass == null) { throw new IllegalStateException( "Class has been closed from further modifications." ); } } /** * Returns true if the method can be modified, otherwise returns * false. A method can be modified only if it is not native, * not abstract, it has a code attribute, and is not one of the "ignored * methods" defined at the top of this class. */ private boolean allowModification( Method m ) { if (!isMarkable( m )) { return false; } String sig = createSignature( m ); for (int i = 0; i < IGNORE_METHODS.length; ++i) { if (IGNORE_METHODS[i].equals( sig )) { return false; } } return true; } /** * Checks if the given method is markable only from the context of the * method contents, not by looking at the signature. */ static boolean isMarkable( Method m ) { return (!m.isNative() && !m.isAbstract() && m.getCode() != null); } /** * */ private String createSignature( Method m ) { String sig = m.getName() + m.getSignature(); return sig; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/MarkedInstruction.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000001213110037421051034215 0ustar drazzibdrazzib/* * @(#)MarkedInstruction.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; /** * Contains one original method instruction, along with all the analysis * module marks for this instruction. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 17, 2002 */ public class MarkedInstruction { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( MarkedInstruction.class ); private final InstructionHandle origInstr; private final List marks = new LinkedList(); private boolean closed = false; /** * constant pool index for the name of the class's signature. */ private final int classSigPoolIndex; /** * constant pool index for the method-ref for invoking the logger. */ private final int staticMethodPoolIndex; /** * Reference to the owning method's index */ private final short methodIndex; /** * @throws IllegalStateException if the class file has already been * modified (identified by a class name field). */ MarkedInstruction( short methodIndex, int classSigPoolIndex, int staticMethodPoolIndex, InstructionHandle instr ) { if (instr == null) { throw new IllegalArgumentException("no null args"); } this.origInstr = instr; this.methodIndex = methodIndex; this.classSigPoolIndex = classSigPoolIndex; this.staticMethodPoolIndex = staticMethodPoolIndex; } /** * Retrieve the list of all the marks (if there are any active ones), * but does not add the original instruction (that is for the owner to * know where it goes - before or after). If there are no active * marks, then null will be returned. After this has been * called, all the active marks will be removed (assuming that they * have been added to the modified method instruction list). */ InstructionList getMarkedList() { InstructionList markedList = null; if (!this.marks.isEmpty()) { markedList = new InstructionList(); // mark the instruction first, then add the instruction Iterator iter = this.marks.iterator(); while (iter.hasNext()) { LOG.debug( "Adding mark to list." ); ((MeasureMark)iter.next()).addToInstructionList( markedList ); } markedList.setPositions( true ); // since we just added the marks, we shouldn't add them // again, so remove all current marks. this.marks.clear(); } return markedList; } public int getInstructionPosition() { return this.origInstr.getPosition(); } /** * Retrieve the instruction represented by this mark. */ public Instruction getInstruction() { return this.origInstr.getInstruction(); } /** * Mark this instruction with the given measure and mark indicies; the * method index is pre-defined by the particular method this instruction * resides in. */ public void addMark( short measureIndex, short markIndex ) { MeasureMark mm = new MeasureMark( this.classSigPoolIndex, this.staticMethodPoolIndex, this.methodIndex, measureIndex, markIndex ); this.marks.add( mm ); } /** * Retrieve the handle this instruction represents. */ InstructionHandle getHandle() { return this.origInstr; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedTargeters.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000003360610037421051034227 0ustar drazzibdrazzib/* * @(#)ModifiedTargeters.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.bcel.generic.BranchInstruction; import org.apache.bcel.generic.CodeExceptionGen; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionTargeter; import org.apache.bcel.generic.LineNumberGen; import org.apache.bcel.generic.LocalVariableGen; import org.apache.bcel.generic.MethodGen; import org.apache.bcel.generic.ObjectType; /** * Keeps track of different target types, and updates them according to * the changes in the instructions. *

    * This class exists due to a bug in the CodeException mod code in BCEL. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since Jan 21, 2004, 2002 */ class ModifiedTargeters { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( ModifiedTargeters.class ); private MethodGen methGen; private Map startToCodeException = new HashMap(); /* no longer needed private Map endToCodeException = new HashMap(); */ private Map handlerToCodeException = new HashMap(); private List myCegs = new LinkedList(); private InstructionHandle lastInstruction; private static class MyCEG { private InstructionHandle origStartPC; private InstructionHandle newStartPC; private InstructionHandle origEndPC; private InstructionHandle newEndPC; private InstructionHandle origHandlerPC; private InstructionHandle newHandlerPC; private ObjectType type; public MyCEG( InstructionHandle s, InstructionHandle e, InstructionHandle h, ObjectType t ) { this.type = t; this.origStartPC = s; this.origEndPC = e; this.origHandlerPC = h; if (t == null) { LOG.debug( ">> Found null object type in CodeExceptionGen" ); } } public CodeExceptionGen addCodeException( MethodGen mg ) { InstructionHandle sp = this.newStartPC; InstructionHandle ep = this.newEndPC; InstructionHandle hp = this.newHandlerPC; if (sp == null) { sp = this.origStartPC; } if (ep == null) { ep = this.origEndPC; } if (hp == null) { hp = this.origHandlerPC; } LOG.debug( "Changing exception handler for type "+this.type+ ": moved from (start = "+this.origStartPC+ ", end = "+this.origEndPC+", handler = "+this.origHandlerPC+ ") to (start = "+sp+", end = "+ep+", handler = "+hp+")" ); return mg.addExceptionHandler( sp, ep, hp, this.type ); } public void setStartPC( InstructionHandle h ) { if (this.newStartPC == null) { LOG.debug( "Updating internal start PC for exception "+ this.type+" to point to "+h ); this.newStartPC = h; } } /* no longer supported public void setEndPC( InstructionHandle h ) { LOG.debug( "Updating internal end PC for exception "+ this.type+" to point to "+h ); this.newEndPC = h; } */ public void setHandlerPC( InstructionHandle h ) { if (this.newHandlerPC == null) { LOG.debug( "Updating internal handler PC for exception "+ this.type+" to point to "+h ); this.newHandlerPC = h; } } } /** */ ModifiedTargeters( MethodGen mg ) { if (mg == null) { throw new IllegalArgumentException("no null args"); } this.methGen = mg; // setup the maps... CodeExceptionGen ceg[] = mg.getExceptionHandlers(); for (int i = 0; i < ceg.length; ++i) { MyCEG ceg2 = new MyCEG( ceg[i].getStartPC(), ceg[i].getEndPC(), ceg[i].getHandlerPC(), ceg[i].getCatchType() ); this.myCegs.add( ceg2 ); putList( this.startToCodeException, ceg2.origStartPC, ceg2 ); /* no longer supported putList( this.endToCodeException, ceg2.origEndPC, ceg2 ); */ putList( this.handlerToCodeException, ceg2.origHandlerPC, ceg2 ); } // discover the last instruction in the method Iterator list = mg.getInstructionList().iterator(); while (list.hasNext()) { this.lastInstruction = (InstructionHandle)list.next(); } } /** * Inserted a probe into the list. "Inserting" means it goes before the * instruction that's being probed, so the "end" parts of targeters don't * need to be updated... */ public void insertProbe( InstructionHandle instr, InstructionHandle probe ) { // the original point that was being updated may not be what was // last referenced for updating handlers. // HOWEVER, the way probes are added is by always inserting them // before the code that needs to be probed. That means, adding // probe A will redirect targeters to A, then adding probe B // will put B after A but before the instructions, so the targeters // MUST NOT be updated, otherwise probe A will not be targeted // correctly. InstructionTargeter [] its = instr.getTargeters(); if (its != null) { for (int j = 0; j < its.length; j++) { LOG.debug( "Found for instruction "+instr+" targeter "+ its[j] ); // don't call updateTargeters, as that is faulty, and doesn't // match what's really going on. Also, that technique was // wrong when dealing with multiple probes added to the same // instruction, multiple times. if (its[j] instanceof LineNumberGen) { LOG.debug( "Updating line number to point to probe "+ probe ); ((LineNumberGen)its[j]).setInstruction( probe ); } else if (its[j] instanceof LocalVariableGen) { // this definitely needs to be separated out, so that // if start and end are the same instruction, the end // doesn't point to the new probe only. if (instr.equals( ((LocalVariableGen)its[j]).getStart() )) { LOG.debug( "Updating local variable start to point to probe "+ probe ); ((LocalVariableGen)its[j]).setStart( probe ); } } else if (its[j] instanceof CodeExceptionGen) { // ignore - we'll handle this separately LOG.debug( "Ignoring CodeExceptionGen" ); } else if (its[j] instanceof BranchInstruction) { // here we need to perform an update, so that the // "Select" table can correctly be updated. LOG.debug( "Updating branch instruction to point to probe "+ probe ); ((BranchInstruction)its[j]).updateTarget( instr, probe ); } else { throw new IllegalStateException( "Unexpected targeter type (" + its[j].getClass().getName() + ") for instruction " + instr ); } } } // if the inserted probe points to the start of a code exception, // then redirect the code exception to the probe. Iterator iter = getList( this.startToCodeException, instr ); while (iter.hasNext()) { MyCEG mceg = (MyCEG)iter.next(); mceg.setStartPC( probe ); } // if the inserted probe points to the start of an exception handler, // then redirect the code exception. iter = getList( this.handlerToCodeException, instr ); while (iter.hasNext()) { MyCEG mceg = (MyCEG)iter.next(); mceg.setHandlerPC( probe ); } } /* * Here, we only need to update the end probes. Note that the last * instruction in the method will change with these added probes. * * WARNING!!!! This should probably be pulled out, as it's very dangerous * to add a probe at the end of a method - it will occur after * any returns! public void appendProbe( InstructionHandle probe ) { // get new last instruction InstructionHandle lastProbe = probe; while (lastProbe.getNext() != null) { lastProbe = lastProbe.getNext(); } InstructionTargeter [] its = this.lastInstruction.getTargeters(); if (its != null) { for (int j = 0; j < its.length; j++) { // don't call updateTargeters, as that is faulty, and doesn't // match what's really going on. Also, that technique was // wrong when dealing with multiple probes added to the same // instruction, multiple times. if (its[j] instanceof LineNumberGen) { // don't do anything } else if (its[j] instanceof LocalVariableGen) { // this definitely needs to be separated out, so that // if start and end are the same instruction, the start // doesn't point to the new probe only. if (this.lastInstruction.equals( ((LocalVariableGen)its[j]).getEnd() )) { ((LocalVariableGen)its[j]).setEnd( lastProbe ); } } else if (its[j] instanceof CodeExceptionGen) { // ignore - we'll handle this separately } else if (its[j] instanceof BranchInstruction) { // don't do anything } else { throw new IllegalStateException( "Unexpected targeter type (" + its[j].getClass().getName() + ") for instruction " + this.lastInstruction ); } } } // if the inserted probe points to the start of a code exception, // then redirect the code exception to the probe. Iterator iter = getList( this.endToCodeException, this.lastInstruction ); while (iter.hasNext()) { MyCEG mceg = (MyCEG)iter.next(); mceg.setEndPC( lastProbe ); } // update the last instruction pointer this.lastInstruction = lastProbe; } */ /** * Updates the targeters after a series of insert and appends. * Note that the targeters might be updated during the inserts and * appends. */ public void update() { this.methGen.removeExceptionHandlers(); Iterator iter = this.myCegs.iterator(); while (iter.hasNext()) { ((MyCEG)iter.next()).addCodeException( this.methGen ); } } private void putList( Map map, Object key, Object value ) { Set s = (Set)map.get( key ); if (s == null) { s = new HashSet(); map.put( key, s ); } s.add( value ); } /** * Never returns null. */ private Iterator getList( Map map, Object key ) { Set s = (Set)map.get( key ); if (s == null) { s = new HashSet(); } return s.iterator(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/NullInstruction.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000320507622026357034237 0ustar drazzibdrazzib/* * @(#)NullInstruction.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import org.apache.bcel.generic.NOP; /** * Refers to a non-existent instruction, which are at the end of the list. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:27 $ * @since January 27, 2003 */ public class NullInstruction extends NOP { } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000001670210037421051034225 0ustar drazzibdrazzib/* * @(#)ParseCoverageLogger.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import net.sourceforge.groboutils.codecoverage.v2.logger.ICoverageLoggerConst; import org.apache.bcel.generic.ObjectType; import org.apache.bcel.generic.Type; /** * Parses the CoverageLogger class to discover the BCEL compatible invocation * objects and names. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 17, 2002 */ public class ParseCoverageLogger { //private static final Class COVERAGELOGGER_CLASS = CoverageLogger.class; /** * This is not the simplest or safest way to default to the coverage * logger, but it does prevent loading the coverage logger class, thus * preventing a possible error message. */ private static final String DEFAULT_COVERAGELOGGER_CLASSNAME = ICoverageLoggerConst.COVERAGELOGGER_CLASSNAME; private static final String DEFAULT_COVERAGELOGGER_METHODNAME = ICoverageLoggerConst.INVOKE_METHOD_NAME; private static final Class COVERAGE_SIGNATURE[] = ICoverageLoggerConst.COVERAGE_SIGNATURE; private static final Class COVERAGE_RETURNTYPE = ICoverageLoggerConst.COVERAGE_RETURNTYPE; private String methodSignature; private String methodName; private String className; /** * Reference the default CoverageLogger for creation. */ public ParseCoverageLogger() { // We will assume that the defaults given are correct. If they // aren't valid, then this is a major bug in the logger, not // this class. storeData( DEFAULT_COVERAGELOGGER_CLASSNAME, DEFAULT_COVERAGELOGGER_METHODNAME ); } /** * Discovers the method signature and accompanying information for a * specific coverage logger to generate. The given method must exist * with the correct parameters, attributes, and return type. * Otherwise, an exception is raised. */ public ParseCoverageLogger( Class coverageClass, String methodName ) { if (methodName == null || coverageClass == null) { throw new IllegalArgumentException( "No null args." ); } parseCoverageLoggerType( coverageClass, methodName ); storeData( coverageClass.getName(), methodName ); } /** * Inner method to store the data of the class and method for the * logger. It doesn't do any checking besides null. Thus, this * method must be private to prevent inadvertent invalid class and * method assignment. */ private void storeData( String className, String methodName ) { this.methodName = methodName; this.className = className; if (methodName == null || className == null) { throw new IllegalArgumentException( "No null args." ); } this.methodSignature = createSignature( COVERAGE_SIGNATURE, COVERAGE_RETURNTYPE ); if (this.methodSignature == null) { throw new IllegalStateException( "Returned null method signature." ); } } /** * Returns the fully-qualified class name for the CoverageLogger. */ public String getClassName() { return this.className; } /** * Returns the name of the method, without the signature. */ public String getMethodName() { return this.methodName; } /** * Returns the signature of the method, without the method name. */ public String getMethodSignature() { return this.methodSignature; } private void parseCoverageLoggerType( Class clazz, String methodName ) { // ensure that the method exists with the correct signature. Method m = null; try { m = clazz.getMethod( methodName, COVERAGE_SIGNATURE ); } catch (NoSuchMethodException nsme) { // this will throw the next exception. Hide this one! m = null; } if (m == null) { throw new IllegalStateException( clazz.getName()+" doesn't have a method named '"+ methodName+"'" ); } // the method MUST NOT return anything! if (m.getReturnType() != null && !m.getReturnType().equals( COVERAGE_RETURNTYPE )) { throw new IllegalStateException( clazz.getName()+" method '"+ methodName+"' incorrectly has a return value." ); } // the method must also be static & public int mod = m.getModifiers(); if (!Modifier.isStatic( mod ) || !Modifier.isPublic( mod )) { throw new IllegalStateException( clazz.getName()+" method '"+ methodName+"' is not public or static." ); } } private static String createSignature( Class signature[], Class returnClass ) { Type returnType = getType( returnClass ); Type args[] = new Type[ signature.length ]; for (int i = 0; i < signature.length; ++i) { args[i] = getType( signature[i] ); } return Type.getMethodSignature( returnType, args ); } private static Type getType( Class c ) { if (c.equals( Void.TYPE )) { return Type.VOID; } if (c.equals( Byte.TYPE )) { return Type.BYTE; } if (c.equals( Character.TYPE )) { return Type.CHAR; } if (c.equals( Short.TYPE )) { return Type.SHORT; } if (c.equals( Integer.TYPE )) { return Type.INT; } if (c.equals( Long.TYPE )) { return Type.LONG; } if (c.equals( Float.TYPE )) { return Type.FLOAT; } if (c.equals( Double.TYPE )) { return Type.DOUBLE; } // else return new ObjectType( c.getName() ); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000755000175000017500000000000011271425773034237 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/AbstractMeasure.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000000554510037421052034233 0ustar drazzibdrazzib/* * @(#)AbstractMeasure.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.util.HashSet; import java.util.Set; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; /** * Offers additional capability to detect when a probe has been measured * more than once. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since January 26, 2003 * @see IAnalysisMetaData */ public abstract class AbstractMeasure implements IAnalysisModule { private Set beenCovered = new HashSet(); protected void markInstruction( IMethodCode method, int instrPos, IAnalysisMetaData data, boolean allowDuplicates ) { boolean addMark = true; if (!allowDuplicates) { String id = getPositionID( method, instrPos ); if (this.beenCovered.contains( id )) { addMark = false; } else { this.beenCovered.add( id ); } } if (addMark) { method.markInstruction( instrPos, data ); } } private String getPositionID( IMethodCode m, int instrPos ) { StringBuffer sb = new StringBuffer( m.getClassName() ); sb.append( '#' ).append( m.getMethodName() ); sb.append( '#' ).append( instrPos ); // more memory conservative return new String( sb ); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/BytecodeCountMeasure.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000000607510037421052034232 0ustar drazzibdrazzib/* * @(#)BytecodeCountMeasure.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; /** * Processes methods for instruction-count coverage analysis. Currently, this * does not support localization. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since January 26, 2003 * @see IAnalysisMetaData */ public class BytecodeCountMeasure implements IAnalysisModule { /** * Returns the human-readable name of the measure. */ public String getMeasureName() { return "BytecodeCount"; } /** * Returns the unit name for this particular coverage measure. */ public String getMeasureUnit() { return "instructions"; } /** * Returns the text format used in meta-data formatted text. This should * be the mime encoding type, such as "text/plain" or "text/html". */ public String getMimeEncoding() { return "text/plain"; } /** * Perform the analysis on the method. */ public void analyze( IMethodCode method ) { int instructionCount = method.getInstructionCount(); for (int i = 0; i < instructionCount; ++i) { IAnalysisMetaData amd = createAnalysisMetaData( i ); method.markInstruction( i, amd ); } } private IAnalysisMetaData createAnalysisMetaData( int bytecodeIndex ) { return new DefaultAnalysisMetaData( "Instruction "+bytecodeIndex, "Didn't cover instruction "+bytecodeIndex, (byte)0 ); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000000023407600160001034215 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.module All analysis modules and their supporting classes. ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/FunctionMeasure.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000000606010037421052034224 0ustar drazzibdrazzib/* * @(#)FunctionMeasure.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; /** * Processes methods for function coverage analysis, which checks that each * method/function has been invoked. Currently, this * does not support localization. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since February 17, 2003 * @see IAnalysisMetaData */ public class FunctionMeasure implements IAnalysisModule { /** * Returns the human-readable name of the measure. */ public String getMeasureName() { return "Function"; } /** * Returns the unit name for this particular coverage measure. */ public String getMeasureUnit() { return "functions"; } /** * Returns the text format used in meta-data formatted text. This should * be the mime encoding type, such as "text/plain" or "text/html". */ public String getMimeEncoding() { return "text/plain"; } /** * Perform the analysis on the method. */ public void analyze( IMethodCode method ) { IAnalysisMetaData amd = createAnalysisMetaData( method.getClassName(), method.getMethodName() ); method.markInstruction( 0, amd ); } private IAnalysisMetaData createAnalysisMetaData( String clazz, String method ) { return new DefaultAnalysisMetaData( "Method "+method+" in class "+clazz, "Didn't ever invoke method "+method+" in class "+clazz+".", (byte)0 ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/LineCountMeasure.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000001156210037421052034227 0ustar drazzibdrazzib/* * @(#)LineCountMeasure.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.util.HashSet; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import org.apache.bcel.classfile.LineNumber; import org.apache.bcel.classfile.LineNumberTable; /** * Processes methods for line-count coverage analysis. Currently, this * does not support localization. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 * @see IAnalysisMetaData */ public class LineCountMeasure extends AbstractMeasure { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( LineCountMeasure.class ); /** * Returns the human-readable name of the measure. */ public String getMeasureName() { return "LineCount"; } /** * Returns the unit name for this particular coverage measure. */ public String getMeasureUnit() { return "lines"; } /** * Returns the text format used in meta-data formatted text. This should * be the mime encoding type, such as "text/plain" or "text/html". */ public String getMimeEncoding() { return "text/plain"; } /** * Perform the analysis on the method. */ public void analyze( IMethodCode method ) { //Method m = method.getOriginalMethod(); LineNumberTable lnt = method.getLineNumberTable(); if (lnt == null) { // nothing to do LOG.info( "Method "+method+" has no line numbers." ); return; } // we must ensure that the same line number is not counted // twice. HashSet linesFound = new HashSet(); LineNumber[] lines = lnt.getLineNumberTable(); int maxInstructionCount = method.getInstructionCount(); int instructionPos[] = new int[ maxInstructionCount ]; // find the positions of the instructions in the bytecode int methodSize = 0; for (int i = 0; i < maxInstructionCount; ++i) { instructionPos[i] = methodSize; methodSize += method.getInstructionAt( i ).getLength(); } for (int i = 0; i < lines.length; ++i) { int bytecodeOffset = lines[i].getStartPC(); for (int j = 1; j < maxInstructionCount; ++j) { if (bytecodeOffset < instructionPos[j]) { Integer lineNo = new Integer( lines[i].getLineNumber() ); if (!linesFound.contains( lineNo ) ) { // the bytecode start was one up from the current // instruction position. IAnalysisMetaData amd = createAnalysisMetaData( lines[i] ); // Bug 906207 markInstruction( method, j-1, amd, false ); // ensure we don't find this line number again linesFound.add( lineNo ); } break; } } } } private IAnalysisMetaData createAnalysisMetaData( LineNumber ln ) { int lineNo = ln.getLineNumber(); return new DefaultAnalysisMetaData( "Line "+lineNo, "Didn't cover line "+lineNo, (byte)0 ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/DefaultAnalysisMetaData.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000000677607622026360034253 0ustar drazzibdrazzib/* * @(#)DefaultAnalysisMetaData.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; /** * Contains data necessary for storing the meta-data associated with a specific * marked bytecode instruction. *

    * There is an optional "weight" value which can associate a number from * -128 to 127 for this particular instruction. This will create a weighted * coverage value to indicate on each summary level how important it is * for this particular bytecode to be executed. If the analysis module doesn't * use weights, then this should return the same value for all instructions. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:28 $ * @since December 15, 2002 */ public class DefaultAnalysisMetaData implements IAnalysisMetaData { private String covered; private String notCovered; private byte weight; public DefaultAnalysisMetaData( String c, String nc, byte w ) { if (c == null || nc == null) { throw new IllegalArgumentException( "No null args." ); } this.covered = c; this.notCovered = nc; this.weight = w; } /** * Returns the formatted, localized text for a report on this instruction * if it was covered during the runtime execution. * * @return formatted, localized, human-readable report */ public String getCoveredFormattedText() { return this.covered; } /** * Returns the formatted, localized text for a report on this instruction * if it was not covered during the runtime execution. * * @return formatted, localized, human-readable report */ public String getNotCoveredFormattedText() { return this.notCovered; } /** * Returns any value in the range of a byte that assigns an * importance "weight" to this instruction. If weights are not used * by the analysis module, then this needs to return the same value * for every instruction. * * @return an instruction weight value. */ public byte getInstructionWeight() { return this.weight; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/BytecodeLineUtil.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000001717210037421052034232 0ustar drazzibdrazzib/* * @(#)BytecodeLineUtil.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.util.Arrays; import java.util.Comparator; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import org.apache.bcel.classfile.LineNumber; import org.apache.bcel.classfile.LineNumberTable; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; /** * Helper that processes bytecode instructions and line-numbering * * @author Matt Albrecht groboclown@users.sourceforge.net * @author Juergen Kindler jkindler@freenet.de * @version $Date: 2004/04/15 05:48:26 $ * @since February 18, 2003 * @see IAnalysisMetaData */ public class BytecodeLineUtil { private int[] instructionPos; // bytecode postion for instruction index private int[] instructionLine; // linenumber for instruction index private InstructionHandle[] handles; private static final LineNumberComparator LINENUMBER_COMPARATOR = new LineNumberComparator(); /** * Helper for sorting a line number table by program counter * * @author Juergen Kindler jkindler@freenet.de */ private static class LineNumberComparator implements Comparator { /** * Compares the PC of two LineNumber objects. * Other objects will lead to a ClassCastException. * * @param o1 an Object value * @param o2 an Object value * @return an int value */ public int compare(Object o1, Object o2) { return ((LineNumber) o1).getStartPC() - ((LineNumber) o2).getStartPC(); } /** * Compares equality of comparator objects. * Returns that objects of same class as this one to be equal to this. * * @param o an Object value * @return a boolean value */ public boolean equals(Object o) { return (o != null) ? (this.getClass() == o.getClass()) : false; } } /** * */ public BytecodeLineUtil( Method m ) { if (m == null) { throw new IllegalArgumentException("no null args."); } initialize( m ); } public BytecodeLineUtil( IMethodCode m ) { if (m == null) { throw new IllegalArgumentException("no null args."); } initialize( m.getOriginalMethod() ); } public InstructionHandle[] getHandles() { return this.handles; } public int getLineNumber( InstructionHandle ih ) { if (ih == null) { throw new IllegalArgumentException("no null args."); } return getLineNumberForBytecodePos( ih.getPosition() ); } public int getLineNumberForBytecodePos( int bytecodePos ) { int instrPos = getInstructionPosForBytecodePos( bytecodePos ); return getLineNumberForInstructionPos( instrPos ); } public int getLineNumberForInstructionPos( int instrPos ) { if (instrPos >= 0 && instrPos < this.instructionLine.length) { return this.instructionLine[ instrPos ]; } //else return -1; } public int getInstructionPosForBytecodePos( int bytecodePos ) { // this method needs to account for the virtual instructions at the // end of a method. int len = this.instructionPos.length; if (len == 0) { return 0; } for (int i = 0; i < len; ++i) { if (this.instructionPos[i] == bytecodePos) { return i; } } if (len >= 1 && this.instructionPos[ len - 1 ] < bytecodePos ) { return len; } throw new IllegalStateException( "Unknown bytecode position "+ bytecodePos ); } //----------------------------------------------------------------------- protected void initialize( Method m ) { if (m == null) { throw new IllegalArgumentException("no null args."); } LineNumberTable lnt = m.getLineNumberTable(); LineNumber[] lines = sort( lnt ); this.instructionPos = getInstructionPositions( m ); this.instructionLine = getInstructionLines( lines, this.instructionPos ); } private LineNumber[] sort( LineNumberTable lnt ) { if (lnt == null) { return new LineNumber[0]; } LineNumber[] lines = lnt.getLineNumberTable(); if (lines == null) { return new LineNumber[0]; } Arrays.sort( lines, LINENUMBER_COMPARATOR ); return lines; } private int[] getInstructionPositions( Method m ) { InstructionList il = new InstructionList( m.getCode().getCode() ); il.setPositions(); this.handles = il.getInstructionHandles(); int instructionCount = handles.length; int instructionPos[] = new int[ instructionCount ]; // find the positions of the instructions in the bytecode for (int i = 0; i < instructionCount; ++i) { instructionPos[i] = this.handles[i].getPosition(); } return instructionPos; } private int[] getInstructionLines( LineNumber lines[], int bytePos[] ) { int out[] = new int[ bytePos.length ]; for (int bIndex = 0; bIndex < bytePos.length; ++bIndex) { out[bIndex] = getLinenoForBytePos( lines, bytePos[ bIndex ] ); } return out; } private int getLinenoForBytePos( LineNumber lines[], int bytePos ) { if (lines.length <= 0) { return -1; } for (int i = 1; i < lines.length; ++i) { if (bytePos < lines[ i ].getStartPC()) { return lines[i - 1].getLineNumber(); } } return lines[ lines.length - 1 ].getLineNumber(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/BranchCountMeasure.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000001725710037421052034236 0ustar drazzibdrazzib/* * @(#)BranchCountMeasure.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import org.apache.bcel.classfile.CodeException; import org.apache.bcel.generic.IfInstruction; import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.JsrInstruction; import org.apache.bcel.generic.Select; /** * Processes methods for branch coverage analysis, where each branch * instruction and its corresponding not-taken instruction are marked. * Currently, this does not support localization. *

    * This is more accurately called "Object Code Branch Coverage", since * true branch coverage requires the originating source code to correctly * discover the branches. *

    * This measure can be superior to line coverage due to the Java construct * of the ?: operation. This hides a branch inside a single * statement. Also, some developers may put an if statement and * its one-line branch all on the same line, which will hide the branch * that was taken. * * @author Matt Albrecht groboclown@users.sourceforge.net * @author Juergen Kindler jkindler@freenet.de * @version $Date: 2004/04/15 05:48:26 $ * @since January 26, 2003 * @see IAnalysisMetaData */ public class BranchCountMeasure extends AbstractMeasure { //private static final org.apache.log4j.Logger LOG = // org.apache.log4j.Logger.getLogger( BranchCountMeasure.class ); /** * Returns the human-readable name of the measure. */ public String getMeasureName() { return "Branch"; } /** * Returns the unit name for this particular coverage measure. */ public String getMeasureUnit() { return "branches"; } /** * Returns the text format used in meta-data formatted text. This should * be the mime encoding type, such as "text/plain" or "text/html". */ public String getMimeEncoding() { return "text/plain"; } /** * Perform the analysis on the method. */ public void analyze( IMethodCode method ) { BytecodeLineUtil blu = new BytecodeLineUtil( method ); InstructionHandle handles[] = blu.getHandles(); // always mark the first instruction, even if there are no // instructions. markInstruction( method, 0, createAMD( "Start of Method", blu.getLineNumberForInstructionPos( 0 ) ), false ); // find the positions of the instructions in the bytecode for (int i = 0; i < handles.length; ++i) { InstructionHandle h = handles[i]; Instruction instr = h.getInstruction(); // Mark the if, select, and jsr instructions if (instr instanceof IfInstruction) { markIf( method, (IfInstruction)instr, i, blu ); } else if (instr instanceof Select) { markSelect( method, (Select)instr, i, blu ); } else if (instr instanceof JsrInstruction) { markJsr( method, (JsrInstruction)instr, i, blu ); } } // Also need to mark all exception handlers. CodeException exceptions[] = method.getOriginalMethod().getCode(). getExceptionTable(); for (int i = 0; i < exceptions.length; ++i) { markExceptionHandler( method, exceptions[i], blu ); } } /** * The target will be the "else" or "default" instruction. */ private void markIf( IMethodCode method, IfInstruction instr, int i, BytecodeLineUtil blu ) { int lineNo = blu.getLineNumberForInstructionPos( i+1 ); // the mark on this part goes AFTER the branch instruction, // not before it. // Bug 906198 // Bug 906207 markInstruction( method, i+1, createAMD( "'True' branch", lineNo ), false ); InstructionHandle target = instr.getTarget(); markTarget( method, target, blu, "'False' branch" ); } /** * */ private void markSelect( IMethodCode method, Select instr, int i, BytecodeLineUtil blu ) { int lineNo = blu.getLineNumberForInstructionPos( i+1 ); markInstruction( method, i+1, createAMD( "After switch", lineNo ), false ); InstructionHandle targets[] = instr.getTargets(); for (int tIndex = 0; tIndex < targets.length; ++tIndex) { markTarget( method, targets[ tIndex ], blu, "Case index "+Integer.toString( tIndex + 1 ) ); } } /** * */ private void markJsr( IMethodCode method, JsrInstruction instr, int i, BytecodeLineUtil blu ) { // For a JSR, the target indicates the location of a finally block. InstructionHandle target = instr.getTarget(); markTarget( method, target, blu, "Finally block" ); } /** * */ private void markExceptionHandler( IMethodCode method, CodeException ce, BytecodeLineUtil blu ) { int pc = ce.getHandlerPC(); // Bug 906207 markInstruction( method, blu.getInstructionPosForBytecodePos( pc ), createAMD( "Exception handler", blu.getLineNumberForBytecodePos( pc ) ), false ); } private void markTarget( IMethodCode method, InstructionHandle target, BytecodeLineUtil blu, String branchDesc ) { if (target != null) { // This does not relate to bug 906207 due to bug 906211 markInstruction( method, blu.getInstructionPosForBytecodePos( target.getPosition() ), createAMD( branchDesc, blu.getLineNumber( target ) ), false ); } } /** * */ private IAnalysisMetaData createAMD( String type, int lineNo ) { return new DefaultAnalysisMetaData( type+" at line "+lineNo, "Didn't cover "+type+" at line "+lineNo, (byte)0 ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module/CallPairMeasure.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/module0000644000175000017500000001023410037421052034222 0ustar drazzibdrazzib/* * @(#)CallPairMeasure.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InvokeInstruction; /** * Processes methods for call pair coverage analysis, where each function * call instruction are marked. * Currently, this does not support localization. *

    * This is more accurately called "Object Code Branch Coverage", since * true branch coverage requires the originating source code to correctly * discover the branches. *

    * This measure can be superior to line coverage due to the Java construct * of the ?: operation. This hides a branch inside a single * statement. Also, some developers may put an if statement and * its one-line branch all on the same line, which will hide the branch * that was took. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since February 17, 2003 * @see IAnalysisMetaData */ public class CallPairMeasure implements IAnalysisModule { /** * Returns the human-readable name of the measure. */ public String getMeasureName() { return "Call Pair"; } /** * Returns the unit name for this particular coverage measure. */ public String getMeasureUnit() { return "call"; } /** * Returns the text format used in meta-data formatted text. This should * be the mime encoding type, such as "text/plain" or "text/html". */ public String getMimeEncoding() { return "text/plain"; } /** * Perform the analysis on the method. */ public void analyze( IMethodCode method ) { BytecodeLineUtil blu = new BytecodeLineUtil( method ); InstructionHandle handles[] = blu.getHandles(); // find the positions of the instructions in the bytecode for (int i = 0; i < handles.length; ++i) { InstructionHandle h = handles[i]; Instruction instr = h.getInstruction(); if (instr instanceof InvokeInstruction) { // need to mark the target(s) and the next instruction, as it // will be the "else" or "default" instruction. int lineNo = blu.getLineNumber( h ); method.markInstruction( i, createMetaData( i, lineNo ) ); } } } private IAnalysisMetaData createMetaData( int bytecodePos, int lineNo ) { return new DefaultAnalysisMetaData( "Invoke for line "+lineNo, "Didn't cover invocation for line "+lineNo, (byte)0 ); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChannelLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChann0000644000175000017500000000441210071620311034073 0ustar drazzibdrazzib/* * @(#)IChannelLogger.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; /** * Logs a particular channel's instruction mark coverage. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 15, 2002 */ public interface IChannelLogger { /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ); } libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/0000755000175000017500000000000011271425773033613 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/StyleTransformer.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/St0000644000175000017500000001545110037421051034112 0ustar drazzibdrazzib/* * @(#)StyleTransformer.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.text.DateFormat; import java.util.Date; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; import org.w3c.dom.Node; /** * Transforms XML with XSL. Stolen from the JUnit optional task... kind of. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since November 22, 2003 */ public class StyleTransformer { private Project project; private Transformer tformer; public StyleTransformer( Project proj, String stylesheetID, File outDir ) throws BuildException { this.project = proj; try { TransformerFactory tfactory = TransformerFactory.newInstance(); Source xslSrc = new StreamSource( stylesheetID ); this.tformer = tfactory.newTransformer( xslSrc ); this.tformer.setParameter("output.dir", outDir.getAbsolutePath()); } catch (javax.xml.transform.TransformerConfigurationException e) { throw new BuildException( "Error creating XSL transformer: "+ e.getMessage(), e ); } } public void setParameter( String name, Object val ) { this.tformer.setParameter( name, val ); } public Document transform( Document in ) throws BuildException { DOMResult result = new DOMResult(); DOMSource source = new DOMSource( in ); execute( source, result ); return getDocument( result.getNode() ); } public void transform( Document in, File outFile ) throws BuildException, IOException { checkFileTree( outFile ); Source source = new DOMSource( in ); FileOutputStream fos = null; try { fos = new FileOutputStream( outFile ); Result result = new StreamResult( fos ); execute( source, result ); } finally { if (fos != null) { fos.close(); } } } public Document transform( File in ) throws BuildException, IOException { DOMResult result = new DOMResult(); FileInputStream fis = null; try { fis = new FileInputStream( in ); Source source = new StreamSource( in ); execute( source, result ); } finally { if (fis != null) { fis.close(); } } return getDocument( result.getNode() ); } public void transform( File in, File outFile ) throws BuildException, IOException { checkFileTree( outFile ); FileOutputStream fos = null; FileInputStream fis = null; try { fos = new FileOutputStream( outFile ); fis = new FileInputStream( in ); Source source = new StreamSource( fis ); Result result = new StreamResult( fos ); execute( source, result ); } finally { if (fos != null) { fos.close(); } if (fis != null) { fis.close(); } } } protected final void execute( Source src, Result res ) throws BuildException { final long t0 = System.currentTimeMillis(); tformer.setParameter( "TSTAMP", DateFormat.getDateTimeInstance(). format( new Date( t0 ) ) ); try { tformer.transform( src, res ); } catch (RuntimeException ex) { throw ex; } catch (Exception e) { throw new BuildException( "Errors while applying transformations: " + e.getMessage(), e ); } finally { final long dt = System.currentTimeMillis() - t0; this.project.log( "Transform time: " + dt + "ms", Project.MSG_DEBUG ); } } private final void checkFileTree( File f ) throws IOException { File p = f.getParentFile(); p.mkdirs(); } private static Document getDocument( Node child ) { if (child instanceof Document) { return (Document)child; } Document doc = child.getOwnerDocument(); if (doc == null) { doc = getDocumentBuilder().newDocument(); Node c = doc.importNode( child, true ); doc.appendChild( c ); } return doc; } private static DocumentBuilder getDocumentBuilder() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (Exception exc) { throw new ExceptionInInitializerError(exc); } } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/pa0000644000175000017500000000023407600160000034111 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.ant Ant interface for performing the code coverage tasks. ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/IReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/IR0000644000175000017500000000437010037421051034034 0ustar drazzibdrazzib/* * @(#)IReportStyle.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.IOException; import java.util.Vector; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; /** * Describes a report style, used to generate readable reports from the * XML output. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since November 22, 2003 */ public interface IReportStyle { /** * @param doc the XML document of the coverage report to process. */ public void generateReport( Project project, Document doc, String moduleName ) throws BuildException, IOException; /** * Called when the task is finished generating all the reports. This * may be useful for styles that join all the reports together. */ public void reportComplete( Project project, Vector errors ) throws BuildException, IOException; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/GroboInstrumentTask.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Gr0000644000175000017500000005370710040164707034110 0ustar drazzibdrazzib/* * @(#)GroboInstrumentTask.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Enumeration; import java.util.Hashtable; import java.util.Properties; import java.util.Vector; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.compiler.AlreadyPostCompiledException; import net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.logger.CacheDirChannelLoggerFactory; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory; import net.sourceforge.groboutils.codecoverage.v2.logger.MinDirChannelLoggerFactory; import net.sourceforge.groboutils.codecoverage.v2.logger.FileSingleSourceLoggerFactory; import net.sourceforge.groboutils.codecoverage.v2.logger.NoOpChannelLoggerFactory; import net.sourceforge.groboutils.util.io.v1.ReadByteStream; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.Delete; import org.apache.tools.ant.types.EnumeratedAttribute; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.util.FileUtils; /** * A variation of the CoveragePostCompilerTask. This one is intended to * simplify the Ant build files. See * * feature request 901588 for details. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/17 08:24:39 $ * @since March 9, 2004 */ public class GroboInstrumentTask extends Task { private static final FileUtils FILEUTILS = FileUtils.newFileUtils(); private static final String CLASSNAME_EXT = ".class"; private static final String LOGGER_SAFE_1 = "safe"; private static final String LOGGER_SAFE_2 = "dir"; private static final String LOGGER_SAFE_3 = "directory"; private static final String LOGGER_SAFE_CLASS = DirectoryChannelLoggerFactory.class.getName(); private static final String LOGGER_KEEP_OPEN_1 = "cache"; private static final String LOGGER_KEEP_OPEN_2 = "cachedir"; private static final String LOGGER_KEEP_OPEN_CLASS = CacheDirChannelLoggerFactory.class.getName(); private static final String LOGGER_MINDIR_1 = "fast"; private static final String LOGGER_MINDIR_2 = "min"; private static final String LOGGER_MINDIR_3 = "mindir"; private static final String LOGGER_MINDIR_CLASS = MinDirChannelLoggerFactory.class.getName(); private static final String LOGGER_SINGLEFILE_1 = "single file"; private static final String LOGGER_SINGLEFILE_2 = "single"; private static final String LOGGER_SINGLEFILE_CLASS = FileSingleSourceLoggerFactory.class.getName(); private static final String LOGGER_NONE_1 = "none"; private static final String LOGGER_NONE_CLASS = NoOpChannelLoggerFactory.class.getName(); private static final Hashtable LOGGER_TO_CLASSNAME = new Hashtable(); static { LOGGER_TO_CLASSNAME.put( LOGGER_SAFE_1, LOGGER_SAFE_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_SAFE_2, LOGGER_SAFE_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_SAFE_3, LOGGER_SAFE_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_KEEP_OPEN_1, LOGGER_KEEP_OPEN_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_KEEP_OPEN_2, LOGGER_KEEP_OPEN_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_MINDIR_1, LOGGER_MINDIR_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_MINDIR_2, LOGGER_MINDIR_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_MINDIR_3, LOGGER_MINDIR_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_SINGLEFILE_1, LOGGER_SINGLEFILE_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_SINGLEFILE_2, LOGGER_SINGLEFILE_CLASS ); LOGGER_TO_CLASSNAME.put( LOGGER_NONE_1, LOGGER_NONE_CLASS ); } /** * Contains all possible logger types. */ public static final class LoggerAttribute extends EnumeratedAttribute { private String types[] = { LOGGER_SAFE_1, LOGGER_SAFE_2, LOGGER_SAFE_3, LOGGER_KEEP_OPEN_1, LOGGER_KEEP_OPEN_2, LOGGER_MINDIR_1, LOGGER_MINDIR_2, LOGGER_MINDIR_3, LOGGER_SINGLEFILE_1, LOGGER_SINGLEFILE_2, LOGGER_NONE_1 }; public String[] getValues() { return this.types; } } /** * Used for associating a key with a value for the properties. */ public static final class LoggerProperty { String key; String value; public void setKey( String k ) { this.key = k; } public void setValue( String v ) { this.value = v; } public void setLocation( File f ) { this.value = f.getAbsolutePath(); } } private static final String HANDLEEXISTING_REPLACE = "replace"; private static final String HANDLEEXISTING_KEEP = "keep"; private static final String HANDLEEXISTING_REMOVE_ALL = "clean"; /** * Contains all possible HandleExisting types. */ public static final class HandleExistingAttribute extends EnumeratedAttribute { private String types[] = { HANDLEEXISTING_REPLACE, HANDLEEXISTING_KEEP, HANDLEEXISTING_REMOVE_ALL }; public String[] getValues() { return types; } } private Vector filesets = new Vector(); private Vector loggerProps = new Vector(); private File datadir = null; private File logdir = null; private File outfiledir = null; private File baselogdir = null; private String logger = LOGGER_SAFE_1; private String loggerClass = null; private Vector analysisModules = new Vector(); private String handleExisting = HANDLEEXISTING_REPLACE; /** * Add a new fileset instance to this compilation. Whatever the fileset is, * only filename that are .class will be considered as * 'candidates'. Currently, jar files are not read; you'll have to * uncompress them to a directory before running this step. * * @param fs the new fileset containing the rules to get the testcases. */ public void addFileSet( FileSet fs ) { this.filesets.addElement(fs); } /** * Set the type of logger to use. This defaults to the "safe" * logger, which is JDK agnostic. */ public void setLogger( LoggerAttribute la ) { this.logger = la.getValue(); } /** * Allow the user to specify a logger factory class name. If this * is specified, it overrides any value set by the "logger" attribute. */ public void setLoggerFactory( String name ) { if (name.indexOf(".") < 0) { this.loggerClass = "net.sourceforge.groboutils.codecoverage.v2.logger."+ name; } else { this.loggerClass = name; } } /** * Sets the directory in which all the data accumulated from the * post compilation step will be placed, and the logging output * as well. This should be a directory dedicated just to the output data. * If the directory doesn't exist when the task runs, it will be * created. */ public void setLogDir( File f ) { this.baselogdir = f; } /** * Sets the directory in which all the recompiled class files will be * placed. This directory should never be confused with the original * class file location. */ public void setDestDir( File f ) { this.outfiledir = f; } /** * Creates a new analysis module. */ public void addMeasure( AnalysisModuleType amt ) { this.analysisModules.addElement( amt ); } /** * Adds a property to the logger properties file. */ public void addLoggerProp( LoggerProperty lp ) { this.loggerProps.addElement( lp ); } /** * Sets the behavior when classes get post-compiled - should the * previous post-compiled class be replaced, kept, or should all * the previous data be cleaned? */ public void setIfExists( HandleExistingAttribute hea ) { this.handleExisting = hea.getValue(); } /** * Perform the task */ public void execute() throws BuildException { // pre-check setupDirectories(); ClassFile classFiles[] = getFilenames(); IAnalysisModule modules[] = getAnalysisModules(); try { log( "Writing meta-data to directory '"+this.datadir+"'.", Project.MSG_VERBOSE ); DirMetaDataWriter dmdw = new DirMetaDataWriter( this.datadir ); try { PostCompileClass pcc = new PostCompileClass( dmdw, modules ); for (int i = 0; i < classFiles.length; ++i) { if (HANDLEEXISTING_REPLACE.equals( this.handleExisting )) { cleanupClass( classFiles[i], modules ); } File infile = classFiles[i].srcFile; String filename = classFiles[i].filename; // create the output class file, and ensure that // its directory structure exists before creating it File outfile = new File( this.outfiledir, filename ); log( "Recompiling class '"+infile+"' to file '"+ outfile+"'.", Project.MSG_VERBOSE ); File parent = outfile.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } // need some code handle the situation where the // outfile may be the same as the infile. This will // also allow us to correctly handle the situation of // an exception not properly creating the instrumented // class. See bug 929332. File tmpout = FILEUTILS.createTempFile( outfile.getName(), ".tmp", parent ); FileOutputStream fos = new FileOutputStream( tmpout ); try { pcc.postCompile( filename, readFile( infile ), fos ); fos.close(); fos = null; FILEUTILS.copyFile( tmpout, outfile ); } catch (AlreadyPostCompiledException apce) { // see bug 903837 log( "Ignoring '"+infile+"': it has already been "+ "post-compiled.", Project.MSG_INFO ); } finally { if (fos != null) { fos.close(); } if (tmpout.exists()) { tmpout.delete(); } } } } finally { dmdw.close(); } } catch (IOException ioe) { throw new BuildException( "I/O exception during execution.", ioe, getLocation() ); } try { generatePropertyFile( this.outfiledir, modules.length ); } catch (IOException ioe) { throw new BuildException( "I/O exception during execution.", ioe, getLocation() ); } } private void setupDirectories() throws BuildException { if (this.baselogdir == null) { throw new BuildException( "Attribute 'logdir' was never set." ); } if (this.outfiledir == null) { throw new BuildException( "Attribute 'destdir' was never set." ); } if (this.datadir == null) { this.datadir = new File( this.baselogdir, "data" ); } if (this.logdir == null) { this.logdir = new File( this.baselogdir, "logs" ); } // bug 906316: ensure the directories exist... if (!this.datadir.exists()) { this.datadir.mkdirs(); } else if (HANDLEEXISTING_REMOVE_ALL.equals( this.handleExisting )) { removeDir( this.datadir ); this.datadir.mkdirs(); removeDir( this.logdir ); } if (!this.outfiledir.exists()) { this.outfiledir.mkdirs(); } } /** * */ private IAnalysisModule[] getAnalysisModules() throws BuildException { final Vector v = new Vector(); final Enumeration enum = this.analysisModules.elements(); while (enum.hasMoreElements()) { AnalysisModuleType amt = (AnalysisModuleType)enum.nextElement(); IAnalysisModule am = amt.getAnalysisModule(); v.addElement( am ); } final IAnalysisModule[] amL = new IAnalysisModule[ v.size() ]; v.copyInto( amL ); return amL; } /** * Iterate over all filesets and return the filename of all files * that end with .class (case insensitive). This is to avoid * trying to parse a non-class file. * * @return an array of filenames to parse. */ private ClassFile[] getFilenames() { Vector v = new Vector(); final int size = this.filesets.size(); for (int j = 0; j < size; j++) { FileSet fs = (FileSet)filesets.elementAt( j ); DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); File baseDir = ds.getBasedir(); ds.scan(); String[] f = ds.getIncludedFiles(); for (int k = 0; k < f.length; k++) { String pathname = f[k]; if (pathname.toLowerCase().endsWith( CLASSNAME_EXT )) { // this isn't right v.addElement( new ClassFile( baseDir, pathname ) ); } } } ClassFile[] files = new ClassFile[v.size()]; v.copyInto(files); return files; } /** * Contains the data for the class file. */ private static final class ClassFile { public File srcFile; public String filename; public ClassFile( File baseDir, String filename ) { if (baseDir == null || filename == null) { throw new IllegalArgumentException("no null args."); } this.filename = filename; this.srcFile = new File( baseDir, filename ); } } /** * Create the property file for the logger. */ private void generatePropertyFile( File outfiledir, int moduleCount ) throws IOException { Properties props = new Properties(); if (this.loggerClass != null) { props.setProperty( "factory", this.loggerClass ); } else { String factoryClass = (String)LOGGER_TO_CLASSNAME.get( this.logger ); if (LOGGER_NONE_CLASS.equals( factoryClass )) { // feature: specifying a logger type (not class) of // none means don't create the property file. return; } props.setProperty( "factory", factoryClass ); } if (this.logdir != null) { props.setProperty( "logger.dir", this.logdir.getAbsolutePath() ); } Enumeration enum = loggerProps.elements(); while (enum.hasMoreElements()) { LoggerProperty lp = (LoggerProperty)enum.nextElement(); if (lp.key == null) { throw new BuildException( "No key given for loggerprop." ); } if (lp.value == null) { throw new BuildException( "No value or location given for loggerprop key \"" + lp.key + "\"." ); } props.setProperty( "logger." + lp.key, lp.value ); } props.setProperty( "channel-count", Integer.toString( moduleCount ) ); FileOutputStream fos = new FileOutputStream( new File( outfiledir, "grobocoverage.properties" ) ); try { props.store( fos, "CodeCoverage setup file" ); } finally { fos.close(); } } /** * */ private byte[] readFile( File file ) throws IOException { FileInputStream fis = new FileInputStream( file ); try { byte[] outfile = ReadByteStream.readByteStream( fis ); return outfile; } finally { fis.close(); } } /** * Recursively removes a directory's contents */ private void removeDir( File d ) { MyDelete md = new MyDelete(); md.setProject( getProject() ); md.setFailOnError( false ); md.removeDir2( d ); } /** all we care about is making the removeDirectory public */ private static final class MyDelete extends Delete { // save some execution time by not overriding removeDir, but // instead have a different method that calls out to the // protected method. public void removeDir2( File f ) { if (f != null && f.exists()) { if (f.isDirectory()) { super.removeDir( f ); } else { f.delete(); } } } } /** * Cleanup the datafiles for the given class. The implementation * is rather hacky. */ private void cleanupClass( ClassFile cf, IAnalysisModule[] modules ) throws IOException { String cfName = cf.filename.replace( File.separatorChar, '.' ); if (cfName.toLowerCase().endsWith( CLASSNAME_EXT )) { cfName = cfName.substring( 0, cfName.length() - CLASSNAME_EXT.length() ); } // be sure to add in the last '-', otherwise inner-classes and // other classes that start with the same text may be accidentally // deleted. This was happening in the testInstrument5 test. cfName = cfName + "-"; for (int amIndex = 0; amIndex < modules.length; ++amIndex) { // analysis module data dir File amdd = new File( this.datadir, modules[ amIndex ].getMeasureName() ); File list[] = amdd.listFiles(); if (list != null) { for (int i = 0; i < list.length; ++i) { // names are of the form: // [full class name]-[CRC].[type].txt String name = list[i].getName(); if (name.startsWith( cfName )) { // delete all for this class!!! list[i].delete(); } } } } } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/AnalysisModuleType.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/An0000644000175000017500000002225210040160433034055 0ustar drazzibdrazzib/* * @(#)AnalysisModuleType.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.util.Hashtable; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure; import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.types.EnumeratedAttribute; import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Reference; /** * Loads an analysis module. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 18, 2002 */ public class AnalysisModuleType extends DataType { private static final Hashtable NAMES_TO_CLASSES = new Hashtable(); static { NAMES_TO_CLASSES.put( "line", LineCountMeasure.class ); NAMES_TO_CLASSES.put( "linecount", LineCountMeasure.class ); NAMES_TO_CLASSES.put( "bytecode", BytecodeCountMeasure.class ); NAMES_TO_CLASSES.put( "branch", BranchCountMeasure.class ); NAMES_TO_CLASSES.put( "call", CallPairMeasure.class ); NAMES_TO_CLASSES.put( "callpair", CallPairMeasure.class ); NAMES_TO_CLASSES.put( "call-pair", CallPairMeasure.class ); NAMES_TO_CLASSES.put( "function", FunctionMeasure.class ); NAMES_TO_CLASSES.put( "method", FunctionMeasure.class ); } public static final class TypeAttribute extends EnumeratedAttribute { private String[] types = { "line", "linecount", "bytecode", "branch", "call", "callpair", "call-pair", "function", "method" }; public String[] getValues() { return this.types; } } private String moduleName; private String className; private Path classpath; private String resource; private String loaderId = null; private String classpathId = null; public void setName( String n ) { this.moduleName = n; } public void setType( TypeAttribute n ) { this.moduleName = n.getValue(); } public void setClassName( String c ) { this.className = c; } /** * Set the classpath to be used when searching for component being defined * * @param classpath an Ant Path object containing the classpath. */ public void setClasspath(Path classpath) { if (this.classpath == null) { this.classpath = classpath; } else { this.classpath.append( classpath ); } } /** * Create the classpath to be used when searching for component being defined */ public Path createClasspath() { if (this.classpath == null) { this.classpath = new Path( getProject() ); } return this.classpath.createPath(); } /** * reference to a classpath to use when loading the files. * To actually share the same loader, set loaderref as well */ public void setClasspathRef( Reference r ) { this.classpathId = r.getRefId(); createClasspath().setRefid(r); } /** * Use the reference to locate the loader. If the loader is not * found, taskdef will use the specified classpath and register it * with the specified name. * * This allow multiple taskdef/typedef to use the same class loader, * so they can be used together. It eliminate the need to * put them in the CLASSPATH. * * @since Ant 1.5 */ public void setLoaderRef( Reference r ) { loaderId = r.getRefId(); } /** * This method is guaranteed to never return null. */ public IAnalysisModule getAnalysisModule() throws BuildException { if (isReference()) { return getRef().getAnalysisModule(); } Class c = null; if (this.moduleName != null) { c = (Class)NAMES_TO_CLASSES.get( this.moduleName.toLowerCase() ); if (c == null) { throw new BuildException( "Unknown analysis module name '"+ this.moduleName+"'." ); } } else if (this.className != null) { c = createClass( this.className ); if (c == null) { throw new BuildException( "Could not find class "+ this.className+" from classpath." ); } } else { throw new BuildException( "Never set either the 'name' "+ "or the 'classname' attribute." ); } try { return (IAnalysisModule)c.newInstance(); } catch (Exception ex) { throw new BuildException( "Error creating analysis module of type "+ c.getName()+".", ex ); } } protected AnalysisModuleType getRef() { return (AnalysisModuleType)getCheckedRef( AnalysisModuleType.class, "analysismodule" ); } /** * Stolen from o.a.t.a.taskdefs.Definer */ private Class createClass( String classname ) throws BuildException { // If a loader has been set ( either by loaderRef or magic property ) if (loaderId != null) { Object reusedLoader = getProject().getReference( loaderId ); if (reusedLoader != null) { if (reusedLoader instanceof AntClassLoader) { try { return ((AntClassLoader)reusedLoader). loadClass( classname ); } catch (Exception e) { throw new BuildException( "Error loading class "+ classname, e ); } } // In future the reference object may be the type // if( reusedLoader instanceof Loader ) { // return ((Loader)reusedLoader).getLoader(project); // } } } AntClassLoader al = null; if (classpath != null) { al = new AntClassLoader( getProject(), classpath, true ); } else { al = new AntClassLoader( getProject(), Path.systemClasspath, true ); } // need to load Task via system classloader or the new // task we want to define will never be a Task but always // be wrapped into a TaskAdapter. // al.addSystemPackageRoot("org.apache.tools.ant"); // If the loader is new, record it for future uses by other // task/typedefs if (loaderId != null) { if (getProject().getReference(loaderId) == null) { getProject().addReference( loaderId, al ); } } try { return al.loadClass( classname ); } catch (Exception e) { throw new BuildException( "Error loading class "+classname, e ); } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/SourceXslReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/So0000644000175000017500000004332510072742275034123 0ustar drazzibdrazzib/* * @(#)SourceXslReportStyle.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Enumeration; import java.util.Vector; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import net.sourceforge.groboutils.codecoverage.v2.report.IXmlReportConst; import net.sourceforge.groboutils.codecoverage.v2.report.XmlSourceReportGenerator2; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** * This is a combo report, which means that it only works * with the combined coverage file. Use of this style is really delicate. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:09 $ * @since March 15, 2004 */ public class SourceXslReportStyle implements IReportStyle, IXmlReportConst { private File outdir; private Vector srcdirs = new Vector(); private boolean removeEmpties = false; private Vector rootStyles = new Vector(); private Vector sourceStyles = new Vector(); private Vector packageStyles = new Vector(); private Vector files = new Vector(); private Vector params = new Vector(); private int totalCachedCount = 100; public static final class DirType { private File dir; public void setName( File name ) { this.dir = name; } public File getDir() { return this.dir; } } public static final class StyleType { String url; File file; String dest; StyleTransformer transformer; int count; int totalCount = -1; public void setTotalCount( int totalCount ) { if (this.totalCount < 0) { this.totalCount = totalCount; if (totalCount == 0) { this.transformer = null; } } } public void setFile( File f ) throws IOException { this.file = f; } public void setUrl( String resource ) { this.url = resource; } // may be ignored public void setDest( String d ) { this.dest = d; } protected StyleTransformer getTransformer() { if (this.transformer != null && ++this.count > this.totalCount) { this.transformer = null; // fall through } return this.transformer; } protected void setTransformer( StyleTransformer st ) { if (this.totalCount != 0) { this.count = 0; this.transformer = st; } } public String getURL( SourceXslReportStyle sxrs ) throws IOException { String ret = null; if (this.file != null) { ret = sxrs.getStylesheetSystemIdForFile( this.file ); } else if (this.url != null) { ret = sxrs.getStylesheetSystemIdForClass( this.url ); } else { throw new BuildException( "Neither 'file' nor 'url' were set for style" ); } return ret; } } public void setStyleCacheCount( int count ) throws BuildException { if (count < 0) { throw new BuildException( "count cannot be less than 0" ); } this.totalCachedCount = count; } public void setDestDir( File dir ) { this.outdir = dir; } public void setSrcDir( File dir ) { if (dir != null) { DirType dt = new DirType(); dt.setName( dir ); this.srcdirs.addElement( dt ); } } public void addRootStyle( StyleType s ) { if (s != null) { this.rootStyles.addElement( s ); } } public void addSourceStyle( StyleType s ) { if (s != null) { this.sourceStyles.addElement( s ); } } public void addPackageStyle( StyleType s ) { if (s != null) { this.packageStyles.addElement( s ); } } public void addFile( StyleType s ) { if (s != null) { this.files.addElement( s ); } } /** * Add a new source directory to this report. */ public void addSrcDir( DirType dt ) { this.srcdirs.addElement( dt ); } public void addParam( SimpleXslReportStyle.ParamType pt ) { if (pt != null) { this.params.addElement( pt ); } } public void setRemoveEmpty( boolean on ) { this.removeEmpties = on; } /** * Called when the task is finished generating all the reports. This * may be useful for styles that join all the reports together. */ public void reportComplete( Project project, Vector errors ) throws BuildException, IOException { // do nothing } public void generateReport( Project project, Document doc, String moduleName ) throws BuildException, IOException { project.log( "Generating source report", Project.MSG_VERBOSE ); if (this.removeEmpties) { project.log( "Removing empty methods and classes...", Project.MSG_VERBOSE ); doc = getRemoveEmptiesStyle( project ).transform( doc ); } setupStyles(); long start = System.currentTimeMillis(); // Transform the source files. // Do this first so that the directory structure exists, and so that // we know that all the source files exist. transformSources( project, doc ); transformPackages( project, doc ); transformRoots( project, doc ); copyResources( project ); project.log( "Total transform time = " + (System.currentTimeMillis() - start) + " ms", Project.MSG_VERBOSE ); } protected void setupStyles() { setupStyles( this.rootStyles.elements() ); setupStyles( this.sourceStyles.elements() ); setupStyles( this.packageStyles.elements() ); } protected void setupStyles( Enumeration e ) { while (e.hasMoreElements()) { StyleType st = (StyleType)e.nextElement(); st.setTotalCount( this.totalCachedCount ); } } /** * This is the biggest time eater. This takes friggin' forever. */ protected void transformSources( Project project, Document doc ) throws IOException { project.log( "Making reports for source files", Project.MSG_VERBOSE ); Element rootEl = doc.getDocumentElement(); XmlSourceReportGenerator2 xsrg = new XmlSourceReportGenerator2( doc ); String sources[] = xsrg.getSourceNames(); for (int i = 0; i < sources.length; ++i) { // existence of the source file logic is in the generator. project.log( "Making report for source file "+sources[i], Project.MSG_DEBUG ); long start = System.currentTimeMillis(); Document srcDoc = xsrg.createXML( sources[i], getSourceFile( sources[i], project ) ); srcDoc.getDocumentElement().setAttribute( "updir", getUpDir( sources[i] ) ); project.log( "Generating source XML doc took "+ (System.currentTimeMillis() - start) + " ms", Project.MSG_DEBUG ); transform( project, srcDoc, this.sourceStyles.elements(), getOutFileBase( sources[i] ) ); // need a better way to clean up this document... srcDoc = null; System.gc(); } clearCache( this.sourceStyles.elements() ); } protected void transformPackages( Project project, Document doc ) throws IOException { // do each individual package... project.log( "Making reports for packages", Project.MSG_VERBOSE ); DocumentBuilder builder = getDocumentBuilder(); NodeList list = doc.getElementsByTagName( "package" ); Element typeEl = (Element)doc.getElementsByTagName( "moduletypes" ). item(0); NodeList classes = doc.getElementsByTagName( "classcoverage" ); for (int i = 0; i < list.getLength(); ++i) { Document ndoc = builder.newDocument(); Element n = (Element)ndoc.importNode( list.item( i ), true ); ndoc.appendChild( n ); String pkgname = n.getAttribute( "name" ); n.appendChild( ndoc.importNode( typeEl, true ) ); for (int j = 0; j < classes.getLength(); ++j) { n.appendChild( ndoc.importNode( classes.item(j), true ) ); } // turn the package name into a path String dirname = ""; if (pkgname.length() > 0) { dirname = pkgname.replace( '.', File.separatorChar ) + File.separatorChar; } n.setAttribute( "updir", getUpDir( dirname ) ); n = null; transform( project, ndoc, this.packageStyles.elements(), getOutFileBase( dirname ) ); ndoc = null; System.gc(); } clearCache( this.packageStyles.elements() ); } protected void transformRoots( Project project, Document doc ) throws IOException { transform( project, doc, this.rootStyles.elements(), getOutFileBase( null ) ); clearCache( this.rootStyles.elements() ); } protected void copyResources( Project project ) throws IOException { Enumeration e = files.elements(); while (e.hasMoreElements()) { StyleType st = (StyleType)e.nextElement(); URL url = new URL( st.getURL( this ) ); InputStream in = url.openStream(); if (in == null) { throw new java.io.FileNotFoundException( "URL " + url ); } FileOutputStream fos = new FileOutputStream( new File( this.outdir, st.dest ) ); try { byte buff[] = new byte[ 4096 ]; int size = in.read( buff, 0, 4096 ); while (size > 0) { fos.write( buff, 0, size ); size = in.read( buff, 0, 4096 ); } } finally { in.close(); fos.close(); } } } protected void transform( Project project, Document doc, Enumeration styles, String baseOutName ) throws IOException { long start = System.currentTimeMillis(); while (styles.hasMoreElements()) { StyleType s = (StyleType)styles.nextElement(); File out = new File( baseOutName + s.dest ); StyleTransformer st = getStyleTransformer( project, s ); // ensure the directory exists out.getParentFile().mkdirs(); st.transform( doc, out ); } project.log( "Transform for all styles took " + (System.currentTimeMillis() - start) + " ms", Project.MSG_VERBOSE ); } protected void clearCache( Enumeration styles ) { while (styles.hasMoreElements()) { StyleType s = (StyleType)styles.nextElement(); s.setTransformer( null ); } System.gc(); } protected StyleTransformer getRemoveEmptiesStyle( Project project ) throws IOException { return new StyleTransformer( project, getStylesheetSystemIdForClass( "xsl/remove-empty-classes.xsl" ), this.outdir ); } /** * Returns the first file from the list of source directories that * contains the given sourcefile. */ protected File getSourceFile( String sourceName, Project project ) { Enumeration enum = this.srcdirs.elements(); while (enum.hasMoreElements()) { File f = ((DirType)enum.nextElement()).getDir(); if (f != null) { File sf = new File( f, sourceName ); if (sf.exists() && sf.isFile()) { return sf; } } } project.log( "Could not find a corresponding file for source '"+ sourceName+"'.", Project.MSG_INFO ); return null; } protected String getOutFileBase( String baseName ) { File f; if (baseName == null) { f = this.outdir; } else { f = new File( this.outdir, baseName ); } return f.getAbsolutePath(); } protected String getUpDir( String filename ) { StringBuffer reldir = new StringBuffer(); int pos = filename.indexOf( File.separatorChar ); while (pos >= 0) { reldir.append( "../" ); pos = filename.indexOf( File.separatorChar, pos+1 ); } return reldir.toString(); } protected StyleTransformer getStyleTransformer( Project project, StyleType s ) throws IOException { StyleTransformer st = s.getTransformer(); if (st != null) { return st; } // otherwise, generate the cache. String url = s.getURL( this ); st = new StyleTransformer( project, url, this.outdir ); Enumeration e = this.params.elements(); while (e.hasMoreElements()) { ((SimpleXslReportStyle.ParamType)e.nextElement()). updateParameter( st, project ); } project.log( "Transforming with stylesheet "+url, Project.MSG_DEBUG ); // Possibly keep a cache of the style, for performance reasons. s.setTransformer( st ); return st; } // ---------------------------------------------------------------- protected String getStylesheetSystemIdForFile( File f ) throws IOException { if (f == null || !f.exists()) { throw new java.io.FileNotFoundException( "Could not find file '" + f + "'" ); } URL url = new URL( "file", "", f.getAbsolutePath() ); return url.toExternalForm(); } protected String getStylesheetSystemIdForClass( String name ) throws IOException { URL url = getClass().getResource( name ); if (url == null) { throw new java.io.FileNotFoundException( "Could not find jar resource " + name); } return url.toExternalForm(); } private static DocumentBuilder getDocumentBuilder() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (Exception ex) { throw new ExceptionInInitializerError( ex ); } } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/CoverageReportTask.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Co0000644000175000017500000003434610040164707034077 0ustar drazzibdrazzib/* * @(#)CoverageReportTask.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Enumeration; import java.util.Vector; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData; import net.sourceforge.groboutils.codecoverage.v2.report.IReportGenerator; import net.sourceforge.groboutils.codecoverage.v2.report.OutputXml; import net.sourceforge.groboutils.codecoverage.v2.report.XmlCombinedReportGenerator; import net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.w3c.dom.Document; import org.w3c.dom.Element; /** * Ant task that creates an XML coverage report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/17 08:24:39 $ * @since December 18, 2002 * @deprecated Use GroboReportTask instead of this one. */ public class CoverageReportTask extends Task { private File datadir = null; private File logdir = null; private File outdir = null; private String prefix = "CoverageReport-"; private String postfix = ".xml"; private boolean failonerror = false; private Vector singleReports = new Vector(); private Vector comboReports = new Vector(); public void setDataDir( File f ) { this.datadir = f; } public void setLogDir( File f ) { this.logdir = f; } public void setOutDir( File f ) { this.outdir = f; } public void setReportFilePrefix( String s ) { this.prefix = s; } public void setReportFileExtension( String s ) { this.postfix = s; } public void setFailOnError( boolean val ) { this.failonerror = val; } public SimpleHtmlReportStyle createSimpleStyle() { SimpleHtmlReportStyle style = new SimpleHtmlReportStyle(); this.singleReports.addElement( style ); return style; } public SourceHtmlReportStyle createSourceStyle() { SourceHtmlReportStyle style = new SourceHtmlReportStyle(); this.comboReports.addElement( style ); return style; } public void execute() throws BuildException { log( "Use of the CoverageReport task is deprecated; please "+ "use the 'grobo-report' task instead. You may need to "+ "change the taskdef to reference the new resource file, located "+ "at [ant-grobocoverage.properties], instead of "+ "[net/sourceforge/groboutils/codecoverage/grobocoverage.properties"+ "].", Project.MSG_WARN ); // check specifications if (this.datadir == null) { throw new BuildException( "Did not specify attribute 'datadir'." ); } if (this.logdir == null) { throw new BuildException( "Did not specify attribute 'logdir'." ); } if (this.outdir == null) { throw new BuildException( "Did not specify attribute 'outdir'." ); } if (this.prefix == null || this.postfix == null) { throw new BuildException( "Output report name format is null." ); } try { setupDirectories(); } catch (IOException ioe) { throw new BuildException( "Error setting up the directories.", ioe ); } IMetaDataReader mdr = createMetaDataReader(); IReportGenerator rg = new XmlReportGenerator(); boolean errors = false; try { Vector reports = new Vector(); AnalysisModuleSet ams = mdr.getAnalysisModuleSet(); IAnalysisModule amL[] = ams.getAnalysisModules(); for (int i = 0; i < amL.length; ++i) { try { IChannelLogReader clr = createChannelLogReader( amL[i], ams ); AnalysisModuleData amd = new AnalysisModuleData( amL[i], mdr, clr ); Element rootEl = createReport( amL[i], amd, rg ); if (rootEl == null) { errors = true; } else { Document doc = rootEl.getOwnerDocument(); reports.addElement( doc ); processStyles( doc, amL[i].getMeasureName() ); } } catch (IllegalArgumentException iae) { iae.printStackTrace(); log( iae.getMessage(), Project.MSG_WARN ); errors = true; } } finishStyles( reports ); } catch (IOException e) { throw new BuildException( "I/O Exception while creating a report.", e, getLocation() ); } finally { try { mdr.close(); } catch (IOException e) { throw new BuildException( "I/O Exception while closing meta-data reader.", e, getLocation() ); } } if (errors && this.failonerror) { throw new BuildException( "No coverage logs were generated, or the logs "+ "are not located under '"+this.logdir+"'.", getLocation() ); } } /** * setup the directories in the logdir - ensure we have adequate * setup protections. This saves some head banging in figuring out * why bad exceptions are thrown. */ private void setupDirectories() throws IOException, BuildException { if (!this.datadir.exists() || !this.datadir.isDirectory()) { throw new BuildException("Data directory setting ("+ this.datadir+") does not exist or is not a directory."); } if (!this.logdir.exists()) { this.logdir.mkdirs(); } if (!this.logdir.isDirectory()) { throw new BuildException("Log directory setting ("+ this.logdir+") is not a directory."); } String modules[] = this.datadir.list(); if (modules == null || modules.length <= 0) { throw new BuildException("There are no module data directories in "+ this.datadir+"."); } String indicies[] = this.logdir.list(); if (indicies == null) { indicies = new String[0]; } int count = modules.length; for (int i = 0; i <= count; ++i) { String dirname = Integer.toString(i); boolean found = false; for (int j = 0; j < indicies.length; ++j) { if (indicies[j].equals( dirname )) { found = true; break; } } if (!found) { File f = new File( this.logdir, dirname ); f.mkdirs(); } } } private Element createReport( IAnalysisModule am, AnalysisModuleData amd, IReportGenerator rg ) throws IOException, BuildException { log( "Creating coverage report for module "+am.getMeasureName(), Project.MSG_INFO ); File outfile = createReportFile( am ); FileOutputStream fos = new FileOutputStream( outfile ); Element ret = null; try { ret = rg.createReport( am, amd ); OutputStreamWriter osw = new OutputStreamWriter( fos, "UTF8" ); (new OutputXml()).write( ret, osw, null ); } catch (IllegalArgumentException iae) { // throw new BuildException( iae ); // this is a hack: really, the underlying code should be made // more robust. iae.printStackTrace(); log( iae.getMessage(), Project.MSG_WARN ); ret = null; } finally { fos.close(); } return ret; } private File createReportFile( IAnalysisModule am ) { File f = new File( this.outdir, this.prefix + am.getMeasureName() + this.postfix ); log( "Creating report file '"+f+"' for measure '"+am.getMeasureName()+ "'.", Project.MSG_VERBOSE ); return f; } private IChannelLogReader createChannelLogReader( IAnalysisModule am, AnalysisModuleSet ams ) throws IOException { short mi = ams.getAnalysisModuleIndex( am ); IChannelLogReader clr = new DirectoryChannelLogReader( this.logdir, mi ); return clr; } private IMetaDataReader createMetaDataReader() throws BuildException { try { return new DirMetaDataReader( this.datadir ); } catch (IOException e) { throw new BuildException( "I/O error creating meta-data reader.", e, getLocation() ); } } private void processStyles( Document doc, String moduleName ) throws BuildException, IOException { Enumeration e = singleReports.elements(); while (e.hasMoreElements()) { IReportStyle rs = (IReportStyle)e.nextElement(); rs.generateReport( getProject(), doc, moduleName ); } } private void finishStyles( Vector reports ) throws BuildException, IOException { Enumeration e = singleReports.elements(); while (e.hasMoreElements()) { IReportStyle rs = (IReportStyle)e.nextElement(); rs.reportComplete( getProject(), new Vector() ); } e = null; // Create the uber document Document docs[] = new Document[ reports.size() ]; reports.copyInto( docs ); XmlCombinedReportGenerator gen = new XmlCombinedReportGenerator(); log( "Creating combined coverage report", Project.MSG_INFO ); File outfile = new File( this.outdir, this.prefix + "all" + this.postfix ); log( "Creating report file '"+outfile+"' for all measures.", Project.MSG_VERBOSE ); FileOutputStream fos = new FileOutputStream( outfile ); Element ret = null; try { ret = gen.createReport( docs ); OutputStreamWriter osw = new OutputStreamWriter( fos, "UTF8" ); (new OutputXml()).write( ret, osw, null ); } catch (IllegalArgumentException iae) { // throw new BuildException( iae ); // this is a hack: really, the underlying code should be made // more robust. iae.printStackTrace(); log( iae.getMessage(), Project.MSG_WARN ); ret = null; } finally { fos.close(); } docs = null; reports.removeAllElements(); reports = null; // process all the combination report styles if (ret != null) { Document doc = ret.getOwnerDocument(); e = comboReports.elements(); while (e.hasMoreElements()) { IReportStyle rs = (IReportStyle)e.nextElement(); rs.generateReport( getProject(), doc, "all" ); // rs.reportComplete( getProject(), new Vector() ); } } e = comboReports.elements(); while (e.hasMoreElements()) { IReportStyle rs = (IReportStyle)e.nextElement(); rs.reportComplete( getProject(), new Vector() ); } } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000755000175000017500000000000011271425773034156 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/UnixStat.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000000364410072742275034164 0ustar drazzibdrazzib/* * Copyright 2001,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; /** * Constants from stat.h on Unix systems. * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public interface UnixStat { /** * Bits used for permissions (and sticky bit) * * @since 1.1 */ int PERM_MASK = 07777; /** * Indicates symbolic links. * * @since 1.1 */ int LINK_FLAG = 0120000; /** * Indicates plain files. * * @since 1.1 */ int FILE_FLAG = 0100000; /** * Indicates directories. * * @since 1.1 */ int DIR_FLAG = 040000; // ---------------------------------------------------------- // somewhat arbitrary choices that are quite common for shared // installations // ----------------------------------------------------------- /** * Default permissions for symbolic links. * * @since 1.1 */ int DEFAULT_LINK_PERM = 0777; /** * Default permissions for directories. * * @since 1.1 */ int DEFAULT_DIR_PERM = 0755; /** * Default permissions for plain files. * * @since 1.1 */ int DEFAULT_FILE_PERM = 0644; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ExtraFieldUtils.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000001336410072742275034164 0ustar drazzibdrazzib/* * Copyright 2001-2002,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.util.Hashtable; import java.util.Vector; import java.util.zip.ZipException; /** * ZipExtraField related methods * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public class ExtraFieldUtils { /** * Static registry of known extra fields. * * @since 1.1 */ private static Hashtable implementations; static { implementations = new Hashtable(); register(AsiExtraField.class); } /** * Register a ZipExtraField implementation. * *

    The given class must have a no-arg constructor and implement * the {@link ZipExtraField ZipExtraField interface}.

    * * @since 1.1 */ public static void register(Class c) { try { ZipExtraField ze = (ZipExtraField) c.newInstance(); implementations.put(ze.getHeaderId(), c); } catch (ClassCastException cc) { throw new RuntimeException(c + " doesn\'t implement ZipExtraField"); } catch (InstantiationException ie) { throw new RuntimeException(c + " is not a concrete class"); } catch (IllegalAccessException ie) { throw new RuntimeException(c + "\'s no-arg constructor is not public"); } } /** * Create an instance of the approriate ExtraField, falls back to * {@link UnrecognizedExtraField UnrecognizedExtraField}. * * @since 1.1 */ public static ZipExtraField createExtraField(ZipShort headerId) throws InstantiationException, IllegalAccessException { Class c = (Class) implementations.get(headerId); if (c != null) { return (ZipExtraField) c.newInstance(); } UnrecognizedExtraField u = new UnrecognizedExtraField(); u.setHeaderId(headerId); return u; } /** * Split the array into ExtraFields and populate them with the * give data. * * @since 1.1 */ public static ZipExtraField[] parse(byte[] data) throws ZipException { Vector v = new Vector(); int start = 0; while (start <= data.length - 4) { ZipShort headerId = new ZipShort(data, start); int length = (new ZipShort(data, start + 2)).getValue(); if (start + 4 + length > data.length) { throw new ZipException("data starting at " + start + " is in unknown format"); } try { ZipExtraField ze = createExtraField(headerId); ze.parseFromLocalFileData(data, start + 4, length); v.addElement(ze); } catch (InstantiationException ie) { throw new ZipException(ie.getMessage()); } catch (IllegalAccessException iae) { throw new ZipException(iae.getMessage()); } start += (length + 4); } if (start != data.length) { // array not exhausted throw new ZipException("data starting at " + start + " is in unknown format"); } ZipExtraField[] result = new ZipExtraField[v.size()]; v.copyInto(result); return result; } /** * Merges the local file data fields of the given ZipExtraFields. * * @since 1.1 */ public static byte[] mergeLocalFileDataData(ZipExtraField[] data) { int sum = 4 * data.length; for (int i = 0; i < data.length; i++) { sum += data[i].getLocalFileDataLength().getValue(); } byte[] result = new byte[sum]; int start = 0; for (int i = 0; i < data.length; i++) { System.arraycopy(data[i].getHeaderId().getBytes(), 0, result, start, 2); System.arraycopy(data[i].getLocalFileDataLength().getBytes(), 0, result, start + 2, 2); byte[] local = data[i].getLocalFileDataData(); System.arraycopy(local, 0, result, start + 4, local.length); start += (local.length + 4); } return result; } /** * Merges the central directory fields of the given ZipExtraFields. * * @since 1.1 */ public static byte[] mergeCentralDirectoryData(ZipExtraField[] data) { int sum = 4 * data.length; for (int i = 0; i < data.length; i++) { sum += data[i].getCentralDirectoryLength().getValue(); } byte[] result = new byte[sum]; int start = 0; for (int i = 0; i < data.length; i++) { System.arraycopy(data[i].getHeaderId().getBytes(), 0, result, start, 2); System.arraycopy(data[i].getCentralDirectoryLength().getBytes(), 0, result, start + 2, 2); byte[] local = data[i].getCentralDirectoryData(); System.arraycopy(local, 0, result, start + 4, local.length); start += (local.length + 4); } return result; } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000000254310072722722034154 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.ant.zip

    The Apache Ant 1.6.1 org.apache.tools.zip package. This was pulled from Ant 1.6.1 due to version inconsistencies between this package in Ant 1.5, 1.5.1, 1.5.3, and 1.6. By using a well-known version of this package, we avoid having to resort to reflection, which might cause the task to break in the future.

    This package does not have any dependencies upon any other Ant package, and so can be included here without worry to its effect on Ant.

    Note that this package is covered by the Apache v2 License, not the MIT license. The Apache v2 license reads:

    /* * Copyright 2001-2002,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */

    ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipFileSet.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000002345710073151323034155 0ustar drazzibdrazzib/* * Copyright 2001-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.io.File; import java.util.Stack; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Reference; // this originally came from here, in Ant 1.6.1 import org.apache.tools.ant.types.FileSet; //import org.apache.tools.ant.types.ZipScanner; import org.apache.tools.ant.types.AbstractFileSet; /** * A ZipFileSet is a FileSet with extra attributes useful in the context of * Zip/Jar tasks. * * A ZipFileSet extends FileSets with the ability to extract a subset of the * entries of a Zip file for inclusion in another Zip file. It also includes * a prefix attribute which is prepended to each entry in the output Zip file. * * Since ant 1.6 ZipFileSet can be defined with an id and referenced in packaging tasks * * @author Don Ferguson don@bea.com * @author Antoine Levy-Lambert */ public class ZipFileSet extends FileSet { /** * Default value for the dirmode attribute. * * @since Ant 1.5.2 */ public static final int DEFAULT_DIR_MODE = UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM; /** * Default value for the filemode attribute. * * @since Ant 1.5.2 */ public static final int DEFAULT_FILE_MODE = UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM; private File srcFile = null; private String prefix = ""; private String fullpath = ""; private boolean hasDir = false; private int fileMode = DEFAULT_FILE_MODE; private int dirMode = DEFAULT_DIR_MODE; private boolean fileModeHasBeenSet = false; private boolean dirModeHasBeenSet = false; public ZipFileSet() { super(); } protected ZipFileSet(FileSet fileset) { super(fileset); } protected ZipFileSet(ZipFileSet fileset) { super(fileset); srcFile = fileset.srcFile; prefix = fileset.prefix; fullpath = fileset.fullpath; hasDir = fileset.hasDir; fileMode = fileset.fileMode; dirMode = fileset.dirMode; fileModeHasBeenSet = fileset.fileModeHasBeenSet; dirModeHasBeenSet = fileset.dirModeHasBeenSet; } /** * Set the directory for the fileset. Prevents both "dir" and "src" * from being specified. */ public void setDir(File dir) throws BuildException { if (isReference()) { throw tooManyAttributes(); } if (srcFile != null) { throw new BuildException("Cannot set both dir and src attributes"); } else { super.setDir(dir); hasDir = true; } } /** * Set the source Zip file for the zipfileset. Prevents both * "dir" and "src" from being specified. * * @param srcFile The zip file from which to extract entries. */ public void setSrc(File srcFile) { if (isReference()) { throw tooManyAttributes(); } if (hasDir) { throw new BuildException("Cannot set both dir and src attributes"); } this.srcFile = srcFile; } /** * Get the zip file from which entries will be extracted. * References are not followed, since it is not possible * to have a reference to a ZipFileSet, only to a FileSet. */ public File getSrc(Project p) { if (isReference()) { return ((ZipFileSet) getRef(p)).getSrc(p); } return srcFile; } /** * Prepend this prefix to the path for each zip entry. * Prevents both prefix and fullpath from being specified * * @param prefix The prefix to prepend to entries in the zip file. */ public void setPrefix(String prefix) { if (!prefix.equals("") && !fullpath.equals("")) { throw new BuildException("Cannot set both fullpath and prefix attributes"); } this.prefix = prefix; } /** * Return the prefix prepended to entries in the zip file. */ public String getPrefix(Project p) { if (isReference()) { return ((ZipFileSet) getRef(p)).getPrefix(p); } return prefix; } /** * Set the full pathname of the single entry in this fileset. * Prevents both prefix and fullpath from being specified * * @param fullpath the full pathname of the single entry in this fileset. */ public void setFullpath(String fullpath) { if (!prefix.equals("") && !fullpath.equals("")) { throw new BuildException("Cannot set both fullpath and prefix attributes"); } this.fullpath = fullpath; } /** * Return the full pathname of the single entry in this fileset. */ public String getFullpath(Project p) { if (isReference()) { return ((ZipFileSet) getRef(p)).getFullpath(p); } return fullpath; } /** * Return the DirectoryScanner associated with this FileSet. * If the ZipFileSet defines a source Zip file, then a ZipScanner * is returned instead. */ public DirectoryScanner getDirectoryScanner(Project p) { if (isReference()) { return getRef(p).getDirectoryScanner(p); } if (srcFile != null) { ZipScanner zs = new ZipScanner(); zs.setSrc(srcFile); super.setDir(p.getBaseDir()); setupDirectoryScanner(zs, p); zs.init(); return zs; } else { return super.getDirectoryScanner(p); } } /** * A 3 digit octal string, specify the user, group and * other modes in the standard Unix fashion; * optional, default=0644 * * @since Ant 1.5.2 */ public void setFileMode(String octalString) { fileModeHasBeenSet = true; this.fileMode = UnixStat.FILE_FLAG | Integer.parseInt(octalString, 8); } /** * @since Ant 1.5.2 */ public int getFileMode(Project p) { if (isReference()) { return ((ZipFileSet) getRef(p)).getFileMode(p); } return fileMode; } /** * Whether the user has specified the mode explicitly. * * @since Ant 1.6 */ public boolean hasFileModeBeenSet() { if (isReference()) { return ((ZipFileSet) getRef(getProject())).hasFileModeBeenSet(); } return fileModeHasBeenSet; } /** * A 3 digit octal string, specify the user, group and * other modes in the standard Unix fashion; * optional, default=0755 * * @since Ant 1.5.2 */ public void setDirMode(String octalString) { dirModeHasBeenSet = true; this.dirMode = UnixStat.DIR_FLAG | Integer.parseInt(octalString, 8); } /** * @since Ant 1.5.2 */ public int getDirMode(Project p) { if (isReference()) { return ((ZipFileSet) getRef(p)).getDirMode(p); } return dirMode; } /** * Whether the user has specified the mode explicitly. * * @since Ant 1.6 */ public boolean hasDirModeBeenSet() { if (isReference()) { return ((ZipFileSet) getRef(getProject())).hasDirModeBeenSet(); } return dirModeHasBeenSet; } /** * A ZipFileset accepts another ZipFileSet or a FileSet as reference * FileSets are often used by the war task for the lib attribute */ protected AbstractFileSet getRef(Project p) { if (!isChecked()) { Stack stk = new Stack(); stk.push(this); dieOnCircularReference(stk, p); } Object o = getRefid().getReferencedObject(p); if (o instanceof ZipFileSet) { return (AbstractFileSet) o; } else if (o instanceof FileSet) { ZipFileSet zfs = new ZipFileSet((FileSet) o); zfs.setPrefix(prefix); zfs.setFullpath(fullpath); zfs.fileModeHasBeenSet = fileModeHasBeenSet; zfs.fileMode = fileMode; zfs.dirModeHasBeenSet = dirModeHasBeenSet; zfs.dirMode = dirMode; return zfs; } else { String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset"; throw new BuildException(msg); } } /** * Return a ZipFileSet that has the same properties * as this one. * @since Ant 1.6 */ public Object clone() { if (isReference()) { return ((ZipFileSet) getRef(getProject())).clone(); } else { return super.clone(); } } // added after Ant 1.5.1 public Reference getRefid() { return this.ref; } // added after Ant 1.5.1 public boolean isChecked() { return this.checked; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipOutputStream.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000005625110072742275034166 0ustar drazzibdrazzib/* * Copyright 2001-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.io.File; import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.UnsupportedEncodingException; import java.util.Date; import java.util.Hashtable; import java.util.Vector; import java.util.zip.CRC32; import java.util.zip.Deflater; import java.util.zip.ZipException; /** * Reimplementation of {@link java.util.zip.ZipOutputStream * java.util.zip.ZipOutputStream} that does handle the extended * functionality of this package, especially internal/external file * attributes and extra fields with different layouts for local file * data and central directory entries. * *

    This class will try to use {@link java.io.RandomAccessFile * RandomAccessFile} when you know that the output is going to go to a * file.

    * *

    If RandomAccessFile cannot be used, this implementation will use * a Data Descriptor to store size and CRC information for {@link * #DEFLATED DEFLATED} entries, this means, you don't need to * calculate them yourself. Unfortunately this is not possible for * the {@link #STORED STORED} method, here setting the CRC and * uncompressed size information is required before {@link * #putNextEntry putNextEntry} can be called.

    * * @author Stefan Bodewig * @author Richard Evans * @version $Revision: 1.1 $ */ public class ZipOutputStream extends FilterOutputStream { /** * Current entry. * * @since 1.1 */ private ZipEntry entry; /** * The file comment. * * @since 1.1 */ private String comment = ""; /** * Compression level for next entry. * * @since 1.1 */ private int level = Deflater.DEFAULT_COMPRESSION; /** * Has the compression level changed when compared to the last * entry? * * @since 1.5 */ private boolean hasCompressionLevelChanged = false; /** * Default compression method for next entry. * * @since 1.1 */ private int method = DEFLATED; /** * List of ZipEntries written so far. * * @since 1.1 */ private Vector entries = new Vector(); /** * CRC instance to avoid parsing DEFLATED data twice. * * @since 1.1 */ private CRC32 crc = new CRC32(); /** * Count the bytes written to out. * * @since 1.1 */ private long written = 0; /** * Data for local header data * * @since 1.1 */ private long dataStart = 0; /** * Offset for CRC entry in the local file header data for the * current entry starts here. * * @since 1.15 */ private long localDataStart = 0; /** * Start of central directory. * * @since 1.1 */ private ZipLong cdOffset = new ZipLong(0); /** * Length of central directory. * * @since 1.1 */ private ZipLong cdLength = new ZipLong(0); /** * Helper, a 0 as ZipShort. * * @since 1.1 */ private static final byte[] ZERO = {0, 0}; /** * Helper, a 0 as ZipLong. * * @since 1.1 */ private static final byte[] LZERO = {0, 0, 0, 0}; /** * Holds the offsets of the LFH starts for each entry * * @since 1.1 */ private Hashtable offsets = new Hashtable(); /** * The encoding to use for filenames and the file comment. * *

    For a list of possible values see http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html. * Defaults to the platform's default character encoding.

    * * @since 1.3 */ private String encoding = null; /** * Deflater object for output * *

    This attribute is only protected to provide a level of API * backwards compatibility. This class used to extend {@link * java.util.zip.DeflaterOutputStream DeflaterOutputStream} up to * Revision 1.13.

    * * @since 1.14 */ protected Deflater def = new Deflater(Deflater.DEFAULT_COMPRESSION, true); /** * Deflater buffer * *

    This attribute is only protected to provide a level of API * backwards compatibility. This class used to extend {@link * java.util.zip.DeflaterOutputStream DeflaterOutputStream} up to * Revision 1.13.

    * * @since 1.14 */ protected byte[] buf = new byte[512]; /** * Optional random access output * * @since 1.14 */ private RandomAccessFile raf = null; /** * Compression method for deflated entries. * * @since 1.1 */ public static final int DEFLATED = ZipEntry.DEFLATED; /** * Compression method for deflated entries. * * @since 1.1 */ public static final int STORED = ZipEntry.STORED; /** * Creates a new ZIP OutputStream filtering the underlying stream. * * @since 1.1 */ public ZipOutputStream(OutputStream out) { super(out); } /** * Creates a new ZIP OutputStream writing to a File. Will use * random access if possible. * * @since 1.14 */ public ZipOutputStream(File file) throws IOException { super(null); try { raf = new RandomAccessFile(file, "rw"); raf.setLength(0); } catch (IOException e) { if (raf != null) { try { raf.close(); } catch (IOException inner) { // ignore } raf = null; } out = new FileOutputStream(file); } } /** * Is this archive writing to a seekable stream (i.e. a random * access file)? * *

    For seekable streams, you don't need to calculate the CRC or * uncompressed size for {@link #STORED STORED} entries before * invoking {@link #putEntry putEntry}. * * @since 1.17 */ public boolean isSeekable() { return raf != null; } /** * The encoding to use for filenames and the file comment. * *

    For a list of possible values see http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html. * Defaults to the platform's default character encoding.

    * * @since 1.3 */ public void setEncoding(String encoding) { this.encoding = encoding; } /** * The encoding to use for filenames and the file comment. * * @return null if using the platform's default character encoding. * * @since 1.3 */ public String getEncoding() { return encoding; } /** * Finishs writing the contents and closes this as well as the * underlying stream. * * @since 1.1 */ public void finish() throws IOException { closeEntry(); cdOffset = new ZipLong(written); for (int i = 0; i < entries.size(); i++) { writeCentralFileHeader((ZipEntry) entries.elementAt(i)); } cdLength = new ZipLong(written - cdOffset.getValue()); writeCentralDirectoryEnd(); offsets.clear(); entries.removeAllElements(); } /** * Writes all necessary data for this entry. * * @since 1.1 */ public void closeEntry() throws IOException { if (entry == null) { return; } long realCrc = crc.getValue(); crc.reset(); if (entry.getMethod() == DEFLATED) { def.finish(); while (!def.finished()) { deflate(); } entry.setSize(def.getTotalIn()); entry.setComprSize(def.getTotalOut()); entry.setCrc(realCrc); def.reset(); written += entry.getCompressedSize(); } else if (raf == null) { if (entry.getCrc() != realCrc) { throw new ZipException("bad CRC checksum for entry " + entry.getName() + ": " + Long.toHexString(entry.getCrc()) + " instead of " + Long.toHexString(realCrc)); } if (entry.getSize() != written - dataStart) { throw new ZipException("bad size for entry " + entry.getName() + ": " + entry.getSize() + " instead of " + (written - dataStart)); } } else { /* method is STORED and we used RandomAccessFile */ long size = written - dataStart; entry.setSize(size); entry.setComprSize(size); entry.setCrc(realCrc); } // If random access output, write the local file header containing // the correct CRC and compressed/uncompressed sizes if (raf != null) { long save = raf.getFilePointer(); raf.seek(localDataStart); writeOut((new ZipLong(entry.getCrc())).getBytes()); writeOut((new ZipLong(entry.getCompressedSize())).getBytes()); writeOut((new ZipLong(entry.getSize())).getBytes()); raf.seek(save); } writeDataDescriptor(entry); entry = null; } /** * Begin writing next entry. * * @since 1.1 */ public void putNextEntry(ZipEntry ze) throws IOException { closeEntry(); entry = ze; entries.addElement(entry); if (entry.getMethod() == -1) { // not specified entry.setMethod(method); } if (entry.getTime() == -1) { // not specified entry.setTime(System.currentTimeMillis()); } // Size/CRC not required if RandomAccessFile is used if (entry.getMethod() == STORED && raf == null) { if (entry.getSize() == -1) { throw new ZipException("uncompressed size is required for" + " STORED method when not writing to a" + " file"); } if (entry.getCrc() == -1) { throw new ZipException("crc checksum is required for STORED" + " method when not writing to a file"); } entry.setComprSize(entry.getSize()); } if (entry.getMethod() == DEFLATED && hasCompressionLevelChanged) { def.setLevel(level); hasCompressionLevelChanged = false; } writeLocalFileHeader(entry); } /** * Set the file comment. * * @since 1.1 */ public void setComment(String comment) { this.comment = comment; } /** * Sets the compression level for subsequent entries. * *

    Default is Deflater.DEFAULT_COMPRESSION.

    * * @since 1.1 */ public void setLevel(int level) { hasCompressionLevelChanged = (this.level != level); this.level = level; } /** * Sets the default compression method for subsequent entries. * *

    Default is DEFLATED.

    * * @since 1.1 */ public void setMethod(int method) { this.method = method; } /** * Writes bytes to ZIP entry. */ public void write(byte[] b, int offset, int length) throws IOException { if (entry.getMethod() == DEFLATED) { if (length > 0) { if (!def.finished()) { def.setInput(b, offset, length); while (!def.needsInput()) { deflate(); } } } } else { writeOut(b, offset, length); written += length; } crc.update(b, offset, length); } /** * Writes a single byte to ZIP entry. * *

    Delegates to the three arg method.

    * * @since 1.14 */ public void write(int b) throws IOException { byte[] buf = new byte[1]; buf[0] = (byte) (b & 0xff); write(buf, 0, 1); } /** * Closes this output stream and releases any system resources * associated with the stream. * * @exception IOException if an I/O error occurs. * @since 1.14 */ public void close() throws IOException { finish(); if (raf != null) { raf.close(); } if (out != null) { out.close(); } } /** * Flushes this output stream and forces any buffered output bytes * to be written out to the stream. * * @exception IOException if an I/O error occurs. * @since 1.14 */ public void flush() throws IOException { if (out == null) { out.flush(); } } /* * Various ZIP constants */ /** * local file header signature * * @since 1.1 */ protected static final ZipLong LFH_SIG = new ZipLong(0X04034B50L); /** * data descriptor signature * * @since 1.1 */ protected static final ZipLong DD_SIG = new ZipLong(0X08074B50L); /** * central file header signature * * @since 1.1 */ protected static final ZipLong CFH_SIG = new ZipLong(0X02014B50L); /** * end of central dir signature * * @since 1.1 */ protected static final ZipLong EOCD_SIG = new ZipLong(0X06054B50L); /** * Writes next block of compressed data to the output stream. * * @since 1.14 */ protected final void deflate() throws IOException { int len = def.deflate(buf, 0, buf.length); if (len > 0) { writeOut(buf, 0, len); } } /** * Writes the local file header entry * * @since 1.1 */ protected void writeLocalFileHeader(ZipEntry ze) throws IOException { offsets.put(ze, new ZipLong(written)); writeOut(LFH_SIG.getBytes()); written += 4; // version needed to extract // general purpose bit flag if (ze.getMethod() == DEFLATED && raf == null) { // requires version 2 as we are going to store length info // in the data descriptor writeOut((new ZipShort(20)).getBytes()); // bit3 set to signal, we use a data descriptor writeOut((new ZipShort(8)).getBytes()); } else { writeOut((new ZipShort(10)).getBytes()); writeOut(ZERO); } written += 4; // compression method writeOut((new ZipShort(ze.getMethod())).getBytes()); written += 2; // last mod. time and date writeOut(toDosTime(new Date(ze.getTime())).getBytes()); written += 4; // CRC // compressed length // uncompressed length localDataStart = written; if (ze.getMethod() == DEFLATED || raf != null) { writeOut(LZERO); writeOut(LZERO); writeOut(LZERO); } else { writeOut((new ZipLong(ze.getCrc())).getBytes()); writeOut((new ZipLong(ze.getSize())).getBytes()); writeOut((new ZipLong(ze.getSize())).getBytes()); } written += 12; // file name length byte[] name = getBytes(ze.getName()); writeOut((new ZipShort(name.length)).getBytes()); written += 2; // extra field length byte[] extra = ze.getLocalFileDataExtra(); writeOut((new ZipShort(extra.length)).getBytes()); written += 2; // file name writeOut(name); written += name.length; // extra field writeOut(extra); written += extra.length; dataStart = written; } /** * Writes the data descriptor entry * * @since 1.1 */ protected void writeDataDescriptor(ZipEntry ze) throws IOException { if (ze.getMethod() != DEFLATED || raf != null) { return; } writeOut(DD_SIG.getBytes()); writeOut((new ZipLong(entry.getCrc())).getBytes()); writeOut((new ZipLong(entry.getCompressedSize())).getBytes()); writeOut((new ZipLong(entry.getSize())).getBytes()); written += 16; } /** * Writes the central file header entry * * @since 1.1 */ protected void writeCentralFileHeader(ZipEntry ze) throws IOException { writeOut(CFH_SIG.getBytes()); written += 4; // version made by writeOut((new ZipShort((ze.getPlatform() << 8) | 20)).getBytes()); written += 2; // version needed to extract // general purpose bit flag if (ze.getMethod() == DEFLATED && raf == null) { // requires version 2 as we are going to store length info // in the data descriptor writeOut((new ZipShort(20)).getBytes()); // bit3 set to signal, we use a data descriptor writeOut((new ZipShort(8)).getBytes()); } else { writeOut((new ZipShort(10)).getBytes()); writeOut(ZERO); } written += 4; // compression method writeOut((new ZipShort(ze.getMethod())).getBytes()); written += 2; // last mod. time and date writeOut(toDosTime(new Date(ze.getTime())).getBytes()); written += 4; // CRC // compressed length // uncompressed length writeOut((new ZipLong(ze.getCrc())).getBytes()); writeOut((new ZipLong(ze.getCompressedSize())).getBytes()); writeOut((new ZipLong(ze.getSize())).getBytes()); written += 12; // file name length byte[] name = getBytes(ze.getName()); writeOut((new ZipShort(name.length)).getBytes()); written += 2; // extra field length byte[] extra = ze.getCentralDirectoryExtra(); writeOut((new ZipShort(extra.length)).getBytes()); written += 2; // file comment length String comm = ze.getComment(); if (comm == null) { comm = ""; } byte[] comment = getBytes(comm); writeOut((new ZipShort(comment.length)).getBytes()); written += 2; // disk number start writeOut(ZERO); written += 2; // internal file attributes writeOut((new ZipShort(ze.getInternalAttributes())).getBytes()); written += 2; // external file attributes writeOut((new ZipLong(ze.getExternalAttributes())).getBytes()); written += 4; // relative offset of LFH writeOut(((ZipLong) offsets.get(ze)).getBytes()); written += 4; // file name writeOut(name); written += name.length; // extra field writeOut(extra); written += extra.length; // file comment writeOut(comment); written += comment.length; } /** * Writes the "End of central dir record" * * @since 1.1 */ protected void writeCentralDirectoryEnd() throws IOException { writeOut(EOCD_SIG.getBytes()); // disk numbers writeOut(ZERO); writeOut(ZERO); // number of entries byte[] num = (new ZipShort(entries.size())).getBytes(); writeOut(num); writeOut(num); // length and location of CD writeOut(cdLength.getBytes()); writeOut(cdOffset.getBytes()); // ZIP file comment byte[] data = getBytes(comment); writeOut((new ZipShort(data.length)).getBytes()); writeOut(data); } /** * Smallest date/time ZIP can handle. * * @since 1.1 */ private static final ZipLong DOS_TIME_MIN = new ZipLong(0x00002100L); /** * Convert a Date object to a DOS date/time field. * *

    Stolen from InfoZip's fileio.c

    * * @since 1.1 */ protected static ZipLong toDosTime(Date time) { int year = time.getYear() + 1900; int month = time.getMonth() + 1; if (year < 1980) { return DOS_TIME_MIN; } long value = ((year - 1980) << 25) | (month << 21) | (time.getDate() << 16) | (time.getHours() << 11) | (time.getMinutes() << 5) | (time.getSeconds() >> 1); byte[] result = new byte[4]; result[0] = (byte) ((value & 0xFF)); result[1] = (byte) ((value & 0xFF00) >> 8); result[2] = (byte) ((value & 0xFF0000) >> 16); result[3] = (byte) ((value & 0xFF000000L) >> 24); return new ZipLong(result); } /** * Retrieve the bytes for the given String in the encoding set for * this Stream. * * @since 1.3 */ protected byte[] getBytes(String name) throws ZipException { if (encoding == null) { return name.getBytes(); } else { try { return name.getBytes(encoding); } catch (UnsupportedEncodingException uee) { throw new ZipException(uee.getMessage()); } } } /** * Write bytes to output or random access file * * @since 1.14 */ protected final void writeOut(byte [] data) throws IOException { writeOut(data, 0, data.length); } /** * Write bytes to output or random access file * * @since 1.14 */ protected final void writeOut(byte [] data, int offset, int length) throws IOException { if (raf != null) { raf.write(data, offset, length); } else { out.write(data, offset, length); } } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipLong.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000000522210072742275034156 0ustar drazzibdrazzib/* * Copyright 2001-2002,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; /** * Utility class that represents a four byte integer with conversion * rules for the big endian byte order of ZIP files. * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public final class ZipLong implements Cloneable { private long value; /** * Create instance from a number. * * @since 1.1 */ public ZipLong(long value) { this.value = value; } /** * Create instance from bytes. * * @since 1.1 */ public ZipLong (byte[] bytes) { this(bytes, 0); } /** * Create instance from the four bytes starting at offset. * * @since 1.1 */ public ZipLong (byte[] bytes, int offset) { value = (bytes[offset + 3] << 24) & 0xFF000000L; value += (bytes[offset + 2] << 16) & 0xFF0000; value += (bytes[offset + 1] << 8) & 0xFF00; value += (bytes[offset] & 0xFF); } /** * Get value as two bytes in big endian byte order. * * @since 1.1 */ public byte[] getBytes() { byte[] result = new byte[4]; result[0] = (byte) ((value & 0xFF)); result[1] = (byte) ((value & 0xFF00) >> 8); result[2] = (byte) ((value & 0xFF0000) >> 16); result[3] = (byte) ((value & 0xFF000000l) >> 24); return result; } /** * Get value as Java int. * * @since 1.1 */ public long getValue() { return value; } /** * Override to make two instances with same value equal. * * @since 1.1 */ public boolean equals(Object o) { if (o == null || !(o instanceof ZipLong)) { return false; } return value == ((ZipLong) o).getValue(); } /** * Override to make two instances with same value equal. * * @since 1.1 */ public int hashCode() { return (int) value; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipExtraField.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000000435710072742275034166 0ustar drazzibdrazzib/* * Copyright 2001,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.util.zip.ZipException; /** * General format of extra field data. * *

    Extra fields usually appear twice per file, once in the local * file data and once in the central directory. Usually they are the * same, but they don't have to be. {@link * java.util.zip.ZipOutputStream java.util.zip.ZipOutputStream} will * only use the local file data in both places.

    * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public interface ZipExtraField { /** * The Header-ID. * * @since 1.1 */ ZipShort getHeaderId(); /** * Length of the extra field in the local file data - without * Header-ID or length specifier. * * @since 1.1 */ ZipShort getLocalFileDataLength(); /** * Length of the extra field in the central directory - without * Header-ID or length specifier. * * @since 1.1 */ ZipShort getCentralDirectoryLength(); /** * The actual data to put into local file data - without Header-ID * or length specifier. * * @since 1.1 */ byte[] getLocalFileDataData(); /** * The actual data to put central directory - without Header-ID or * length specifier. * * @since 1.1 */ byte[] getCentralDirectoryData(); /** * Populate data from this array as if it was in local file data. * * @since 1.1 */ void parseFromLocalFileData(byte[] data, int offset, int length) throws ZipException; } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipScanner.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000001677210073151215034157 0ustar drazzibdrazzib/* * Copyright 2001-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; import java.util.zip.ZipException; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; //import org.apache.tools.zip.ZipEntry; //import org.apache.tools.zip.ZipFile; /** * ZipScanner accesses the pattern matching algorithm in DirectoryScanner, * which are protected methods that can only be accessed by subclassing. * * This implementation of FileScanner defines getIncludedFiles to return * the matching Zip entries. * * @author Don Ferguson don@bea.com * @author Antoine Levy-Lambert */ public class ZipScanner extends DirectoryScanner { /** * The zip file which should be scanned. */ protected File srcFile; /** * to record the last scanned zip file with its modification date */ private Resource lastScannedResource; /** * record list of all zip entries */ private Hashtable myentries; /** * encoding of file names. * * @since Ant 1.6 */ private String encoding; /** * Sets the srcFile for scanning. This is the jar or zip file that * is scanned for matching entries. * * @param srcFile the (non-null) zip file name for scanning */ public void setSrc(File srcFile) { this.srcFile = srcFile; } /** * Sets encoding of file names. * * @since Ant 1.6 */ public void setEncoding(String encoding) { this.encoding = encoding; } /** * Returns the names of the files which matched at least one of the * include patterns and none of the exclude patterns. * The names are relative to the base directory. * * @return the names of the files which matched at least one of the * include patterns and none of the exclude patterns. */ public String[] getIncludedFiles() { if (srcFile != null) { Vector myvector = new Vector(); // first check if the archive needs to be scanned again scanme(); for (Enumeration e = myentries.elements(); e.hasMoreElements();) { Resource myresource = (Resource) e.nextElement(); if (!myresource.isDirectory() && match(myresource.getName())) { myvector.addElement(myresource.getName()); } } String[] files = new String[myvector.size()]; myvector.copyInto(files); Arrays.sort(files); return files; } else { return super.getIncludedFiles(); } } /** * Returns the names of the directories which matched at least one of the * include patterns and none of the exclude patterns. * The names are relative to the base directory. * * @return the names of the directories which matched at least one of the * include patterns and none of the exclude patterns. */ public String[] getIncludedDirectories() { if (srcFile != null) { Vector myvector = new Vector(); // first check if the archive needs to be scanned again scanme(); for (Enumeration e = myentries.elements(); e.hasMoreElements();) { Resource myresource = (Resource) e.nextElement(); if (myresource.isDirectory() && match(myresource.getName())) { myvector.addElement(myresource.getName()); } } String[] files = new String[myvector.size()]; myvector.copyInto(files); Arrays.sort(files); return files; } else { return super.getIncludedDirectories(); } } /** * Initialize DirectoryScanner data structures. */ public void init() { if (includes == null) { // No includes supplied, so set it to 'matches all' includes = new String[1]; includes[0] = "**"; } if (excludes == null) { excludes = new String[0]; } } /** * Matches a jar entry against the includes/excludes list, * normalizing the path separator. * * @param path the (non-null) path name to test for inclusion * * @return true if the path should be included * false otherwise. */ public boolean match(String path) { String vpath = path.replace('/', File.separatorChar). replace('\\', File.separatorChar); return isIncluded(vpath) && !isExcluded(vpath); } /** * if the datetime of the archive did not change since * lastScannedResource was initialized returns immediately else if * the archive has not been scanned yet, then all the zip entries * are put into the vector myentries as a vector of the resource * type */ private void scanme() { Resource thisresource = new Resource(srcFile.getAbsolutePath(), srcFile.exists(), srcFile.lastModified()); // spare scanning again and again if (lastScannedResource != null && lastScannedResource.getName().equals(thisresource.getName()) && lastScannedResource.getLastModified() == thisresource.getLastModified()) { return; } ZipEntry entry = null; ZipFile zf = null; myentries = new Hashtable(); try { try { zf = new ZipFile(srcFile, encoding); } catch (ZipException ex) { throw new BuildException("problem reading " + srcFile, ex); } catch (IOException ex) { throw new BuildException("problem opening " + srcFile, ex); } Enumeration e = zf.getEntries(); while (e.hasMoreElements()) { entry = (ZipEntry) e.nextElement(); myentries.put(new String(entry.getName()), new Resource(entry.getName(), true, entry.getTime(), entry.isDirectory())); } } finally { if (zf != null) { try { zf.close(); } catch (IOException ex) { // swallow } } } // record data about the last scanned resource lastScannedResource = thisresource; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/Resource.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000001131610073151130034140 0ustar drazzibdrazzib/* * Copyright 2003-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; /** * describes a File or a ZipEntry * * this class is meant to be used by classes needing to record path * and date/time information about a file, a zip entry or some similar * resource (URL, archive in a version control repository, ...) * * @author Antoine Levy-Lambert * @since Ant 1.5.2 */ public class Resource implements Cloneable, Comparable { private String name = null; private boolean exists = true; private long lastmodified = 0; private boolean directory = false; /** * default constructor */ public Resource() { } /** * only sets the name. * *

    This is a dummy, used for not existing resources.

    * * @param name relative path of the resource. Expects * "/" to be used as the directory separator. */ public Resource(String name) { this(name, false, 0, false); } /** * sets the name, lastmodified flag, and exists flag * * @param name relative path of the resource. Expects * "/" to be used as the directory separator. */ public Resource(String name, boolean exists, long lastmodified) { this(name, exists, lastmodified, false); } /** * @param name relative path of the resource. Expects * "/" to be used as the directory separator. */ public Resource(String name, boolean exists, long lastmodified, boolean directory) { this.name = name; this.exists = exists; this.lastmodified = lastmodified; this.directory = directory; } /** * name attribute will contain the path of a file relative to the * root directory of its fileset or the recorded path of a zip * entry. * *

    example for a file with fullpath /var/opt/adm/resource.txt * in a file set with root dir /var/opt it will be * adm/resource.txt.

    * *

    "/" will be used as the directory separator.

    */ public String getName() { return name; } /** * @param name relative path of the resource. Expects * "/" to be used as the directory separator. */ public void setName(String name) { this.name = name; } /** * the exists attribute tells whether a file exists */ public boolean isExists() { return exists; } public void setExists(boolean exists) { this.exists = exists; } /** * tells the modification time in milliseconds since 01.01.1970 of * * @return 0 if the resource does not exist to mirror the behavior * of {@link java.io.File File}. */ public long getLastModified() { return !exists || lastmodified < 0 ? 0 : lastmodified; } public void setLastModified(long lastmodified) { this.lastmodified = lastmodified; } /** * tells if the resource is a directory * @return boolean flag indicating if the resource is a directory */ public boolean isDirectory() { return directory; } public void setDirectory(boolean directory) { this.directory = directory; } /** * @return copy of this */ public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new Error("CloneNotSupportedException for a " + "Clonable Resource caught?"); } } /** * delegates to a comparison of names. * * @since Ant 1.6 */ public int compareTo(Object other) { if (!(other instanceof Resource)) { throw new IllegalArgumentException("Can only be compared with " + "Resources"); } Resource r = (Resource) other; return getName().compareTo(r.getName()); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/AsiExtraField.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000002115610072742275034162 0ustar drazzibdrazzib/* * Copyright 2001-2002,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.util.zip.CRC32; import java.util.zip.ZipException; /** * Adds Unix file permission and UID/GID fields as well as symbolic * link handling. * *

    This class uses the ASi extra field in the format: *

     *         Value         Size            Description
     *         -----         ----            -----------
     * (Unix3) 0x756e        Short           tag for this extra block type
     *         TSize         Short           total data size for this block
     *         CRC           Long            CRC-32 of the remaining data
     *         Mode          Short           file permissions
     *         SizDev        Long            symlink'd size OR major/minor dev num
     *         UID           Short           user ID
     *         GID           Short           group ID
     *         (var.)        variable        symbolic link filename
     * 
    * taken from appnote.iz (Info-ZIP note, 981119) found at ftp://ftp.uu.net/pub/archiving/zip/doc/

    * *

    Short is two bytes and Long is four bytes in big endian byte and * word order, device numbers are currently not supported.

    * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public class AsiExtraField implements ZipExtraField, UnixStat, Cloneable { private static final ZipShort HEADER_ID = new ZipShort(0x756E); /** * Standard Unix stat(2) file mode. * * @since 1.1 */ private int mode = 0; /** * User ID. * * @since 1.1 */ private int uid = 0; /** * Group ID. * * @since 1.1 */ private int gid = 0; /** * File this entry points to, if it is a symbolic link. * *

    empty string - if entry is not a symbolic link.

    * * @since 1.1 */ private String link = ""; /** * Is this an entry for a directory? * * @since 1.1 */ private boolean dirFlag = false; /** * Instance used to calculate checksums. * * @since 1.1 */ private CRC32 crc = new CRC32(); public AsiExtraField() { } /** * The Header-ID. * * @since 1.1 */ public ZipShort getHeaderId() { return HEADER_ID; } /** * Length of the extra field in the local file data - without * Header-ID or length specifier. * * @since 1.1 */ public ZipShort getLocalFileDataLength() { return new ZipShort(4 // CRC + 2 // Mode + 4 // SizDev + 2 // UID + 2 // GID + getLinkedFile().getBytes().length); } /** * Delegate to local file data. * * @since 1.1 */ public ZipShort getCentralDirectoryLength() { return getLocalFileDataLength(); } /** * The actual data to put into local file data - without Header-ID * or length specifier. * * @since 1.1 */ public byte[] getLocalFileDataData() { // CRC will be added later byte[] data = new byte[getLocalFileDataLength().getValue() - 4]; System.arraycopy((new ZipShort(getMode())).getBytes(), 0, data, 0, 2); byte[] linkArray = getLinkedFile().getBytes(); System.arraycopy((new ZipLong(linkArray.length)).getBytes(), 0, data, 2, 4); System.arraycopy((new ZipShort(getUserId())).getBytes(), 0, data, 6, 2); System.arraycopy((new ZipShort(getGroupId())).getBytes(), 0, data, 8, 2); System.arraycopy(linkArray, 0, data, 10, linkArray.length); crc.reset(); crc.update(data); long checksum = crc.getValue(); byte[] result = new byte[data.length + 4]; System.arraycopy((new ZipLong(checksum)).getBytes(), 0, result, 0, 4); System.arraycopy(data, 0, result, 4, data.length); return result; } /** * Delegate to local file data. * * @since 1.1 */ public byte[] getCentralDirectoryData() { return getLocalFileDataData(); } /** * Set the user id. * * @since 1.1 */ public void setUserId(int uid) { this.uid = uid; } /** * Get the user id. * * @since 1.1 */ public int getUserId() { return uid; } /** * Set the group id. * * @since 1.1 */ public void setGroupId(int gid) { this.gid = gid; } /** * Get the group id. * * @since 1.1 */ public int getGroupId() { return gid; } /** * Indicate that this entry is a symbolic link to the given filename. * * @param name Name of the file this entry links to, empty String * if it is not a symbolic link. * * @since 1.1 */ public void setLinkedFile(String name) { link = name; mode = getMode(mode); } /** * Name of linked file * * @return name of the file this entry links to if it is a * symbolic link, the empty string otherwise. * * @since 1.1 */ public String getLinkedFile() { return link; } /** * Is this entry a symbolic link? * * @since 1.1 */ public boolean isLink() { return getLinkedFile().length() != 0; } /** * File mode of this file. * * @since 1.1 */ public void setMode(int mode) { this.mode = getMode(mode); } /** * File mode of this file. * * @since 1.1 */ public int getMode() { return mode; } /** * Indicate whether this entry is a directory. * * @since 1.1 */ public void setDirectory(boolean dirFlag) { this.dirFlag = dirFlag; mode = getMode(mode); } /** * Is this entry a directory? * * @since 1.1 */ public boolean isDirectory() { return dirFlag && !isLink(); } /** * Populate data from this array as if it was in local file data. * * @since 1.1 */ public void parseFromLocalFileData(byte[] data, int offset, int length) throws ZipException { long givenChecksum = (new ZipLong(data, offset)).getValue(); byte[] tmp = new byte[length - 4]; System.arraycopy(data, offset + 4, tmp, 0, length - 4); crc.reset(); crc.update(tmp); long realChecksum = crc.getValue(); if (givenChecksum != realChecksum) { throw new ZipException("bad CRC checksum " + Long.toHexString(givenChecksum) + " instead of " + Long.toHexString(realChecksum)); } int newMode = (new ZipShort(tmp, 0)).getValue(); byte[] linkArray = new byte[(int) (new ZipLong(tmp, 2)).getValue()]; uid = (new ZipShort(tmp, 6)).getValue(); gid = (new ZipShort(tmp, 8)).getValue(); if (linkArray.length == 0) { link = ""; } else { System.arraycopy(tmp, 10, linkArray, 0, linkArray.length); link = new String(linkArray); } setDirectory((newMode & DIR_FLAG) != 0); setMode(newMode); } /** * Get the file mode for given permissions with the correct file type. * * @since 1.1 */ protected int getMode(int mode) { int type = FILE_FLAG; if (isLink()) { type = LINK_FLAG; } else if (isDirectory()) { type = DIR_FLAG; } return type | (mode & PERM_MASK); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipEntry.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000003100410072742275034153 0ustar drazzibdrazzib/* * Copyright 2001-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Vector; import java.util.zip.ZipException; /** * Extension that adds better handling of extra fields and provides * access to the internal and external file attributes. * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable { private static final int PLATFORM_UNIX = 3; private static final int PLATFORM_FAT = 0; private int internalAttributes = 0; private int platform = PLATFORM_FAT; private long externalAttributes = 0; private Vector extraFields = new Vector(); private String name = null; /** * Creates a new zip entry with the specified name. * * @since 1.1 */ public ZipEntry(String name) { super(name); } /** * Creates a new zip entry with fields taken from the specified zip entry. * * @since 1.1 */ public ZipEntry(java.util.zip.ZipEntry entry) throws ZipException { /* * REVISIT: call super(entry) instead of this stuff in Ant2, * "copy constructor" has not been available in JDK 1.1 */ super(entry.getName()); setComment(entry.getComment()); setMethod(entry.getMethod()); setTime(entry.getTime()); long size = entry.getSize(); if (size > 0) { setSize(size); } long cSize = entry.getCompressedSize(); if (cSize > 0) { setComprSize(cSize); } long crc = entry.getCrc(); if (crc > 0) { setCrc(crc); } byte[] extra = entry.getExtra(); if (extra != null) { setExtraFields(ExtraFieldUtils.parse(extra)); } else { // initializes extra data to an empty byte array setExtra(); } } /** * Creates a new zip entry with fields taken from the specified zip entry. * * @since 1.1 */ public ZipEntry(ZipEntry entry) throws ZipException { this((java.util.zip.ZipEntry) entry); setInternalAttributes(entry.getInternalAttributes()); setExternalAttributes(entry.getExternalAttributes()); setExtraFields(entry.getExtraFields()); } /** * @since 1.9 */ protected ZipEntry() { super(""); } /** * Overwrite clone * * @since 1.1 */ public Object clone() { try { ZipEntry e = (ZipEntry) super.clone(); e.setName(getName()); e.setComment(getComment()); e.setMethod(getMethod()); e.setTime(getTime()); long size = getSize(); if (size > 0) { e.setSize(size); } long cSize = getCompressedSize(); if (cSize > 0) { e.setComprSize(cSize); } long crc = getCrc(); if (crc > 0) { e.setCrc(crc); } e.extraFields = (Vector) extraFields.clone(); e.setInternalAttributes(getInternalAttributes()); e.setExternalAttributes(getExternalAttributes()); e.setExtraFields(getExtraFields()); return e; } catch (Throwable t) { // in JDK 1.1 ZipEntry is not Cloneable, so super.clone declares // to throw CloneNotSupported - since JDK 1.2 it is overridden to // not throw that exception return null; } } /** * Retrieves the internal file attributes. * * @since 1.1 */ public int getInternalAttributes() { return internalAttributes; } /** * Sets the internal file attributes. * * @since 1.1 */ public void setInternalAttributes(int value) { internalAttributes = value; } /** * Retrieves the external file attributes. * * @since 1.1 */ public long getExternalAttributes() { return externalAttributes; } /** * Sets the external file attributes. * * @since 1.1 */ public void setExternalAttributes(long value) { externalAttributes = value; } /** * Sets Unix permissions in a way that is understood by Info-Zip's * unzip command. * * @since Ant 1.5.2 */ public void setUnixMode(int mode) { setExternalAttributes((mode << 16) // MS-DOS read-only attribute | ((mode & 0200) == 0 ? 1 : 0) // MS-DOS directory flag | (isDirectory() ? 0x10 : 0)); platform = PLATFORM_UNIX; } /** * Unix permission. * * @since Ant 1.6 */ public int getUnixMode() { return (int) ((getExternalAttributes() >> 16) & 0xFFFF); } /** * Platform specification to put into the "version made * by" part of the central file header. * * @return 0 (MS-DOS FAT) unless {@link #setUnixMode setUnixMode} * has been called, in which case 3 (Unix) will be returned. * * @since Ant 1.5.2 */ public int getPlatform() { return platform; } /** * @since 1.9 */ protected void setPlatform(int platform) { this.platform = platform; } /** * Replaces all currently attached extra fields with the new array. * * @since 1.1 */ public void setExtraFields(ZipExtraField[] fields) { extraFields.removeAllElements(); for (int i = 0; i < fields.length; i++) { extraFields.addElement(fields[i]); } setExtra(); } /** * Retrieves extra fields. * * @since 1.1 */ public ZipExtraField[] getExtraFields() { ZipExtraField[] result = new ZipExtraField[extraFields.size()]; extraFields.copyInto(result); return result; } /** * Adds an extra fields - replacing an already present extra field * of the same type. * * @since 1.1 */ public void addExtraField(ZipExtraField ze) { ZipShort type = ze.getHeaderId(); boolean done = false; for (int i = 0; !done && i < extraFields.size(); i++) { if (((ZipExtraField) extraFields.elementAt(i)).getHeaderId().equals(type)) { extraFields.setElementAt(ze, i); done = true; } } if (!done) { extraFields.addElement(ze); } setExtra(); } /** * Remove an extra fields. * * @since 1.1 */ public void removeExtraField(ZipShort type) { boolean done = false; for (int i = 0; !done && i < extraFields.size(); i++) { if (((ZipExtraField) extraFields.elementAt(i)).getHeaderId().equals(type)) { extraFields.removeElementAt(i); done = true; } } if (!done) { throw new java.util.NoSuchElementException(); } setExtra(); } /** * Throws an Exception if extra data cannot be parsed into extra fields. * * @since 1.1 */ public void setExtra(byte[] extra) throws RuntimeException { try { setExtraFields(ExtraFieldUtils.parse(extra)); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } } /** * Unfortunately {@link java.util.zip.ZipOutputStream * java.util.zip.ZipOutputStream} seems to access the extra data * directly, so overriding getExtra doesn't help - we need to * modify super's data directly. * * @since 1.1 */ protected void setExtra() { super.setExtra(ExtraFieldUtils.mergeLocalFileDataData(getExtraFields())); } /** * Retrieves the extra data for the local file data. * * @since 1.1 */ public byte[] getLocalFileDataExtra() { byte[] extra = getExtra(); return extra != null ? extra : new byte[0]; } /** * Retrieves the extra data for the central directory. * * @since 1.1 */ public byte[] getCentralDirectoryExtra() { return ExtraFieldUtils.mergeCentralDirectoryData(getExtraFields()); } /** * Helper for JDK 1.1 <-> 1.2 incompatibility. * * @since 1.2 */ private Long compressedSize = null; /** * Make this class work in JDK 1.1 like a 1.2 class. * *

    This either stores the size for later usage or invokes * setCompressedSize via reflection.

    * * @since 1.2 */ public void setComprSize(long size) { if (haveSetCompressedSize()) { performSetCompressedSize(this, size); } else { compressedSize = new Long(size); } } /** * Override to make this class work in JDK 1.1 like a 1.2 class. * * @since 1.2 */ public long getCompressedSize() { if (compressedSize != null) { // has been set explicitly and we are running in a 1.1 VM return compressedSize.longValue(); } return super.getCompressedSize(); } /** * @since 1.9 */ public String getName() { return name == null ? super.getName() : name; } /** * @since 1.10 */ public boolean isDirectory() { return getName().endsWith("/"); } protected void setName(String name) { this.name = name; } /** * Helper for JDK 1.1 * * @since 1.2 */ private static Method setCompressedSizeMethod = null; /** * Helper for JDK 1.1 * * @since 1.2 */ private static Object lockReflection = new Object(); /** * Helper for JDK 1.1 * * @since 1.2 */ private static boolean triedToGetMethod = false; /** * Are we running JDK 1.2 or higher? * * @since 1.2 */ private static boolean haveSetCompressedSize() { checkSCS(); return setCompressedSizeMethod != null; } /** * Invoke setCompressedSize via reflection. * * @since 1.2 */ private static void performSetCompressedSize(ZipEntry ze, long size) { Long[] s = {new Long(size)}; try { setCompressedSizeMethod.invoke(ze, s); } catch (InvocationTargetException ite) { Throwable nested = ite.getTargetException(); throw new RuntimeException("Exception setting the compressed size " + "of " + ze + ": " + nested.getMessage()); } catch (Throwable other) { throw new RuntimeException("Exception setting the compressed size " + "of " + ze + ": " + other.getMessage()); } } /** * Try to get a handle to the setCompressedSize method. * * @since 1.2 */ private static void checkSCS() { if (!triedToGetMethod) { synchronized (lockReflection) { triedToGetMethod = true; try { setCompressedSizeMethod = java.util.zip.ZipEntry.class.getMethod("setCompressedSize", new Class[] {Long.TYPE}); } catch (NoSuchMethodException nse) { } } } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/UnrecognizedExtraField.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000000511310072742275034155 0ustar drazzibdrazzib/* * Copyright 2001-2002,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; /** * Simple placeholder for all those extra fields we don't want to deal * with. * *

    Assumes local file data and central directory entries are * identical - unless told the opposite.

    * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public class UnrecognizedExtraField implements ZipExtraField { /** * The Header-ID. * * @since 1.1 */ private ZipShort headerId; public void setHeaderId(ZipShort headerId) { this.headerId = headerId; } public ZipShort getHeaderId() { return headerId; } /** * Extra field data in local file data - without * Header-ID or length specifier. * * @since 1.1 */ private byte[] localData; public void setLocalFileDataData(byte[] data) { localData = data; } public ZipShort getLocalFileDataLength() { return new ZipShort(localData.length); } public byte[] getLocalFileDataData() { return localData; } /** * Extra field data in central directory - without * Header-ID or length specifier. * * @since 1.1 */ private byte[] centralData; public void setCentralDirectoryData(byte[] data) { centralData = data; } public ZipShort getCentralDirectoryLength() { if (centralData != null) { return new ZipShort(centralData.length); } return getLocalFileDataLength(); } public byte[] getCentralDirectoryData() { if (centralData != null) { return centralData; } return getLocalFileDataData(); } public void parseFromLocalFileData(byte[] data, int offset, int length) { byte[] tmp = new byte[length]; System.arraycopy(data, offset, tmp, 0, length); setLocalFileDataData(tmp); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipFile.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000004317210072742275034164 0ustar drazzibdrazzib/* * Copyright 2003-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile; import java.io.UnsupportedEncodingException; import java.util.Calendar; import java.util.Date; import java.util.Enumeration; import java.util.Hashtable; import java.util.zip.Inflater; import java.util.zip.InflaterInputStream; import java.util.zip.ZipException; /** * Replacement for java.util.ZipFile. * *

    This class adds support for file name encodings other than UTF-8 * (which is required to work on ZIP files created by native zip tools * and is able to skip a preamble like the one found in self * extracting archives. Furthermore it returns instances of * org.apache.tools.zip.ZipEntry instead of * java.util.zip.ZipEntry.

    * *

    It doesn't extend java.util.zip.ZipFile as it would * have to reimplement all methods anyway. Like * java.util.ZipFile, it uses RandomAccessFile under the * covers and supports compressed and uncompressed entries.

    * *

    The method signatures mimic the ones of * java.util.zip.ZipFile, with a couple of exceptions: * *

      *
    • There is no getName method.
    • *
    • entries has been renamed to getEntries.
    • *
    • getEntries and getEntry return * org.apache.tools.zip.ZipEntry instances.
    • *
    • close is allowed to throw IOException.
    • *
    * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public class ZipFile { /** * Maps ZipEntrys to Longs, recording the offsets of the local * file headers. */ private Hashtable entries = new Hashtable(); /** * Maps String to ZipEntrys, name -> actual entry. */ private Hashtable nameMap = new Hashtable(); /** * Maps ZipEntrys to Longs, recording the offsets of the actual file data. */ private Hashtable dataOffsets = new Hashtable(); /** * The encoding to use for filenames and the file comment. * *

    For a list of possible values see http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html. * Defaults to the platform's default character encoding.

    */ private String encoding = null; /** * The actual data source. */ private RandomAccessFile archive; /** * Opens the given file for reading, assuming the platform's * native encoding for file names. * * @param f the archive. * * @throws IOException if an error occurs while reading the file. */ public ZipFile(File f) throws IOException { this(f, null); } /** * Opens the given file for reading, assuming the platform's * native encoding for file names. * * @param name name of the archive. * * @throws IOException if an error occurs while reading the file. */ public ZipFile(String name) throws IOException { this(new File(name), null); } /** * Opens the given file for reading, assuming the specified * encoding for file names. * * @param name name of the archive. * @param encoding the encoding to use for file names * * @throws IOException if an error occurs while reading the file. */ public ZipFile(String name, String encoding) throws IOException { this(new File(name), encoding); } /** * Opens the given file for reading, assuming the specified * encoding for file names. * * @param f the archive. * @param encoding the encoding to use for file names * * @throws IOException if an error occurs while reading the file. */ public ZipFile(File f, String encoding) throws IOException { this.encoding = encoding; archive = new RandomAccessFile(f, "r"); populateFromCentralDirectory(); resolveLocalFileHeaderData(); } /** * The encoding to use for filenames and the file comment. * * @return null if using the platform's default character encoding. */ public String getEncoding() { return encoding; } /** * Closes the archive. * @throws IOException if an error occurs closing the archive. */ public void close() throws IOException { archive.close(); } /** * Returns all entries as {@link org.apache.tools.ant.ZipEntry * ZipEntry} instances. * @return all entries as ZipEntry instances. */ public Enumeration getEntries() { return entries.keys(); } /** * Returns a named entry - or null if no entry by * that name exists. * @param name name of the entry. * @return the ZipEntry corresponding to the given name - or * null if not present. */ public ZipEntry getEntry(String name) { return (ZipEntry) nameMap.get(name); } /** * Returns an InputStream for reading the contents of the given entry. * @param ze the entry to get the stream for. * @return a stream to read the entry from. */ public InputStream getInputStream(ZipEntry ze) throws IOException, ZipException { Long start = (Long) dataOffsets.get(ze); if (start == null) { return null; } BoundedInputStream bis = new BoundedInputStream(start.longValue(), ze.getCompressedSize()); switch (ze.getMethod()) { case ZipEntry.STORED: return bis; case ZipEntry.DEFLATED: bis.addDummy(); return new InflaterInputStream(bis, new Inflater(true)); default: throw new ZipException("Found unsupported compression method " + ze.getMethod()); } } private static final int CFH_LEN = /* version made by */ 2 + /* version needed to extract */ 2 + /* general purpose bit flag */ 2 + /* compression method */ 2 + /* last mod file time */ 2 + /* last mod file date */ 2 + /* crc-32 */ 4 + /* compressed size */ 4 + /* uncompressed size */ 4 + /* filename length */ 2 + /* extra field length */ 2 + /* file comment length */ 2 + /* disk number start */ 2 + /* internal file attributes */ 2 + /* external file attributes */ 4 + /* relative offset of local header */ 4; /** * Reads the central directory of the given archive and populates * the internal tables with ZipEntry instances. * *

    The ZipEntrys will know all data that can be obtained from * the central directory alone, but not the data that requires the * local file header or additional data to be read.

    */ private void populateFromCentralDirectory() throws IOException { positionAtCentralDirectory(); byte[] cfh = new byte[CFH_LEN]; byte[] signatureBytes = new byte[4]; archive.readFully(signatureBytes); ZipLong sig = new ZipLong(signatureBytes); while (sig.equals(ZipOutputStream.CFH_SIG)) { archive.readFully(cfh); int off = 0; ZipEntry ze = new ZipEntry(); ZipShort versionMadeBy = new ZipShort(cfh, off); off += 2; ze.setPlatform((versionMadeBy.getValue() >> 8) & 0x0F); off += 4; // skip version info and general purpose byte ze.setMethod((new ZipShort(cfh, off)).getValue()); off += 2; ze.setTime(fromDosTime(new ZipLong(cfh, off)).getTime()); off += 4; ze.setCrc((new ZipLong(cfh, off)).getValue()); off += 4; ze.setCompressedSize((new ZipLong(cfh, off)).getValue()); off += 4; ze.setSize((new ZipLong(cfh, off)).getValue()); off += 4; int fileNameLen = (new ZipShort(cfh, off)).getValue(); off += 2; int extraLen = (new ZipShort(cfh, off)).getValue(); off += 2; int commentLen = (new ZipShort(cfh, off)).getValue(); off += 2; off += 2; // disk number ze.setInternalAttributes((new ZipShort(cfh, off)).getValue()); off += 2; ze.setExternalAttributes((new ZipLong(cfh, off)).getValue()); off += 4; // LFH offset entries.put(ze, new Long((new ZipLong(cfh, off)).getValue())); byte[] fileName = new byte[fileNameLen]; archive.readFully(fileName); ze.setName(getString(fileName)); nameMap.put(ze.getName(), ze); archive.skipBytes(extraLen); byte[] comment = new byte[commentLen]; archive.readFully(comment); ze.setComment(getString(comment)); archive.readFully(signatureBytes); sig = new ZipLong(signatureBytes); } } private static final int MIN_EOCD_SIZE = /* end of central dir signature */ 4 + /* number of this disk */ 2 + /* number of the disk with the */ + /* start of the central directory */ 2 + /* total number of entries in */ + /* the central dir on this disk */ 2 + /* total number of entries in */ + /* the central dir */ 2 + /* size of the central directory */ 4 + /* offset of start of central */ + /* directory with respect to */ + /* the starting disk number */ 4 + /* zipfile comment length */ 2; private static final int CFD_LOCATOR_OFFSET = /* end of central dir signature */ 4 + /* number of this disk */ 2 + /* number of the disk with the */ + /* start of the central directory */ 2 + /* total number of entries in */ + /* the central dir on this disk */ 2 + /* total number of entries in */ + /* the central dir */ 2 + /* size of the central directory */ 4; /** * Searches for the "End of central dir record", parses * it and positions the stream at the first central directory * record. */ private void positionAtCentralDirectory() throws IOException { long off = archive.length() - MIN_EOCD_SIZE; archive.seek(off); byte[] sig = ZipOutputStream.EOCD_SIG.getBytes(); int curr = archive.read(); boolean found = false; while (curr != -1) { if (curr == sig[0]) { curr = archive.read(); if (curr == sig[1]) { curr = archive.read(); if (curr == sig[2]) { curr = archive.read(); if (curr == sig[3]) { found = true; break; } } } } archive.seek(--off); curr = archive.read(); } if (!found) { throw new ZipException("archive is not a ZIP archive"); } archive.seek(off + CFD_LOCATOR_OFFSET); byte[] cfdOffset = new byte[4]; archive.readFully(cfdOffset); archive.seek((new ZipLong(cfdOffset)).getValue()); } /** * Number of bytes in local file header up to the "length of * filename" entry. */ private static final long LFH_OFFSET_FOR_FILENAME_LENGTH = /* local file header signature */ 4 + /* version needed to extract */ 2 + /* general purpose bit flag */ 2 + /* compression method */ 2 + /* last mod file time */ 2 + /* last mod file date */ 2 + /* crc-32 */ 4 + /* compressed size */ 4 + /* uncompressed size */ 4; /** * Walks through all recorded entries and adds the data available * from the local file header. * *

    Also records the offsets for the data to read from the * entries.

    */ private void resolveLocalFileHeaderData() throws IOException { Enumeration e = getEntries(); while (e.hasMoreElements()) { ZipEntry ze = (ZipEntry) e.nextElement(); long offset = ((Long) entries.get(ze)).longValue(); archive.seek(offset + LFH_OFFSET_FOR_FILENAME_LENGTH); byte[] b = new byte[2]; archive.readFully(b); int fileNameLen = (new ZipShort(b)).getValue(); archive.readFully(b); int extraFieldLen = (new ZipShort(b)).getValue(); archive.skipBytes(fileNameLen); byte[] localExtraData = new byte[extraFieldLen]; archive.readFully(localExtraData); ze.setExtra(localExtraData); dataOffsets.put(ze, new Long(offset + LFH_OFFSET_FOR_FILENAME_LENGTH + 2 + 2 + fileNameLen + extraFieldLen)); } } /** * Convert a DOS date/time field to a Date object. * * @param l contains the stored DOS time. * @return a Date instance corresponding to the given time. */ protected static Date fromDosTime(ZipLong l) { long dosTime = l.getValue(); Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, (int) ((dosTime >> 25) & 0x7f) + 1980); cal.set(Calendar.MONTH, (int) ((dosTime >> 21) & 0x0f) - 1); cal.set(Calendar.DATE, (int) (dosTime >> 16) & 0x1f); cal.set(Calendar.HOUR_OF_DAY, (int) (dosTime >> 11) & 0x1f); cal.set(Calendar.MINUTE, (int) (dosTime >> 5) & 0x3f); cal.set(Calendar.SECOND, (int) (dosTime << 1) & 0x3e); return cal.getTime(); } /** * Retrieve a String from the given bytes using the encoding set * for this ZipFile. * * @param bytes the byte array to transform * @return String obtained by using the given encoding * @throws ZipException if the encoding cannot be recognized. */ protected String getString(byte[] bytes) throws ZipException { if (encoding == null) { return new String(bytes); } else { try { return new String(bytes, encoding); } catch (UnsupportedEncodingException uee) { throw new ZipException(uee.getMessage()); } } } /** * InputStream that delegates requests to the underlying * RandomAccessFile, making sure that only bytes from a certain * range can be read. */ private class BoundedInputStream extends InputStream { private long remaining; private long loc; private boolean addDummyByte = false; BoundedInputStream(long start, long remaining) { this.remaining = remaining; loc = start; } public int read() throws IOException { if (remaining-- <= 0) { if (addDummyByte) { addDummyByte = false; return 0; } return -1; } synchronized (archive) { archive.seek(loc++); return archive.read(); } } public int read(byte[] b, int off, int len) throws IOException { if (remaining <= 0) { if (addDummyByte) { addDummyByte = false; b[off] = 0; return 1; } return -1; } if (len <= 0) { return 0; } if (len > remaining) { len = (int) remaining; } int ret = -1; synchronized (archive) { archive.seek(loc); ret = archive.read(b, off, len); } if (ret > 0) { loc += ret; remaining -= ret; } return ret; } /** * Inflater needs an extra dummy byte for nowrap - see * Inflater's javadocs. */ void addDummy() { addDummyByte = true; } } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zip/ZipShort.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/zi0000644000175000017500000000464610072742276034170 0ustar drazzibdrazzib/* * Copyright 2001-2002,2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.groboutils.codecoverage.v2.ant.zip; /** * Utility class that represents a two byte integer with conversion * rules for the big endian byte order of ZIP files. * * @author Stefan Bodewig * @version $Revision: 1.1 $ */ public final class ZipShort implements Cloneable { private int value; /** * Create instance from a number. * * @since 1.1 */ public ZipShort (int value) { this.value = value; } /** * Create instance from bytes. * * @since 1.1 */ public ZipShort (byte[] bytes) { this(bytes, 0); } /** * Create instance from the two bytes starting at offset. * * @since 1.1 */ public ZipShort (byte[] bytes, int offset) { value = (bytes[offset + 1] << 8) & 0xFF00; value += (bytes[offset] & 0xFF); } /** * Get value as two bytes in big endian byte order. * * @since 1.1 */ public byte[] getBytes() { byte[] result = new byte[2]; result[0] = (byte) (value & 0xFF); result[1] = (byte) ((value & 0xFF00) >> 8); return result; } /** * Get value as Java int. * * @since 1.1 */ public int getValue() { return value; } /** * Override to make two instances with same value equal. * * @since 1.1 */ public boolean equals(Object o) { if (o == null || !(o instanceof ZipShort)) { return false; } return value == ((ZipShort) o).getValue(); } /** * Override to make two instances with same value equal. * * @since 1.1 */ public int hashCode() { return value; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/GroboReZipTask.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Gr0000644000175000017500000010501710120244473034076 0ustar drazzibdrazzib/* * @(#)GroboReZipTask.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.Stack; import java.util.Vector; import java.util.zip.CRC32; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.PatternSet; //import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.util.FileUtils; // We have to use the Ant ZipScanner due to the Reference type. // But it's easy to avoid this... //import org.apache.tools.ant.types.ZipScanner; // use our own re-packaging of the Apache zip utility import net.sourceforge.groboutils.codecoverage.v2.ant.zip.ZipEntry; import net.sourceforge.groboutils.codecoverage.v2.ant.zip.ZipOutputStream; import net.sourceforge.groboutils.codecoverage.v2.ant.zip.ZipFile; import net.sourceforge.groboutils.codecoverage.v2.ant.zip.ZipFileSet; /** * Similar to the Zip task, but its purpose is to modify not only * one zip file, but possibly many containing zip files as well. * Also, should have meta-inf support for modifying the classpath to * add in the runtime jar file. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/08 05:29:19 $ * @since March 23, 2004 */ public class GroboReZipTask extends Task { private boolean failOnError = true; private Vector zips = new Vector(); private static final int BUFFER_SIZE = 8 * 1024; private static final int DELETE_RETRY_SLEEP_MILLIS = 10; private static final FileUtils FILEUTILS = FileUtils.newFileUtils(); private static final long EMPTY_CRC = new CRC32 ().getValue (); public static class ReZipFileSet extends ZipFileSet { private boolean replaceOnly = false; public ReZipFileSet() { super(); } public ReZipFileSet( FileSet fs ) { super( fs ); } public ReZipFileSet( ZipFileSet zfs ) { super( zfs ); } public ReZipFileSet( ReZipFileSet rzfs ) { super( (ZipFileSet)rzfs ); this.replaceOnly = rzfs.replaceOnly; } /** * If this is set to true, then only the files in this fileset * that already exist in the owning zip file will be added, all * others in this fileset will be ignored. */ public void setReplaceOnly( boolean replace ) { this.replaceOnly = replace; } public boolean getReplaceOnly( Project p ) { if (isReference()) { return ((ReZipFileSet)getRef( p )).getReplaceOnly( p ); } return this.replaceOnly; } } /** the base type for altering a zip file. */ public static class AlterZip { private Vector subZip = new Vector(); private Vector fileSets = new Vector(); private Vector alter = new Vector(); private String srcFile; private String destFile; String encoding; boolean doCompress = true; public void setSrc( String f ) { this.srcFile = f; } public void setDest( String f ) { this.destFile = f; } public void addFileSet( ReZipFileSet zfs ) { if (zfs != null) { this.fileSets.addElement( zfs ); } } public void addZipFileSet( ReZipFileSet zfs ) { if (zfs != null) { this.fileSets.addElement( zfs ); } } public void addAlterZip( AlterZip z ) { if (z != null) { this.subZip.addElement( z ); } } public void addAlterWar( AlterWar z ) { if (z != null) { this.subZip.addElement( z ); } } public void addAlterEar( AlterEar z ) { if (z != null) { this.subZip.addElement( z ); } } public void addAlterJar( AlterJar z ) { if (z != null) { this.subZip.addElement( z ); } } protected void _addModifyEntry( ModifyEntry me ) { if (me != null) { this.alter.addElement( me ); } } public File getAbsoluteSrc( Project p ) { return p.resolveFile( this.srcFile ); } public File getAbsoluteDest( Project p ) { return p.resolveFile( this.destFile ); } public String getSrc() { return this.srcFile; } public String getDest() { return this.destFile; } public boolean hasDest() { return (this.destFile != null); } public AlterZip[] getSubZips() { AlterZip az[] = new AlterZip[ this.subZip.size() ]; this.subZip.copyInto( az ); return az; } public FileSet[] getFileSets() { FileSet fs[] = new FileSet[ this.fileSets.size() ]; this.fileSets.copyInto( fs ); return fs; } public ModifyEntry[] getModifyEntries() { Vector entries = new Vector(); Enumeration e = this.alter.elements(); while (e.hasMoreElements()) { entries.addElement( e.nextElement() ); } e = this.subZip.elements(); while (e.hasMoreElements()) { AlterZip az = (AlterZip)e.nextElement(); entries.addElement( new AlterZipModifyEntry( az ) ); } ModifyEntry me[] = new ModifyEntry[ entries.size() ]; entries.copyInto( me ); return me; } public ModifyEntry shouldModify( String r ) { ModifyEntry[] me = getModifyEntries(); for (int i = 0; i < me.length; ++i) { if (me[i].shouldModify( r )) { return me[i]; } } return null; } } /** * Tells the processing system that a particular file needs to * be modified. */ public static abstract class ModifyEntry { private String filename; public ModifyEntry( String src ) { this.filename = src; } public boolean shouldModify( String r ) { return (this.filename.equals( r ) ); } public abstract void modify( GroboReZipTask grze, InputStream in, File outfile ) throws IOException; } /** * Recursively alter the inner zip file, by writing its contents * to temporary files. */ public static class AlterZipModifyEntry extends ModifyEntry { private AlterZip az; public AlterZipModifyEntry( AlterZip az ) { super( az.srcFile ); this.az = az; } public void modify( GroboReZipTask grze, InputStream in, File outfile ) throws IOException { File src = FILEUTILS.createTempFile( "z", ".zip", null ); src.deleteOnExit(); FileOutputStream fos = new FileOutputStream( src ); byte buff[] = new byte[ BUFFER_SIZE ]; try { int size = in.read( buff, 0, BUFFER_SIZE ); while (size > 0) { fos.write( buff, 0, size ); size = in.read( buff, 0, BUFFER_SIZE ); } } finally { fos.close(); } try { grze.processZip( this.az, src, outfile ); } finally { delete( src ); } } } public static class AlterEar extends AlterZip { // currently, this is exactly the same. // we may want to alter the application.xml file // in the future. } public static class AlterJar extends AlterZip { // currently, this is exactly the same. // we may want to alter the MANIFEST.MF file // in the future, to possibly append the classpath entry. // This should be based on a 'addLib' like syntax. } public static class AlterWar extends AlterZip { public void addClasses( ReZipFileSet zfs ) { zfs.setPrefix( "WEB-INF/classes/" ); zfs.setReplaceOnly( true ); addZipFileSet( zfs ); } public void addLib( ReZipFileSet zfs ) { zfs.setPrefix( "WEB-INF/lib/" ); addZipFileSet( zfs ); } } //------------------------------------------------------------------ public void addAlterZip( AlterZip z ) { if (z != null) { this.zips.addElement( z ); } } public void addAlterWar( AlterWar z ) { if (z != null) { this.zips.addElement( z ); } } public void addAlterEar( AlterEar z ) { if (z != null) { this.zips.addElement( z ); } } public void addAlterJar( AlterJar z ) { if (z != null) { this.zips.addElement( z ); } } //------------------------------------------------------------------ public void execute() throws BuildException { // the top level zips act a bit differently than the rest - // their files are absolute. Enumeration e = this.zips.elements(); while (e.hasMoreElements()) { AlterZip az = (AlterZip)e.nextElement(); File src = az.getAbsoluteSrc( getProject() ); if (src == null) { String msg = "No source specified for zip."; if (this.failOnError) { throw new BuildException( msg ); } else { log( msg, Project.MSG_WARN ); } } File dest = null; boolean isTemp = false; if (az.hasDest()) { dest = az.getAbsoluteDest( getProject() ); if (dest.equals( src )) { // replacing the original file... dest = null; } } if (dest == null) { isTemp = true; dest = FILEUTILS.createTempFile( "z", ".zip", null ); dest.deleteOnExit(); } log( "Altering ["+src.getAbsolutePath()+"] into ["+ dest.getAbsolutePath()+"]", Project.MSG_INFO ); try { processZip( az, src, dest ); if (isTemp) { // replace the original file. FILEUTILS.copyFile( dest, src ); System.gc(); System.runFinalization(); delete( dest ); } } catch (SecurityException se) { throw new BuildException( "Not allowed to rename temporary file to old file (" + src.getAbsolutePath() + ")" ); } catch (IOException ioe) { String msg = "Problem processing zip file "+ src.getAbsolutePath()+": "+ ioe.getMessage(); if (this.failOnError) { throw new BuildException( msg, ioe ); } else { log( msg, Project.MSG_WARN ); } } catch (BuildException be) { if (this.failOnError) { throw be; } else { log( be.getMessage(), Project.MSG_WARN ); } } } } //------------------------------------------------------------------ public void processZip( AlterZip az, File src, File dest ) throws BuildException, IOException { ZipFile inzip = new ZipFile( src ); az.encoding = inzip.getEncoding(); Vector originalFiles = new Vector(); Enumeration entries = inzip.getEntries(); while (entries.hasMoreElements()) { ZipEntry ze = (ZipEntry)entries.nextElement(); originalFiles.addElement( ze.getName() ); } entries = null; inzip.close(); inzip = null; ZipOutputStream zOut = new ZipOutputStream( new FileOutputStream( dest ) ); zOut.setEncoding( az.encoding ); Vector addedFiles = new Vector(); addFiles( zOut, az.getFileSets(), az, addedFiles, originalFiles ); log( "Adding contents of original zip ["+src.getAbsolutePath()+"]", Project.MSG_VERBOSE ); ReZipFileSet oldFiles = new ReZipFileSet(); oldFiles.setProject( getProject() ); oldFiles.setSrc( src ); oldFiles.setReplaceOnly( false ); /* Enumeration af = addedFiles.elements(); while (af.hasMoreElements()) { PatternSet.NameEntry ne = oldFiles.createExclude(); ne.setName( (String)af.nextElement() ); } */ addFiles( zOut, oldFiles, az, addedFiles, originalFiles ); finalizeZipOutputStream(zOut); } private void addFiles( ZipOutputStream zOut, FileSet[] filesets, AlterZip az, Vector addedFiles, Vector originalFiles ) throws IOException, BuildException { for (int i = 0; i < filesets.length; ++i) { addFiles( zOut, filesets[i], az, addedFiles, originalFiles ); } } private void addFiles( ZipOutputStream zOut, FileSet fileset, AlterZip az, Vector addedFiles, Vector originalFiles ) throws IOException, BuildException { DirectoryScanner ds = fileset.getDirectoryScanner( getProject() ); //if (ds instanceof ZipScanner) //{ // ((ZipScanner) ds).setEncoding( az.encoding ); //} ds.scan(); String[] f = ds.getIncludedFiles(); if (f.length > 0) { addResources( az, fileset, f, false, zOut, addedFiles, originalFiles ); } String[] d = ds.getIncludedDirectories(); if (d.length > 0) { addResources( az, fileset, d, true, zOut, addedFiles, originalFiles ); } } /** * Add the given resources. Ripped from Ant's Zip task. * * @param fileset may give additional information like fullpath or * permissions. * @param resources the resources to add * @param zOut the stream to write to * * @since Ant 1.5.2 */ protected final void addResources( AlterZip az, FileSet fileset, String[] resources, boolean areDirs, ZipOutputStream zOut, Vector addedFiles, Vector originalFiles ) throws IOException { String prefix = ""; String fullpath = ""; int dirMode = ZipFileSet.DEFAULT_DIR_MODE; int fileMode = ZipFileSet.DEFAULT_FILE_MODE; boolean replaceOnly = false; ZipFileSet zfs = null; if (fileset instanceof ZipFileSet) { zfs = (ZipFileSet) fileset; prefix = zfs.getPrefix(getProject()); fullpath = zfs.getFullpath(getProject()); dirMode = zfs.getDirMode(getProject()); fileMode = zfs.getFileMode(getProject()); if (fileset instanceof ReZipFileSet) { replaceOnly = ((ReZipFileSet)fileset).getReplaceOnly(getProject()); } log( "Processing resources from ZipFileSet: prefix=["+ prefix+"]; fullpath=["+fullpath+"]; dirMode=["+ dirMode+"]; fileMode=["+fileMode+"]; replaceOnly=["+ replaceOnly+"]", Project.MSG_DEBUG ); } if (prefix.length() > 0 && fullpath.length() > 0) { throw new BuildException("Both prefix and fullpath attributes must" + " not be set on the same fileset."); } if (resources.length != 1 && fullpath.length() > 0) { throw new BuildException("fullpath attribute may only be specified" + " for filesets that specify a single" + " file."); } if (prefix.length() > 0) { if (!prefix.endsWith("/") && !prefix.endsWith("\\")) { prefix += "/"; } addParentDirs( null, prefix, zOut, "", dirMode, addedFiles, replaceOnly ); } ZipFile zf = null; try { boolean dealingWithFiles = false; File base = null; if (zfs == null || zfs.getSrc( getProject() ) == null) { dealingWithFiles = true; base = fileset.getDir( getProject() ); log( "Dealing with files (base=["+base+"])", Project.MSG_DEBUG ); } else { File src = zfs.getSrc( getProject() ); zf = new ZipFile( src, az.encoding ); log( "Dealing with zipFile (src=["+src.getAbsolutePath()+"])", Project.MSG_DEBUG ); } for (int i = 0; i < resources.length; i++) { log("Processing resource ["+resources[i]+"]", Project.MSG_DEBUG ); String name = null; if (fullpath.length() > 0) { name = fullpath; } else { name = resources[i]; } name = name.replace(File.separatorChar, '/'); if ("".equals(name)) { log("Empty name - continuing.", Project.MSG_DEBUG ); continue; } if (areDirs && !name.endsWith("/")) { name = name + "/"; } String prefixName = prefix + name; log("Output Zip entry name = ["+prefixName+"]", Project.MSG_DEBUG ); if (replaceOnly && !originalFiles.contains( prefixName )) { // only add the file when the original Zip contains it. log( prefixName + " not in original zip, so skip it.", Project.MSG_VERBOSE ); continue; } if (!dealingWithFiles && areDirs && !zfs.hasDirModeBeenSet()) { log("Adding directory's path into zip", Project.MSG_DEBUG); int nextToLastSlash = name.lastIndexOf( "/", name.length() - 2 ); if (nextToLastSlash != -1) { addParentDirs( base, name.substring( 0, nextToLastSlash + 1 ), zOut, prefix, dirMode, addedFiles, replaceOnly ); } ZipEntry ze = zf.getEntry( resources[i] ); addParentDirs( base, name, zOut, prefix, ze.getUnixMode(), addedFiles, replaceOnly ); } else { log("Adding file's path into zip", Project.MSG_DEBUG); addParentDirs( base, name, zOut, prefix, dirMode, addedFiles, replaceOnly ); } if (!areDirs) { if (dealingWithFiles) { File f = FILEUTILS.resolveFile(base, resources[i]); // only modify files that already exist in the // zip file. zipFile( az, f, zOut, prefixName, fileMode, addedFiles ); } else { ZipEntry ze = zf.getEntry( resources[i] ); if (ze != null) { log("Inserting zip entry ["+resources[i]+ "]", Project.MSG_DEBUG); boolean oldCompress = az.doCompress; az.doCompress = (ze.getMethod() == ZipEntry.DEFLATED); ModifyEntry me = az.shouldModify( resources[i] ); try { zipFile( az, me, zf.getInputStream(ze), zOut, prefixName, ze.getTime(), zfs.getSrc( getProject() ), zfs.hasFileModeBeenSet() ? fileMode : ze.getUnixMode(), addedFiles ); } finally { az.doCompress = oldCompress; } } } } } } finally { if (zf != null) { zf.close(); } } } /** * Ripped from Ant's Zip task. * * Ensure all parent dirs of a given entry have been added. * * @since Ant 1.5.2 */ protected final void addParentDirs( File baseDir, String entry, ZipOutputStream zOut, String prefix, int dirMode, Vector addedFiles, boolean replaceOnly ) throws IOException { // note: if replaceOnly == true, then any directories added would // mean that for them to be added, they must already exist in // the original zip file. If that's the case, then the directory // will be added anyway. Therefore we don't need to add the // directory if replaceOnly == true. if (replaceOnly) { return; } Stack directories = new Stack(); int slashPos = entry.length(); while ((slashPos = entry.lastIndexOf( '/', slashPos - 1 )) != -1) { String dir = entry.substring( 0, slashPos + 1 ); if (addedFiles.contains( prefix + dir )) { break; } directories.push(dir); } while (!directories.isEmpty()) { String dir = (String) directories.pop(); File f = null; if (baseDir != null) { f = new File(baseDir, dir); } else { f = new File(dir); } zipDir( f, zOut, prefix + dir, dirMode, addedFiles ); } } /** * Ripped from Ant's Zip task. * * @since Ant 1.5.2 */ protected void zipDir( File dir, ZipOutputStream zOut, String vPath, int mode, Vector addedFiles ) throws IOException { if (addedFiles.contains(vPath)) { // don't add directories we've already added. // no warning if we try, it is harmless in and of itself return; } log( "adding directory " + vPath, Project.MSG_VERBOSE ); addedFiles.addElement( vPath ); ZipEntry ze = new ZipEntry(vPath); if (dir != null && dir.exists()) { // ZIPs store time with a granularity of 2 seconds, round up ze.setTime(dir.lastModified() + 1999); } else { // ZIPs store time with a granularity of 2 seconds, round up ze.setTime(System.currentTimeMillis() + 1999); } ze.setSize( 0 ); ze.setMethod( ZipEntry.STORED ); // This is faintly ridiculous: ze.setCrc( EMPTY_CRC ); ze.setUnixMode(mode); zOut.putNextEntry( ze ); } /** * Ripped from Ant's Zip task. * Method that gets called when adding from java.io.File instances. * *

    This implementation delegates to the six-arg version.

    * * @param file the file to add to the archive * @param zOut the stream to write to * @param vPath the name this entry shall have in the archive * @param mode the Unix permissions to set. * * @since Ant 1.5.2 */ protected void zipFile( AlterZip az, File file, ZipOutputStream zOut, String vPath, int mode, Vector addedFiles ) throws IOException { /* if (file.equals(zipFile)) { throw new BuildException("A zip file cannot include itself", getLocation()); } */ log("zipFile( vPath = ["+vPath+"]; file = ["+file.getAbsolutePath()+"] )", Project.MSG_DEBUG ); FileInputStream fIn = new FileInputStream(file); try { // ZIPs store time with a granularity of 2 seconds, round up zipFile( az, null, fIn, zOut, vPath, file.lastModified() + 1999, null, mode, addedFiles ); } finally { fIn.close(); } } /** * Ripped from Ant's Zip task. * * Adds a new entry to the archive, takes care of duplicates as well. * * @param in the stream to read data for the entry from. * @param zOut the stream to write to. * @param vPath the name this entry shall have in the archive. * @param lastModified last modification time for the entry. * @param fromArchive the original archive we are copying this * entry from, will be null if we are not copying from an archive. * @param mode the Unix permissions to set. * * @since Ant 1.5.2 */ protected void zipFile( AlterZip az, ModifyEntry me, InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode, Vector addedFiles ) throws IOException { if (addedFiles.contains(vPath)) { log( vPath + " already added, skipping", Project.MSG_VERBOSE ); return; /* if (duplicate.equals("preserve")) { log(vPath + " already added, skipping", Project.MSG_INFO); return; } else if (duplicate.equals("fail")) { throw new BuildException("Duplicate file " + vPath + " was found and the duplicate " + "attribute is 'fail'."); } else { // duplicate equal to add, so we continue log("duplicate file " + vPath + " found, adding.", Project.MSG_VERBOSE); } */ } else { log( "adding entry " + vPath, Project.MSG_VERBOSE ); } ZipEntry ze = new ZipEntry( vPath ); ze.setTime( lastModified ); ze.setMethod( az.doCompress ? ZipEntry.DEFLATED : ZipEntry.STORED ); // should this zip file be modified? File tmpFile = null; try { if (me != null) { tmpFile = FILEUTILS.createTempFile( "z", ".tmp", null ); tmpFile.deleteOnExit(); me.modify( this, in, tmpFile ); in = new FileInputStream( tmpFile ); } /* * ZipOutputStream.putNextEntry expects the ZipEntry to * know its size and the CRC sum before you start writing * the data when using STORED mode - unless it is seekable. * * This forces us to process the data twice. */ if (!zOut.isSeekable() && !az.doCompress) { long size = 0; CRC32 cal = new CRC32(); if (!in.markSupported()) { // Store data into a byte[] ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buffer = new byte[8 * 1024]; int count = 0; do { size += count; cal.update(buffer, 0, count); bos.write(buffer, 0, count); count = in.read(buffer, 0, buffer.length); } while (count != -1); in = new ByteArrayInputStream(bos.toByteArray()); } else { in.mark(Integer.MAX_VALUE); byte[] buffer = new byte[8 * 1024]; int count = 0; do { size += count; cal.update(buffer, 0, count); count = in.read(buffer, 0, buffer.length); } while (count != -1); in.reset(); } ze.setSize(size); ze.setCrc(cal.getValue()); } ze.setUnixMode(mode); zOut.putNextEntry(ze); byte[] buffer = new byte[BUFFER_SIZE]; int count = 0; do { if (count != 0) { zOut.write(buffer, 0, count); } count = in.read(buffer, 0, BUFFER_SIZE); } while (count != -1); addedFiles.addElement(vPath); } finally { // close the input stream before deleting the temp file. if (in != null) { in.close(); } if (tmpFile != null) { delete( tmpFile ); } } } /** * method for subclasses to override */ protected void initZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException { } /** * method for subclasses to override */ protected void finalizeZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException { zOut.finish(); } /** * (pulled from the ant Delete task) * Attempt to fix possible race condition when deleting * files on WinXP. If the delete does not work, * wait a little and try again. */ private static boolean delete(File f) { if (!f.delete()) { try { Thread.sleep( DELETE_RETRY_SLEEP_MILLIS ); } catch (InterruptedException ex) { // ignore } return f.delete(); } return true; } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000755000175000017500000000000011271425773034166 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/overview-frame.xsllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000001604310026077766034176 0ustar drazzibdrazzib Overview (<xsl:value-of select="$title" />)
    2 Overview
    All Classes

    Packages

    (%)
    Overview (<xsl:value-of select="$title" />)
    2 Package Overview

    Classes

    (%)
    bpassall bpass bfailall bfail
    ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/source-frame-html.xsllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000007471110071613422034165 0ustar drazzibdrazzib
    No coverage numbers exist for this project

    No coverage numbers exist for this package

    No coverage numbers exist for class

    No source available

    Method Source Line Details
    Method Index Details
    NotCoveredLine (); (); CoveredLine SourceLineNC SourceLineC (); TOTAL Covered Total % Covered Units Covered Total Units % Covered
    bpassall bpass bfailall bfail
    PerfectGoodWarnFail CovRowOdd CovRowEven <xsl:value-of select="$fulltitle" /> ========= START OF TOP NAVBAR ======= spacer
    ========= END OF TOP NAVBAR =========
    &nbsp;
    ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/index.xsllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000000347407777607731034214 0ustar drazzibdrazzib <xsl:value-of select="$title" /> <h2> Frame Alert</h2> <p /> This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. <br /> Link to <a HREF="overview-summary.html">Non-frame version.</a> ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/report-html.xsllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000002272007760223216034167 0ustar drazzibdrazzib This file was auto-generated. Code Coverage Report - <xsl:value-of select="@measure" />

    Coverage Report for

    All units are in .

    Totals

    All Packages


    Classes By Package


    Methods By Class


    Method Details

    Package

    Class

    Class

    Method

    Units Not Covered
    Index Details
    All units were covered
    Covered Total % Covered Weighted % # PerfectGoodWarnFail
    ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/allclasses-frame.xsllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000001113410023746524034162 0ustar drazzibdrazzib All Classes (<xsl:value-of select="$title" />) All Classes
    (%)
    bpassall bpass bfailall bfail
    ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/remove-empty-classes.xsllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000000211007760223216034156 0ustar drazzibdrazzib ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/stylesheet.csslibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000001444110040164707034162 0ustar drazzibdrazzib/* Code Coverage style sheet - based off of the Javadoc style sheet * * @version $Date: 2004/04/17 08:24:39 $ * @author Matt Albrecht (mailto:groboclown@users.sourceforge.net) */ /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Headings */ h1 { font-size: 145% } /* Table colors */ .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ .TableRowColor { background: #FFFFFF } /* White */ .TableSpacer { background: #FFFFFF; /* White */ font-size: 9px; } /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#EEEEFF; } /* Light mauve */ .NavBarBlockLink { background-color:#EEEEFF; color:#000000; font-family: Arial, Helvetica, sans-serif; } .NavBarBlockLinkRev { background-color:#000080; color:#FFFFFF; font-family: Arial, Helvetica, sans-serif; } .NavBarTitle { background-color:#EEEEFF; font-weight: bold; } .NavBarTStamp { font-size: 9px; font-weight: normal; padding-left: 1px; } .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; font-size: 8px; } .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; } .CoverHeaderRow { } .CoverHeader { font-family: Arial, Helvetica, sans-serif; font-size: 9px; background: #FFFFFF; /* white */ padding-left: 4px; padding-right: 4px; } .CoverHeadDesc { font-family: Arial, Helvetica, sans-serif; font-size: 10px; background: #CCCCCC; /* grey */ padding-left: 4px; padding-right: 4px; } .Perfect { background: #99FF99; /* green */ font-weight: bold; color: black; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 10px; } .Good { background: #CCCCFF; /* blue */ font-weight: bold; color: black; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 10px; } .Warn { background: #FFCC66; /* orange */ font-weight: bold; color: black; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 10px; } .Fail { background: #FF9999; /* red */ font-weight: bold; color: black; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 10px; } .CoverageTitle { text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 10px; } .CovRowEven { background: #DDDDDD; /* grey */ } .CovRowOdd { background: #FFFFFF; /* white */ } .SourceTable { font-size: 10px; border-left: #202020 1px solid; border-right: #d0d0d0 1px solid; border-bottom: #202020 1px solid; border-top: #202020 1px solid; } .SourceRow { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .SourceLineNo { text-align: right; background: #E0E0E0; color: black; padding-right: 2px; vertical-align: bottom; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .NotCoveredLine { text-align: center; background: #FF3030; color: white; vertical-align: bottom; padding-left: 2px; padding-right: 2px; /*border-left:#202020 1px solid; border-right:#d0d0d0 1px solid;*/ margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .CoveredLine { background: #E0E0E0; vertical-align: bottom; /*border-left: #202020 1px solid; border-right: #d0d0d0 1px solid;*/ padding-left: 2px; padding-right: 2px; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .SourceLineC { width: 100%; vertical-align: bottom; background: #FFFFFF; color: black; font-family: Courier, fixed; white-space: pre; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .SourceLineNC { width: 100%; vertical-align: bottom; background: #FFFFE0; color: black; font-family: Courier, fixed; white-space: pre; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .SLP { background: #FFFFFF; color: black; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } .S { padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 0px; } /* The % coverage bar graph */ .bcell { padding: 0px 0px 0px 0px; width: 100%; height: 10px; background: #FFFFFF; } .bar { vertical-align: top; width: 100%; height: 10px; } .bpassall { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 2px; border-right: 1px solid; border-left: 1px solid; border-top: 1px solid; border-bottom: 1px solid; background: #99FF99; /* green */ } .bfailall { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 2px; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; border-bottom: 1px solid; background: #FF9999; /* red */ } .bpass { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 2px; border-right: 0px; border-left: 1px solid; border-top: 1px solid; border-bottom: 1px solid; background: #99FF99; /* green */ } .bfail { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 2px; border-left: 0px; border-right: 1px solid; border-top: 1px solid; border-bottom: 1px solid; background: #FF9999; /* red */ } .bimg { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; height: 8px; }././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xsl/1x1.pnglibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/xs0000644000175000017500000000010410017220734034146 0ustar drazzibdrazzib‰PNG  IHDRĉ IDATxc`N ¨fIEND®B`‚././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/FailOnReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Fa0000644000175000017500000004423110037421051034050 0ustar drazzibdrazzib/* * @(#)FailOnReportStyle.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.text.NumberFormat; import java.util.Enumeration; import java.util.StringTokenizer; import java.util.Vector; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** * Checks the coverage report for a subset of classes whose total * coverage percentage isn't up-to-snuff. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since March 15, 2003 */ public class FailOnReportStyle implements IReportStyle { private Vector includeExcludeSet = new Vector(); private String failureProperty = null; private double minPercent = 80.0; private int markCount = 0; private int coverCount = 0; private static final NumberFormat DOUBLE_FORMATTER = NumberFormat.getInstance(); static { DOUBLE_FORMATTER.setMaximumFractionDigits( 2 ); } public static class IncludeAndExclude { String value = null; boolean module = false; boolean corp = false; boolean isInclude = true; public void setModule( String s ) { this.module = true; this.value = s; } public void setClass( String f ) { this.corp = true; this.value = f; } protected void check() throws BuildException { if (this.module && this.corp) { throw new BuildException( "Only one of 'module' and 'class' attributes can be "+ "specified in an "+this.getType()+" element." ); } if (!this.module && !this.corp) { throw new BuildException( "One of 'module' or 'class' attributes must be "+ "specified in an "+this.getType()+" element." ); } } protected String getType() { return (this.isInclude ? "include" : "exclude"); } } static class ClassFilter { IFilterToken parts[]; public ClassFilter( String filter ) throws BuildException { if (filter == null || filter.length() <= 0 || filter.charAt(0) == '.' || filter.indexOf( ".." ) >= 0 || filter.indexOf( "//" ) >= 0 || filter.indexOf( "/." ) >= 0 || filter.indexOf( "./" ) >= 0 || filter.charAt(filter.length()-1) == '.' || filter.charAt(filter.length()-1) == '/') { throw new BuildException( "Invalid class filter '"+filter+"'" ); } if (filter.charAt(0) == '/') { if (filter.length() <= 1) { throw new BuildException( "Invalid class filter '"+filter+"'" ); } filter = filter.substring( 1 ); } StringTokenizer st = new StringTokenizer( filter, "./", false ); Vector v = new Vector(); while (st.hasMoreTokens()) { String s = st.nextToken(); if (s.length() <= 0) { throw new BuildException( "Invalid class filter: no values between delimiters." ); } int len = s.length(); if (s.charAt(0) == '*') { if (len == 1) { v.addElement( ANY_TOKEN ); } else //if (s.equals( "**" )) if (len == 2 && s.charAt(1) == '*') { v.addElement( NULL_TOKEN ); } else { s = s.substring( 1 ); if (s.indexOf( '*' ) >= 0) { throw new BuildException( "Invalid class filter: only 1 wildcard may "+ "be present between delimiters." ); } v.addElement( new BeforeFilterToken( s ) ); } } else if (s.charAt( len - 1) == '*') { s = s.substring( 0, len - 1 ); if (s.indexOf( '*' ) >= 0) { throw new BuildException( "Invalid class filter: only 1 wildcard may "+ "be present between delimiters." ); } v.addElement( new EndFilterToken( s ) ); } else { if (s.indexOf( '*' ) > 0) { throw new BuildException( "Invalid class filter: a wildcard may "+ "only be present before and after a text part." ); } v.addElement( new ExactFilterToken( s ) ); } } if (v.size() <= 0) { throw new BuildException( "Invalid class filter: no delimited elements" ); } parts = new IFilterToken[ v.size() ]; v.copyInto( parts ); } public boolean match( String c ) { if (c == null || c.length() <= 0) { throw new IllegalArgumentException( "no null args." ); } StringTokenizer st = new StringTokenizer( c, ".", false ); int filterPos = 0; while (st.hasMoreTokens()) { if (filterPos >= this.parts.length) { return false; } String s = st.nextToken(); // special handling for the '**' filter if (this.parts[filterPos] == NULL_TOKEN) { // if the rest of the filters are '**', early out if (filterPos == this.parts.length - 1) { return true; } // this kind of pattern matching isn't greedy. if (this.parts[filterPos+1].match( s )) { // we can advance to the filter after the // one just matched filterPos += 2; } // else the next filterPos doesn't match this token, // so keep this token for the next match } else { // check if the next filter doesn't match, so we can // early out. if (!this.parts[filterPos++].match( s )) { return false; } } } // no more tokens, but are there more filters? if so, then // the token didn't match everything return (filterPos >= this.parts.length); } } // uses an anti-pattern: use a "null" token to be used for the "**" // filter. static interface IFilterToken { public boolean match( String part ); } private static class BeforeFilterToken implements IFilterToken { private String m; public BeforeFilterToken( String s ) { this.m = s; } public boolean match( String part ) { return part.endsWith( this.m ); } } private static class EndFilterToken implements IFilterToken { private String m; public EndFilterToken( String s ) { this.m = s; } public boolean match( String part ) { return part.startsWith( this.m ); } } private static class ExactFilterToken implements IFilterToken { private String m; public ExactFilterToken( String s ) { this.m = s; } public boolean match( String part ) { return part.equals( this.m ); } } private static class AnyFilterToken implements IFilterToken { public boolean match( String part ) { return true; } } private static final IFilterToken ANY_TOKEN = new AnyFilterToken(); private static final IFilterToken NULL_TOKEN = new AnyFilterToken(); public void setPercentage( double v ) { this.minPercent = v; } public void setProperty( String p ) { this.failureProperty = p; } public void addInclude( IncludeAndExclude iae ) { if (iae != null) { iae.isInclude = true; this.includeExcludeSet.addElement( iae ); } } public void addExclude( IncludeAndExclude iae ) { if (iae != null) { iae.isInclude = false; this.includeExcludeSet.addElement( iae ); } } /** * Called when the task is finished generating all the reports. This * may be useful for styles that join all the reports together. */ public void reportComplete( Project project, Vector errorList ) throws BuildException { double actual = getActualPercentage(); project.log( "Testing for minimal coverage of "+ DOUBLE_FORMATTER.format( this.minPercent )+ ", and found an actual coverage of "+ DOUBLE_FORMATTER.format( actual ), Project.MSG_VERBOSE ); if (actual < this.minPercent) { // post an error if (this.failureProperty != null) { project.setNewProperty( this.failureProperty, Double.toString( actual ) ); } errorList.addElement( "Did not have sufficient coverage: requires "+ DOUBLE_FORMATTER.format( this.minPercent ) + ", but found " + DOUBLE_FORMATTER.format( actual ) + "." ); } } public void generateReport( Project project, Document doc, String moduleName ) throws BuildException { Vector inClass = new Vector(); Vector exClass = new Vector(); Vector inMod = new Vector(); Vector exMod = new Vector(); setupFilters( inClass, exClass, inMod, exMod ); if (!"all".equalsIgnoreCase( moduleName ) && !matchModule( moduleName, inMod, exMod )) { return; } NodeList ccList = doc.getElementsByTagName( "classcoverage" ); for (int ccIndex = 0; ccIndex < ccList.getLength(); ++ccIndex) { Element ccEl = (Element)ccList.item( ccIndex ); NodeList coverList = ccEl.getElementsByTagName( "cover" ); for (int coverIndex = 0; coverIndex < coverList.getLength(); ++coverIndex) { Element coverEl = (Element)coverList.item( coverIndex ); NodeList modList = coverEl.getElementsByTagName( "modulecover" ); if (modList != null && modList.getLength() > 0) { for (int modIndex = 0; modIndex < modList.getLength(); ++modIndex) { Element modEl = (Element)modList.item( modIndex ); if (matchModule( modEl.getAttribute( "measure" ), inMod, exMod )) { cover( project, modEl ); } } } else { cover( project, coverEl ); } } } /* */ } protected void cover( Project project, Element el ) { String coveredS = el.getAttribute( "covered" ); String markedS = el.getAttribute( "total" ); try { int cov = Integer.parseInt( coveredS ); int mar = Integer.parseInt( markedS ); // if any of the values were invalid, then this shouldn't be reached if (cov > 0 && mar > 0) { this.coverCount += cov; this.markCount += mar; } } catch (NumberFormatException e) { project.log( "Invalid covered attribute: expected a number.", Project.MSG_VERBOSE ); } } protected double getActualPercentage() { if (this.markCount == 0) { return 100.0; } // else return ((double)this.coverCount * 100.0) / (double)this.markCount; } protected boolean matchModule( String moduleName, Vector inMod, Vector exMod ) { // it must pass all inMod and fail all exMod if (!matchModuleInSet( moduleName, inMod )) { return false; } if (matchModuleInSet( moduleName, exMod )) { return false; } return true; } protected boolean matchModuleInSet( String moduleName, Vector set ) { Enumeration e = set.elements(); while (e.hasMoreElements()) { String m = (String)e.nextElement(); if ("*".equals(m) || moduleName.equalsIgnoreCase( m )) { return true; } } return false; } protected boolean matchClass( String className, Vector inClass, Vector exClass ) { if (!matchClassInSet( className, inClass )) { return false; } if (matchClassInSet( className, exClass )) { return false; } return true; } protected boolean matchClassInSet( String className, Vector set ) { Enumeration e = set.elements(); while (e.hasMoreElements()) { ClassFilter cf = (ClassFilter)e.nextElement(); if (cf.match( className )) { return true; } } return false; } protected void setupFilters( Vector includeClass, Vector excludeClass, Vector includeModule, Vector excludeModule ) throws BuildException { Enumeration e = this.includeExcludeSet.elements(); while (e.hasMoreElements()) { IncludeAndExclude iae = (IncludeAndExclude)e.nextElement(); iae.check(); if (iae.module) { if (iae.isInclude) { includeModule.addElement( iae.value ); } else { excludeModule.addElement( iae.value ); } } else // if (iae.corp) { if (iae.isInclude) { includeClass.addElement( new ClassFilter( iae.value ) ); } else { excludeClass.addElement( new ClassFilter( iae.value ) ); } } } // by default, if no includes are specified, then there's an implicit // include ** if (includeModule.size() <= 0) { includeModule.addElement( "*" ); } if (includeClass.size() <= 0) { includeClass.addElement( new ClassFilter( "**" ) ); } } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/XmlReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Xm0000644000175000017500000000720210037421051034103 0ustar drazzibdrazzib/* * @(#)XmlReportStyle.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import net.sourceforge.groboutils.codecoverage.v2.report.OutputXml; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; /** * Generates the XML file for the report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since March 15, 2003 */ public class XmlReportStyle implements IReportStyle { private File outdir; private String prefix = "CoverageReport-"; private String suffix = ".xml"; public void setPrefix( String p ) { if (p == null) { p = ""; } this.prefix = p; } public void setSuffix( String s ) { if (s == null) { s = ""; } this.suffix = s; } public void setDestDir( File dir ) { this.outdir = dir; } /** * Called when the task is finished generating all the reports. This * may be useful for styles that join all the reports together. */ public void reportComplete( Project project, java.util.Vector errorList ) throws BuildException, IOException { // do nothing } public void generateReport( Project project, Document doc, String moduleName ) throws BuildException, IOException { if (this.outdir == null) { throw new BuildException( "Must set the 'destdir' attribute." ); } project.log( "Generating XML report for module "+moduleName, Project.MSG_VERBOSE ); File outFile = new File( this.outdir, this.prefix + moduleName + this.suffix ); File parent = outFile.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } OutputStreamWriter osw = null; try { osw = new OutputStreamWriter( new FileOutputStream( outFile ), "UTF8" ); (new OutputXml()).write( doc.getDocumentElement(), osw, null ); } finally { if (osw != null) { osw.close(); } } } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/CoveragePostCompilerTask.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Co0000644000175000017500000003341110040136465034067 0ustar drazzibdrazzib/* * @(#)CoveragePostCompilerTask.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.compiler.AlreadyPostCompiledException; import net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter; import net.sourceforge.groboutils.util.io.v1.ReadByteStream; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.util.FileUtils; /** * Ant task the compiles the class files into coverage files. Now, also * generates the properties file for you. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 18, 2002 * @deprecated Please use the GroboInstrumentTask instead of this one. */ public class CoveragePostCompilerTask extends Task { private static final FileUtils FILEUTILS = FileUtils.newFileUtils(); private static final String CLASSNAME_EXT = ".class"; private Vector filesets = new Vector(); private File datadir = null; private File outfiledir = null; private Vector analysisModules = new Vector(); private Configuration config = null; /** * Add a new fileset instance to this compilation. Whatever the fileset is, * only filename that are .class will be considered as * 'candidates'. Currently, jar files are not read; you'll have to * uncompress them to a directory before running this step. * * @param fs the new fileset containing the rules to get the testcases. */ public void addFileSet( FileSet fs ) { this.filesets.addElement(fs); } /** * Sets the directory in which all the data accumulated from the * post compilation step will be placed. This should be a directory * dedicated just to the output data. */ public void setDataDir( File f ) { this.datadir = f; } /** * Sets the directory in which all the recompiled class files will be * placed. This directory should never be confused with the original * class file location. */ public void setOutClassDir( File f ) { this.outfiledir = f; } /** * Creates a new analysis module. */ public AnalysisModuleType createAnalysisModule() { AnalysisModuleType amt = new AnalysisModuleType(); this.analysisModules.addElement( amt ); return amt; } /** * Create the property file settings. */ public Configuration createLogSettings() throws BuildException { if (this.config != null) { throw new BuildException( "Only one logsetting tag can be in this target." ); } this.config = new Configuration(); return this.config; } /** * Perform the task */ public void execute() throws BuildException { log( "Use of the CoveragePostCompiler task is deprecated; please "+ "use the 'grobo-instrument' task instead. You may need to "+ "change the taskdef to reference the new resource file, located "+ "at [ant-grobocoverage.properties], instead of "+ "[net/sourceforge/groboutils/codecoverage/grobocoverage.properties"+ "].", Project.MSG_WARN ); // pre-check if (this.datadir == null) { throw new BuildException( "Attribute 'datadir' was never set." ); } if (this.outfiledir == null) { throw new BuildException( "Attribute 'outfiledir' was never set." ); } // bug 906316: ensure the directories exist... if (!this.datadir.exists()) { this.datadir.mkdirs(); } if (!this.outfiledir.exists()) { this.outfiledir.mkdirs(); } ClassFile classFiles[] = getFilenames(); try { log( "Writing meta-data to directory '"+this.datadir+"'.", Project.MSG_VERBOSE ); DirMetaDataWriter dmdw = new DirMetaDataWriter( this.datadir ); try { PostCompileClass pcc = new PostCompileClass( dmdw, getAnalysisModules() ); for (int i = 0; i < classFiles.length; ++i) { File infile = classFiles[i].srcFile; String filename = classFiles[i].filename; // create the output class file, and ensure that // its directory structure exists before creating it File outfile = new File( this.outfiledir, filename ); log( "Recompiling class '"+infile+"' to file '"+ outfile+"'.", Project.MSG_VERBOSE ); File parent = outfile.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } // need some code handle the situation where the // outfile may be the same as the infile. This will // also allow us to correctly handle the situation of // an exception not properly creating the instrumented // class. See bug 929332. File tmpout = FILEUTILS.createTempFile( outfile.getName(), ".tmp", parent ); FileOutputStream fos = new FileOutputStream( tmpout ); try { pcc.postCompile( filename, readFile( infile ), fos ); fos.close(); fos = null; FILEUTILS.copyFile( tmpout, outfile ); } catch (AlreadyPostCompiledException apce) { // see bug 903837 log( "Ignoring '"+infile+"': it has already been "+ "post-compiled.", Project.MSG_INFO ); } finally { if (fos != null) { fos.close(); } if (tmpout.exists()) { tmpout.delete(); } } } } finally { dmdw.close(); } } catch (IOException ioe) { throw new BuildException( "I/O exception during execution.", ioe, getLocation() ); } // generate the property file if (this.config == null) { // use defaults if it wasn't set. this.config = new Configuration(); } try { this.config.generatePropertyFile( this.outfiledir, this.analysisModules.size() ); } catch (IOException ioe) { throw new BuildException( "I/O exception during execution.", ioe, getLocation() ); } } /** * */ private IAnalysisModule[] getAnalysisModules() throws BuildException { final Vector v = new Vector(); final Enumeration enum = this.analysisModules.elements(); while (enum.hasMoreElements()) { AnalysisModuleType amt = (AnalysisModuleType)enum.nextElement(); IAnalysisModule am = amt.getAnalysisModule(); v.addElement( am ); } final IAnalysisModule[] amL = new IAnalysisModule[ v.size() ]; v.copyInto( amL ); return amL; } /** * Iterate over all filesets and return the filename of all files * that end with .class (case insensitive). This is to avoid * trying to parse a non-class file. * * @return an array of filenames to parse. */ private ClassFile[] getFilenames() { Vector v = new Vector(); final int size = this.filesets.size(); for (int j = 0; j < size; j++) { FileSet fs = (FileSet)filesets.elementAt( j ); DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); File baseDir = ds.getBasedir(); ds.scan(); String[] f = ds.getIncludedFiles(); for (int k = 0; k < f.length; k++) { String pathname = f[k]; if (pathname.toLowerCase().endsWith( CLASSNAME_EXT )) { // this isn't right v.addElement( new ClassFile( baseDir, pathname ) ); } } } ClassFile[] files = new ClassFile[v.size()]; v.copyInto(files); return files; } private static final class ClassFile { public File srcFile; public String filename; public ClassFile( File baseDir, String filename ) { if (baseDir == null || filename == null) { throw new IllegalArgumentException("no null args."); } this.filename = filename; this.srcFile = new File( baseDir, filename ); } } public static final class Configuration { public String factory = "net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory"; public File logDir; public int cacheSize = -1; public void setFactory( String name ) { if (name.indexOf(".") < 0) { this.factory = "net.sourceforge.groboutils.codecoverage.v2.logger."+ name; } else { this.factory = name; } } public void setLogdir( File dirname ) { this.logDir = dirname; } public void setCacheSize( int size ) { this.cacheSize = size; } public void generatePropertyFile( File outfiledir, int moduleCount ) throws IOException { Properties props = new Properties(); if (this.factory != null) { props.setProperty( "factory", this.factory ); } if (this.logDir != null) { props.setProperty( "logger.dir", this.logDir.getAbsolutePath() ); } if (this.cacheSize > 0) { props.setProperty( "logger.cache-size", Integer.toString( this.cacheSize ) ); } props.setProperty( "channel-count", Integer.toString( moduleCount ) ); FileOutputStream fos = new FileOutputStream( new File( outfiledir, "grobocoverage.properties" ) ); try { props.store( fos, "CodeCoverage setup file" ); } finally { fos.close(); } } } /** * */ private byte[] readFile( File file ) throws IOException { FileInputStream fis = new FileInputStream( file ); try { byte[] outfile = ReadByteStream.readByteStream( fis ); return outfile; } finally { fis.close(); } } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/GroboReportTask.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Gr0000644000175000017500000004141510072742275034110 0ustar drazzibdrazzib/* * @(#)GroboReportTask.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import java.util.Enumeration; import java.util.Vector; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData; import net.sourceforge.groboutils.codecoverage.v2.report.IReportGenerator; import net.sourceforge.groboutils.codecoverage.v2.report.XmlCombinedReportGenerator; import net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator; import net.sourceforge.groboutils.codecoverage.v2.util.ILogFilter; import net.sourceforge.groboutils.codecoverage.v2.util.SingleLogFilter; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.EnumeratedAttribute; import org.w3c.dom.Document; import org.w3c.dom.Element; /** * A variation of the CoveragePostCompilerTask. This one is intended to * simplify the Ant build files. See * * feature request 901588 for details. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:09 $ * @since March 13, 2004 */ public class GroboReportTask extends Task { private File baselogdir; private File logdir; private File datadir; private Vector singleStyles = new Vector(); private Vector comboStyles = new Vector(); private boolean failOnError = true; private LogFilter filter = null; public static final class FilterTypeAttribute extends EnumeratedAttribute { private String[] types = { "single", "none" }; public String[] getValues() { return this.types; } } public static class LogFilter { private String type = "none"; public void setType( FilterTypeAttribute fta ) { this.type = fta.getValue(); } public ILogFilter getFilter() { if ("single".equalsIgnoreCase( this.type )) { return new SingleLogFilter(); } // else return null; } } /** * Set the directory which contains the log and data directories. */ public void setLogDir( File dir ) { this.baselogdir = dir; } /** * Add a filter to convert the Logger's output format to the standard * format. If no filter is given, then we assume that the logs are * already in the standard format. */ public void addLogFilter( LogFilter lf ) { this.filter = lf; } /** * */ public void addXml( XmlReportStyle xrs ) { // creates an XML report for both the single and combo files. _addSingle( xrs ); _addCombo( xrs ); } /** * */ public void addXsl( SimpleXslReportStyle sxrs ) { _addSingle( sxrs ); } /** * */ public void addSourceXsl( SourceXslReportStyle sxrs ) { _addCombo( sxrs ); } /** * */ public void addSimpleHtml( SimpleHtmlReportStyle shrs ) { _addSingle( shrs ); } /** * */ public void addSimple( SimpleHtmlReportStyle shrs ) { _addSingle( shrs ); } /** * */ public void addSourceHtml( SourceHtmlReportStyle shrs ) { _addCombo( shrs ); } /** * */ public void addSource( SourceHtmlReportStyle shrs ) { _addCombo( shrs ); } /** * */ public void addFailOn( FailOnReportStyle fors ) { _addCombo( fors ); } public void setFailOnError( boolean f ) { this.failOnError = f; } public void execute() throws BuildException { try { setupDirectories(); } catch (IOException ioe) { throw new BuildException( "Error setting up the directories.", ioe ); } IMetaDataReader mdr = createMetaDataReader(); IReportGenerator rg = new XmlReportGenerator(); boolean errors = false; Vector reports = new Vector(); Vector errorList = new Vector(); try { AnalysisModuleSet ams = mdr.getAnalysisModuleSet(); IAnalysisModule amL[] = ams.getAnalysisModules(); for (int i = 0; i < amL.length; ++i) { try { IChannelLogReader clr = createChannelLogReader( amL[i], ams ); AnalysisModuleData amd = new AnalysisModuleData( amL[i], mdr, clr ); Element rootEl = createReport( amL[i], amd, rg ); if (rootEl == null) { log( "Creating the report returned null", Project.MSG_WARN ); errors = true; } else { Document doc = rootEl.getOwnerDocument(); reports.addElement( doc ); processSingleStyles( doc, amL[i].getMeasureName() ); } } catch (IllegalArgumentException iae) { iae.printStackTrace(); log( iae.getMessage(), Project.MSG_WARN ); errors = true; } } finishSingleStyles( errorList ); } catch (IOException e) { throw new BuildException( "I/O Exception while creating a report.", e, getLocation() ); } finally { try { mdr.close(); } catch (IOException e) { throw new BuildException( "I/O Exception while closing meta-data reader.", e, getLocation() ); } } rg = null; mdr = null; try { processCombos( reports, errorList ); } catch (IOException e) { throw new BuildException( "I/O Exception while creating a report.", e, getLocation() ); } if (errors && this.failOnError) { throw new BuildException( "No coverage logs were generated, or the logs "+ "are not located under '"+this.logdir+"'.", getLocation() ); } if (errorList.size() > 0) { StringBuffer sb = new StringBuffer(); Enumeration e = errorList.elements(); while (e.hasMoreElements()) { sb.append( "; " ).append( (String)e.nextElement() ); } if (this.failOnError) { throw new BuildException( "Error conditions caused failure" + sb.toString() ); } else { log( "Warning: " + sb.toString(), Project.MSG_WARN ); } } } private void processCombos( Vector reports, Vector errorList ) throws BuildException, IOException { // only process the combos (and thus create the uber XML file) // if needed. if (this.comboStyles.size() > 0) { // Create the uber document Document docs[] = new Document[ reports.size() ]; reports.copyInto( docs ); // a memory conservation item. This means this can only be // the last method to run with the reports from execute() reports.removeAllElements(); XmlCombinedReportGenerator gen = new XmlCombinedReportGenerator(); log( "Creating combined coverage report", Project.MSG_INFO ); Element ret = null; try { ret = gen.createReport( docs ); } catch (IllegalArgumentException iae) { // throw new BuildException( iae ); // this is a hack: really, the underlying code should be made // more robust. iae.printStackTrace(); log( iae.getMessage(), Project.MSG_WARN ); ret = null; } docs = null; if (ret != null) { processComboStyles( ret.getOwnerDocument() ); finishComboStyles( errorList ); } } } private void processSingleStyles( Document doc, String moduleName ) throws BuildException, IOException { processStyles( doc, moduleName, this.singleStyles.elements() ); } private void finishSingleStyles( Vector errorList ) throws BuildException, IOException { finishStyles( this.singleStyles.elements(), errorList ); } private void processComboStyles( Document doc ) throws BuildException, IOException { processStyles( doc, "all", this.comboStyles.elements() ); } private void finishComboStyles( Vector errorList ) throws BuildException, IOException { finishStyles( this.comboStyles.elements(), errorList ); } private void processStyles( Document doc, String moduleName, Enumeration styles ) throws BuildException, IOException { while (styles.hasMoreElements()) { IReportStyle rs = (IReportStyle)styles.nextElement(); rs.generateReport( getProject(), doc, moduleName ); } } private void finishStyles( Enumeration styles, Vector errors ) throws BuildException, IOException { while (styles.hasMoreElements()) { IReportStyle rs = (IReportStyle)styles.nextElement(); rs.reportComplete( getProject(), errors ); } } /** * Even though these are public, they take an interface, and so can't * be called through the Ant script. */ public void _addSingle( IReportStyle rs ) { if (rs != null) { this.singleStyles.addElement( rs ); } } /** * Even though these are public, they take an interface, and so can't * be called through the Ant script. */ public void _addCombo( IReportStyle rs ) { if (rs != null) { this.comboStyles.addElement( rs ); } } private Element createReport( IAnalysisModule am, AnalysisModuleData amd, IReportGenerator rg ) throws IOException, BuildException { log( "Creating coverage report for module "+am.getMeasureName(), Project.MSG_INFO ); Element ret = null; try { ret = rg.createReport( am, amd ); } catch (IllegalArgumentException iae) { // throw new BuildException( iae ); // this is a hack: really, the underlying code should be made // more robust. iae.printStackTrace(); log( iae.getMessage(), Project.MSG_WARN ); ret = null; } return ret; } private IChannelLogReader createChannelLogReader( IAnalysisModule am, AnalysisModuleSet ams ) throws IOException { short mi = ams.getAnalysisModuleIndex( am ); IChannelLogReader clr = new DirectoryChannelLogReader( this.logdir, mi ); return clr; } private IMetaDataReader createMetaDataReader() throws BuildException { try { return new DirMetaDataReader( this.datadir ); } catch (IOException e) { throw new BuildException( "I/O error creating meta-data reader.", e, getLocation() ); } } /** * setup the directories in the logdir - ensure we have adequate * setup protections. This saves some head banging in figuring out * why bad exceptions are thrown from the Ant script. */ private void setupDirectories() throws IOException, BuildException { // check specifications if (this.baselogdir == null) { throw new BuildException( "Did not specify attribute 'datadir'." ); } if (this.datadir == null) { this.datadir = new File( this.baselogdir, "data" ); } if (this.logdir == null) { this.logdir = new File( this.baselogdir, "logs" ); } if (!this.datadir.exists() || !this.datadir.isDirectory()) { throw new BuildException("Data directory setting ("+ this.datadir+") does not exist or is not a directory."); } if (!this.logdir.exists()) { this.logdir.mkdirs(); } if (!this.logdir.isDirectory()) { throw new BuildException("Log directory setting ("+ this.logdir+") is not a directory."); } String modules[] = this.datadir.list(); if (modules == null || modules.length <= 0) { throw new BuildException("There are no module data directories in "+ this.datadir+"."); } String indicies[] = this.logdir.list(); if (indicies == null) { indicies = new String[0]; } int count = modules.length; for (int i = 0; i <= count; ++i) { String dirname = Integer.toString(i); boolean found = false; for (int j = 0; j < indicies.length; ++j) { if (indicies[j].equals( dirname )) { found = true; break; } } if (!found) { File f = new File( this.logdir, dirname ); f.mkdirs(); } } if (this.filter != null) { ILogFilter lf = this.filter.getFilter(); if (lf != null) { lf.process( count, this.logdir ); } } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/SimpleHtmlReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Si0000644000175000017500000000437110037421051034076 0ustar drazzibdrazzib/* * @(#)SimpleHtmlReportStyle.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import org.apache.tools.ant.BuildException; /** * Describes a report style, used to generate readable reports from the * XML output. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since November 22, 2003 */ public class SimpleHtmlReportStyle extends SimpleXslReportStyle { public SimpleHtmlReportStyle() { try { super.setStyleURL( getStylesheetSystemIdForClass( "report-html.xsl" ) ); } catch (IOException e) { throw new BuildException( e ); } } public void setStyle( File f ) { throw new BuildException( "Attribute 'style' not supported" ); } public void setStyleURL( String url ) { throw new BuildException( "Attribute 'styleurl' not supported" ); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/SimpleXslReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/Si0000644000175000017500000001740510037421051034100 0ustar drazzibdrazzib/* * @(#)SimpleXslReportStyle.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import java.net.URL; import java.util.Enumeration; import java.util.Vector; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; /** * Describes a report style, used to generate readable reports from the * XML output. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since March 15, 2004 */ public class SimpleXslReportStyle implements IReportStyle { private File outdir; private boolean removeEmpties = false; private StyleTransformer styleRemove = null; private StyleTransformer styleHtml = null; private String prefix = "CoverageReport-"; private String suffix = ".html"; private File styleFile = null; private String styleUrl = null; private Vector params = new Vector(); public static final class ParamType { String name; String expr; String ifProp; String elseProp; public void setName( String n ) { this.name = n; } public void setExpression( String x ) { this.expr = x; } public void setIf( String i ) { this.ifProp = i; } public void setElse( String e ) { this.elseProp = e; } public void updateParameter( StyleTransformer st, Project p ) { if (this.ifProp != null && p.getProperty( this.ifProp ) == null) { p.log( "Ignoring parameter '"+this.name+"' because property '"+ this.ifProp+"' was not set.", Project.MSG_VERBOSE ); return; } if (this.elseProp != null && p.getProperty( this.elseProp ) != null) { p.log( "Ignoring parameter '"+this.name+"' because property '"+ this.elseProp+"' was set.", Project.MSG_VERBOSE ); return; } st.setParameter( this.name, this.expr ); } } public void setPrefix( String p ) { if (p == null) { p = ""; } this.prefix = p; } public void setSuffix( String s ) { if (s == null) { s = ""; } this.suffix = s; } public void setDestDir( File dir ) { this.outdir = dir; } public void setRemoveEmpty( boolean on ) { this.removeEmpties = on; } public void setStyle( File f ) { this.styleFile = f; } public void setStyleURL( String url ) { this.styleUrl = url; } public void addParam( ParamType pt ) { if (pt != null) { this.params.addElement( pt ); } } /** * Called when the task is finished generating all the reports. This * may be useful for styles that join all the reports together. */ public void reportComplete( Project project, Vector errors ) throws BuildException, IOException { // free up memory this.styleHtml = null; this.styleRemove = null; } public void generateReport( Project project, Document doc, String moduleName ) throws BuildException, IOException { project.log( "Generating XSL report for module "+moduleName, Project.MSG_VERBOSE ); if (this.removeEmpties) { project.log( "Removing empty methods and classes...", Project.MSG_DEBUG ); doc = getRemoveEmptiesStyle( project ).transform( doc ); } project.log( "Transforming...", Project.MSG_DEBUG ); this.outdir.mkdirs(); File outFile = new File( this.outdir, this.prefix + moduleName + this.suffix ); getHtmlStyle( project ).transform( doc, outFile ); } protected StyleTransformer getRemoveEmptiesStyle( Project project ) throws IOException { if (this.styleRemove == null && this.removeEmpties) { this.styleRemove = new StyleTransformer( project, getStylesheetSystemIdForClass( "remove-empty-classes.xsl" ), this.outdir ); } return this.styleRemove; } protected StyleTransformer getHtmlStyle( Project project ) throws IOException { if (this.styleHtml == null) { this.styleHtml = new StyleTransformer( project, getStylesheetSystemId(), this.outdir ); Enumeration e = this.params.elements(); while (e.hasMoreElements()) { ((ParamType)e.nextElement()).updateParameter( this.styleHtml, project ); } } return this.styleHtml; } /** * Get the systemid of the appropriate stylesheet based on its * name and styledir. If no styledir is defined it will load * it as a java resource in the xsl child package, otherwise it * will get it from the given directory. * * @throws IOException thrown if the requested stylesheet does * not exist. */ protected String getStylesheetSystemId() throws IOException { URL url = null; if (this.styleFile == null) { if (this.styleUrl == null) { throw new BuildException( "No URL or file defined for XSL style sheet." ); } url = new URL( this.styleUrl ); } else { if (!this.styleFile.exists()) { throw new java.io.FileNotFoundException( "Could not find file '" + this.styleFile + "'" ); } url = new URL( "file", "", styleFile.getAbsolutePath() ); } return url.toExternalForm(); } protected String getStylesheetSystemIdForClass( String xslname ) throws IOException { URL url = getClass().getResource( "xsl/" + xslname ); if (url == null) { throw new java.io.FileNotFoundException( "Could not find jar resource " + xslname); } return url.toExternalForm(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/SourceHtmlReportStyle.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/ant/So0000644000175000017500000001222110037421051034075 0ustar drazzibdrazzib/* * @(#)SourceHtmlReportStyle.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.w3c.dom.Document; /** * Describes a report style, used to generate readable reports from the * XML output. This is a combo report, which means that it only works * with the combined coverage file. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since November 22, 2003 */ public class SourceHtmlReportStyle extends SourceXslReportStyle { private File stylesheet = null; private String title = null; private String footerText = null; private String footerLink = null; private boolean hasSetup = false; public SourceHtmlReportStyle() { SourceXslReportStyle.StyleType st; st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/1x1.png" ); st.setDest( "/1x1.png" ); addFile( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/source-frame-html.xsl" ); st.setDest( ".html" ); addSourceStyle( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/source-frame-html.xsl" ); st.setDest( "/package-frame.html" ); addPackageStyle( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/overview-frame.xsl" ); st.setDest( "/package-classes.html" ); addPackageStyle( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/index.xsl" ); st.setDest( "/index.html" ); addRootStyle( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/overview-frame.xsl" ); st.setDest( "/overview-frame.html" ); addRootStyle( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/allclasses-frame.xsl" ); st.setDest( "/allclasses-frame.html" ); addRootStyle( st ); st = new SourceXslReportStyle.StyleType(); st.setUrl( "xsl/source-frame-html.xsl" ); st.setDest( "/overview-summary.html" ); addRootStyle( st ); } /** Well-defined XSL parameters */ public void setTitle( String title ) { this.title = title; } public void setFooterText( String t ) { this.footerText = t; } public void setFooterHref( String t ) { this.footerLink = t; } public void setStylesheet( File f ) { this.stylesheet = f; } public void generateReport( Project project, Document doc, String moduleName ) throws BuildException, IOException { if (!this.hasSetup) { SourceXslReportStyle.StyleType st = new SourceXslReportStyle.StyleType(); st.setDest( "stylesheet.css" ); if (this.stylesheet == null) { st.setUrl( "xsl/stylesheet.css" ); } else { st.setFile( this.stylesheet ); } addFile( st ); st = null; addMyParam( "title", this.title ); addMyParam( "footerText", this.footerText ); addMyParam( "footerLink", this.footerLink ); this.hasSetup = true; } super.generateReport( project, doc, moduleName ); } private void addMyParam( String name, String value ) { if (value != null) { SimpleXslReportStyle.ParamType pt = new SimpleXslReportStyle.ParamType(); pt.setName( name ); pt.setExpression( value ); addParam( pt ); } } }././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IAnalysisModule.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IAnaly0000644000175000017500000000527707622026355034142 0ustar drazzibdrazzib/* * @(#)IAnalysisModule.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; /** * Processes a method for coverage analysis. The analysis should mark * certain bytecode instructions with IAnalysisMetaData for * report generation. Each module generates data that is used for one * specific measure type, such as source line coverage, or branch coverage. * The coverage amount is based on the number of marks added verses the * number of marks (and which ones) encountered during a run. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 15, 2002 * @see IAnalysisMetaData */ public interface IAnalysisModule { /** * Returns the human-readable name of the measure. */ public String getMeasureName(); /** * Returns the unit name for this particular coverage measure. */ public String getMeasureUnit(); /** * Returns the text format used in meta-data formatted text. This should * be the mime encoding type, such as "text/plain" or "text/html". */ public String getMimeEncoding(); /** * Perform the analysis on the method. method should never * be null, so null checking isn't necessary; * NullPointerExceptions are an acceptable exception to be * thrown from this method. */ public void analyze( IMethodCode method ); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000755000175000017500000000000011271425773034232 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000002163510037421052034224 0ustar drazzibdrazzib/* * @(#)ClassRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil; /** * Contains data associated with a parsed class. Each class is associated * with a collection of analysis modules' marks. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ public class ClassRecord { private String className; private long classCRC; private String sourceFileName; private Map methodToIndex; private String[] methodSignatures; private AnalysisModuleSet amSet; private List marks[]; // each index is for the analysis module public ClassRecord( String className, long classCRC, String sourceFileName, String[] methSigs, AnalysisModuleSet ams ) { // we can have an empty set of methods. if (className == null || className.length() <= 0 || methSigs == null || ams == null || sourceFileName == null) { throw new IllegalArgumentException( "No null args." ); } this.className = className; this.classCRC = classCRC; this.sourceFileName = sourceFileName; int len = methSigs.length; if (len > Short.MAX_VALUE) { throw new IllegalStateException( "Too many methods. There is a maximum internal count of "+ Short.MAX_VALUE+"." ); } this.methodSignatures = new String[ len ]; this.methodToIndex = new HashMap(); for (int i = 0; i < len; ++i) { if (methSigs[i] == null) { throw new IllegalArgumentException( "No null args." ); } this.methodSignatures[i] = methSigs[i]; this.methodToIndex.put( methSigs[i], new Short( (short)i ) ); } // make a copy of the set, so it isn't changed underneath us. this.amSet = new AnalysisModuleSet( ams ); len = this.amSet.getAnalysisModuleCount(); this.marks = new List[ len ]; for (int i = 0; i < len; ++i) { this.marks[i] = new LinkedList(); } } /** * Gets the name of the corresponding class for this record. * * @return the class name. */ public String getClassName() { return this.className; } /** * Returns the cyclic redundancy check (CRC) for the class in this record. * * @return the class CRC. */ public long getClassCRC() { return this.classCRC; } /** * Returns the implementation-specific class signature for the class this * record refers to. It should be a String which is unique for this class, * even if multiple class files have the same class name (note that if the * class files are identical, it makes perfect sense to return identical * signatures). * * @return the unique signature for the class in this record. */ public String getClassSignature() { return ClassSignatureUtil.getInstance(). createClassSignature( getClassName(), getClassCRC() ); } /** * Returns the name of the Java source file. * * @return the source file name */ public String getSourceFileName() { return this.sourceFileName; } /** * Returns a copy of the internal analysis module set. * * @return a copy of the set of analysis modules. */ public AnalysisModuleSet getAnalysisModuleSet() { return new AnalysisModuleSet( this.amSet ); } /** * Returns a list of known method signatures for this class. * * @return all method signatures known for this class, in the correct * sorted order. */ public String[] getMethods() { int len = this.methodSignatures.length; String s[] = new String[ len ]; System.arraycopy( this.methodSignatures, 0, s, 0, len ); return s; } /** * Returns the index (as a short) for the given method signature. If the * signature is not registered, then -1 will be returned. * * @param methodSignature the signature to find the corresponding index * for in this class. * @return the index for methodSignature if it is in this method, * or -1 if it is not in the list. * @exception IllegalArgumentException if methodSignature is * null. */ public short getMethodIndex( String methodSignature ) { if (methodSignature == null) { throw new IllegalArgumentException( "No null args." ); } Short i = (Short)this.methodToIndex.get( methodSignature ); if (i == null) { return -1; } return i.shortValue(); } /** * Returns the total number of method signatures for this class. * * @return the method signature count. */ public int getMethodCount() { return this.methodSignatures.length; } /** * Returns the method signature at the given index. * * @param index the index of the method signature to find. * @return the method signature at index index. * @exception IllegalArgumentException if index is not within the * bounds of [0 .. getMethodCount()-1 ]. */ public String getMethodAt( short index ) { int iindex = (int)index; if (iindex < 0 || iindex >= this.methodSignatures.length) { throw new IllegalArgumentException( "Index out of bounds [0.."+ this.methodSignatures.length+")" ); } return this.methodSignatures[ iindex ]; } /** * Adds a mark record, and ensures that it is unique upon insertion. * * @param mr the new mark to add. Adding this mark will complete its * internal data structure. */ public void addMark( MarkRecord mr ) { if (mr == null) { throw new IllegalArgumentException( "No null args." ); } mr.processMark( this, getAnalysisModuleSet() ); int moduleIndex = (int)mr.getAnalysisModuleIndex(); Iterator iter = this.marks[ moduleIndex ].iterator(); boolean add = true; while (iter.hasNext()) { MarkRecord listRecord = (MarkRecord)iter.next(); if (listRecord.equals( mr )) { add = false; break; } } if (add) { this.marks[ moduleIndex ].add( mr ); } } public MarkRecord[] getMarksForAnalysisModule( String measureName ) { int moduleIndex = (int)this.amSet.getMeasureIndex( measureName ); if (moduleIndex < 0 || moduleIndex >= this.marks.length) { throw new IllegalArgumentException( "Unknown analysis module '"+measureName+ "' (index = "+moduleIndex+")" ); } List list = this.marks[ moduleIndex ]; MarkRecord mr[] = (MarkRecord[])list.toArray( new MarkRecord[ list.size() ] ); return mr; } public MarkRecord[] getMarksForAnalysisModule( IAnalysisModule am ) { return getMarksForAnalysisModule( am.getMeasureName() ); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000424510037421052034222 0ustar drazzibdrazzib/* * @(#)IMetaDataReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to read the meta-data in a repository. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ public interface IMetaDataReader { /** * Returns a mark meta-data reader for a specific class signature. */ public IClassMetaDataReader getClassReader( IAnalysisModule module ) throws IOException; /** * Returns the list of all known modules at the time of recording. */ public AnalysisModuleSet getAnalysisModuleSet() throws IOException; /** * Closes this reader to prevent further access. */ public void close() throws IOException; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000031007600160001034203 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.datastore Controls the meta-data access for post-compilation and report generation, and logging data. ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSetIO.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000716010037421052034221 0ustar drazzibdrazzib/* * @(#)AnalysisModuleSetIO.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to read and write an AnalysisModuleSet object. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ class AnalysisModuleSetIO { public AnalysisModuleSetIO() { // do nothing } public void writeAnalysisModuleSet( AnalysisModuleSet ams, Writer out ) throws IOException { AnalysisModuleIO amw = new AnalysisModuleIO(); StringBuffer sb = new StringBuffer(); int count = ams.getAnalysisModuleCount(); sb.append( count ).append( '{' ); for (short i = 0; i < count; ++i) { StringWriter sw = new StringWriter(); amw.writeAnalysisModule( ams.getAnalysisModuleAt( i ), sw ); String text = sw.toString(); sb.append( '[' ).append( i ).append( ';' ). append( text.length() ).append( ';' ).append( text ). append( ']' ); } sb.append( '}' ); out.write( sb.toString() ); } public AnalysisModuleSet readAnalysisModuleSet( Reader in ) throws IOException { AnalysisModuleIO amr = new AnalysisModuleIO(); int count = ReadUtil.toInt( ReadUtil.readTo( in, '{' ) ); AnalysisModuleSet ams = new AnalysisModuleSet(); for (int i = 0; i < count; ++i) { ReadUtil.readTo( in, '[' ); int index = ReadUtil.toInt( ReadUtil.readTo( in, ';' ) ); if (i != index) { throw new IOException( "Expected to find index "+i+ ", but found "+index+"." ); } int size = ReadUtil.toInt( ReadUtil.readTo( in, ';' ) ); StringReader sr = new StringReader( ReadUtil.readCount( in, size ) ); IAnalysisModule am = amr.readAnalysisModule( sr ); ams.addAnalysisModule( am ); ReadUtil.readTo( in, ']' ); } ReadUtil.readTo( in, '}' ); return ams; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/DirClassMetaDataReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000675110037421052034226 0ustar drazzibdrazzib/* * @(#)DirClassMetaDataReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to operate the repository for the meta-data. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 16, 2002 */ public class DirClassMetaDataReader implements IClassMetaDataReader { private DirMetaDataIO store; private IAnalysisModule am; private AnalysisModuleSet ams; DirClassMetaDataReader( IAnalysisModule module, DirMetaDataIO data ) throws IOException { if (data == null || module == null) { throw new IllegalArgumentException("no null args"); } this.store = data; this.am = module; this.ams = data.getAnalysisModuleSet(); } /** * Returns the class record for the class with this particular signature. */ public ClassRecord readClass( String classSignature ) throws IOException { if (classSignature == null) { throw new IllegalArgumentException("no null args"); } checkClose(); return this.store.getClassRecord( this.ams, this.am, classSignature ); } /** * Returns all classes known for this particular data set. */ public String[] getClassSignatures() throws IOException { checkClose(); return this.store.getClassSigsForAnalysisModule( this.am ); } /** * Closes this reader to prevent further access. */ public void close() throws IOException { checkClose(); // do not close the store!! this.store = null; } private void checkClose() throws IOException { if (this.store == null) { throw new IOException( "Reader has already been closed." ); } } protected void finalize() throws Throwable { super.finalize(); if (this.store != null) { throw new IllegalStateException("Did not close reader."); } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000001225007760652321034233 0ustar drazzibdrazzib/* * @(#)MarkRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; /** * Contains data associated with an analysis module's bytecode instruction * mark. It should be associated with a particular class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/11/25 13:10:41 $ * @since December 15, 2002 */ public class MarkRecord { private IAnalysisMetaData amd; private String analysisModule; private String methodSignature; private short markIndex; private short amIndex = -1; private short methIndex = -1; private int lineNo = -1; /** * @param data cannot be null. * @param am the analysis module that made this mark. * @param methSig the method signature where this mark was placed. * @param lineNumber the Java source line corresponding to this mark. */ public MarkRecord( IAnalysisMetaData data, String am, String methSig, short markId, int lineNumber ) { if (data == null || am == null || methSig == null) { throw new IllegalArgumentException( "No null args." ); } if (markId < 0) { throw new IllegalArgumentException( "Indicies cannot be less than 0."); } this.amd = data; this.analysisModule = am; this.methodSignature = methSig; this.markIndex = markId; this.lineNo = lineNumber; } /** * @see ClassRecord#addMark( MarkRecord ) */ void processMark( ClassRecord cr, AnalysisModuleSet ams ) { if (cr == null) { throw new IllegalArgumentException( "No null args." ); } if (ams == null) { ams = cr.getAnalysisModuleSet(); } this.amIndex = ams.getMeasureIndex( getAnalysisModule() ); this.methIndex = cr.getMethodIndex( getMethodSignature() ); } public boolean equals( Object o ) { if (o == null || !(o instanceof MarkRecord)) { return false; } if (this == o) { return true; } // line number doesn't add into the equals. MarkRecord mr = (MarkRecord)o; if (mr.analysisModule.equals( this.analysisModule ) && mr.methodSignature.equals( this.methodSignature ) && mr.markIndex == this.markIndex) { // the amd object doesn't have to match. return true; } // else return false; } public int hashCode() { return (int)this.markIndex + this.analysisModule.hashCode() + this.methodSignature.hashCode(); } public IAnalysisMetaData getAnalysisMetaData() { return this.amd; } public String getAnalysisModule() { return this.analysisModule; } public short getAnalysisModuleIndex() { if (this.amIndex < 0) { throw new IllegalStateException( "Never processed or unknown module '"+this.analysisModule+ "'." ); } return this.amIndex; } public String getMethodSignature() { return this.methodSignature; } public short getMethodIndex() { if (this.methIndex < 0) { throw new IllegalStateException( "Never processed or unknown method '"+this.methodSignature+ "'." ); } return this.methIndex; } public short getMarkIndex() { return this.markIndex; } public int getLineNumber() { return this.lineNo; } public String toString() { return "Mark Record: "+getMethodSignature()+", mark "+getMarkIndex(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleIO.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000775610037421052034234 0ustar drazzibdrazzib/* * @(#)AnalysisModuleIO.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.Reader; import java.io.Writer; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; /** * Knows how to read and write an AnalysisModule object. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ class AnalysisModuleIO { public AnalysisModuleIO() { // do nothing } static class StaleAnalysisModule implements IAnalysisModule { private String name; private String unit; private String mime; public StaleAnalysisModule( String n, String u, String m ) { this.name = n; this.unit = u; this.mime = m; } public String getMeasureName() { return this.name; } public String getMeasureUnit() { return this.unit; } public String getMimeEncoding() { return this.mime; } public void analyze( IMethodCode method ) { throw new IllegalStateException( "this is a stale module for measure '"+this.name+"'" ); } } public void writeAnalysisModule( IAnalysisModule ams, Writer out ) throws IOException { StringBuffer sb = new StringBuffer(); sb.append( ams.getMeasureName().length() ). append( ':' ). append( ams.getMeasureName() ). append( ',' ). append( ams.getMeasureUnit().length() ). append( ':' ). append( ams.getMeasureUnit() ). append( ',' ). append( ams.getMimeEncoding().length() ). append( ':' ). append( ams.getMimeEncoding() ); out.write( sb.toString() ); } /** * Does not read in the actual module, but a datastore that * resembles the original. */ public IAnalysisModule readAnalysisModule( Reader in ) throws IOException { int count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String measureName = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String measureUnit = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String mimeEncoding = ReadUtil.readCount( in, count ); return new StaleAnalysisModule( measureName, measureUnit, mimeEncoding ); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisMetaDataIO.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000721010037421051034214 0ustar drazzibdrazzib/* * @(#)AnalysisMetaDataIO.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.Reader; import java.io.Writer; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; /** * Knows how to read and write an IAnalysisMetaData object. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 15, 2002 */ class AnalysisMetaDataIO { public AnalysisMetaDataIO() { // do nothing } private static class StaleAnalysisMetaData implements IAnalysisMetaData { private String covered; private String notCovered; private byte weight; public StaleAnalysisMetaData( String c, String n, byte w ) { this.covered = c; this.notCovered = n; this.weight = w; } public String getCoveredFormattedText() { return this.covered; } public String getNotCoveredFormattedText() { return this.notCovered; } public byte getInstructionWeight() { return this.weight; } } public void writeAnalysisMetaData( IAnalysisMetaData ams, Writer out ) throws IOException { StringBuffer sb = new StringBuffer(); sb.append( ams.getCoveredFormattedText().length() ). append( ':' ). append( ams.getCoveredFormattedText() ). append( ',' ). append( ams.getNotCoveredFormattedText().length() ). append( ':' ). append( ams.getNotCoveredFormattedText() ). append( ',' ). append( ams.getInstructionWeight() ). append( ',' ); out.write( sb.toString() ); } public IAnalysisMetaData readAnalysisMetaData( Reader in ) throws IOException { int count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String covered = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String notCovered = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); int iweight = ReadUtil.toInt( ReadUtil.readTo( in, ',' ) ); return new StaleAnalysisMetaData( covered, notCovered, (byte)iweight ); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/DirClassMetaDataWriter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000001015410037421052034216 0ustar drazzibdrazzib/* * @(#)DirClassMetaDataWriter.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to store the meta-data in a repository. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 16, 2002 */ public class DirClassMetaDataWriter implements IClassMetaDataWriter { private DirMetaDataIO store; private IAnalysisModule am; private AnalysisModuleSet ams; DirClassMetaDataWriter( IAnalysisModule module, DirMetaDataIO data ) throws IOException { if (data == null || module == null) { throw new IllegalArgumentException("no null args"); } this.store = data; this.am = module; this.ams = data.getAnalysisModuleSet(); } /** * Writes the given class record and its associated marks for this * Analysis Module to the repository. It will overwrite any existing * data. */ public void writeClassRecord( ClassRecord cr ) throws IOException { if (cr == null) { throw new IllegalArgumentException("no null args"); } checkClose(); // create the record for this particular module cr = getAMClassRecord( cr ); this.store.putClassRecord( this.am, cr ); } /** * Closes off the writer's connection to the store. Mark writers may * still have open connections that are still able to be used. */ public void close() throws IOException { checkClose(); // do not close the store!!! this.store = null; } /** * Creates a class record for this specific module. */ private ClassRecord getAMClassRecord( ClassRecord cr ) throws IOException { ClassRecord c2 = new ClassRecord( cr.getClassName(), cr.getClassCRC(), cr.getSourceFileName(), cr.getMethods(), this.ams ); // get only the marks for this analysis module MarkRecord mr[] = cr.getMarksForAnalysisModule( this.am ); for (int i = 0; i < mr.length; ++i) { // this guarantees a unique addition of marks c2.addMark( mr[i] ); } return c2; } private void checkClose() throws IOException { if (this.store == null) { throw new IOException( "Writer has already been closed." ); } } protected void finalize() throws Throwable { super.finalize(); // class-based post condition if (this.store != null) { throw new IllegalStateException("Did not close writer."); } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000721110037421052034216 0ustar drazzibdrazzib/* * @(#)DirMetaDataReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.File; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to read the meta-data in a repository. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ public class DirMetaDataReader implements IMetaDataReader { private DirMetaDataIO store; /** * Creates a meta-data writer for a specific directory. This directory * should be dedicated to just this writer. */ public DirMetaDataReader( File basedir ) throws IOException { if (basedir == null) { throw new IllegalArgumentException( "No null args." ); } this.store = new DirMetaDataIO( basedir ); } /** * Returns a mark meta-data reader for a specific class signature. */ public IClassMetaDataReader getClassReader( IAnalysisModule module ) throws IOException { if (module == null) { throw new IllegalArgumentException("no null args"); } checkClose(); // check if the module exists? return new DirClassMetaDataReader( module, this.store ); } /** * Returns the list of all known modules at the time of recording. */ public AnalysisModuleSet getAnalysisModuleSet() throws IOException { checkClose(); return this.store.getAnalysisModuleSet(); } /** * Closes this reader to prevent further access. */ public void close() throws IOException { checkClose(); this.store.close(); this.store = null; } private void checkClose() throws IOException { if (this.store == null) { throw new IOException( "Writer has already been closed." ); } } protected void finalize() throws Throwable { Exception ex = null; if (this.store != null) { ex = new IllegalStateException("Did not close writer."); } super.finalize(); // class-based post condition if (ex != null) { throw ex; } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataWriter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000374710037421052034230 0ustar drazzibdrazzib/* * @(#)IMetaDataWriter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to store the meta-data in a repository. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ public interface IMetaDataWriter { /** * Returns a mark meta-data writer for a specific class. */ public IClassMetaDataWriter getClassWriter( IAnalysisModule module ) throws IOException; /** * Closes this writer to prevent further access. */ public void close() throws IOException; } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataWriter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000475010023746524034234 0ustar drazzibdrazzib/* * @(#)IClassMetaDataWriter.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; /** * Knows how to store the meta-data in a repository. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/03/09 22:23:58 $ * @since December 15, 2002 */ public interface IClassMetaDataWriter { /** * Writes the given class record and its associated marks for this * Analysis Module to the repository. If class record cr * has already been written, another call will overwrite any existing * data. * * @param cr the class record to write to the underlying repository. * @exception IOException thrown if there is an underlying problem, or * if the close method has been executed. * @exception IllegalArgumentException if cr is null. */ public void writeClassRecord( ClassRecord cr ) throws IOException; /** * Closes off the writer's connection to the store. * * @exception IOException thrown if there is an underlying problem, or * if the close method has been executed before. */ public void close() throws IOException; } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/ReadUtil.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000001001210037421052034207 0ustar drazzibdrazzib/* * @(#)ReadUtil.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.Reader; /** * Helps with standard read methods. Package protected. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ class ReadUtil { /** * reads from the stream up to the given character, but not * including it. If an end-of-stream is encountered before the * character, then an exception is thrown. */ public static final String readTo( Reader in, char val ) throws IOException { StringBuffer sb = new StringBuffer(); int c = in.read(); while (c != -1 && (char)c != val) { sb.append( (char)c ); c = in.read(); } if (c == -1) { throw new IOException( "Expected '"+val+ "', but found end-of-stream." ); } return sb.toString(); } public static final String readCount( Reader in, int count ) throws IOException { char c[] = new char[ count ]; int read = in.read( c, 0, count ); if (read < 0) { throw new IOException( "Expected to read "+(count)+ " more characters, but encountered end-of-stream." ); } int totRead = read; while (totRead < count) { read = in.read( c, totRead, (count - totRead) ); if (read < 0) { throw new IOException( "Expected to read "+(count-totRead)+ " more characters, but encountered end-of-stream." ); } totRead += read; } return new String( c ); } public static final int toInt( String s ) throws IOException { if (s == null || s.length() <= 0) { throw new IOException( "Invalid empty string; expected an integer." ); } try { int i = Integer.parseInt( s ); return i; } catch (NumberFormatException ex) { throw new IOException( "String '"+s+"' is not an integer." ); } } public static final long toLong( String s ) throws IOException { if (s == null || s.length() <= 0) { throw new IOException( "Invalid empty string; expected a long integer." ); } try { long i = Long.parseLong( s ); return i; } catch (NumberFormatException ex) { throw new IOException( "String '"+s+"' is not a long integer." ); } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataWriter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000001033710037421052034221 0ustar drazzibdrazzib/* * @(#)DirMetaDataWriter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.File; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Stores meta-data in a directory structure. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 * @see ZipMetaDataReader */ public class DirMetaDataWriter implements IMetaDataWriter { private DirMetaDataIO store; /** * Creates a meta-data writer for a specific directory. This directory * should be dedicated to just this writer. */ public DirMetaDataWriter( File basedir ) throws IOException { if (basedir == null) { throw new IllegalArgumentException( "No null args." ); } this.store = new DirMetaDataIO( basedir ); } /** * Returns a mark meta-data writer for a specific class. If the * module has not already been added to the store, it will be added. */ public IClassMetaDataWriter getClassWriter( IAnalysisModule module ) throws IOException { if (module == null) { throw new IllegalArgumentException("no null args"); } checkClose(); addModule( module ); return new DirClassMetaDataWriter( module, this.store ); } /** * Closes this writer to prevent further access. */ public void close() throws IOException { checkClose(); this.store.close(); this.store = null; } /** * Conditionally add the module if it isn't already known. */ private void addModule( IAnalysisModule module ) throws IOException { /* System.out.println( "********************************************\n"+ "Oi! There seems to be a bug in this method!\n"+ "********************************************\n" ); */ AnalysisModuleSet ams = this.store.getAnalysisModuleSet(); if (ams.getAnalysisModuleIndex( module ) < 0) { // add the module ams.addAnalysisModule( module ); this.store.putAnalysisModuleSet( ams ); } } private void checkClose() throws IOException { if (this.store == null) { throw new IOException( "Writer has already been closed." ); } } // this shouldn't close the DirMetaDataIO instance, but rather the // DirMetaDataIO instance should close itself. protected void finalize() throws Throwable { Exception ex = null; if (this.store != null) { ex = new IllegalStateException("Did not close writer."); } super.finalize(); // class-based post condition if (ex != null) { throw ex; } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000000550710037421052034224 0ustar drazzibdrazzib/* * @(#)IClassMetaDataReader.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; /** * Knows how to read class meta-data from the repository. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ public interface IClassMetaDataReader { /** * Returns the class record for the class with this particular signature. * * @param classSignature the class signature requested for reading in * the class record. * @return the record corresponding to this class, or null if * there is no such class signature known. * @exception IOException if there is an underlying error during the read, * or if the reader has been closed. */ public ClassRecord readClass( String classSignature ) throws IOException; /** * Returns all classes known for this particular data set. * * @return the list of all class signatures that can be read by * readClass( String ), but never null. * @exception IOException if there was an underlying read error, or if * the reader has been closed. */ public String[] getClassSignatures() throws IOException; /** * Closes off the reader's connection to the store. * * @exception IOException if there was an underlying read error, or if * the reader has already been closed. */ public void close() throws IOException; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataIO.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000002401510037421052034217 0ustar drazzibdrazzib/* * @(#)DirMetaDataIO.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.util.io.v1.ExtensionFilenameFilter; /** * Accesses the meta-data at the I/O level in a directory structure. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 * @see ZipMetaDataReader */ class DirMetaDataIO { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( DirMetaDataIO.class ); private static final String MODULE_SET_FILENAME = "moduleset.txt"; private static final String CLASS_FILE_EXT = ".classdata.txt"; private static final String MARK_FILE_EXT = ".classmarks.txt"; private File basedir; private static final ExtensionFilenameFilter CLASS_FILE_FILTER = new ExtensionFilenameFilter( CLASS_FILE_EXT, true ); static { CLASS_FILE_FILTER.allowsDirectories( false ); } public DirMetaDataIO( File dir ) throws IOException { if (dir == null) { throw new IllegalArgumentException( "No null args." ); } if (dir.exists() && !dir.isDirectory()) { throw new IllegalArgumentException( "File "+dir+" is not a directory." ); } if (!dir.exists()) { dir.mkdir(); } this.basedir = dir; } /** * */ public AnalysisModuleSet getAnalysisModuleSet() throws IOException { checkClosed(); AnalysisModuleSetIO amsr = new AnalysisModuleSetIO(); AnalysisModuleSet ams; File amsf = getAnalysisModuleSetFile(); if (!amsf.exists()) { ams = new AnalysisModuleSet(); } else { BufferedReader fr = new BufferedReader( new FileReader( amsf ) ); try { ams = amsr.readAnalysisModuleSet( fr ); } finally { fr.close(); } } return ams; } /** * */ public void putAnalysisModuleSet( AnalysisModuleSet ams ) throws IOException { if (ams == null) { throw new IllegalArgumentException("no null args"); } checkClosed(); AnalysisModuleSetIO amsw = new AnalysisModuleSetIO(); File amsf = getAnalysisModuleSetFile(); BufferedWriter bw = new BufferedWriter( new FileWriter( amsf ) ); try { amsw.writeAnalysisModuleSet( ams, bw ); } finally { bw.close(); } } /** * */ public String[] getClassSigsForAnalysisModule( IAnalysisModule am ) throws IOException { if (am == null) { throw new IllegalArgumentException("no null args"); } checkClosed(); File amDir = getAnalysisModuleDir( am ); String names[] = amDir.list( CLASS_FILE_FILTER ); for (int i = 0; i < names.length; ++i) { names[i] = names[i].substring( 0, names[i].length() - CLASS_FILE_EXT.length() ); } return names; } /** * */ public ClassRecord getClassRecord( IAnalysisModule am, String classSig ) throws IOException { return getClassRecord( getAnalysisModuleSet(), am, classSig ); } /** * If the class record does not exist, then null is returned. */ public ClassRecord getClassRecord( AnalysisModuleSet ams, IAnalysisModule am, String classSig ) throws IOException { if (am == null || classSig == null || ams == null) { throw new IllegalArgumentException("no null args"); } checkClosed(); File cf = getClassDataFileForModule( am, classSig ); ClassRecordIO crr = new ClassRecordIO(); BufferedReader fr; try { fr = new BufferedReader( new FileReader( cf ) ); } catch (java.io.FileNotFoundException fnfe) { LOG.warn( "Couldn't find the file '"+cf+ "' containing the class details." ); return null; } ClassRecord cr; try { cr = crr.readClass( ams, fr ); } finally { fr.close(); } // read marks File mcf = getClassMarkFileForModule( am, cr.getClassSignature() ); try { fr = new BufferedReader( new FileReader( mcf ) ); } catch (java.io.FileNotFoundException fnfe) { LOG.warn( "Could not find file '"+mcf+"' containing marks." ); return cr; } try { crr.readMarks( cr, fr ); } finally { fr.close(); } return cr; } /** * */ public void putClassRecord( IAnalysisModule am, ClassRecord cr ) throws IOException { if (am == null || cr == null) { throw new IllegalArgumentException("no null args"); } checkClosed(); File cf = getClassDataFileForModule( am, cr.getClassSignature() ); ClassRecordIO crw = new ClassRecordIO(); BufferedWriter fw = new BufferedWriter( new FileWriter( cf ) ); try { crw.writeClass( cr, fw ); } finally { fw.close(); } // write marks File mcf = getClassMarkFileForModule( am, cr.getClassSignature() ); fw = new BufferedWriter( new FileWriter( mcf ) ); try { crw.writeMarksForAnalysisModule( cr, am, fw ); } finally { fw.close(); } } /** * */ public void deleteClassRecord( IAnalysisModule am, ClassRecord cr ) throws IOException { if (am == null || cr == null) { throw new IllegalArgumentException("no null args"); } checkClosed(); File cf = getClassDataFileForModule( am, cr.getClassSignature() ); if (cf.exists()) { cf.delete(); } } /** * */ private File getAnalysisModuleSetFile() { File moduleSetFile = new File( this.basedir, MODULE_SET_FILENAME ); return moduleSetFile; } /** * */ private File getAnalysisModuleDir( IAnalysisModule am ) throws IOException { File newDir = new File( this.basedir, am.getMeasureName() ); if (newDir.exists() && !newDir.isDirectory()) { throw new IOException( "Expected measure directory '"+newDir+ "', but it isn't a directory." ); } if (!newDir.exists()) { newDir.mkdir(); } return newDir; } /** * */ private File getClassDataFileForModule( IAnalysisModule am, String classSig ) throws IOException { File mf = getAnalysisModuleDir( am ); File cf = new File( mf, classSig + CLASS_FILE_EXT ); return cf; } /** * */ private File getClassMarkFileForModule( IAnalysisModule am, String classSig ) throws IOException { File mf = getAnalysisModuleDir( am ); File cf = new File( mf, classSig + MARK_FILE_EXT ); return cf; } /** * This can be called multiple times without error. */ public void close() throws IOException { LOG.debug( "Closing DirMetaDataIO." ); this.basedir = null; } /** * */ private void checkClosed() throws IOException { if (isClosed()) { throw new IOException( "Directory storage has been closed." ); } } /** * */ boolean isClosed() { return (this.basedir == null); } protected void finalize() throws Throwable { Exception ex = null; if (!isClosed()) { ex = new IllegalStateException("Did not close writer."); close(); } super.finalize(); // class-based post condition if (ex != null) { throw ex; } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000002030210037421052034212 0ustar drazzibdrazzib/* * @(#)AnalysisModuleSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.util.Hashtable; import java.util.Vector; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Contains data associated with each analysis module. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ public class AnalysisModuleSet { private Hashtable moduleNameToIndex = new Hashtable(); private Vector moduleList = new Vector(); /** * Default constructor */ public AnalysisModuleSet() { // do nothing } /** * Create an instance using the given array of modules as the default * set. * * @param modules collection of modules to initialize the set with. * @exception IllegalArgumentException if modules is * null. */ public AnalysisModuleSet( IAnalysisModule[] modules ) { if (modules == null) { throw new IllegalArgumentException( "No null args." ); } addAnalysisModules( modules ); } /** * Copy ams's modules into this new set. * * @param ams the set to copy from * @exception IllegalArgumentException if ams is null. */ public AnalysisModuleSet( AnalysisModuleSet ams ) { if (ams == null) { throw new IllegalArgumentException( "No null args." ); } joinAnalysisModuleSet( ams ); } /** * Add an array of modules to this set. * * @param modules the array of modules to add to the set * @exception IllegalArgumentException if modules is * null, or if any element in the array is null. */ public void addAnalysisModules( IAnalysisModule[] modules ) { if (modules == null) { throw new IllegalArgumentException( "No null args." ); } for (int i = 0; i < modules.length; ++i) { addAnalysisModule( modules[i] ); } } /** * Add a module to the set. * * @param module the module to add. * @exception IllegalArgumentException if module is null. * @exception IllegalStateException if module has a measure name * that is the same as a previously added module. */ public void addAnalysisModule( IAnalysisModule module ) { if (module == null) { throw new IllegalArgumentException( "No null args." ); } String name = module.getMeasureName(); synchronized (this.moduleNameToIndex) { if (this.moduleNameToIndex.containsKey( name )) { throw new IllegalStateException( "Already have module with "+ "measure '"+name+"'." ); } int nextIndex = this.moduleList.size(); if (nextIndex >= Short.MAX_VALUE) { throw new IllegalStateException( "Too many modules. There is a maximum of "+ Short.MAX_VALUE+" modules allowed." ); } this.moduleNameToIndex.put( name, new Short( (short)nextIndex ) ); this.moduleList.addElement( module ); } } /** * Join a module set to this set. It will not add to this set any * repeated measure names that are in the given set. * * @param set the module set to add. * @exception IllegalArgumentException if set is null. */ public void joinAnalysisModuleSet( AnalysisModuleSet set ) { if (set == null) { throw new IllegalArgumentException( "No null args." ); } java.util.Enumeration enum = set.moduleList.elements(); while (enum.hasMoreElements()) { IAnalysisModule module = (IAnalysisModule)enum.nextElement(); String name = module.getMeasureName(); if (!this.moduleNameToIndex.containsKey( name )) { addAnalysisModule( module ); } } } /** * Return a complete list of modules in order. * * @return the ordered array of stored modules. */ public IAnalysisModule[] getAnalysisModules() { synchronized( this.moduleNameToIndex ) { int len = this.moduleList.size(); IAnalysisModule[] am = new IAnalysisModule[ len ]; this.moduleList.copyInto( am ); return am; } } /** * Retrieves the index associated with the module with the given * measure name. * * @param measureName the measure name of the module. * @return the index of the module, or -1 if there is no such module * with the given measure name. * @exception IllegalArgumentException if measureName is * null. * @see #getAnalysisModuleIndex( IAnalysisModule ) */ public short getMeasureIndex( String measureName ) { if (measureName == null) { throw new IllegalArgumentException( "No null args." ); } Short i = (Short)this.moduleNameToIndex.get( measureName ); if (i == null) { return -1; } return i.shortValue(); } /** * Returns the module am's index. * * @param am the module. * @return the index of am, or -1 if it is not stored in this * set. * @exception IllegalArgumentException if am is null. * @see #getMeasureIndex( Stirng ) */ public short getAnalysisModuleIndex( IAnalysisModule am ) { if (am == null) { throw new IllegalArgumentException( "No null args." ); } return getMeasureIndex( am.getMeasureName() ); } /** * Retrieve the number of modules stored in this set. * * @return the number of modules in the set. */ public int getAnalysisModuleCount() { return this.moduleList.size(); } /** * Returns the module stored at the given index index. * * @return the module at index index. * @exception IllegalArgumentException if index is less than 0 * or greater than or equal to the returned value of * getAnalysisModuleCount(). */ public IAnalysisModule getAnalysisModuleAt( short index ) { int iindex = (int)index; if (iindex < 0 || iindex >= this.moduleList.size()) { throw new IllegalArgumentException( "index out of range [0.."+ (this.moduleList.size()-1)+"]" ); } return (IAnalysisModule)this.moduleList.elementAt( iindex ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecordIO.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/datast0000644000175000017500000002010310037421052034211 0ustar drazzibdrazzib/* * @(#)ClassRecordIO.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Knows how to read and write a ClassRecord object. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 15, 2002 */ class ClassRecordIO { public ClassRecordIO() { // do nothing } /** * Write only the class data for a class record. */ public void writeClass( ClassRecord cr, Writer out ) throws IOException { StringBuffer sb = new StringBuffer(); sb.append( cr.getClassName().length() ). append( ':' ). append( cr.getClassName() ). append( ',' ). append( cr.getClassCRC() ). append( ',' ). append( cr.getSourceFileName().length() ). append( ':' ). append( cr.getSourceFileName() ). append( ',' ); int count = cr.getMethodCount(); sb.append( count ).append( '[' ); for (short i = 0; i < count; ++i) { sb.append( '(' ); String m = cr.getMethodAt( i ); sb.append( m.length() ). append( ':' ). append( m ); sb.append( ')' ); } sb.append( ']' ); out.write( sb.toString() ); } /** * Read only the class data for a class record. */ public ClassRecord readClass( AnalysisModuleSet ams, Reader in ) throws IOException { int count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String className = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); long classCRC = ReadUtil.toLong( ReadUtil.readTo( in, ',' ) ); count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String sourceFileName = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); int methodCount = ReadUtil.toInt( ReadUtil.readTo( in, '[' ) ); String[] methodSigs = new String[ methodCount ]; for (int i = 0; i < methodCount; ++i) { ReadUtil.readTo( in, '(' ); count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); methodSigs[i] = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ')' ); } ReadUtil.readTo( in, ']' ); return new ClassRecord( className, classCRC, sourceFileName, methodSigs, ams ); } //--------------------------------------------------------------------- /** * Writes the set of marks for the given analysis module. */ public void writeMarksForAnalysisModule( ClassRecord cr, IAnalysisModule am, Writer out ) throws IOException { writeMarksForMeasure( cr, am.getMeasureName(), out ); } /** * Writes the set of marks for the given analysis module. */ public void writeMarksForMeasure( ClassRecord cr, String measureName, Writer out ) throws IOException { MarkRecord mr[] = cr.getMarksForAnalysisModule( measureName ); StringBuffer sb = new StringBuffer(); sb.append( measureName.length() ). append( ':' ). append( measureName ). append( ',' ). append( mr.length ). append( '[' ); for (int i = 0; i < mr.length; ++i) { StringWriter sw = new StringWriter(); writeMark( mr[i], sw ); String text = sw.toString(); sb.append( text.length() ). append( '(' ). append( text ). append( ')' ); } sb.append( ']' ); out.write( sb.toString() ); } public void readMarks( ClassRecord cr, Reader in ) throws IOException { AnalysisModuleSet ams = cr.getAnalysisModuleSet(); int count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); String measureName = ReadUtil.readCount( in, count ); ReadUtil.readTo( in, ',' ); int markCount = ReadUtil.toInt( ReadUtil.readTo( in, '[' ) ); for (int i = 0; i < markCount; ++i) { count = ReadUtil.toInt( ReadUtil.readTo( in, '(' ) ); StringReader sr = new StringReader( ReadUtil.readCount( in, count ) ); MarkRecord mr = readMark( cr, ams, sr ); cr.addMark( mr ); ReadUtil.readTo( in, ')' ); } ReadUtil.readTo( in, ']' ); } //----------------------------------------------------------------------- public void writeMark( MarkRecord mr, Writer out ) throws IOException { short amIndex = mr.getAnalysisModuleIndex(); short methodIndex = mr.getMethodIndex(); short markIndex = mr.getMarkIndex(); int lineNumber = mr.getLineNumber(); IAnalysisMetaData amd = mr.getAnalysisMetaData(); StringBuffer sb = new StringBuffer(); sb.append( amIndex ). append( ',' ). append( methodIndex ). append( ',' ). append( markIndex ). append( ',' ). append( lineNumber ). append( ',' ); StringWriter sw = new StringWriter(); AnalysisMetaDataIO amdw = new AnalysisMetaDataIO(); amdw.writeAnalysisMetaData( amd, sw ); String text = sw.toString(); sb.append( text.length() ). append( ':' ). append( text ). append( ',' ); out.write( sb.toString() ); } public MarkRecord readMark( ClassRecord cr, AnalysisModuleSet ams, Reader in ) throws IOException { short amIndex = (short)ReadUtil.toInt( ReadUtil.readTo( in, ',' ) ); short methodIndex = (short)ReadUtil.toInt( ReadUtil.readTo( in, ',' ) ); short markIndex = (short)ReadUtil.toInt( ReadUtil.readTo( in, ',' ) ); int lineNumber = ReadUtil.toInt( ReadUtil.readTo( in, ',' ) ); int count = ReadUtil.toInt( ReadUtil.readTo( in, ':' ) ); StringReader sr = new StringReader( ReadUtil.readCount( in, count ) ); AnalysisMetaDataIO amdr = new AnalysisMetaDataIO(); IAnalysisMetaData amd = amdr.readAnalysisMetaData( sr ); ReadUtil.readTo( in, ',' ); return new MarkRecord( amd, ams.getAnalysisModuleAt( amIndex ).getMeasureName(), cr.getMethodAt( methodIndex ), markIndex, lineNumber ); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IMethodCode.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IMetho0000644000175000017500000000732710037421051034132 0ustar drazzibdrazzib/* * @(#)IMethodCode.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import org.apache.bcel.classfile.LineNumberTable; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Instruction; /** * Contains the BCEL bytecode for a method, and provides helper methods for * generating the marks for certain bytecode instructions. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:25 $ * @since December 15, 2002 */ public interface IMethodCode { /** * Returns the original BCEL Method object. * * @return the original BCEL Method object */ public Method getOriginalMethod(); /** * Returns the line number table for the original BCEL method object. * * @return the LineNumberTable, or null if there isn't one * for this method. */ public LineNumberTable getLineNumberTable(); /** * A helper to get the method name. * * @return the method name */ public String getMethodName(); /** * A helper to get the class name. * * @return the class name */ public String getClassName(); /** * Returns the number of bytecode instructions in the method. * * @return the number of bytecode instructions */ public int getInstructionCount(); /** * Returns the bytecode instruction at the given index. If the index * is out of range (< 0 or >= getInstructionCount()), * then a IndexOutOfBoundsException is thrown. * * @param index the 0-based index of the method's instruction list * @return the instruction at index */ public Instruction getInstructionAt( int index ); /** * Marks an instruction for coverage analysis. If the index * is out of range (< 0 or >= getInstructionCount()), * then a IndexOutOfBoundsException is thrown. * * @param index the 0-based index of the method's instruction list * @param meta meta-data the analysis module records in association with * the mark. This cannot be null. * @exception IllegalArgumentException if meta is null. * @exception IndexOutOfBoundsException if index is not within * the valid range. */ public void markInstruction( int index, IAnalysisMetaData meta ); } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000755000175000017500000000000011271425773034265 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/IXmlReportConst.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000640407770630121034265 0ustar drazzibdrazzib/* * @(#)IXmlReportConst.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; /** * Contains constants for generating an XML Coverage report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/12/19 17:07:29 $ * @since November 25, 2003 */ public interface IXmlReportConst { public static final String T_COVERAGEREPORT = "coveragereport"; public static final String A_MEASURE = "measure"; public static final String A_UNIT = "unit"; public static final String T_CLASSCOVERAGE = "classcoverage"; public static final String A_CLASSSIGNATURE = "classsignature"; public static final String A_CLASSNAME = "classname"; public static final String A_SOURCEFILE = "sourcefile"; public static final String A_PACKAGE = "package"; public static final String T_COVER = "cover"; public static final String A_COVERED_DISP = "display-covered"; public static final String A_COVERED = "covered"; public static final String A_TOTAL_DISP = "display-total"; public static final String A_TOTAL = "total"; public static final String A_PERCENTCOVERED_DISP = "display-percentcovered"; public static final String A_PERCENTCOVERED = "percentcovered"; public static final String A_WEIGHTEDPERCENT_DISP = "display-weightedpercent"; public static final String A_WEIGHTEDPERCENT = "weightedpercent"; public static final String T_METHODCOVERAGE = "methodcoverage"; public static final String A_METHODSIGNATURE = "methodsignature"; public static final String A_METHODSIGNATURE_REAL = "real-methodsignature"; public static final String T_MARK = "mark"; // public static final String A_COVERED = "covered"; public static final String A_INDEX = "index"; public static final String A_TEXT = "text"; public static final String A_WEIGHT = "weight"; public static final String A_SOURCELINE = "sourceline"; public static final String T_PACKAGE = "package"; public static final String A_NAME = "name"; } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/XmlSourceReportGenerator.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000001673710037421052034266 0ustar drazzibdrazzib/* * @(#)XmlSourceReportGenerator.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * Generates an XML report about a Java source file, containing the source * file's line-by-line source, and the coverage information on that class. *

    * Unlike the other generators, this class must be instantiated for a * particular coverage report, and will be reused to make each sub-source * file. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since November 26, 2003 */ public class XmlSourceReportGenerator implements IXmlSourceReportConst { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( XmlCombinedReportGenerator.class ); private Map sourceFileMap = new HashMap(); private Node moduleTypesNode; public XmlSourceReportGenerator( Document coverageReport ) { if (coverageReport == null) { throw new IllegalArgumentException( "No null args" ); } NodeList list = coverageReport.getDocumentElement(). getElementsByTagName( T_CLASSCOVERAGE ); for (int i = 0; i < list.getLength(); ++i) { Node node = list.item(i); if (node instanceof Element) { String name = getSourceName( (Element)node ); List nodes = (List)this.sourceFileMap.get( name ); if (nodes == null) { nodes = new LinkedList(); this.sourceFileMap.put( name, nodes ); } nodes.add( node ); } } this.moduleTypesNode = coverageReport.getDocumentElement(). getElementsByTagName( "moduletypes" ).item(0); } public String[] getSourceNames() { Set keys = this.sourceFileMap.keySet(); return (String[])keys.toArray( new String[ keys.size() ] ); } /** * Sends the generated report to out using the given module * and data set. * * @return the root element generated. */ public Document createXML( String srcName, File srcFile ) throws IOException { List coverageNodes = (List)this.sourceFileMap.get( srcName ); if (coverageNodes == null) { throw new IllegalArgumentException( "No such source: "+ srcName ); } // this is a bit slower, but it conserves some memory resources. DocumentBuilder docBuilder = getDocumentBuilder(); Document doc = docBuilder.newDocument(); Element rootEl = doc.createElement( T_JAVACOVERAGE ); doc.appendChild( rootEl ); rootEl.setAttribute( A_JAVACLASS, srcName ); rootEl.appendChild( copyNode( this.moduleTypesNode, doc ) ); parseSourceFile( srcFile, rootEl, doc ); Iterator iter = coverageNodes.iterator(); while (iter.hasNext()) { rootEl.appendChild( copyNode( (Node)iter.next(), doc ) ); } return doc; } protected void parseSourceFile( File src, Element parent, Document doc ) throws IOException { Element srcEl = doc.createElement( T_SOURCE ); parent.appendChild( srcEl ); // If the file doesn't exist, don't fail. Just put it in the report. if (src == null || !src.exists() || !src.isFile()) { // System.out.println( "No source file" ); Element lineEl = doc.createElement( T_LINE ); srcEl.appendChild( lineEl ); lineEl.setAttribute( A_INDEX, Integer.toString( 0 ) ); lineEl.setAttribute( A_SRC, "Could not find source file." ); return; } // else, parse the source file. BufferedReader in = new BufferedReader( new FileReader( src ) ); try { int lineNo = 0; for (String line = in.readLine(); line != null; line = in.readLine()) { ++lineNo; // should color-code the line according to Java syntax. // But, we can't guarantee that the source is Java! It // might be NetRexx or any number of other source types. Element lineEl = doc.createElement( T_LINE ); srcEl.appendChild( lineEl ); lineEl.setAttribute( A_INDEX, Integer.toString( lineNo ) ); lineEl.setAttribute( A_SRC, line ); } } finally { if (in != null) { in.close(); } } } protected Node copyNode( Node el, Document doc ) { return doc.importNode( el, true ); } //------------------------------------------------------------------------ // Private methods private static DocumentBuilder getDocumentBuilder() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (Exception exc) { throw new ExceptionInInitializerError(exc); } } private static String getSourceName( Element coverageEl ) { String pkg = coverageEl.getAttribute( A_PACKAGE ); String src = coverageEl.getAttribute( A_SOURCEFILE ); return makeSourceName( pkg, src ); } private static String makeSourceName( String pkg, String srcFile ) { if (pkg == null || pkg.length() <= 0) { return srcFile; } pkg = pkg.replace( '.', File.separatorChar ); return pkg + File.separatorChar + srcFile; } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000022407600160002034243 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.report Generates reports on the coverage metrics. ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000003512510037421052034256 0ustar drazzibdrazzib/* * @(#)XmlReportGenerator.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.IOException; import java.text.NumberFormat; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord; import net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil; import org.apache.bcel.classfile.Utility; import org.w3c.dom.Document; import org.w3c.dom.Element; /** * Creates an XML formatted report, suitable for framing. *

    * Re-written to use DOM for XML creation; see bug 847334. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 18, 2002 * @see IAnalysisMetaData */ public class XmlReportGenerator implements IReportGenerator, IXmlReportConst { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( XmlReportGenerator.class ); private static final NumberFormat DFORMAT = NumberFormat.getInstance(); private static final NumberFormat IFORMAT = NumberFormat.getInstance(); static { DFORMAT.setMaximumFractionDigits( 2 ); DFORMAT.setMinimumFractionDigits( 2 ); IFORMAT.setMaximumFractionDigits( 0 ); } private DocumentBuilder docBuilder = getDocumentBuilder(); private class CoverageCount { public CoverageCount() {} public CoverageCount( boolean covered, byte weight ) { int cc = 0; int tcc = 1; if (covered) { cc = 1; } this.coveredCount = cc; this.totalCount = tcc; this.weightedCoverage = ((double)weight + (double)Byte.MAX_VALUE + 1.0) * (double)(cc + 1) / (double)Byte.MAX_VALUE * 2.0; } public int coveredCount; public int totalCount; public double weightedCoverage; public void add( CoverageCount b ) { this.coveredCount += b.coveredCount; this.totalCount += b.totalCount; this.weightedCoverage += b.weightedCoverage; } public double getCoveredPercent() { if (this.totalCount == 0) { return 100.0; } return ((double)this.coveredCount / (double)this.totalCount) * 100.0; } public double getWeightedValue() { if (this.totalCount == 0) { return 100.0; } return (this.weightedCoverage / (double)this.totalCount) * 100.0; } } /** * Sends the generated report to out using the given module * and data set. * * @return the root element generated. */ public Element createReport( IAnalysisModule module, AnalysisModuleData data ) throws IOException { if (module == null || data == null) { throw new IllegalArgumentException("no null args"); } Document doc = this.docBuilder.newDocument(); // get the list of all classes under consideration final String classSigs[] = data.getClassSignatures(); Map packageCounts = loadPackageCounts( classSigs ); Element rootEl = createRootNode( module, doc ); // get each class's count, and append the output for each for (int i = 0; i < classSigs.length; ++i) { LOG.info( "Reading class "+classSigs[i]+"." ); ClassMarkSet cms = data.createClassMarkSet( classSigs[i] ); CoverageCount classCount = writeClass( cms, data.getClassRecord( classSigs[i] ), rootEl, doc ); CoverageCount pkgCount = (CoverageCount)packageCounts.get( getPackageName( classSigs[i] ) ); pkgCount.add( classCount ); } final CoverageCount totalCount = new CoverageCount(); Iterator iter = packageCounts.keySet().iterator(); while (iter.hasNext()) { String pkgName = (String)iter.next(); CoverageCount pkgCount = (CoverageCount)packageCounts.get( pkgName ); writePackage( pkgName, pkgCount, rootEl, doc ); totalCount.add( pkgCount ); } // don't need this memory anymore packageCounts = null; writeCoverage( totalCount, rootEl, doc ); return rootEl; } private Element createRootNode( IAnalysisModule module, Document doc ) { if (module == null || doc == null) { throw new IllegalArgumentException("no null args"); } Element rootEl = doc.createElement( T_COVERAGEREPORT ); doc.appendChild( rootEl ); rootEl.setAttribute( A_MEASURE, module.getMeasureName() ); rootEl.setAttribute( A_UNIT, module.getMeasureUnit() ); return rootEl; } private CoverageCount writeClass( ClassMarkSet cms, ClassRecord cr, Element rootEl, Document doc ) { if (cr == null || cms == null || rootEl == null || doc == null) { throw new IllegalArgumentException("no null args"); } final String classSig = cr.getClassSignature(); final String className = cr.getClassName(); Element classEl = doc.createElement( T_CLASSCOVERAGE ); rootEl.appendChild( classEl ); classEl.setAttribute( A_CLASSSIGNATURE, classSig ); classEl.setAttribute( A_CLASSNAME, className ); classEl.setAttribute( A_PACKAGE, getPackageName( classSig ) ); classEl.setAttribute( A_SOURCEFILE, cr.getSourceFileName() ); final CoverageCount classCoverage = writeMethods( cms, classEl, doc ); writeCoverage( classCoverage, classEl, doc ); return classCoverage; } private void writePackage( String packageName, CoverageCount pkgCount, Element parent, Document doc ) { if (packageName == null || pkgCount == null || parent == null || doc == null) { throw new IllegalArgumentException("no null args"); } Element packEl = doc.createElement( T_PACKAGE ); parent.appendChild( packEl ); packEl.setAttribute( A_NAME, packageName ); writeCoverage( pkgCount, packEl, doc ); } private CoverageCount writeMethods( ClassMarkSet cms, Element parent, Document doc ) { if (cms == null || parent == null || doc == null) { throw new IllegalArgumentException("no null args"); } final CoverageCount classCoverage = new CoverageCount(); final String methodList[] = cms.getMethodSignatures(); for (int i = 0; i < methodList.length; ++i) { String methodSig = methodList[i]; CoverageCount methodCoverage = new CoverageCount(); Element methEl = doc.createElement( T_METHODCOVERAGE ); parent.appendChild( methEl ); methEl.setAttribute( A_METHODSIGNATURE, translate( methodSig ) ); methEl.setAttribute( A_METHODSIGNATURE_REAL, methodSig ); // covered marks MarkRecord marks[] = cms.getCoveredMarksForMethod( methodSig ); for (int markI = 0; markI < marks.length; ++markI) { CoverageCount cc = writeMark( marks[ markI ], true, methEl, doc ); methodCoverage.add( cc ); } // uncovered marks // (note that putting this allocation in the same array is a bit // of a memory conservation) marks = cms.getNotCoveredMarksForMethod( methodSig ); for (int markI = 0; markI < marks.length; ++markI) { CoverageCount cc = writeMark( marks[ markI ], false, methEl, doc ); methodCoverage.add( cc ); } writeCoverage( methodCoverage, methEl, doc ); classCoverage.add( methodCoverage ); } return classCoverage; } private CoverageCount writeMark( MarkRecord mr, boolean covered, Element parent, Document doc ) { if (mr == null || parent == null || doc == null) { throw new IllegalArgumentException("no null args"); } final IAnalysisMetaData amd = mr.getAnalysisMetaData(); Element markEl = doc.createElement( T_MARK ); parent.appendChild( markEl ); markEl.setAttribute( A_COVERED, covered ? "true" : "false" ); markEl.setAttribute( A_TEXT, amd.getCoveredFormattedText() ); markEl.setAttribute( A_WEIGHT, formatNumber( amd.getInstructionWeight() ) ); markEl.setAttribute( A_SOURCELINE, formatNumber( mr.getLineNumber() ) ); CoverageCount cc = new CoverageCount( covered, amd.getInstructionWeight() ); return cc; } private void writeCoverage( CoverageCount cc, Element parent, Document doc ) { if (cc == null || parent == null || doc == null) { throw new IllegalArgumentException("no null args"); } Element cover = doc.createElement( T_COVER ); parent.appendChild( cover ); cover.setAttribute( A_COVERED_DISP, format( cc.coveredCount ) ); cover.setAttribute( A_COVERED, formatNumber( cc.coveredCount ) ); cover.setAttribute( A_TOTAL_DISP, format( cc.totalCount ) ); cover.setAttribute( A_TOTAL, formatNumber( cc.totalCount ) ); cover.setAttribute( A_PERCENTCOVERED_DISP, format( cc.getCoveredPercent() ) ); cover.setAttribute( A_PERCENTCOVERED, formatNumber( cc.getCoveredPercent() ) ); cover.setAttribute( A_WEIGHTEDPERCENT_DISP, format( cc.getWeightedValue() ) ); cover.setAttribute( A_WEIGHTEDPERCENT, formatNumber( cc.getWeightedValue() ) ); } //----------------------------------------------------------------------- // Helper / utilities private Map loadPackageCounts( String[] classSigs ) { PackageSorter ps = new PackageSorter(); ps.addClassSignatures( classSigs ); String[] pkgs = ps.getPackages(); Map counts = new HashMap(); for (int i = 0; i < pkgs.length; ++i) { counts.put( pkgs[i], new CoverageCount() ); } return counts; } private String getPackageName( String className ) { return PackageSorter.getPackageName( className ); } private String getClassName( String classSig ) { return ClassSignatureUtil.getInstance().getClassName( classSig ); } private String format( int i ) { return IFORMAT.format( (long)i ); } private String format( double d ) { return DFORMAT.format( d ); } private String formatNumber( int i ) { return Integer.toString( i ); } private String formatNumber( double d ) { return Double.toString( d ); } private static DocumentBuilder getDocumentBuilder() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (Exception ex) { throw new ExceptionInInitializerError( ex ); } } static String translate( String methodSig ) { if (methodSig == null) { return null; } // Translate both the method name and the method arguments int pos1 = methodSig.indexOf( '(' ); if (pos1 < 0) { return methodSig; } int pos2 = methodSig.indexOf( ')' ); if (pos2 < 0) { return methodSig; } String mname = methodSig.substring( 0, pos1 ); // translate the method names - should this be done??? if ("".equals( mname )) { mname = "[constructor]"; } else if ("".equals( mname )) { return "[static initializer]"; } StringBuffer sig = new StringBuffer( mname ); sig.append( '(' ); String s = methodSig.substring( pos1, pos2+1 ); if (!"()".equals( s )) { String parms[] = Utility.methodSignatureArgumentTypes( s ); if (parms.length > 0) { sig.append( parms[0] ); for (int i = 1; i < parms.length; ++i) { sig.append( ", " ); sig.append( parms[i] ); } } } sig.append( ')' ); // don't include return value return new String( sig ); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/XmlSourceReportGenerator2.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000003110010061423707034251 0ustar drazzibdrazzib/* * @(#)XmlSourceReportGenerator2.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Collection; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * Generates an XML report about a Java source file, containing the source * file's line-by-line source, and the coverage information on that class. *

    * Unlike the other generators, this class must be instantiated for a * particular coverage report, and will be reused to make each sub-source * file. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/06/08 20:55:35 $ * @since November 26, 2003 */ public class XmlSourceReportGenerator2 implements IXmlSourceReportConst { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( XmlCombinedReportGenerator.class ); private SourceNodeMap sourceNodeMap = new SourceNodeMap(); private Node moduleTypesNode; private static class SourceNodes { public List coverNodes = new LinkedList(); public Map uncoveredMarkNodesByLine = new HashMap(); public List noLine = new LinkedList(); public void addCoverNode( Element e ) { // we're going to move the marks out of this.coverNodes.add( e ); NodeList nl = e.getElementsByTagName( T_MARK ); for (int i = 0; i < nl.getLength(); ++i) { Node node = nl.item(i); if (node instanceof Element) { Element me = (Element)node; if (!"true".equals( me.getAttribute( A_COVERED ) )) { Element methodNode = (Element)me.getParentNode(); me.setAttribute( A_METHODSIGNATURE, methodNode.getAttribute( A_METHODSIGNATURE ) ); me.setAttribute( A_METHODSIGNATURE_REAL, methodNode.getAttribute( A_METHODSIGNATURE_REAL ) ); String line = me.getAttribute( A_SOURCELINE ); List marks; if ("-1".equals( line )) { marks = this.noLine; } else { marks = (List)this.uncoveredMarkNodesByLine. get( line ); if (marks == null) { marks = new LinkedList(); this.uncoveredMarkNodesByLine.put( line, marks ); } } marks.add( me ); } } } } public void copyClassCoverInto( Element rootEl, Document doc ) { copyNodesInto( this.coverNodes, rootEl, doc ); } public int getNoLineMarkCount() { return this.noLine.size(); } public void copyMarksInto( int lineNo, Element rootEl, Document doc ) { List marks; if (lineNo < 0) { marks = this.noLine; } else { marks = (List)this.uncoveredMarkNodesByLine.get( Integer.toString( lineNo ) ); } copyNodesInto( marks, rootEl, doc ); } public boolean copyAllMarksInto( Element rootEl, Document doc ) { boolean added = false; Iterator iter = this.uncoveredMarkNodesByLine.keySet().iterator(); while (iter.hasNext()) { added = copyNodesInto( (List)this.uncoveredMarkNodesByLine. get( iter.next() ), rootEl, doc ); } return added; } private boolean copyNodesInto( Collection src, Element rootEl, Document doc ) { boolean added =false; if (src != null) { Iterator iter = src.iterator(); while (iter.hasNext()) { added = true; rootEl.appendChild( copyNode( (Node)iter.next(), doc ) ); } } return added; } } private static class SourceNodeMap { private Map sourceFileMap = new HashMap(); public void addClassCoverageNode( Node n ) { if (n instanceof Element) { Element e = (Element)n; String name = getSourceName( e ); SourceNodes sn = getSource( name ); if (sn == null) { sn = new SourceNodes(); this.sourceFileMap.put( name, sn ); } sn.addCoverNode( e ); } } public SourceNodes getSource( String name ) { return (SourceNodes)this.sourceFileMap.get( name ); } public String[] getSourceNames() { Set keys = this.sourceFileMap.keySet(); return (String[])keys.toArray( new String[ keys.size() ] ); } } public XmlSourceReportGenerator2( Document coverageReport ) { if (coverageReport == null) { throw new IllegalArgumentException( "No null args" ); } NodeList list = coverageReport.getDocumentElement(). getElementsByTagName( T_CLASSCOVERAGE ); for (int i = 0; i < list.getLength(); ++i) { this.sourceNodeMap.addClassCoverageNode( list.item(i) ); } this.moduleTypesNode = coverageReport.getDocumentElement(). getElementsByTagName( "moduletypes" ).item(0); } public String[] getSourceNames() { return this.sourceNodeMap.getSourceNames(); } /** * Sends the generated report using the given module * and data set. * * @return the root element generated. */ public Document createXML( String srcName, File srcFile ) throws IOException { SourceNodes coverageNodes = this.sourceNodeMap.getSource( srcName ); if (coverageNodes == null) { throw new IllegalArgumentException( "No such source: "+ srcName ); } // this is a bit slower, but it conserves some memory resources. DocumentBuilder docBuilder = getDocumentBuilder(); Document doc = docBuilder.newDocument(); Element rootEl = doc.createElement( T_JAVACOVERAGE ); doc.appendChild( rootEl ); rootEl.setAttribute( A_JAVACLASS, srcName ); rootEl.appendChild( copyNode( this.moduleTypesNode, doc ) ); parseSourceFile( srcFile, rootEl, doc, coverageNodes ); coverageNodes.copyClassCoverInto( rootEl, doc ); return doc; } protected void parseSourceFile( File src, Element parent, Document doc, SourceNodes sourceNode ) throws IOException { // everyone needs this. Element nolineEl = null; if (sourceNode.getNoLineMarkCount() > 0) { nolineEl = doc.createElement( T_NO_LINE ); sourceNode.copyMarksInto( -1, nolineEl, doc ); } // If the file doesn't exist, don't fail. Just put it in the report. if (src == null || !src.exists() || !src.isFile()) { Element nosrcEl = doc.createElement( T_NO_SOURCE ); parent.appendChild( nosrcEl ); // System.out.println( "No source file" ); if (nolineEl != null) { nosrcEl.appendChild( nolineEl ); nolineEl.setAttribute( A_INDEX, Integer.toString( -1 ) ); nolineEl.setAttribute( A_SRC, "Could not find source file." ); } Element nsmEl = doc.createElement( T_NO_SOURCE_MARKS ); if (sourceNode.copyAllMarksInto( nsmEl, doc )) { nosrcEl.appendChild( nsmEl ); } return; } // else, parse the source file. Element srcEl = doc.createElement( T_SOURCE ); parent.appendChild( srcEl ); if (nolineEl != null) { srcEl.appendChild( nolineEl ); } BufferedReader in = new BufferedReader( new FileReader( src ) ); try { int lineNo = 0; for (String line = in.readLine(); line != null; line = in.readLine()) { ++lineNo; // should color-code the line according to Java syntax. // But, we can't guarantee that the source is Java! It // might be NetRexx or any number of other source types. Element lineEl = doc.createElement( T_LINE ); srcEl.appendChild( lineEl ); lineEl.setAttribute( A_INDEX, Integer.toString( lineNo ) ); lineEl.setAttribute( A_SRC, line ); sourceNode.copyMarksInto( lineNo, lineEl, doc ); } } finally { if (in != null) { in.close(); } } } protected static Node copyNode( Node el, Document doc ) { return doc.importNode( el, true ); } //------------------------------------------------------------------------ // Private methods private static DocumentBuilder getDocumentBuilder() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (Exception exc) { throw new ExceptionInInitializerError(exc); } } private static String getSourceName( Element coverageEl ) { String pkg = coverageEl.getAttribute( A_PACKAGE ); String src = coverageEl.getAttribute( A_SOURCEFILE ); return makeSourceName( pkg, src ); } private static String makeSourceName( String pkg, String srcFile ) { if (pkg == null || pkg.length() <= 0) { return srcFile; } pkg = pkg.replace( '.', File.separatorChar ); return pkg + File.separatorChar + srcFile; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/PackageSorter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000731010037421052034251 0ustar drazzibdrazzib/* * @(#)PackageSorter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; /** * Sorts classes into packages. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 * @see IAnalysisMetaData */ public class PackageSorter { private Map packagesToClassSet = new HashMap(); /** * */ public PackageSorter() { // do nothing } public void addClassSignatures( String classSigs[] ) { if (classSigs == null) { throw new IllegalArgumentException("no null args"); } for (int i = 0; i < classSigs.length; ++i) { addClassSignature( classSigs[i] ); } } public void addClassSignature( String classSig ) { if (classSig == null) { throw new IllegalArgumentException("no null args"); } String packageName = getPackageName( classSig ); Set classSigSet = (Set)this.packagesToClassSet.get( packageName ); if (classSigSet == null) { classSigSet = new HashSet(); this.packagesToClassSet.put( packageName, classSigSet ); } classSigSet.add( classSig ); } /** * Returns a list of all registered packages. */ public String[] getPackages() { Set s = this.packagesToClassSet.keySet(); String[] pkgs = (String[])s.toArray( new String[ s.size() ] ); return pkgs; } /** * Returns all class signatures for a specific package. */ public String[] getClassSignaturesForPackage( String packageName ) { Set s = (Set)this.packagesToClassSet.get( packageName ); if (s == null) { return new String[0]; } return (String[])s.toArray( new String[ s.size() ] ); } public static String getPackageName( String classSig ) { if (classSig == null) { throw new IllegalArgumentException("no null args"); } String pkg = ""; int pos = classSig.lastIndexOf( '.' ); if (pos >= 0) { pkg = classSig.substring( 0, pos ); } return pkg; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/IXmlCombinedReportConst.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000361207761545556034304 0ustar drazzibdrazzib/* * @(#)IXmlCombinedReportConst.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; /** * Contains constants for the combined report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/11/28 04:13:34 $ * @since November 25, 2003 */ public interface IXmlCombinedReportConst extends IXmlReportConst { public static final String T_MODULETYPES = "moduletypes"; public static final String T_MODULE = "module"; // public static final String A_MEASURE = "measure"; // public static final String A_UNIT = "unit"; public static final String T_MODULECOVER = "modulecover"; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000003230010037421052034246 0ustar drazzibdrazzib/* * @(#)ClassMarkSet.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord; /** * Contains all the marks (sorted by covered and not covered) per method. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 * @see IAnalysisMetaData */ public class ClassMarkSet { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( ClassMarkSet.class ); private String[] methodNames; private Map methodToCoveredMarks; private Map methodToNotCoveredMarks; //------------------------------------------------------------------------ /** * Container data for a mark and whether it were covered. * Instances of this class are only used in the ClassMarkSet constructor. */ private static class DidCover { public MarkRecord mr; public boolean wasCovered; public DidCover( MarkRecord mr ) { if (mr == null) { throw new IllegalArgumentException("no null args."); } this.mr = mr; } public void cover() { this.wasCovered = true; } public String toString() { return this.mr.toString(); } } //------------------------------------------------------------------------ /** * Convienient way to store marks and their mark index relationship. * Instances of this class are only used in the ClassMarkSet constructor. */ private static class MarkSet { private short methodIndex; private String methodName; private Map markSet = new HashMap(); public MarkSet( String name, short methIndex ) { this.methodName = name; this.methodIndex = methIndex; } public String getMethodName() { return this.methodName; } public short getMethodIndex() { return this.methodIndex; } public void addMark( MarkRecord mr ) { if (this.methodIndex != mr.getMethodIndex()) { throw new IllegalStateException( "Put mark in wrong method bucket."); } Short index = new Short( mr.getMarkIndex() ); if (!this.markSet.containsKey( index )) { this.markSet.put( index, new DidCover( mr ) ); } else { throw new IllegalArgumentException( "Mark index "+index+ " is in the MarkRecord list mroe than once." ); } } public void coverMark( short index ) { DidCover dc = getMark( index ); if (dc != null) { dc.cover(); } else { // the marks and the logs are out-of-sync /* LOG.fatal( "Channel log record "+ "has mark "+index+" in method "+getMethodName()+ " [index "+getMethodIndex()+ "] which is not known by the class records." ); */ throw new IllegalArgumentException( "Channel log record "+ "has mark "+index+" in method "+getMethodName()+ " [index "+getMethodIndex()+ "] which is not known by the class records." ); } } public DidCover getMark( short index ) { return (DidCover)this.markSet.get( new Short( index ) ); } public MarkRecord[] getMarksOfType( boolean type ) { List out = new ArrayList(); Iterator iter = this.markSet.values().iterator(); while (iter.hasNext()) { DidCover dc = (DidCover)iter.next(); if (dc.wasCovered == type) { out.add( dc.mr ); } } return (MarkRecord[])out.toArray( new MarkRecord[ out.size() ] ); } } //------------------------------------------------------------------------ /** * Convienient way to store the sorted methods and their data. * Instances of this class are only used in the ClassMarkSet constructor. */ private static class MethodSet { private String methodNames[]; private Map perMethodItems = new HashMap(); public MethodSet( String methNames[], MarkRecord mrL[] ) { this.methodNames = copyStringArray( methNames ); for (int i = 0; i < methNames.length; ++i) { if (methNames[i] == null) { throw new IllegalArgumentException( "No null args." ); } this.perMethodItems.put( methNames[i], new MarkSet( methNames[i], (short)i ) ); } int len = mrL.length; for (int i = 0; i < len; ++i) { if (mrL[i] == null) { throw new IllegalArgumentException( "No null args." ); } String sig = mrL[i].getMethodSignature(); MarkSet ms = get( sig ); if (ms == null) { throw new IllegalArgumentException( "Found mark for method "+sig+ " which was not in the method list." ); } // assurance if (ms.getMethodIndex() != mrL[i].getMethodIndex()) { throw new IllegalArgumentException( "The signature order from ClassRecord ["+ ms.getMethodIndex()+ " does not match the method index ["+ mrL[i].getMethodIndex()+"] for the mark." ); } ms.addMark( mrL[i] ); } } public int getMethodCount() { return this.methodNames.length; } public String[] getMethodNames() { return copyStringArray( this.methodNames ); } public short getMethodIndex( String methName ) { MarkSet ms = get( methName ); if (ms == null) { return (short)-1; } return ms.getMethodIndex(); } public String getMethodByIndex( short index ) { int iindex = (int)index; String names[] = getMethodNames(); if (iindex < 0 || iindex >= names.length) { return null; } return names[ iindex ]; } public Iterator nameIterator() { return this.perMethodItems.keySet().iterator(); } public MarkSet get( String methName ) { return (MarkSet)this.perMethodItems.get( methName ); } public MarkSet get( short methodIndex ) { return get( getMethodByIndex( methodIndex ) ); } } //------------------------------------------------------------------------ /** * */ ClassMarkSet( String className, String methodSigs[], MarkRecord[] marks, IChannelLogRecord[] classLogs ) { if (marks == null || classLogs == null || methodSigs == null) { throw new IllegalArgumentException( "No null args." ); } this.methodNames = copyStringArray( methodSigs ); MethodSet set = new MethodSet( methodSigs, marks ); coverMarks( set, classLogs ); this.methodToCoveredMarks = getMarksOfType( set, true ); this.methodToNotCoveredMarks = getMarksOfType( set, false ); } /** * Return all the methods known by the list of marks and class logs. */ public String[] getMethodSignatures() { String s[] = this.methodNames; List list = new ArrayList( s.length ); for (int i = 0; i < s.length; ++i) { if (s[i] != null) { list.add( s[i] ); } } return (String[])list.toArray( new String[ list.size() ] ); } /** * Return all the marks that were covered during the execution of the * given method. Guaranteed to never return null. */ public MarkRecord[] getCoveredMarksForMethod( String methodSig ) { MarkRecord[] mrL = (MarkRecord[])this.methodToCoveredMarks.get( methodSig ); if (mrL == null) { throw new IllegalArgumentException( "Unknown method: "+methodSig ); } return mrL; } /** * Return all the marks that were not executed during the runtime * of the given method. Guaranteed to never return null. */ public MarkRecord[] getNotCoveredMarksForMethod( String methodSig ) { MarkRecord[] mrL = (MarkRecord[])this.methodToNotCoveredMarks.get( methodSig ); if (mrL == null) { throw new IllegalArgumentException( "Unknown method: "+methodSig ); } return mrL; } //------------------------------------------------------------------------ // Examine the input data and organize it private void coverMarks( MethodSet methods, IChannelLogRecord[] classLogs ) { for (int i = 0; i < classLogs.length; ++i) { IChannelLogRecord clr = classLogs[i]; if (clr == null) { throw new IllegalArgumentException( "no null args" ); } short markIndex = clr.getMarkIndex(); short methIndex = clr.getMethodIndex(); //LOG.debug( "Covering method "+mi+", mark "+markIndex ); MarkSet ms = methods.get( methIndex ); if (ms != null) { ms.coverMark( markIndex ); } else { // the marks and the logs are out-of-sync /* // let's assume that it's ok. LOG.fatal( "Channel log record "+ "refers to a method index ("+methIndex+ ") that is not known by the class records (mark = "+ markIndex+")." ); */ throw new IllegalArgumentException( "Channel log record "+ "refers to a method index ("+methIndex+ ") that is not known by the class records (mark = "+ markIndex+")." ); } } } private Map getMarksOfType( MethodSet methods, boolean covered ) { Map map = new HashMap(); Iterator iter = methods.nameIterator(); while (iter.hasNext()) { String methName = (String)iter.next(); MarkSet ms = methods.get( methName ); map.put( methName, ms.getMarksOfType( covered ) ); } return map; } private static String[] copyStringArray( String in[] ) { int len = in.length; String out[] = new String[ len ]; System.arraycopy( in, 0, out, 0, len ); return out; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/IXmlSourceReportConst.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000424510071613422034257 0ustar drazzibdrazzib/* * @(#)IXmlCombinedReportConst.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; /** * Contains constants for generating a Java-source XML report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/06/08 20:55:35 $ * @since November 26, 2003 */ public interface IXmlSourceReportConst extends IXmlReportConst { public static final String T_JAVACOVERAGE = "javacoverage"; public static final String A_JAVACLASS = "javaclass"; public static final String T_SOURCE = "source"; public static final String T_LINE = "line"; public static final String A_INDEX = "i"; public static final String A_SRC = "src"; public static final String T_NO_LINE = "noline"; public static final String T_NO_SOURCE = "nosource"; public static final String T_NO_SOURCE_MARKS = "nosource-marks"; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/IReportGenerator.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000461710037421052034260 0ustar drazzibdrazzib/* * @(#)IReportGenerator.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import org.w3c.dom.Element; /** * Interface for all classes that generate reports of coverage data. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 * @see IAnalysisMetaData */ public interface IReportGenerator { /** * Sends the generated report to out using the given module * and data set. * * @param module the measure which is being reported. * @param data the set of data to report. * @return the root element generated. * @exception IOException thrown if writing to out causes an * IOException. * @exception IllegalArgumentException thrown if any argument is * null. */ public Element createReport( IAnalysisModule module, AnalysisModuleData data ) throws IOException; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/XmlCombinedReportGenerator.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000004520710037421052034260 0ustar drazzibdrazzib/* * @(#)XmlCombinedReportGenerator.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.IOException; import java.text.NumberFormat; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** * Combines all the XML Reports into a single XML report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 18, 2002 * @see IAnalysisMetaData */ public class XmlCombinedReportGenerator implements IXmlCombinedReportConst { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( XmlCombinedReportGenerator.class ); private static final NumberFormat DFORMAT = NumberFormat.getInstance(); private static final NumberFormat IFORMAT = NumberFormat.getInstance(); static { DFORMAT.setMaximumFractionDigits( 2 ); DFORMAT.setMinimumFractionDigits( 2 ); IFORMAT.setMaximumFractionDigits( 0 ); } private DocumentBuilder docBuilder = getDocumentBuilder(); private static class Report { String measureName; String unitName; Element current; public Report( Document doc ) { Element e = doc.getDocumentElement(); if (!T_COVERAGEREPORT.equals( e.getTagName() )) { throw new IllegalArgumentException( "Document root is not "+ T_COVERAGEREPORT ); } this.measureName = e.getAttribute( A_MEASURE ); this.unitName = e.getAttribute( A_UNIT ); if (this.measureName == null || this.measureName.length() <= 0 || this.unitName == null || this.unitName.length() <= 0) { throw new IllegalArgumentException( "Document root is not a proper "+T_COVERAGEREPORT ); } this.current = e; } public Report( String mn, String un, Element c ) { this.measureName = mn; this.unitName = un; this.current = c; } public Report getFirst( String childName ) { NodeList list = this.current.getChildNodes(); for (int i = 0; i < list.getLength(); ++i) { if (list.item(i) instanceof Element) { Element e = (Element)list.item(i); if (e.getTagName().equals( childName )) { return new Report( this.measureName, this.unitName, e ); } } } return null; } public Report[] getAll( String childName ) { NodeList list = this.current.getChildNodes(); List out = new LinkedList(); for (int i = list.getLength(); --i >= 0;) { if (list.item(i) instanceof Element) { Element e = (Element)list.item(i); if (e.getTagName().equals( childName )) { out.add( new Report( this.measureName, this.unitName, e ) ); } } } Report r[] = (Report[])out.toArray( new Report[ out.size() ] ); return r; } } /** * Contains all reports at the same element depth */ private static class ReportSet { private Map reports = new HashMap(); public ReportSet( Document docs[] ) { for (int i = 0; i < docs.length; ++i) { Report r = new Report( docs[i] ); this.reports.put( r.measureName, r ); } } public ReportSet( Report r[] ) { for (int i = 0; i < r.length; ++i) { this.reports.put( r[i].measureName, r[i] ); } } public ReportSet getFirst( String childName ) { Iterator iter = getMeasureNames(); List reps = new LinkedList(); while (iter.hasNext()) { Report r = getReport( (String)iter.next() ); if (r != null) { r = r.getFirst( childName ); if (r != null) { reps.add( r ); } } } return new ReportSet( (Report[])reps.toArray( new Report[ reps.size() ] ) ); } public Report getReport( String measureName ) { Object o = this.reports.get( measureName ); if (!(o instanceof Report)) { throw new IllegalStateException("Expected Report, but found " +o+" ("+o.getClass()+")" ); } Report r = (Report)o; //Report r = (Report)this.reports.get( measureName ); /* there might be an empty measure for this sub-element. if (r == null) { throw new IllegalArgumentException( "Unknown measure name "+measureName ); } */ return r; } // helper method. public Report nextReport( Iterator iter ) { return getReport( (String)iter.next() ); } public Iterator getMeasureNames() { return this.reports.keySet().iterator(); } } /** * Create a report from the given report set. * * @return the root element generated. */ public Element createReport( Document reports[] ) throws IOException { if (reports == null) { throw new IllegalArgumentException("no null args"); } Document doc = this.docBuilder.newDocument(); Element rootEl = createRootNode( doc ); ReportSet rootDocs = new ReportSet( reports ); join( doc, rootEl, rootDocs ); return rootEl; } private Element createRootNode( Document doc ) { if (doc == null) { throw new IllegalArgumentException("no null args"); } Element rootEl = doc.createElement( T_COVERAGEREPORT ); doc.appendChild( rootEl ); return rootEl; } private void join( Document doc, Element rootEl, ReportSet reports ) { // make a top-level node that describes all the measure types Element moduleTypesEl = doc.createElement( T_MODULETYPES ); rootEl.appendChild( moduleTypesEl ); Iterator iter = reports.getMeasureNames(); while (iter.hasNext()) { Report r = reports.nextReport( iter ); Element moduleEl = doc.createElement( T_MODULE ); moduleTypesEl.appendChild( moduleEl ); moduleEl.setAttribute( A_MEASURE, r.measureName ); moduleEl.setAttribute( A_UNIT, r.unitName ); } // join the total coverage numbers joinCoverage( doc, rootEl, reports.getFirst( T_COVER ) ); // join the package coverage numbers ReportSet[] byPackage = sort( reports, T_PACKAGE, A_NAME ); for (int i = 0; i < byPackage.length; ++i) { joinPackage( doc, rootEl, byPackage[i] ); } // join the class coverage numbers ReportSet[] byClass = sort( reports, T_CLASSCOVERAGE, A_CLASSSIGNATURE ); for (int i = 0; i < byClass.length; ++i) { joinClass( doc, rootEl, byClass[i] ); } } private void joinClass( Document doc, Element parentEl, ReportSet reports ) { Iterator iter = reports.getMeasureNames(); if (!iter.hasNext()) { throw new IllegalStateException("No class elements."); } Element classEl = doc.createElement( T_CLASSCOVERAGE ); parentEl.appendChild( classEl ); // join the coverage numbers joinCoverage( doc, classEl, reports.getFirst( T_COVER ) ); Report r = reports.nextReport( iter ); iter = null; classEl.setAttribute( A_CLASSSIGNATURE, r.current.getAttribute( A_CLASSSIGNATURE ) ); classEl.setAttribute( A_CLASSNAME, r.current.getAttribute( A_CLASSNAME ) ); classEl.setAttribute( A_PACKAGE, r.current.getAttribute( A_PACKAGE ) ); classEl.setAttribute( A_SOURCEFILE, r.current.getAttribute( A_SOURCEFILE ) ); r = null; // join the method coverage numbers ReportSet[] byMethod = sort( reports, T_METHODCOVERAGE, A_METHODSIGNATURE ); for (int i = 0; i < byMethod.length; ++i) { joinMethod( doc, classEl, byMethod[i] ); } } private void joinMethod( Document doc, Element parentEl, ReportSet reports ) { Iterator iter = reports.getMeasureNames(); if (!iter.hasNext()) { throw new IllegalStateException("No class elements."); } Element methodEl = doc.createElement( T_METHODCOVERAGE ); parentEl.appendChild( methodEl ); boolean notSetup = true; while (iter.hasNext()) { Report r = reports.nextReport( iter ); if (notSetup) { methodEl.setAttribute( A_METHODSIGNATURE, r.current.getAttribute( A_METHODSIGNATURE ) ); methodEl.setAttribute( A_METHODSIGNATURE_REAL, r.current.getAttribute( A_METHODSIGNATURE_REAL ) ); notSetup = false; } Report marks[] = r.getAll( T_MARK ); for (int i = 0; i < marks.length; ++i) { joinMark( doc, methodEl, marks[i] ); } } // join the coverage numbers joinCoverage( doc, methodEl, reports.getFirst( T_COVER ) ); } private void joinMark( Document doc, Element parentEl, Report mark ) { // original // Element mEl = doc.createElement( T_MARK ); parentEl.appendChild( mEl ); mEl.setAttribute( A_MEASURE, mark.measureName ); mEl.setAttribute( A_COVERED, mark.current.getAttribute( A_COVERED ) ); mEl.setAttribute( A_INDEX, mark.current.getAttribute( A_INDEX ) ); mEl.setAttribute( A_TEXT, mark.current.getAttribute( A_TEXT ) ); mEl.setAttribute( A_WEIGHT, mark.current.getAttribute( A_WEIGHT ) ); mEl.setAttribute( A_SOURCELINE, mark.current.getAttribute( A_SOURCELINE ) ); } /** * Join a package element together */ private void joinPackage( Document doc, Element parentEl, ReportSet reports ) { Iterator iter = reports.getMeasureNames(); if (!iter.hasNext()) { throw new IllegalStateException("No package elements."); } Element packageEl = doc.createElement( T_PACKAGE ); parentEl.appendChild( packageEl ); Report r = reports.nextReport( iter ); iter = null; packageEl.setAttribute( A_NAME, r.current.getAttribute( A_NAME ) ); r = null; joinCoverage( doc, packageEl, reports.getFirst( T_COVER ) ); } private void joinCoverage( Document doc, Element parentEl, ReportSet reports ) { joinCoverage( doc, parentEl, reports, false ); } /** * Join the coverage numbers together. */ private void joinCoverage( Document doc, Element parentEl, ReportSet reports, boolean debug ) { Element coverEl = doc.createElement( T_COVER ); parentEl.appendChild( coverEl ); if (debug) { System.out.println("jc: Adding coverage to "+parentEl.getTagName()); } Iterator iter = reports.getMeasureNames(); int measureCount = 0; int coveredCount = 0; int totalCount = 0; double weightedPercentTotal = 0.0; while (iter.hasNext()) { Report r = reports.nextReport( iter ); if (debug) { System.out.println("jc: - Adding measure "+r.measureName); System.out.println("jc: - measure parent = "+ ((Element)r.current.getParentNode()).getTagName()); } Element modCoverEl = doc.createElement( T_MODULECOVER ); coverEl.appendChild( modCoverEl ); modCoverEl.setAttribute( A_MEASURE, r.measureName ); Element cur = r.current; ++measureCount; coveredCount += parseI( cur.getAttribute( A_COVERED ) ); totalCount += parseI( cur.getAttribute( A_TOTAL ) ); weightedPercentTotal += parseD( cur.getAttribute( A_WEIGHTEDPERCENT ) ); modCoverEl.setAttribute( A_COVERED_DISP, cur.getAttribute( A_COVERED_DISP ) ); modCoverEl.setAttribute( A_COVERED, cur.getAttribute( A_COVERED ) ); modCoverEl.setAttribute( A_TOTAL_DISP, cur.getAttribute( A_TOTAL_DISP ) ); modCoverEl.setAttribute( A_TOTAL, cur.getAttribute( A_TOTAL ) ); modCoverEl.setAttribute( A_PERCENTCOVERED_DISP, cur.getAttribute( A_PERCENTCOVERED_DISP ) ); modCoverEl.setAttribute( A_PERCENTCOVERED, cur.getAttribute( A_PERCENTCOVERED ) ); modCoverEl.setAttribute( A_WEIGHTEDPERCENT_DISP, cur.getAttribute( A_WEIGHTEDPERCENT_DISP ) ); modCoverEl.setAttribute( A_WEIGHTEDPERCENT, cur.getAttribute( A_WEIGHTEDPERCENT ) ); } double perc = 100.0; if (totalCount > 0) { perc = (double)coveredCount * 100.0 / (double)totalCount; } // not totally accurate, but it works, and the value isn't used right now double weight = 100.0; if (measureCount > 0) { weight = weightedPercentTotal / (double)measureCount; } coverEl.setAttribute( A_COVERED_DISP, format( coveredCount ) ); coverEl.setAttribute( A_COVERED, formatNumber( coveredCount ) ); coverEl.setAttribute( A_TOTAL_DISP, format( totalCount ) ); coverEl.setAttribute( A_TOTAL, formatNumber( totalCount ) ); coverEl.setAttribute( A_PERCENTCOVERED_DISP, format( perc ) ); coverEl.setAttribute( A_PERCENTCOVERED, formatNumber( perc ) ); coverEl.setAttribute( A_WEIGHTEDPERCENT_DISP, format( weight ) ); coverEl.setAttribute( A_WEIGHTEDPERCENT, formatNumber( weight ) ); } //----------------------------------------------------------------------- // Helper / utilities private String format( int i ) { return IFORMAT.format( (long)i ); } private String format( double d ) { return DFORMAT.format( d ); } private String formatNumber( int i ) { return Integer.toString( i ); } private String formatNumber( double d ) { return Double.toString( d ); } private int parseI( String s ) { try { return IFORMAT.parse( s ).intValue(); } catch (java.text.ParseException e) { throw new IllegalStateException( "Expected an integer, but found "+ s ); } } private double parseD( String s ) { try { return DFORMAT.parse( s ).doubleValue(); } catch (java.text.ParseException e) { throw new IllegalStateException( "Expected a number, but found "+ s ); } } private ReportSet[] sort( ReportSet reports, String tagName, String attrName ) { Map reportsByPackage = new HashMap(); Iterator iter = reports.getMeasureNames(); while (iter.hasNext()) { Report r = reports.nextReport( iter ); Report[] subs = r.getAll( tagName ); for (int i = 0; i < subs.length; ++i) { String val = subs[i].current.getAttribute( attrName ); List s = (List)reportsByPackage.get( val ); if (s == null) { s = new LinkedList(); reportsByPackage.put( val, s ); } s.add( subs[i] ); } } List sets = new LinkedList(); iter = reportsByPackage.values().iterator(); while (iter.hasNext()) { List rep = (List)iter.next(); ReportSet rs = new ReportSet( (Report[])rep.toArray( new Report[ rep.size() ] ) ); sets.add( rs ); } return (ReportSet[])sets.toArray( new ReportSet[ sets.size() ] ); } private static DocumentBuilder getDocumentBuilder() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (Exception exc) { throw new ExceptionInInitializerError(exc); } } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/OutputXml.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000000516610037421052034260 0ustar drazzibdrazzib/* * @(#)OutputXml.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.IOException; import java.io.Writer; import org.apache.tools.ant.util.DOMElementWriter; import org.w3c.dom.Element; /** * Writes the XML document to an output stream. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since March 15, 2004 */ public class OutputXml { public static final String DEFAULT_ENCODING = "UTF-8"; /** * Sends the XML document to out using the given module * and data set. * * @param rootEl the root element of the XML document. * @param out the output stream to send the XML document. * The writer is not closed by this method. * @param encoding the output encoding of the given writer. Defaults to * UTF-8. * @return the root element generated. */ public void write( Element rootEl, Writer out, String encoding ) throws IOException { if (out == null) { throw new IllegalArgumentException("no null args"); } if (encoding == null) { encoding = DEFAULT_ENCODING; } out.write("\n"); (new DOMElementWriter()).write(rootEl, out, 0, " "); out.flush(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report/AnalysisModuleData.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/report0000644000175000017500000001171210037421052034252 0ustar drazzibdrazzib/* * @(#)AnalysisModuleData.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.IOException; import java.util.HashSet; import java.util.Set; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord; /** * Combine all post-compilation data along with the coverage logs for * a specific analysis module. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 * @see IAnalysisMetaData */ public class AnalysisModuleData { private IChannelLogReader logReader; private IClassMetaDataReader mdReader; private IAnalysisModule am; /** * */ public AnalysisModuleData( IAnalysisModule module, IMetaDataReader mdr, IChannelLogReader clr ) throws IOException { if (module == null || mdr == null || clr == null) { throw new IllegalArgumentException( "No null args." ); } this.mdReader = mdr.getClassReader( module ); this.logReader = clr; this.am = module; } /** * Retrieves the corresponding analysis module. */ public IAnalysisModule getAnalysisModule() { return this.am; } /** * Return the list of all class signatures for the module from the * post-compilation reader. */ public String[] getClassSignatures() throws IOException { String cs[] = this.mdReader.getClassSignatures(); return cs; } /** * Retrieves the class record with all marks. */ public ClassRecord getClassRecord( String classSig ) throws IOException { return this.mdReader.readClass( classSig ); } /** * Retrieves all the mark records for the given class. */ public MarkRecord[] getAllClassMarks( String classSig ) throws IOException { return getClassRecord( classSig ).getMarksForAnalysisModule( this.am ); } /** * Retrieves all unique log records for this module. */ public IChannelLogRecord[] getChannelLogRecords( String classSig ) throws IOException { Set set = new HashSet(); IClassChannelLogReader reader = this.logReader. getReaderForClassSignature( classSig ); IChannelLogRecord clr = reader.nextRecord(); while (clr != null) { set.add( clr ); clr = reader.nextRecord(); } IChannelLogRecord[] records = (IChannelLogRecord[])set.toArray( new IChannelLogRecord[ set.size() ] ); return records; } /** * Retrieves the sorted (by covered/not covered) set of marks * for the class. */ public ClassMarkSet createClassMarkSet( String classSig ) throws IOException { ClassRecord cr = getClassRecord( classSig ); ClassMarkSet cms = new ClassMarkSet( cr.getClassName(), cr.getMethods(), getAllClassMarks( classSig ), getChannelLogRecords( classSig ) ); return cms; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IClassChannelLogReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IClass0000644000175000017500000000416407622026355034135 0ustar drazzibdrazzib/* * @(#)IClassChannelLogReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.IOException; /** * Reads in all the records that were written to the corresponding logger via * the "cover" method for a specific class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 15, 2002 */ public interface IClassChannelLogReader { /** * Reads the next record from the log. If there are no more records, then * null is returned. These do not need to be returned in any * specific order, and there can be duplicate entries. * * @return the next log record. * @exception IOException thrown if there was an underlying problem reading * from the log. */ public IChannelLogRecord nextRecord() throws IOException; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChannelLogReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChann0000644000175000017500000000413407622026355034114 0ustar drazzibdrazzib/* * @(#)IChannelLogReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.IOException; /** * Reads in all the records that were written to the corresponding logger via * the "cover" method. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 15, 2002 */ public interface IChannelLogReader { /** * Returns a channel reader for a specific class signature. * * @return the reader for the given class signature. If there are no * logs for the given class, then the reader will not return anything. * @exception IOException thrown if there was an underlying problem reading * from the log. */ public IClassChannelLogReader getReaderForClassSignature( String signature ) throws IOException; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IAnaly0000644000175000017500000000561707622026355034140 0ustar drazzibdrazzib/* * @(#)IAnalysisMetaData.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; /** * Contains data necessary for storing the meta-data associated with a specific * marked bytecode instruction. *

    * There is an optional "weight" value which can associate a number from * -128 to 127 for this particular instruction. This will create a weighted * coverage value to indicate on each summary level how important it is * for this particular bytecode to be executed. If the analysis module doesn't * use weights, then this should return the same value for all instructions. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 15, 2002 */ public interface IAnalysisMetaData { /** * Returns the formatted, localized text for a report on this instruction * if it was covered during the runtime execution. * * @return formatted, localized, human-readable report */ public String getCoveredFormattedText(); /** * Returns the formatted, localized text for a report on this instruction * if it was not covered during the runtime execution. * * @return formatted, localized, human-readable report */ public String getNotCoveredFormattedText(); /** * Returns any value in the range of a byte that assigns an * importance "weight" to this instruction. If weights are not used * by the analysis module, then this needs to return the same value * for every instruction. * * @return an instruction weight value. */ public byte getInstructionWeight(); } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000755000175000017500000000000011271425773034231 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/DefaultChannelLogRecord.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000622110040164707034222 0ustar drazzibdrazzib/* * @(#)DefaultChannelLogRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; /** * A standard implementation of a channel log record. Includes an * equals( Object ) and hashCode() implementation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/17 08:24:39 $ * @since December 17, 2002 */ public final class DefaultChannelLogRecord implements IChannelLogRecord { private String sig; private short methIndex; private short markIndex; public DefaultChannelLogRecord( String s, short me, short ma ) { if (s == null) { throw new IllegalArgumentException("no null args"); } this.sig = s; this.methIndex = me; this.markIndex = ma; } public boolean equals( Object o ) { if (o == null) { return false; } if (this == o) { return true; } if (o instanceof IChannelLogRecord) { IChannelLogRecord dclr = (IChannelLogRecord)o; if (dclr.getClassSignature().equals( this.sig ) && dclr.getMethodIndex() == this.methIndex && dclr.getMarkIndex() == this.markIndex) { return true; } } return false; } public int hashCode() { return this.sig.hashCode() + (int)this.methIndex + (int)this.markIndex; } public String getClassSignature() { return this.sig; } public short getMethodIndex() { return this.methIndex; } public short getMarkIndex() { return this.markIndex; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/FileSingleSourceLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001111010072742276034223 0ustar drazzibdrazzib/* * @(#)FileSingleSourceLoggerFactory.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.FileWriter; import java.io.Writer; import java.io.IOException; import java.util.Properties; /** * Output the shared marks to a file. *

    * Since this outputs to a single file, this has a potential issue * when multiple loggers are trying to access the same file. This * could happen if the CoverageLogger class is loaded by different class * loaders; as a result, multiple CoverageLogger instances will be created, * allowing for multiple channel loggers to write to the same area. *

    * We resolve this issue by adding a pseudo-random value to the end of * the file name. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:10 $ * @since April 16, 2004 */ public class FileSingleSourceLoggerFactory extends AbstractSingleSourceLoggerFactory { public static final String DIRECTORY_PROPERTY = "dir"; public static final String FILENAME_PROPERTY = "file"; private static final String DEFAULT_FILENAME_PREFIX = "single."; private static final String FILENAME_SUFFIX = ".log"; private File outfile; /** * Setup the source writer. This can return null. Its * actions will be synchronized for you. */ protected Writer setupSource() { setReloadSourceAfterError( false ); try { //System.out.println(":: Creating FileWriter for "+outfile.getAbsolutePath()); return new FileWriter( this.outfile ); } catch (IOException e) { e.printStackTrace(); return null; } } /** * Extend this method to setup your own properties. Be sure to * call the super's setupProps, though. Be sure to keep the * properties around for how to connect to the source. */ protected void setupProps( String prefix, Properties props ) { super.setupProps( prefix, props ); // fix the filename issue by adding a random value to the // name String pseudoRandom = Long.toString( System.currentTimeMillis() ) + Long.toString( Math.round( Math.random() * 1000.0 ) ) + FILENAME_SUFFIX; // the filename property should only really be used for debugging // purposes, as it invalidates the "single." prefix that the // report filter looks for. String filename = props.getProperty( prefix + FILENAME_PROPERTY ); if (filename != null) { this.outfile = new File( filename + pseudoRandom ); } else { String dir = props.getProperty( prefix + DIRECTORY_PROPERTY ); if (dir != null) { this.outfile = new File( dir, DEFAULT_FILENAME_PREFIX + pseudoRandom ); } } if (this.outfile == null) { this.outfile = new File( DEFAULT_FILENAME_PREFIX + pseudoRandom ); } File parent = this.outfile.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/SingleSourceLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000542510052047206034224 0ustar drazzibdrazzib/* * @(#)SingleSourceLogger.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; /** * Outputs the marks to the owning source. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/05/14 21:12:12 $ * @since April 16, 2004 */ public class SingleSourceLogger implements IChannelLogger { private short channel; private ISingleSource ss; public SingleSourceLogger( short channelIndex, ISingleSource ss ) { this.channel = channelIndex; this.ss = ss; } /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ) { if (this.ss != null) { this.ss.cover( this.channel, classSignature, methodIndex, markIndex ); } } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/MinDirChannelLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000726010040131360034213 0ustar drazzibdrazzib/* * @(#)MinDirChannelLoggerFactory.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.util.Properties; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * The singleton invoked at runtime to log each marked bytecode instruction * covered. *

    * This class needs to be fast, efficient, thread-safe, and classloader-safe. * "Classloader-safe" means that it needs to be resiliant to multiple instances * of this class being loaded, and possibly interfering with each other. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/12/03 22:17:31 $ * @since December 3, 2003 */ public class MinDirChannelLoggerFactory implements IChannelLoggerFactory { public static final String DIRECTORY_PROPERTY = "dir"; public static final String DEFAULT_DIRECTORY = "./.cover-logs"; /** * Creates a specific logger type. Initializes the logger based on the * given collection of properties. * * @param propertyPrefix the prefix that all logger properties will begin * with. Expect all logger-specific properties to be appended directly * to this string. * @param props the property collection to pull the logger properties from. * @param channelIndex channel number to log to. * @return the initialized logger. */ public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ) { String directory = getDirectory( propertyPrefix, props ); File dir = new File( directory, Short.toString( channelIndex ) ); if (dir.exists()) { if (!dir.isDirectory()) { System.err.println( "MinDirLogger base directory is a file."); dir = null; } } else { dir.mkdirs(); } return new MinDirChannelLogger( dir ); } protected String getDirectory( String propertyPrefix, Properties props ) { String directory = props.getProperty( propertyPrefix + DIRECTORY_PROPERTY ); if (directory == null) { directory = DEFAULT_DIRECTORY; } return directory; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/NoOpChannelLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000541410040131367034221 0ustar drazzibdrazzib/* * @(#)NoOpChannelLoggerFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.util.Properties; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * The singleton invoked at runtime to log each marked bytecode instruction * covered. *

    * This class needs to be fast, efficient, thread-safe, and classloader-safe. * "Classloader-safe" means that it needs to be resiliant to multiple instances * of this class being loaded, and possibly interfering with each other. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:28 $ * @since December 17, 2002 */ public class NoOpChannelLoggerFactory implements IChannelLoggerFactory { /** * Creates a specific logger type. Initializes the logger based on the * given collection of properties. * * @param propertyPrefix the prefix that all logger properties will begin * with. Expect all logger-specific properties to be appended directly * to this string. * @param props the property collection to pull the logger properties from. * @param channelIndex channel number to log to. * @return the initialized logger. */ public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ) { return new NoOpChannelLogger(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000026510071620045034220 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.logger A minimal package that is included in the runtime execution environment. ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/AbstractSingleSourceLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000003451210072742276034236 0ustar drazzibdrazzib/* * @(#)AbstractSingleSourceLoggerFactory.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.Writer; import java.io.IOException; import java.util.Properties; import java.util.HashSet; import java.util.Set; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * A shared mark writer. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:10 $ * @since April 16, 2004 */ public abstract class AbstractSingleSourceLoggerFactory implements ISingleSource, IChannelLoggerFactory, Runnable { public static final String WRITES_PER_FLUSH_PROP = "writes-per-flush"; private static final int DEFAULT_WRITES_PER_FLUSH = 2; private static final int INIT_BUFFER_SIZE = 4096; public static final String MILLIS_PER_FLUSH_PROP = "millis-per-flush"; private static final long DEFAULT_MILLIS_PER_FLUSH = 0; public static final String USE_CACHE_PROP = "use-cache"; // remember that StringBuffers are thread safe private StringBuffer buffer = new StringBuffer( INIT_BUFFER_SIZE ); private Writer source; private int writesPerFlush = DEFAULT_WRITES_PER_FLUSH; private long millisPerFlush = DEFAULT_MILLIS_PER_FLUSH; private boolean reloadSourceAfterError = false; // due to how we access the writeCount outside synch blocks, it needs to be // volatile. private volatile int writeCount = 0; private boolean isSetup = false; private boolean useCache = true; private Thread flushThread = null; private Set covered = new HashSet( 20000, 0.75f ); // synchronize on a private member, so nobody else can interfere // with our threaded behavior. Make this the string buffer, to // speed up with the string buffer operations (it is thread safe, // after all, and string buffers synchronize on "this", not an inner // object). private Object sync = buffer; /** * Need a thread to flush the buffer. */ private class FlushRunner implements Runnable { public void run() { Thread t = Thread.currentThread(); try { while (true) { Thread.sleep( millisPerFlush ); flushBuffer(); if (t.interrupted()) { break; } } } catch (InterruptedException e) { // stop the run thread //e.printStackTrace(); } } } public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ) { // we only set ourself up once synchronized( this.sync ) { if (!this.isSetup) { setupProps( propertyPrefix, props ); this.source = setupSource(); addShutdownHook(); this.isSetup = true; } } return new SingleSourceLogger( channelIndex, this ); } /** * Outputs all the data associated with a probe to the shared single source. * This class manages its own buffering for safety. */ public void cover( short channelIndex, String classSig, short methodIndex, short markIndex ) { synchronized (this.sync) { if (this.source == null) { if (this.reloadSourceAfterError) { // don't write this time, but write next time. this.source = setupSource(); if (this.source == null) { // no need to continue - we don't want the buffer to get // huge while we're not flushing it. //System.out.println("++ source is null"); return; } } else { // same as the comment for the above return. // they could be merged into a single block, but // let's reduce the number of if statements where // necessary. //System.out.println("++ source is null and don't reload source"); return; } // We had a failed source, but now we're going to resume // where we know we left off. // We're not sure where we failed, so add a line // boundary to the beginning of our buffer. // Yes, this is slow, but so is setting up the source. this.buffer.insert( 0, '\n' ); this.writeCount = this.writesPerFlush; } } // For the non-cached version, this may be a bit slower, but // it avoids locking on the buffer until absolutely necessary. StringBuffer sb = new StringBuffer(); appendToLog( sb, channelIndex, classSig, methodIndex, markIndex ); String s = sb.toString(); if (this.useCache) { synchronized (this.sync) { if (this.covered.contains( s )) { // early out //System.out.println("++ cache already contains "+s); return; } // else add the temp string, and do flush checking //System.out.println("++ adding ["+s+"] to cache"); this.covered.add( s ); } } // else, just blindly add the string to our buffer. // Note that buffers are thread safe, so we don't need an extra // sync around this this.buffer.append( s ); // if writesPerFlush is < 0, then we always flush, but we need // to keep track of the writeCount due to the way flushBuffer is // implemented. If writesPerFlush is 0, then we never flush. // Since the write count is an int, singlular operations (like inc // and assign, the only two operations we use on it) are thread safe int wpf = this.writesPerFlush; if (wpf != 0 && ++this.writeCount >= wpf) { flushBuffer(); } } /** * This is the shutdown hook. We flush the buffer to the source, * then we call close() on the writer. */ public void run() { //System.out.println("++ Start shutdown hook"); synchronized( this.buffer ) { if (this.flushThread != null) { this.flushThread.interrupt(); this.flushThread = null; } // this is a modified cut-n-paste of the cover command above. // however, we also close off the stream with a close(); if (this.source == null) { if (this.reloadSourceAfterError) { this.source = setupSource(); } if (this.source == null) { //System.out.println("++ Early leave from shutdown hook"); // Don't keep generating source files if another shutdown // hook is registered for code coverage. Force us not to! this.reloadSourceAfterError = false; return; } this.buffer.insert( 0, '\n' ); } flushBuffer(); try { this.source.close(); } catch (Exception e) { // ignore //e.printStackTrace(); } // Don't keep generating source files if another shutdown // hook is registered for code coverage. Force us not to! this.source = null; this.reloadSourceAfterError = false; //System.out.println("++ End of shutdown hook"); } } /** * Setup the source writer. This can return null. Its * actions will be synchronized for you. */ protected abstract Writer setupSource(); /** * Extend this method to setup your own properties. Be sure to * call the super's setupProps, though. Be sure to keep the * properties around for how to connect to the source. */ protected void setupProps( String prefix, Properties props ) { String wpf = props.getProperty( prefix + WRITES_PER_FLUSH_PROP ); if (wpf != null) { try { this.writesPerFlush = Integer.parseInt( wpf ); } catch (NumberFormatException e) { // default this.writesPerFlush = DEFAULT_WRITES_PER_FLUSH; //e.printStackTrace(); } } //System.out.println("++ writes per flush = "+this.writesPerFlush); String uc = props.getProperty( prefix + USE_CACHE_PROP ); if (uc != null) { this.useCache = Boolean.valueOf( uc ).booleanValue(); } String mpf = props.getProperty( prefix + MILLIS_PER_FLUSH_PROP ); if (mpf != null) { try { this.millisPerFlush = Long.parseLong( mpf ); } catch (NumberFormatException e) { this.millisPerFlush = DEFAULT_MILLIS_PER_FLUSH; //e.printStackTrace(); } } //System.out.println("++ millis per flush = "+this.millisPerFlush); if (this.millisPerFlush > 0) { if (this.flushThread == null) { // create our flush thread Thread t = new Thread( new FlushRunner() ); t.setDaemon( true ); t.setPriority( Thread.MIN_PRIORITY ); t.setName( "Code Coverage Flusher" ); t.start(); this.flushThread = t; } } } /** * Set to true if you want to try to reconnect to the * source everytime the I/O write fails. This can be changed * at any time. */ protected void setReloadSourceAfterError( boolean yes ) { this.reloadSourceAfterError = yes; } /** * A consistent way to flush the write buffer. Set as "private final" to * improve performance. Note that this method blocks. */ private final void flushBuffer() { synchronized (this.sync) { if (this.writeCount <= 0 || this.source == null) { // there were no writes since the last flush - exit. //System.out.println("++ Nothing to flush."); return; } try { //System.out.println("++ Writing to source."); this.source.write( this.buffer.toString() ); // ensure we flush out the source. this.source.flush(); // only delete and reset count if the write doesn't fail. // This ensures that the data is actually written. Since // we don't care about duplicates (on line boundaries, // that is), this should be safe. Using a setLength is // faster (avoids a System.arraycopy call) than delete. this.buffer.setLength( 0 ); this.writeCount = 0; } catch (IOException e) { e.printStackTrace(); // failed I/O, so signal this. this.source = null; } } } protected void addShutdownHook() { Class c = Runtime.class; try { java.lang.reflect.Method m = c.getMethod( "addShutdownHook", new Class[] { Thread.class } ); Thread t = new Thread( this, this.getClass().getName()+" shutdown hook" ); m.invoke( Runtime.getRuntime(), new Object[] { t } ); } catch (Exception ex) { // prolly JDK 1.3 not supported. // but it's not necessary... //ex.printStackTrace(); } } private static final void appendToLog( StringBuffer log, short channelIndex, String classSig, short methodIndex, short markIndex ) { log.append( channelIndex ). append( ',' ).append( classSig ).append( ',' ). append( DirectoryChannelLogger.createCoverString( methodIndex, markIndex ) ); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/EmptyClassChannelLogReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000457610040131322034220 0ustar drazzibdrazzib/* * @(#)EmptyClassChannelLogReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader; /** * Reads logs written by DirectoryChannelLogger. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 */ public class EmptyClassChannelLogReader implements IClassChannelLogReader { public EmptyClassChannelLogReader() { // do nothing } /** * Reads the next record from the log. If there are no more records, then * null is returned. These do not need to be returned in any * specific order. * * @return the next log record. * @exception IOException thrown if there was an underlying problem reading * from the log. */ public IChannelLogRecord nextRecord() throws IOException { return null; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000730210040131247034214 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLoggerFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.util.Properties; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * The singleton invoked at runtime to log each marked bytecode instruction * covered. *

    * This class needs to be fast, efficient, thread-safe, and classloader-safe. * "Classloader-safe" means that it needs to be resiliant to multiple instances * of this class being loaded, and possibly interfering with each other. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/04 06:40:09 $ * @since December 17, 2002 */ public class DirectoryChannelLoggerFactory implements IChannelLoggerFactory { public static final String DIRECTORY_PROPERTY = "dir"; public static final String DEFAULT_DIRECTORY = "./.cover-logs"; /** * Creates a specific logger type. Initializes the logger based on the * given collection of properties. * * @param propertyPrefix the prefix that all logger properties will begin * with. Expect all logger-specific properties to be appended directly * to this string. * @param props the property collection to pull the logger properties from. * @param channelIndex channel number to log to. * @return the initialized logger. */ public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ) { String directory = getDirectory( propertyPrefix, props ); File dir = new File( directory, Short.toString( channelIndex ) ); if (dir.exists()) { if (!dir.isDirectory()) { System.err.println( "DirectoryLogger base directory is a file."); dir = null; } } else { dir.mkdirs(); } return new DirectoryChannelLogger( dir ); } protected String getDirectory( String propertyPrefix, Properties props ) { String directory = props.getProperty( propertyPrefix + DIRECTORY_PROPERTY ); if (directory == null) { directory = DEFAULT_DIRECTORY; } return directory; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/ICoverageLoggerConst.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000476610040131332034222 0ustar drazzibdrazzib/* * @(#)ICoverageLoggerConst.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; /** * Contains all the constants used by CoverageLogger. Put here so that * outside classes can refer to them without getting the CoverageLogger * initializer warning message. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since February 27, 2002 */ public interface ICoverageLoggerConst { /** * For generation of the classes, define some of the string constants here. */ public static final String INVOKE_METHOD_NAME = "cover"; /** * The expected signature of the INVOKE_METHOD_NAME method. */ public static final Class COVERAGE_SIGNATURE[] = { String.class, Short.TYPE, Short.TYPE, Short.TYPE }; /** * The expected return type of the INVOKE_METHOD_NAME method. */ public static final Class COVERAGE_RETURNTYPE = Void.TYPE; // this is bad form, but it prevents the class loading issue discussed // above. public static final String COVERAGELOGGER_CLASSNAME = "net.sourceforge.groboutils.codecoverage.v2.logger.CoverageLogger"; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/StdoutChannelLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000545010050260071034215 0ustar drazzibdrazzib/* * @(#)StdoutChannelLoggerFactory.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.util.Properties; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * The singleton invoked at runtime to log each marked bytecode instruction * covered. *

    * This class needs to be fast, efficient, thread-safe, and classloader-safe. * "Classloader-safe" means that it needs to be resiliant to multiple instances * of this class being loaded, and possibly interfering with each other. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/05/11 23:22:33 $ * @since December 17, 2002 */ public class StdoutChannelLoggerFactory implements IChannelLoggerFactory { /** * Creates a specific logger type. Initializes the logger based on the * given collection of properties. * * @param propertyPrefix the prefix that all logger properties will begin * with. Expect all logger-specific properties to be appended directly * to this string. * @param props the property collection to pull the logger properties from. * @param channelIndex channel number to log to. * @return the initialized logger. */ public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ) { return new StdoutChannelLogger( channelIndex ); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/CacheDirChannelLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001536110072742276034237 0ustar drazzibdrazzib/* * @(#)CacheDirChannelLogger.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import net.sourceforge.groboutils.util.datastruct.v1.HashCache; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; /** * This is the same as the DirectoryChannelLogger, except that the open * files are cached for access. *

    * Besides some other issues with this (see open bugs), it can cause * issues if multiple loggers are trying to access the same file. This * could happen if the CoverageLogger class is loaded by different class * loaders; as a result, multiple CoverageLogger instances will be created, * allowing for multiple channel loggers to write to the same area. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:10 $ * @since May 9, 2003 */ public class CacheDirChannelLogger extends DirectoryChannelLogger implements Runnable, HashCache.ObjectManager { private final HashCache openedFiles; public CacheDirChannelLogger( File baseDir, int cacheSize ) { super( baseDir ); if (baseDir != null) { // even though the logic in the factory shouldn't allow this, // it apparently can happen. // See bug 923349 if (cacheSize <= 0) { cacheSize = CacheDirChannelLoggerFactory.DEFAULT_CACHESIZE; } this.openedFiles = new HashCache( this, cacheSize ); addShutdownHook(); } else { this.openedFiles = null; } } /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ) { if (this.baseDir != null) { File f = getClassFile( this.baseDir, classSignature ); Writer w = null; try { char[] out = createCoverString( methodIndex, markIndex ); synchronized (this) { w = (Writer)this.openedFiles.get( f ); if (w != null) { w.write( out ); } } } catch (IOException ioe) { // gasp!!!! ioe.printStackTrace(); // prevent these errors from occuring again this.baseDir = null; } } } /** * Called when the shutdown hook is called. */ public void run() { synchronized( this ) { this.openedFiles.clear(); } } /** * Called by the HashCache */ public Object createObject( Object key ) { File f = (File)key; try { // bug 907800 BufferedWriter bw = new BufferedWriter( new FileWriter( f.toString(), true ) ); return bw; } catch (IOException ioe) { // gasp!!!! ioe.printStackTrace(); // prevent these errors from occuring again this.baseDir = null; // we have to return something... return null; } } /** * Called by HashCache when the given object is being removed from the * cache. * * @param key the key associated with the object. * @param obj the object being cleaned up. */ public void cleanUpObject( Object key, Object obj ) { if (obj != null) { Writer w = (Writer)obj; try { w.flush(); w.close(); } catch (IOException ioe) { ioe.printStackTrace(); } } } protected void finalize() throws Throwable { // our cleanup method is the "run" method. Of course! run(); super.finalize(); } protected void addShutdownHook() { Class c = Runtime.class; try { java.lang.reflect.Method m = c.getMethod( "addShutdownHook", new Class[] { Thread.class } ); Thread t = new Thread( this, this.getClass().getName()+" shutdown hook" ); m.invoke( Runtime.getRuntime(), new Object[] { t } ); } catch (Exception ex) { // prolly JDK 1.3 not supported. System.err.println(this.getClass().getName()+ " should only be run in a JDK 1.3 compatible JVM."); ex.printStackTrace(); } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/MinDirChannelLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001102010072742276034223 0ustar drazzibdrazzib/* * @(#)MinDirChannelLogger.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.HashSet; import java.util.Set; /** * Same as the DirectoryChannelLogger, but includes a JDK 1.2 optimization * to minimize the size of the log files. * * @author Matt Albrecht groboclown@users.sourceforge.net * @author Graf Leonardo leolegenie@hotmail.com * @version $Date: 2004/07/07 09:39:10 $ * @since December 3, 2003 */ public class MinDirChannelLogger extends DirectoryChannelLogger { private final Set covered = new HashSet( 10000, 0.75f ); public MinDirChannelLogger( File baseDir ) { super( baseDir ); } /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ) { if (this.baseDir != null) { char[] out = createCoverString( methodIndex, markIndex ); // optimize // String key = classSignature + '.' + out; int csl = classSignature.length(); char cs[] = new char[ csl + 3 ]; classSignature.getChars( 0, csl, cs, 0 ); cs[csl] = '-'; cs[csl+1] = (char)methodIndex; cs[csl+2] = (char)markIndex; String key = new String( cs ); synchronized (this) { // access to covered needs to be inside the synchronized block if (!covered.contains( key )) { covered.add( key ); File f = getClassFile( this.baseDir, classSignature ); FileWriter fw = null; try { fw = new FileWriter( f.toString(), true ); try { fw.write( out ); fw.flush(); } finally { fw.close(); } } catch (IOException ioe) { // don't throw this exception outside this block. ioe.printStackTrace(); // prevent these errors from occuring again this.baseDir = null; } } } } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/NoOpChannelLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000465510040131375034226 0ustar drazzibdrazzib/* * @(#)NoOpChannelLogger.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; /** * Doesn't do any logging. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 */ public class NoOpChannelLogger implements IChannelLogger { /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ) { // do nothing } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/ISingleSource.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000342410040055623034220 0ustar drazzibdrazzib/* * @(#)ISingleSource.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; /** * A shared mark writer. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/16 22:17:55 $ * @since December 17, 2002 */ public interface ISingleSource { /** * Outputs all the data associated with a probe to the shared single source. */ public void cover( short channelIndex, String classSig, short methodIndex, short markIndex ); } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryClassChannelLogReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001035410072742276034234 0ustar drazzibdrazzib/* * @(#)DirectoryClassChannelLogReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.util.HexUtil; /** * Reads logs written by DirectoryChannelLogger. *

    * As of 2004-Jul-03, the output format has changed the way the indices * numbers are written. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:10 $ * @since December 17, 2002 */ public class DirectoryClassChannelLogReader implements IClassChannelLogReader { private File classLogFile; private String classSig; private BufferedReader in; DirectoryClassChannelLogReader( File log, String classSig ) { if (log == null || classSig == null) { throw new IllegalArgumentException( "No null args." ); } if (!log.exists() || !log.isFile()) { throw new IllegalArgumentException( "File "+log+ " is not a file or doesn't exist." ); } this.classLogFile = log; this.classSig = classSig; } /** * Reads the next record from the log. If there are no more records, then * null is returned. These do not need to be returned in any * specific order. * * @return the next log record. * @exception IOException thrown if there was an underlying problem reading * from the log. */ public synchronized IChannelLogRecord nextRecord() throws IOException { if (this.classLogFile == null) { return null; } if (this.in == null) { this.in = new BufferedReader( new FileReader( this.classLogFile ) ); } String s = this.in.readLine(); if (s == null) { close(); return null; } // method value then mark value HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); if (!HexUtil.getInstance().parseTwoHex( s.trim(), ts, ' ', 0)) { close(); throw new IOException( "Invalid file format in '"+ this.classLogFile+"'." ); } return new DefaultChannelLogRecord( this.classSig, ts.a, ts.b ); } public void close() throws IOException { if (this.in != null) { this.in.close(); this.in = null; } this.classLogFile = null; } protected void finalize() throws Throwable { close(); super.finalize(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/StdoutChannelLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000715710050260071034223 0ustar drazzibdrazzib/* * @(#)StdoutChannelLogger.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.FileWriter; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; /** * Logs coverage reports to a directory of logs. The directories are split * by the channel index, and the directory contains one log per class file * analyzed. The contents are in CSV format: *

     *    method index , mark index EOL
     * 
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/05/11 23:22:33 $ * @since May 11, 2004 */ public class StdoutChannelLogger implements IChannelLogger { private short channelIndex; public StdoutChannelLogger( short index ) { this.channelIndex = index; } /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ) { String text = createCoverString( classSignature, methodIndex, markIndex ); System.err.println(text); } /** * Make static final so that the invocation time is minimized. */ protected final String createCoverString( String classSig, short methodIndex, short markIndex ) { // make the string too big, so we don't need to resize it during // execution. StringBuffer sb = new StringBuffer( "[Cover String: " ); sb.append( this.channelIndex ).append( ',' ). append( classSig ).append( ',' ). append( methodIndex ).append( ',' ). append( markIndex ).append( ']' ); String out = sb.toString(); return out; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/CoverageLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000002562210071617351034232 0ustar drazzibdrazzib/* * @(#)CoverageLogger.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.InputStream; import java.util.Properties; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * The singleton invoked at runtime to log each marked bytecode instruction * covered. *

    * This class needs to be fast, efficient, thread-safe, and classloader-safe. * "Classloader-safe" means that it needs to be resiliant to multiple instances * of this class being loaded, and possibly interfering with each other. *

    * As of 12-Feb-2003, this class loads up its properties from a property * file, in the same way that Log4J loads its properties. It attempts to * load the property file "/grobocoverage.properties" from the system * resources. If the file cannot be found, then a warning is displayed * to STDERR. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/05/14 21:12:11 $ * @since December 15, 2002 */ public final class CoverageLogger implements ICoverageLoggerConst { private static final String PROP_FILE_NAME = "grobocoverage.properties"; private static final String PROP_FILE_RES = '/' + PROP_FILE_NAME; private static final boolean DEBUG = false; private static final String FACTORY_PROP = "factory"; private static final String CHANNEL_COUNT_PROP = "channel-count"; private static final String LOGGER_INIT_BASE_PROP = "logger."; private static final int DEFAULT_CHANNEL_COUNT = 0; private static final Class DEFAULT_CHANNEL_FACTORY = NoOpChannelLoggerFactory.class; // this must be defined before initBase(), and shouldn't set the loggers // to anything, due to the static processing order // of Java. We avoid the null pointer checking by using the loggers count // field. private static IChannelLogger LOGGERS[]; private static short LOGGERS_COUNT = (short)0; /** * Initialize the logger on class loading. */ static { initBase(); } /** * The primary entry method. This must be lean, mean, thread-safe, * and classloader-safe. */ public static final void cover( String classSig, short methodIndex, short channel, short markIndex ) { if (channel >= 0 && channel < LOGGERS_COUNT) { //debug( "Logging ["+classSig+";"+methodIndex+":"+channel+ // "-"+markIndex+"]" ); //error( "Logging ["+classSig+";"+methodIndex+":"+channel+ // "-"+markIndex+"]" ); LOGGERS[ (int)channel ].cover( classSig, methodIndex, markIndex ); } /* else { if (LOGGERS == null) { debug( "Couldn't log ["+classSig+";"+channel+":"+methodIndex+"."+ "-"+markIndex+"]: LOGGERS=null" ); } else { debug( "Couldn't log ["+classSig+";"+channel+":"+methodIndex+"."+ "-"+markIndex+"]: LOGGERS length="+LOGGERS.length ); } } */ } /** * Initializes or reinitializes the static logger object based on the * logger property file, which will be used as the argument to * init( Properties ). If no such file is found, then a * warning is reported to STDERR, and the System properties are passed * into the init method. */ public static final void initBase() { // make sure we set the loggers count to 0 before we get started. // this way, we don't have to deal with LOGGERS null checking. LOGGERS_COUNT = (short)0; Properties props = null; try { InputStream is = CoverageLogger.class.getResourceAsStream( PROP_FILE_RES ); if (is == null) { is = ClassLoader.getSystemResourceAsStream( PROP_FILE_NAME ); } if (is != null) { debug( "Loading "+PROP_FILE_NAME ); props = new Properties(); props.load( is ); } else { error( "No resource named "+PROP_FILE_NAME+"." ); } } catch (ThreadDeath td) { // never catch these throw td; } catch (Throwable t) { error( t.toString() ); // ignore } if (props == null) { props = System.getProperties(); error( "Please create and/or add the file "+PROP_FILE_NAME+ " to the classpath." ); if (DEBUG) { System.exit(1); } } init( props ); } /** * Initializes or reinitializes the static logger object with a specific * set of properties. * * @param props collection of properties used to discover the channel * logger factory, and to initialize the new channel logger. */ public static final void init( Properties props ) { // start out by saying that there are no loggers. This will only // change if we get to the end without errors. LOGGERS_COUNT = (short)0; if (props == null) { error( "Encountered null properties instance." ); return; } short channelCount = getChannelCount( props ); IChannelLoggerFactory factory = getChannelLoggerFactory( props ); if (factory != null) { // only assign the loggers at the end, after we've created // everything IChannelLogger ls[] = new IChannelLogger[ channelCount ]; for (short i = 0; i < channelCount; ++i) { ls[ (int)i ] = factory. createChannelLogger( LOGGER_INIT_BASE_PROP, props, i ); debug( "Logger "+i+" = "+ls[(int)i] ); } LOGGERS = ls; } // else keep the loggers list as it was. if (LOGGERS == null) { debug( "Logger list is null." ); LOGGERS = new IChannelLogger[ 0 ]; } LOGGERS_COUNT = (short)LOGGERS.length; } private static final short getChannelCount( Properties props ) { short channelCount = DEFAULT_CHANNEL_COUNT; String countStr = props.getProperty( CHANNEL_COUNT_PROP ); if (countStr != null && countStr.length() > 0) { try { // if this line throws an exception, it will not // disturb the default count. int i = Integer.parseInt( countStr ); if (i < 0 || i > Short.MAX_VALUE) { error( "Channel count is outside range [0.."+ Short.MAX_VALUE+"]. Using default." ); } else { // no exception was thrown, so assign the new count. channelCount = (short)i; } } catch (NumberFormatException ex) { error( "Trouble translating channel count ('"+countStr+ "') to a number. Using default." ); } } debug( "Channel Count = "+channelCount ); return channelCount; } private static final IChannelLoggerFactory getChannelLoggerFactory( Properties props ) { String factoryClassName = props.getProperty( FACTORY_PROP ); Class factoryClass = DEFAULT_CHANNEL_FACTORY; IChannelLoggerFactory factory = null; if (factoryClassName != null) { try { // if this line throws an exception, it will not // disturb the factoryClass object. Class c = Class.forName( factoryClassName ); // no exception was thrown, so assign the new class. factoryClass = c; } catch (ThreadDeath td) { // never catch these throw td; } catch (Throwable t) { error( "Could not load factory class '"+factoryClassName+ "'. Using default." ); } } try { factory = (IChannelLoggerFactory)factoryClass.newInstance(); } catch (ThreadDeath td) { // never catch these throw td; } catch (Throwable t) { error( "Couldn't create a new factory or cast it to a "+ (IChannelLoggerFactory.class.getName())+ ". Not using a logger." ); } debug( "Factory = "+factory ); return factory; } private static final void error( String message ) { System.err.println( CoverageLogger.class.getName()+": "+message ); } private static final void debug( String message ) { if (DEBUG) { System.out.println( "DEBUG ["+ CoverageLogger.class.getName()+"]: "+message ); } } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLogReader.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000000704710040131254034220 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLogReader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader; /** * Reads logs written by DirectoryChannelLogger. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since December 17, 2002 */ public class DirectoryChannelLogReader implements IChannelLogReader { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( DirectoryChannelLogReader.class ); private static final String EXTENTION = DirectoryChannelLogger.CLASS_LOG_EXTENTION; private File channelDir; public DirectoryChannelLogReader( File baseDir, short channel ) { File newDir = new File( baseDir, Short.toString( channel ) ); if (!newDir.exists() || !newDir.isDirectory()) { throw new IllegalArgumentException( "File "+newDir+ " is not a directory or doesn't exist." ); } this.channelDir = newDir; } /** * Returns a channel reader for a specific class signature. * * @return the reader for the given class signature. If there are no * logs for the given class, then the reader will not return anything. * @exception IOException thrown if there was an underlying problem reading * from the log. */ public IClassChannelLogReader getReaderForClassSignature( String signature ) throws IOException { File logFile = new File( this.channelDir, signature+EXTENTION ); if (!logFile.exists()) { // this isn't a critical error: it means that nothing in this class // was ever executed. LOG.info( "Couldn't finding a log file for class "+signature+ " in file "+logFile+"." ); return new EmptyClassChannelLogReader(); } LOG.debug( "Loading class log reader from file "+logFile+"." ); return new DirectoryClassChannelLogReader( logFile, signature ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLogger.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001440610072742276034236 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLogger.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.FileWriter; import java.io.IOException; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; /** * Logs coverage reports to a directory of logs. The directories are split * by the channel index, and the directory contains one log per class file * analyzed. *

    * As of 2004-Jun-3, the output format has changed to: *

     *    method index mark index EOL
     * 
    * where both indices are output in hexidecimal format. This is for performance * reasons. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:10 $ * @since December 17, 2002 */ public class DirectoryChannelLogger implements IChannelLogger { public static final String CLASS_LOG_EXTENTION = ".class.log"; protected File baseDir; public DirectoryChannelLogger( File baseDir ) { // basedir can be null! this.baseDir = baseDir; if (baseDir == null) { System.err.println("DirectoryLogger base directory is null."); } else { if (!baseDir.exists()) { baseDir.mkdir(); } } } /** * Records a coverage of a marked bytecode instruction. This method should * never throw an exception. * * @param classSignature a signature of the class file being covered. * this signature includes the fully-qualified name of the class, * along with a checksum to uniquely identify it. * @param methodIndex index for a method within the class. The meta-data * store will know how to translate the index to a method signature. * @param markIndex the index of the bytecode instruction mark for this * particular channel. */ public void cover( String classSignature, short methodIndex, short markIndex ) { if (this.baseDir != null) { //System.err.println("DirectoryChannelLogger: "+classSignature+":"+methodIndex+"."+markIndex); File f = getClassFile( this.baseDir, classSignature ); FileWriter fw = null; try { char[] out = createCoverString( methodIndex, markIndex ); synchronized (this) { fw = new FileWriter( f.toString(), true ); fw.write( out ); fw.flush(); //System.out.println("** wrote ["+out+"] to "+f.getAbsolutePath()); } } catch (IOException ioe) { // gasp!!!! ioe.printStackTrace(); // prevent these errors from occuring again this.baseDir = null; } finally { if (fw != null) { try { fw.close(); } catch (IOException ioe) { // gasp again! ioe.printStackTrace(); // this this happened on a close, I'll ignore it } } } } } private static final char[] HEX = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; /** * Make static final so that the invocation time is minimized. *

    * This now returns a character array, for performance reasons. The * array's format is in hexidecimal. */ protected static final char[] createCoverString( short methodIndex, short markIndex ) { char c[] = new char[10]; c[9] = '\n'; // avoid the integer promotion later on, // and do the masking with the HEX index lookup int imeth = (int)methodIndex; int imark = (int)markIndex; // unroll the loop // make sure we do a bitwise shift, not an arithmetic shift. c[8] = HEX[ imark & 0xf ]; imark >>>= 4; c[7] = HEX[ imark & 0xf ]; imark >>>= 4; c[6] = HEX[ imark & 0xf ]; imark >>>= 4; c[5] = HEX[ imark & 0xf ]; c[4] = ' '; c[3] = HEX[ imeth & 0xf ]; imeth >>>= 4; c[2] = HEX[ imeth & 0xf ]; imeth >>>= 4; c[1] = HEX[ imeth & 0xf ]; imeth >>>= 4; c[0] = HEX[ imeth & 0xf ]; return c; } /** * Make static final so that the invocation time is minimized. */ protected static final File getClassFile( File basedir, String classSignature ) { return new File( basedir, classSignature + CLASS_LOG_EXTENTION ); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger/CacheDirChannelLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001053210041353654034224 0ustar drazzibdrazzib/* * @(#)CacheDirChannelLoggerFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.util.Properties; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory; /** * This is the same as the DirectoryChannelLoggerFactory, except * that it caches the files as open. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/21 02:08:44 $ * @since May 9, 2003 */ public class CacheDirChannelLoggerFactory implements IChannelLoggerFactory { public static final String DIRECTORY_PROPERTY = "dir"; public static final String DEFAULT_DIRECTORY = "./.cache-cover-logs"; public static final String CACHESIZE_PROPERTY = "cache-size"; public static final int DEFAULT_CACHESIZE = 25; /** * Creates a specific logger type. Initializes the logger based on the * given collection of properties. * * @param propertyPrefix the prefix that all logger properties will begin * with. Expect all logger-specific properties to be appended directly * to this string. * @param props the property collection to pull the logger properties from. * @param channelIndex channel number to log to. * @return the initialized logger. */ public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ) { String directory = getDirectory( propertyPrefix, props ); int cacheSize = getCacheSize( propertyPrefix, props ); File dir = new File( directory, Short.toString( channelIndex ) ); if (dir.exists()) { if (!dir.isDirectory()) { System.err.println( "DirectoryLogger base directory is a file."); dir = null; } } else { dir.mkdirs(); } return new CacheDirChannelLogger( dir, cacheSize ); } protected String getDirectory( String propertyPrefix, Properties props ) { String directory = props.getProperty( propertyPrefix + DIRECTORY_PROPERTY ); if (directory == null) { directory = DEFAULT_DIRECTORY; } return directory; } protected int getCacheSize( String propertyPrefix, Properties props ) { String csS = props.getProperty( propertyPrefix + CACHESIZE_PROPERTY ); int cs = DEFAULT_CACHESIZE; if (csS != null) { try { int i = Integer.parseInt( csS ); if (i > 0) { cs = i; } } catch (NumberFormatException e) { System.out.println("Bad cache size property value: "+ csS ); } } return cs; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChann0000644000175000017500000000422407622026355034114 0ustar drazzibdrazzib/* * @(#)IChannelLogRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; /** * Contains an individual record that was passed in a single "cover" method * call. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 17, 2002 */ public interface IChannelLogRecord { /** * Returns the signature for the class (fully-qualified class name + * the checksum for the class bytecode). * * @return the class signature. */ public String getClassSignature(); /** * Returns the index for the method in which this entry was recorded. * * @return the method index. */ public short getMethodIndex(); /** * Returns the recorded index for the channel's mark in this method. * * @return the mark index. */ public short getMarkIndex(); } libgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/0000755000175000017500000000000011271425773034006 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/ConvertSingleLog.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/C0000644000175000017500000001716010072742277034117 0ustar drazzibdrazzib/* * @(#)ConvertSingleLog.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import java.io.Reader; import java.io.BufferedReader; import java.io.IOException; /** * A way to convert the single log style (not necessarily a file), and outputs * it to a channel logger. This converter handles multiple channels. *

    * As of 2004-Jun-03, the format has changed. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:11 $ * @since April 16, 2004 */ public class ConvertSingleLog { private IChannelLogger channels[]; /** * Create a new converter, using the given initialized loggers as the * output channels. The order matters: each logger index refers to * that specific channel index; so ch[1] refers to channel 1. * * @param ch the channels to output the single log to. * @exception IllegalArgumentException if ch or any entry inside * ch is null, or if the length of ch is 0. */ public ConvertSingleLog( IChannelLogger ch[] ) { if (ch == null) { throw new IllegalArgumentException("no null args"); } int len = ch.length; if (len <= 0) { throw new IllegalArgumentException("must pass at least one channel"); } this.channels = new IChannelLogger[ len ]; for (int i = 0; i < len; ++i) { if (ch[i] == null) { throw new IllegalArgumentException("channel "+i+" is null"); } this.channels[i] = ch[i]; } } /** * Loads all data from the given reader and parses it out to the * channels. The reader is closed on return. * * @exception IOException if there is an I/O error reading from r. * @exception IllegalArgumentException if the reader is null. */ public void read( Reader r, boolean ignoreFormatErrors ) throws IOException { if (r == null) { throw new IllegalArgumentException("no null args"); } BufferedReader br = new BufferedReader( r ); try { String line; while ((line = br.readLine()) != null) { //System.out.println("-- processing line ["+line+"]"); processLine( line, ignoreFormatErrors ); } } finally { br.close(); r.close(); } } /** * Process a single line from the single file. Invalid formatted lines * will cause an I/O exception. Blank lines are ignored. Whitespace * is also ignored. * * @param line the input line * @exception IOException if there's a problem with the format of the line, * or if line is null. */ public void processLine( String line, boolean ignoreFormatErrors ) throws IOException { if (line == null) { throw new IOException("End of stream: line is null"); } line = line.trim(); if (line.length() <= 0) { // ignore empty lines. return; } try { int pos[] = { 0, 0 }; int channel = (int)nextShort( pos, line ); // test the channel if (channel < 0) { throw new IOException( "Invalid channel: requested "+ channel+", but we're restricted to "+this.channels.length+ " channels." ); } if (channel >= this.channels.length) { if (ignoreFormatErrors) { return; } // don't ignore the error throw new IOException( "Invalid channel: requested "+ channel+", but we're restricted to "+this.channels.length+ " channels." ); } // process the rest of the line String classID = nextElement( pos, line ); String s = lastElement( pos, line ); HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); // method then mark if (!HexUtil.getInstance().parseTwoHex( s, ts, ' ', 0 )) { throw new IOException( "invalid format for hexidecimal ["+ line+"]" ); } // don't cover the line unless there were no format errors //System.out.println("-- Covering channel "+channel+" ["+classID+"]["+ts.a+"]["+ts.b+"]"); this.channels[ channel ].cover( classID, ts.a, ts.b ); } catch (IOException ioe) { if (!ignoreFormatErrors) { throw ioe; } // else ignore the errors } } protected String nextElement( int pos[], String line ) throws IOException { pos[1] = line.indexOf( ',', pos[0] ); if (pos[1] <= pos[0]) { throw new IOException( "invalid format ["+line+"]" ); } String ret = line.substring( pos[0], pos[1] ).trim(); pos[0] = pos[1] + 1; return ret; } protected short nextShort( int pos[], String line ) throws IOException { String s = nextElement( pos, line ); return parseShort( s, line ); } protected String lastElement( int pos[], String line ) throws IOException { if (pos[0] >= line.length()) { throw new IOException( "invalid format ["+line+"]" ); } String s = line.substring( pos[0] ); return s; } protected short parseShort( String txt, String line ) throws IOException { try { return Short.parseShort( txt ); } catch (NumberFormatException e) { throw new IOException( "invalid format for short ["+line+"]" ); } } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/package.htmllibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/p0000644000175000017500000000022407600160002034144 0ustar drazzibdrazzibnet.sourceforge.groboutils.codecoverage.v2.util Standard utilities used by all the packages. ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/SingleLogFilter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/S0000644000175000017500000000730710072742277034141 0ustar drazzibdrazzib/* * @(#)SingleLogFilter.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogger; import java.io.File; import java.io.IOException; import java.io.FileReader; /** * Transforms the single logging format to the standard logging format. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:11 $ * @since April 16, 2004 */ public class SingleLogFilter implements ILogFilter { public void process( int channelCount, File dir ) throws IOException { //System.out.println("++ Processing single log filter for dir "+dir.getAbsolutePath()+" with "+channelCount+" channels"); IChannelLogger[] loggers = createChannels( dir, channelCount ); try { ConvertSingleLog csl = new ConvertSingleLog( loggers ); File[] contents = dir.listFiles(); if (contents != null) { for (int i = 0; i < contents.length; ++i) { String name = contents[i].getName(); //System.out.println("++ dir contains "+name); if (contents[i].isFile() && name.startsWith( "single." ) && name.endsWith( ".log" )) { //System.out.println("++ it's a log - process it."); FileReader fr = new FileReader( contents[i] ); csl.read( fr, true ); } } } } finally { cleanupChannels( loggers ); } } protected IChannelLogger[] createChannels( File dir, int count ) { DirectoryChannelLogger[] loggers = new DirectoryChannelLogger[ count ]; for (int i = 0; i < count; ++i) { File outdir = new File( dir, Integer.toString( i ) ); outdir.mkdirs(); //System.out.println("++ channel "+i+" outputting to dir "+outdir.getAbsolutePath()); loggers[i] = new DirectoryChannelLogger( outdir ); } return loggers; } protected void cleanupChannels( IChannelLogger[] loggers ) { DirectoryChannelLogger[] dcl = (DirectoryChannelLogger[])loggers; // Need to somehow clean up these loggers. } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/ILogFilter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/I0000644000175000017500000000450410040165021034100 0ustar drazzibdrazzib/* * @(#)ILogFilter.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.io.File; import java.io.IOException; /** * Describes a method to transform a specialized log format into the * standard format. Implementations must have a no-arg constructor. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/17 08:25:53 $ * @since April 16, 2004 */ public interface ILogFilter { /** * Loads all data from the given log directory, and outputs the * standard format in the same place. This should only fail on * I/O errors, not on format errors. * * @param channelCount the number of channels that the output logging * should use. * @param dir the directory where all the logs should live. * @exception IOException if there is an I/O error reading from r. * @exception IllegalArgumentException if the reader is null. */ public void process( int channelCount, File dir ) throws IOException; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/ChecksumUtil.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/C0000644000175000017500000001735010037421052034102 0ustar drazzibdrazzib/* * @(#)ChecksumUtil.java * * Copyright (C) 2002-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.util.Comparator; import java.util.zip.CRC32; import java.util.zip.Checksum; /** * A "universal" method to extract a checksum from the various kinds of * data the codecoverage package needs. *

    * This is made such that the equivalent types between the BCEL library and * JDI library return the same CRC. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since Feb 3, 2003 */ public class ChecksumUtil { protected static ChecksumUtil s_instance = new ChecksumUtil(); // ensure that we ALWAYS get the same collator, no matter the // executing environment. protected final Comparator StringCollator = java.text.Collator.getInstance(new java.util.Locale("en", "US", "")); /** * Creates a new finder using the default (system) classpath. */ protected ChecksumUtil() { // do nothing } public static ChecksumUtil getInstance() { return s_instance; } public long checksum( byte[] buff ) { Checksum crc = createChecksum(); update( crc, buff ); return crc.getValue(); } /* public long checksum( JavaClass jc ) { Checksum crc = createChecksum(); update( crc, jc ); return crc.getValue(); } */ /* public long checksum( ReferenceType rt ) { Checksum crc = createChecksum(); update( crc, rt ); return crc.getValue(); } */ /* public long checksum( org.apache.bcel.classfile.Method m ) { Checksum crc = createChecksum(); update( crc, m ); return crc.getValue(); } */ /* public long checksum( Code c ) { Checksum crc = createChecksum(); update( crc, c ); return crc.getValue(); } */ /* public long checksum( com.sun.jdi.Method m ) { Checksum crc = createChecksum(); update( crc, m ); return crc.getValue(); } */ //------------------------------------------------------------------------ // Factory methods protected Checksum createChecksum() { return new CRC32(); } protected void update( Checksum crc, byte[] buff ) { if (buff != null) { crc.update( buff, 0, buff.length ); } } /* protected void update( Checksum crc, JavaClass jc ) { // If JDI allowed for "bytecodes()" on the class level, as // opposed to the Method level, then we could just do this: // update( crc, jc.getBytes() ); // However, JDI only allows bytecodes() on the method level, // so we must parse the checksum on a per-method basis. // Note that to ensure that the correct CRC is generated, we // need to ensure that the ORDER of methods is identical across // all runs and all types! org.apache.bcel.classfile.Method ms[] = jc.getMethods(); ArrayList list = new ArrayList(); for (int i = 0; i < ms.length; ++i) { list.add( ms[i] ); } Iterator iter = sortList( list.iterator(), new Comparator() { public int compare( Object o1, Object o2 ) { org.apache.bcel.classfile.Method m1 = (org.apache.bcel.classfile.Method)o1; org.apache.bcel.classfile.Method m2 = (org.apache.bcel.classfile.Method)o2; return StringCollator.compare( m1.getSignature(), m2.getSignature() ); } public boolean equals( Object o1 ) { if (o1 == null) return false; if (o1 == this) return true; return (o1.getClass().equals( this.getClass() )); } } ); while (iter.hasNext()) { update( crc, (org.apache.bcel.classfile.Method)iter.next() ); } } */ /* protected void update( Checksum crc, ReferenceType rt ) { // JDI does not have a "bytecodes()" method on ReferenceType, // but does on methods. // Note that to ensure that the correct CRC is generated, we // need to ensure that the ORDER of methods is identical across // all runs and all types! Iterator iter = sortList( rt.methods().iterator(), new Comparator() { public int compare( Object o1, Object o2 ) { com.sun.jdi.Method m1 = (com.sun.jdi.Method)o1; com.sun.jdi.Method m2 = (com.sun.jdi.Method)o2; return StringCollator.compare( m1.signature(), m2.signature() ); } public boolean equals( Object o1 ) { if (o1 == null) return false; if (o1 == this) return true; return (o1.getClass().equals( this.getClass() )); } } ); while (iter.hasNext()) { update( crc, (com.sun.jdi.Method)iter.next() ); } } */ /* protected void update( Checksum crc, org.apache.bcel.classfile.Method m ) { update( crc, m.getCode() ); } */ /* protected void update( Checksum crc, Code c ) { // abstract methods don't have code. if (c != null) { update( crc, c.getCode() ); } } */ /* protected void update( Checksum crc, com.sun.jdi.Method m ) { // abstract methods may not have any bytecodes. // thus, this called method needs to be null-proof. update( crc, m.bytecodes() ); } */ /* * Sorts the given iteration with the given comparator. * Made generic enough to allow an iterator. Should allow a * Collection to simplify this method, but it's simple enough. protected Iterator sortList( Iterator list, Comparator c ) { TreeSet ts = new TreeSet( c ); while (list.hasNext()) { ts.add( list.next() ); } return ts.iterator(); } */ } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/ClassSignatureUtil.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/C0000644000175000017500000000463307622026361034114 0ustar drazzibdrazzib/* * @(#)ClassSignatureUtil.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; /** * Knows how to create a class signature. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:29 $ * @since December 17, 2002 */ public class ClassSignatureUtil { protected static ClassSignatureUtil s_instance = new ClassSignatureUtil(); protected ClassSignatureUtil() { // do nothing } public static ClassSignatureUtil getInstance() { return s_instance; } public String createClassSignature( String className, long checksum ) { if (className == null) { throw new IllegalArgumentException("no null args"); } return className + '-' + checksum; } public String getClassName( String signature ) { if (signature == null) { throw new IllegalArgumentException( "No null args." ); } int pos = signature.indexOf( '-' ); if (pos < 0) { return signature; } return signature.substring( 0, pos ); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/ClassfileCheckerCLI.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/C0000644000175000017500000006114010037421052034076 0ustar drazzibdrazzib/* * @(#)ClassfileCheckerCLI.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord; import org.apache.bcel.classfile.ClassParser; import org.apache.bcel.classfile.CodeException; import org.apache.bcel.classfile.ConstantPool; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.LineNumberTable; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; /** * This file joins the class detail files, original class files, and covered * class files with the source, into a STDOUT report. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:26 $ * @since January 15, 2004 */ public class ClassfileCheckerCLI { public static void main( String args[] ) throws IOException { if (args.length <= 1) { System.out.println("ClassfileCheckerCLI:"); System.out.println(" Compares original vs. covered class files"); System.out.println(""); System.out.println(" Usage:"); System.out.println(" Report the lines in source code that are marked:"); System.out.println(" " + ClassfileCheckerCLI.class.getName() + " -m classname datadir srcdir" ); System.out.println(" Report the differences between the original and covered class files:"); System.out.println(" " + ClassfileCheckerCLI.class.getName() + " -c classname origclassdir covclassdir" ); System.out.println(" Both reports:"); System.out.println(" " + ClassfileCheckerCLI.class.getName() + " -mc classname datadir srcdir origclassdir covclassdir" ); } // note: this needs to be improved String type = args[0].toLowerCase(); String cname = args[1]; String datadir = null; String srcdir = null; String origclassdir = null; String covclassdir = null; boolean doMarkReport = false; boolean doClassReport = false; int pos = 2; if (type.indexOf('m') >= 0) { doMarkReport = true; datadir = args[pos++]; srcdir = args[pos++]; } if (type.indexOf('c') >= 0) { doClassReport = true; origclassdir = args[pos++]; covclassdir = args[pos++]; } ClassfileCheckerCLI ccc = new ClassfileCheckerCLI(); if (doMarkReport) { ccc.reportMarkedSource( cname, new File( datadir ), new File( srcdir ), System.out ); } if (doClassReport) { ccc.reportClassDiff( cname, new File( origclassdir ), new File( covclassdir ), System.out ); } } public void reportMarkedSource( String classname, File coveredDataDir, File srcDir, PrintStream out ) throws IOException { IMetaDataReader mdr = createMetaDataReader( coveredDataDir ); File srcFile = getSourceFileForClass( classname, srcDir ); reportMarkedSource( classname, mdr, srcFile, out ); } /** * Comment the source code for the given class with the line number and * which analysis module marked each line. */ public void reportMarkedSource( String classname, IMetaDataReader mdr, File srcFile, PrintStream out ) throws IOException { out.println( "Marks on source for class "+classname ); out.println( "" ); MarkRecord mrL[] = getMarkRecords( classname, mdr ); Map amIndex = createAnalysisModuleIndexMap( mdr ); int maxAM = printLegend( amIndex, out ); FileReader fr = new FileReader( srcFile ); try { BufferedReader br = new BufferedReader( fr ); int lineNo = 0; String line = br.readLine(); while (line != null) { ++lineNo; out.print( ' ' + format8( lineNo ) ); out.print( " | " ); // find all the AM measure names that marked this line String amnL[] = markedLine( mrL, lineNo ); for (int i = 1; i <= maxAM; ++i) { boolean notfound = true; Integer idx = new Integer(i); for (int j = 0; j < amnL.length; ++j) { if (idx.equals( amIndex.get( amnL[j] ) )) { out.print( indexCode( i ) ); notfound = false; break; } } if (notfound) { out.print( " " ); } } out.println( " | " + line ); line = br.readLine(); } } finally { fr.close(); } } /** * Perform a diff on the covered and original class files for a * specific class. This only does a diff on the code, not the * fields. */ public void reportClassDiff( String classname, File originalClassDir, File coveredClassDir, PrintStream out ) throws IOException { File origClassF = getClassFileForClass( classname, originalClassDir ); File covClassF = getClassFileForClass( classname, coveredClassDir ); JavaClass origClass = createJavaClass( origClassF ); JavaClass covClass = createJavaClass( covClassF ); Method omL[] = origClass.getMethods(); Method cmL[] = covClass.getMethods(); out.println( "Comparing covered and original classes for class named "+ classname ); out.println( "(Original is on the left side, covered is on the right)" ); // compare each method Set covNotFound = new HashSet(); for (int i = 0; i < cmL.length; ++i) { covNotFound.add( cmL[i] ); } for (int i = 0; i < omL.length; ++i) { String omName = omL[i].getName(); String omSig = omL[i].getSignature(); boolean notFound = true; for (int j = 0; notFound && j < cmL.length; ++j) { if (omName.equals( cmL[j].getName() ) && omSig.equals( cmL[j].getSignature() )) { notFound = false; covNotFound.remove( cmL[j] ); out.println(""); reportMethodDiff( omL[i], cmL[j], origClass.getConstantPool(), covClass.getConstantPool(), out ); } } if (notFound) { out.println(""); reportRemovedMethod( omL[i], out ); } } Iterator iter = covNotFound.iterator(); while (iter.hasNext()) { out.println(""); reportAddedMethod( (Method)iter.next(), out ); } } public void reportMethodDiff( Method orig, Method cov, ConstantPool origCP, ConstantPool covCP, PrintStream out ) { out.println( " = Method " + orig.getName() + " " + orig.getSignature() ); LineNumberTable ot = orig.getLineNumberTable(); LineNumberTable ct = cov.getLineNumberTable(); CodeException oce[] = orig.getCode().getExceptionTable(); CodeException cce[] = cov.getCode().getExceptionTable(); // assume that bytecode instructions were only added, not removed InstructionHandle oList[] = (new InstructionList( orig.getCode().getCode() )).getInstructionHandles(); InstructionHandle cList[] = (new InstructionList( cov.getCode().getCode() )).getInstructionHandles(); int oNextI = 0; int cNextI = 0; int lastOLine = -2; int lastCLine = -2; while (oNextI < oList.length && cNextI < cList.length) { InstructionHandle oNext = null; InstructionHandle cNext = null; if (oNextI < oList.length) { oNext = oList[ oNextI ]; } if (cNextI < cList.length) { cNext = cList[ cNextI ]; } if (oNext == null || !oNext.getInstruction().equals( cNext.getInstruction() )) { lastOLine = -2; int lineNo = ct.getSourceLine( cNext.getPosition() ); if (lastCLine != lineNo) { out.println( " + Line: Orig: N/A Covered: " + format8( lineNo ) ); } printCodeException( "Covered", cce, cNext.getPosition(), covCP, out ); printSideBySide( null, cNext.getInstruction().toString( true ), 36, " | ", " ", out ); lastCLine = lineNo; ++cNextI; } else if (cNext == null) { lastCLine = -2; int lineNo = ot.getSourceLine( oNext.getPosition() ); if (lastOLine != lineNo) { out.println( " - Line: Orig: " + format8( lineNo ) + " Covered: N/A" ); } printCodeException( "Original", oce, oNext.getPosition(), origCP, out ); printSideBySide( oNext.getInstruction().toString( true ), null, 36, " | ", " ", out ); lastOLine = lineNo; ++oNextI; } else { int olineNo = ot.getSourceLine( oNext.getPosition() ); int clineNo = ct.getSourceLine( cNext.getPosition() ); if (lastOLine != olineNo && lastCLine != clineNo) { out.println( " = Line: Orig: " + format8( olineNo ) + " Covered: " + format8( clineNo ) ); } printCodeException( "Original", oce, oNext.getPosition(), origCP, out ); printCodeException( "Covered", cce, cNext.getPosition(), covCP, out ); printSideBySide( oNext.getInstruction().toString( true ), cNext.getInstruction().toString( true ), 36, " | ", " ", out ); lastOLine = olineNo; lastCLine = clineNo; ++oNextI; ++cNextI; } } } public void reportRemovedMethod( Method orig, PrintStream out ) { out.println( " < Method Removed in covered version: " + orig.getName() + " " + orig.getSignature() ); LineNumberTable ot = orig.getLineNumberTable(); InstructionHandle oNext = (new InstructionList( orig.getCode().getCode() )).getStart(); while (oNext != null) { out.println( " - Line: Orig: " + format8( ot.getSourceLine( oNext.getPosition() ) ) + " Covered: N/A" ); printSideBySide( oNext.getInstruction().toString( true ), null, 36, " | ", " ", out ); oNext = oNext.getNext(); } } public void reportAddedMethod( Method cov, PrintStream out ) { out.println( " > Method Added in covered version: " + cov.getName() + " " + cov.getSignature() ); LineNumberTable ct = cov.getLineNumberTable(); InstructionHandle cNext = (new InstructionList( cov.getCode().getCode() )).getStart(); while (cNext != null) { out.println( " + Line: Orig: N/A Covered: " + format8( ct.getSourceLine( cNext.getPosition() ) ) ); printSideBySide( null, cNext.getInstruction().toString( true ), 36, " | ", " ", out ); cNext = cNext.getNext(); } } /** * Returns the measure names of the analysis modules that marked this * particular line. */ public String[] markedLine( MarkRecord mrL[], int lineNo ) { Set ret = new HashSet(); for (int i = 0; i < mrL.length; ++i) { if (mrL[i].getLineNumber() == lineNo) { ret.add( mrL[i].getAnalysisModule() ); } } return (String[])ret.toArray( new String[ ret.size() ] ); } /** * Returns all class files related to the given classname. That is, * the class and its inner classes. */ public File[] getClassFilesForClass( String classname, File classdir ) { String pkgname = getPackageName( classname ).replace( '.', File.separatorChar ); String cname = getJustClassName( classname ); List ret = new ArrayList(); if (classdir != null) { String match1 = cname + ".class"; String match2 = cname + '$'; File pkgdir = new File( classdir, pkgname ); if (pkgdir.exists() && pkgdir.isDirectory()) { String files[] = pkgdir.list(); for (int i = 0; i < files.length; ++i) { if (files[i].equals( match1 ) || (files[i].startsWith( match2 ) && files[i].endsWith( ".class" ))) { ret.add( new File( pkgdir, files[i] ) ); } } } } return (File[])ret.toArray( new File[ ret.size() ] ); } /** * Returns only the class file for the given class name. */ public File getClassFileForClass( String classname, File classdir ) throws IOException { String fname = classname.replace( '.', File.separatorChar ) + ".class"; File cf = new File( classdir, fname ); if (!cf.exists() || !cf.isFile()) { throw new java.io.FileNotFoundException( "No such class file '"+fname+"' in directory '"+ classdir+"'" ); } return cf; } /** * Returns only the class file for the given class name. */ public File getSourceFileForClass( String classname, File srcdir ) throws IOException { int pos = classname.indexOf( '$' ); if (pos > 0) { classname = classname.substring( 0, pos ); } String fname = classname.replace( '.', File.separatorChar ) + ".java"; File cf = new File( srcdir, fname ); //System.err.println("Checking file ["+cf+"]: exists="+ // cf.exists()+", isfile="+cf.isFile()); if (!cf.exists() || !cf.isFile()) { throw new java.io.FileNotFoundException( "No such source file '"+fname+"' in directory '"+ srcdir ); } return cf; } public MarkRecord[] getMarkRecords( String classname, IMetaDataReader mdr ) throws IOException { AnalysisModuleSet ams = mdr.getAnalysisModuleSet(); IAnalysisModule amL[] = ams.getAnalysisModules(); List ret = new ArrayList(); for (int i = 0; i < amL.length; ++i) { IClassMetaDataReader cmdr = mdr.getClassReader( amL[i] ); String[] sigs = getMachingClassSignatures( classname, cmdr.getClassSignatures() ); for (int j = 0; j < sigs.length; ++j) { ClassRecord cr = cmdr.readClass( sigs[j] ); if (cr != null) { MarkRecord[] mrL = cr.getMarksForAnalysisModule( amL[i] ); for (int k = 0; k < mrL.length; ++k) { ret.add( mrL[k] ); } } } } return (MarkRecord[])ret.toArray( new MarkRecord[ ret.size() ] ); } protected JavaClass createJavaClass( File filename ) throws IOException { ClassParser cp = new ClassParser( filename.getAbsolutePath() ); return cp.parse(); } protected String[] getMachingClassSignatures( String classname, String sigs[] ) { List ret = new ArrayList(); String match1 = classname + '-'; String match2 = classname + '$'; if (sigs != null) { for (int i = 0; i < sigs.length; ++i) { if (sigs[i].startsWith( match1 ) || sigs[i].startsWith( match2 )) { ret.add( sigs[i] ); } } } return (String[])ret.toArray( new String[ ret.size() ] ); } protected String getPackageName( String classname ) { String pkgname = ""; int i = classname.lastIndexOf( '.' ); if (i >= 0) { pkgname = classname.substring( 0, i-1 ); } return pkgname; } protected String getJustClassName( String classname ) { String cname = classname; int i = classname.lastIndexOf( '.' ); if (i >= 0) { cname = classname.substring( i+1 ); } return cname; } protected IMetaDataReader createMetaDataReader( File datadir ) throws IOException { return new DirMetaDataReader( datadir ); } protected Map createAnalysisModuleIndexMap( IMetaDataReader mdr ) throws IOException { HashMap map = new HashMap(); int count = 0; AnalysisModuleSet ams = mdr.getAnalysisModuleSet(); IAnalysisModule amL[] = ams.getAnalysisModules(); for (int j = 0; j < amL.length; ++j) { if (!map.containsKey( amL[j].getMeasureName() )) { map.put( amL[j].getMeasureName(), new Integer( ++count ) ); } } return map; } protected int printLegend( Map amToIndex, PrintStream out ) { out.println( "Legend of Analysis Modules:" ); int index = 0; Set entries = amToIndex.entrySet(); boolean found = true; while (found) { Integer x = new Integer( ++index ); found = false; Iterator iter = entries.iterator(); while (iter.hasNext()) { Map.Entry e = (Map.Entry)iter.next(); if (e.getValue().equals( x )) { found = true; out.println( " "+indexCode( index )+" = "+ (String)e.getKey() ); } } } out.println( "" ); out.print( " lineno | " ); for (int i = 1; i < index; ++i) { out.print( indexCode( i ) ); } out.println( " | source code" ); for (int i = 0; i < 78; ++i) { out.print( "-" ); } out.println( "-" ); return index - 1; } protected String indexCode( int i ) { return ""+(char)('A' + i - 1); } protected String format8( int i ) { StringBuffer sb = new StringBuffer(); for (int top = 1000000; top > 1 && i < top; top /= 10) { sb.append( ' ' ); } sb.append( i ); return sb.toString(); } protected String[] formatWidth( String t, int width ) { List ret = new ArrayList(); while (t.length() > width) { ret.add( t.substring( 0, width ) ); t = t.substring( width ); } StringBuffer sb = new StringBuffer( t ); while (sb.length() < width) { sb.append( " " ); } ret.add( sb.toString() ); return (String[])ret.toArray( new String[ ret.size() ] ); } protected void printCodeException( String type, CodeException[] ce, int pos, ConstantPool cp, PrintStream out ) { for (int i = 0; i < ce.length; ++i) { if (pos == ce[i].getStartPC()) { out.println( " { " + type + ": start try block for exception " + getClassName( cp, ce[i].getCatchType() ) ); } if (pos == ce[i].getEndPC()) { out.println( " } " + type + ": end try block for exception " + getClassName( cp, ce[i].getCatchType() ) ); } if (pos == ce[i].getHandlerPC()) { out.println( " > " + type + ": exception handler block for " + getClassName( cp, ce[i].getCatchType() ) ); } } } protected void printSideBySide( String left, String right, int width, String sep, String indent, PrintStream out ) { if (left == null) { left = ""; } if (right == null) { right = ""; } String blank = formatWidth( "", width )[0]; String fl[] = formatWidth( left, width ); String rl[] = formatWidth( right, width ); int len = (fl.length > rl.length) ? fl.length : rl.length; for (int i = 0; i < len; ++i) { out.print( indent ); if (i >= fl.length) { out.print( blank ); } else { out.print( fl[i] ); } out.print( sep ); if (i >= rl.length) { out.println( blank ); } else { out.println( rl[i] ); } } } protected String getClassName( ConstantPool cp, int typeIndex ) { String name; try { name = org.apache.bcel.classfile.Utility. compactClassName( cp.getConstantString( typeIndex, org.apache.bcel.Constants.CONSTANT_Class), false ); } catch (org.apache.bcel.classfile.ClassFormatException ex) { // ignore name = ""; } return name; } }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/StandardLogFilter.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/S0000644000175000017500000000352610040165021034115 0ustar drazzibdrazzib/* * @(#)StandardLogFilter.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.io.File; import java.io.IOException; /** * Transforms the Standard logging format to the standard logging format * (that is, it does nothing). * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/17 08:25:53 $ * @since April 16, 2004 */ public class StandardLogFilter implements ILogFilter { public void process( int channelCount, File dir ) throws IOException { // do nothing } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/HexUtil.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/util/H0000644000175000017500000001075310073155660034120 0ustar drazzibdrazzib/* * @(#)HexUtil.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.util.Comparator; import java.util.zip.CRC32; import java.util.zip.Checksum; /** * A simple utility to provide the Hexidecimal conversions for the log files. * This contains the string-length checking and other verification steps * that might be left out of some implementations. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/08 05:29:20 $ * @since July 7, 2004 */ public class HexUtil { protected static HexUtil s_instance = new HexUtil(); public static class TwoShorts { public short a; public short b; public TwoShorts() {} public TwoShorts( short a, short b ) { this.a = a; this.b = b; } } /** * Creates a new finder using the default (system) classpath. */ protected HexUtil() { // do nothing } public static final HexUtil getInstance() { return s_instance; } /** * Parses two hex strings separated by a character. The string should * not start with the separator char after the startPos. * * @return true if ts was populated correctly, * or false if there was an error parsing the string. */ public boolean parseTwoHex( String text, final TwoShorts ts, final char sep, final int startPos ) { if (text == null || ts == null || startPos < 0) { return false; } int sepPos = text.indexOf( sep, startPos ); if (sepPos <= 0 || sepPos >= text.length()) { return false; } try { ts.a = (short)Integer.parseInt( text.substring( startPos, sepPos ), 16 ); ts.b = (short)Integer.parseInt( text.substring( sepPos + 1 ).trim(), 16 ); } catch (NumberFormatException e) { return false; } return true; } /* This logic for creating the HEX string will be contained only in the DirectoryChannelLogger class. * Make static final so that the invocation time is minimized. *

    * This now returns a character array, for performance reasons. The * array's format is in hexidecimal. public static final char[] createCoverString( short methodIndex, short markIndex ) { char c[] = new char[10]; c[9] = '\n'; // unroll the loop c[8] = HEX[ methodIndex & 0xf ]; methodIndex >>= 4; c[7] = HEX[ methodIndex & 0xf ]; methodIndex >>= 4; c[6] = HEX[ methodIndex & 0xf ]; methodIndex >>= 4; c[5] = HEX[ methodIndex & 0xf ]; c[4] = ' '; c[3] = HEX[ markIndex & 0xf ]; markIndex >>= 4; c[2] = HEX[ markIndex & 0xf ]; markIndex >>= 4; c[1] = HEX[ markIndex & 0xf ]; markIndex >>= 4; c[0] = HEX[ markIndex & 0xf ]; return c; } */ } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChannelLoggerFactory.javalibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/codecoverage/v2/IChann0000644000175000017500000000446107622026355034117 0ustar drazzibdrazzib/* * @(#)IChannelLoggerFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.util.Properties; /** * Creates a channel logger. Used by the singleton CoverageLogger * to dynamically create the logger being used for the runtime execution. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:25 $ * @since December 15, 2002 */ public interface IChannelLoggerFactory { /** * Creates a specific logger type. Initializes the logger based on the * given collection of properties. * * @param propertyPrefix the prefix that all logger properties will begin * with. Expect all logger-specific properties to be appended directly * to this string. * @param props the property collection to pull the logger properties from. * @param channelIndex channel number to log to. * @return the initialized logger. */ public IChannelLogger createChannelLogger( String propertyPrefix, Properties props, short channelIndex ); } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/grobocoverage.propertieslibgroboutils-java-5.orig/codecoverage/sources/dev/net/sourceforge/groboutils/grobocoverage.properti0000644000175000017500000000025607757574023034500 0ustar drazzibdrazzibcoveragepostcompiler=net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask coveragereport=net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask libgroboutils-java-5.orig/codecoverage/sources/dev/ant-grobocoverage.properties0000644000175000017500000000063210027777455030302 0ustar drazzibdrazzibcoveragepostcompiler=net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask coveragereport=net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask grobo-instrument=net.sourceforge.groboutils.codecoverage.v2.ant.GroboInstrumentTask grobo-report=net.sourceforge.groboutils.codecoverage.v2.ant.GroboReportTask grobo-rezip=net.sourceforge.groboutils.codecoverage.v2.ant.GroboReZipTask libgroboutils-java-5.orig/codecoverage/sources/ut/0000755000175000017500000000000010017105265022410 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/net/0000755000175000017500000000000010011472722023175 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/0000755000175000017500000000000010011472722025520 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472722027711 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/0000755000175000017500000000000010120240417032332 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/0000755000175000017500000000000011271425773032703 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaDataUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IAnalys0000644000175000017500000001051310037421053034150 0ustar drazzibdrazzib/* * @(#)IAnalysisMetaDataUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IAnalysisMetaData interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IAnalysisMetaDataUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IAnalysisMetaDataUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IAnalysisMetaDataUTestI( String name, ImplFactory f ) { super( name, IAnalysisMetaData.class, f ); } public IAnalysisMetaData createIAnalysisMetaData() { return (IAnalysisMetaData)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetCoveredFormattedText1() { IAnalysisMetaData amd = createIAnalysisMetaData(); String s = amd.getCoveredFormattedText(); assertNotNull( "Null covered text.", s ); assertTrue( "Empty covered text.", s.length() > 0 ); } public void testGetNotCoveredFormattedText1() { IAnalysisMetaData amd = createIAnalysisMetaData(); String s = amd.getNotCoveredFormattedText(); assertNotNull( "Null not-covered text.", s ); assertTrue( "Empty not-covered text.", s.length() > 0 ); } public void getInstructionWeight() { IAnalysisMetaData amd = createIAnalysisMetaData(); byte w = amd.getInstructionWeight(); // any value is acceptable. } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/BCELCreatorUtil.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/BCELCre0000644000175000017500000000632710037421053033757 0ustar drazzibdrazzib/* * @(#)BCELCreatorUtil.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.IOException; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; import org.apache.bcel.generic.LDC; import org.apache.bcel.generic.MethodGen; /** * Helper for creating BCEL objects. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since January 23, 2003 */ public class BCELCreatorUtil { private static final Class THIS_CLASS = BCELCreatorUtil.class; public static JavaClass createJavaClass( Class c ) throws IOException { JavaClass jc = BytecodeLoaderUtil.loadJavaClass( c.getName() ); return jc; } public static Method getMethod( JavaClass jc, int methodIndex ) { Method mL[] = jc.getMethods(); Method m = mL[ methodIndex ]; return m; } public static MethodGen createMethodGen( JavaClass jc, int methodIndex ) { MethodGen mg = createMethodGen( jc, getMethod( jc, methodIndex ) ); return mg; } public static MethodGen createMethodGen( JavaClass jc, Method m ) { ConstantPoolGen cpg = new ConstantPoolGen( jc.getConstantPool() ); MethodGen mg = new MethodGen( m, jc.getClassName(), cpg ); return mg; } public static InstructionList createInstructionList() { InstructionList il = new InstructionList(); return il; } public static InstructionHandle addInstructionHandle( InstructionList il ) { InstructionHandle ih = il.append( new LDC( 0 ) ); return ih; } public static InstructionHandle createInstructionHandle() { return addInstructionHandle( createInstructionList() ); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IAnalysisModuleUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IAnalys0000644000175000017500000001515010037421053034152 0ustar drazzibdrazzib/* * @(#)IAnalysisModuleUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.LineNumberTable; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.MethodGen; /** * Tests the IAnalysisModule interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IAnalysisModuleUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IAnalysisModuleUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IAnalysisModuleUTestI( String name, ImplFactory f ) { super( name, IAnalysisModule.class, f ); } public IAnalysisModule createIAnalysisModule() { return (IAnalysisModule)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetMeasureName1() { IAnalysisModule am = createIAnalysisModule(); String s = am.getMeasureName(); assertNotNull( "Null measure name.", s ); assertTrue( "Empty measure name.", s.length() > 0 ); } public void testGetMeasureUnit1() { IAnalysisModule am = createIAnalysisModule(); String s = am.getMeasureUnit(); assertNotNull( "Null measure Unit.", s ); assertTrue( "Empty measure Unit.", s.length() > 0 ); } public void testGetMimeEncoding1() { IAnalysisModule am = createIAnalysisModule(); String s = am.getMimeEncoding(); assertNotNull( "Null mime encoding.", s ); assertTrue( "Empty mime encoding.", s.length() > 0 ); int pos = s.indexOf( '/' ); assertTrue( "No '/' in mime encoding: invalid encoding type.", pos > 0 ); assertTrue( "Multiple mime encoding types are not allowed.", s.indexOf( ';' ) < 0 ); } private static class MockMethodCode implements IMethodCode { private Method meth; private Instruction[] instrL; private String className; public MockMethodCode( Class c, int methodIndex ) throws IOException { if (c == null) { c = this.getClass(); } JavaClass jc = loadBytecode( c.getName() ); this.className = jc.getClassName(); this.meth = jc.getMethods()[ methodIndex ]; MethodGen mg = new MethodGen( this.meth, this.className, new ConstantPoolGen( jc.getConstantPool() ) ); this.instrL = mg.getInstructionList().getInstructions(); } public Method getOriginalMethod() { return this.meth; } public String getMethodName() { return this.meth.getName(); } public String getClassName() { return this.className; } public int getInstructionCount() { return this.instrL.length; } public Instruction getInstructionAt( int index ) { if (index < 0 || index >= getInstructionCount()) { throw new IndexOutOfBoundsException( ""+index ); } return this.instrL[ index ]; } public void markInstruction( int index, IAnalysisMetaData meta ) { if (index < 0 || index >= getInstructionCount()) { throw new IndexOutOfBoundsException( ""+index ); } // ignore mark. } public LineNumberTable getLineNumberTable() { return this.meth.getLineNumberTable(); } } public void testAnalyze1() throws Exception { IAnalysisModule am = createIAnalysisModule(); am.analyze( new MockMethodCode( null, 0 ) ); } //------------------------------------------------------------------------- protected static JavaClass loadBytecode( String className ) throws IOException { return BytecodeLoaderUtil.loadJavaClass( className ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChannelLoggerUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChanne0000644000175000017500000000724410037421053034124 0ustar drazzibdrazzib/* * @(#)IChannelLoggerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.codecoverage.v2; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IChannelLogger interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IChannelLoggerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IChannelLoggerUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IChannelLoggerUTestI( String name, ImplFactory f ) { super( name, IChannelLogger.class, f ); } public IChannelLogger createIChannelLogger() { return (IChannelLogger)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCover1() { IChannelLogger cl = createIChannelLogger(); cl.cover( null, (short)0, (short)0 ); } public void testCover2() { IChannelLogger cl = createIChannelLogger(); cl.cover( "", (short)0, (short)0 ); } public void testCover3() { IChannelLogger cl = createIChannelLogger(); cl.cover( "a", Short.MIN_VALUE, Short.MIN_VALUE ); } public void testCover4() { IChannelLogger cl = createIChannelLogger(); cl.cover( "a", Short.MAX_VALUE, Short.MAX_VALUE ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000755000175000017500000000000011271425773034254 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/CompilerCreatorUtil.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000000504310037421054034243 0ustar drazzibdrazzib/* * @(#)CompilerCreatorUtil.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Assert; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.MethodGen; /** * Helper for creating code coverage test objects. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 23, 2003 */ public class CompilerCreatorUtil { private static final Class THIS_CLASS = CompilerCreatorUtil.class; public static ModifiedMethod createModifiedMethod( JavaClass jc, int methodIndex, Method m, MethodGen mg ) { Assert.assertNotNull( jc ); Assert.assertNotNull( m ); Assert.assertNotNull( mg ); ModifiedMethod mm = new ModifiedMethod( (short)methodIndex, 0, 0, jc, m, mg ); return mm; } public static IMethodCode createIMethodCode( int measureIndex, ModifiedMethod mm, ClassRecord cr ) { IMethodCode mc = new DefaultMethodCode( (short)measureIndex, mm, cr ); return mc; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/DefaultMethodCodeUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000002360110037421054034243 0ustar drazzibdrazzib/* * @(#)DefaultMethodCodeUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BCELCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IMethodCodeUTestI; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.MethodGen; /** * Tests the DefaultMethodCode class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 11, 2003 */ public class DefaultMethodCodeUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultMethodCodeUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultMethodCodeUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultMethodCode( (short)0, null, null ); fail( "Did not throw IllegalArgumentException" ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor2() throws Exception { try { new DefaultMethodCode( (short)0, createModifiedMethod(), null ); fail( "Did not throw IllegalArgumentException" ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor3() throws Exception { try { new DefaultMethodCode( (short)0, null, createClassRecord( createModifiedMethod() ) ); fail( "Did not throw IllegalArgumentException" ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor4() throws Exception { ModifiedMethod mm = createModifiedMethod(); new DefaultMethodCode( (short)0, mm, createClassRecord( mm ) ); } public void testConstructor5() throws Exception { ModifiedMethod mm = createModifiedMethod( GCI1.class, "m" ); try { new DefaultMethodCode( (short)0, mm, createClassRecord( mm ) ); fail( "Did not throw an IllegalStateException." ); } catch (IllegalStateException ise) { assertTrue( "Did not mention the abstract method.", ise.getMessage().indexOf( "abstract method" ) >= 0 ); } } public void testGetOriginalMethod1() throws Exception { ModifiedMethod mm = createModifiedMethod(); DefaultMethodCode dmc = new DefaultMethodCode( (short)0, mm, createClassRecord( mm ) ); assertNotNull( "Returned null original method.", dmc.getOriginalMethod() ); assertSame( "Not the same original method.", mm.getOriginalMethod(), dmc.getOriginalMethod() ); } public void testGetMethodName1() throws Exception { ModifiedMethod mm = createModifiedMethod(); Method m = mm.getOriginalMethod(); DefaultMethodCode dmc = new DefaultMethodCode( (short)0, mm, createClassRecord( mm ) ); assertNotNull( "Returned null method name.", dmc.getMethodName() ); assertEquals( "Not the same original method.", m.getName()+m.getSignature(), dmc.getMethodName() ); } public void testGetClassName1() throws Exception { ModifiedMethod mm = createModifiedMethod(); DefaultMethodCode dmc = new DefaultMethodCode( (short)0, mm, createClassRecord( mm ) ); assertNotNull( "Returned null class name.", dmc.getClassName() ); assertSame( "Not the same original method.", mm.getOriginalClass().getClassName(), dmc.getClassName() ); } // the other methods are sufficiently tested by IMethodCodeUTestI //------------------------------------------------------------------------- // Helpers protected static ModifiedMethod createModifiedMethod() throws Exception { return CCCreatorUtil.createModifiedMethod( THIS_CLASS, 0 ); } protected static ModifiedMethod getModifiedMethod( Class c, String methodName ) throws Exception { // return the first method with the given name (not sig) ModifiedClass mc = CCCreatorUtil.createModifiedClass( c ); ModifiedMethod mmL[] = mc.getMethods(); for (int i = 0; i < mmL.length; ++i) { if (methodName.equals( mmL[i].getOriginalMethod().getName() )) { return mmL[i]; } } fail( "Could not find method named '"+methodName+"' in class "+c+"." ); // for the fans... throw new Exception(); } protected static ModifiedMethod createModifiedMethod( Class c, String methodName ) throws Exception { // This is really difficult now, because the non-modifiable // methods are not returned by ModifierClass. JavaClass jc = BCELCreatorUtil.createJavaClass( c ); Method mL[] = jc.getMethods(); for (int i = 0; i < mL.length; ++i) { if (methodName.equals( mL[i].getName())) { Method m = mL[i]; MethodGen mg = BCELCreatorUtil.createMethodGen( jc, m ); ModifiedMethod mm = CCCreatorUtil.createModifiedMethod( jc, i, m, mg ); return mm; } } fail( "Could not find method named '"+methodName+"' in class "+c+"." ); // for the fans... throw new Exception(); } protected static AnalysisModuleSet createAnalysisModuleSet() { IAnalysisModule amL[] = new IAnalysisModule[] { CCCreatorUtil.createIAnalysisModule( 0 ), CCCreatorUtil.createIAnalysisModule( 1 ), CCCreatorUtil.createIAnalysisModule( 2 ), }; return CCCreatorUtil.createAnalysisModuleSet( amL ); } protected static ClassRecord createClassRecord( ModifiedMethod mm ) { return CCCreatorUtil.createClassRecord( THIS_CLASS, mm, createAnalysisModuleSet() ); } private static abstract class GCI1 { public abstract void m(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IMethodCodeUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws Exception { ModifiedMethod mm = createModifiedMethod(); return new DefaultMethodCode( (short)0, mm, createClassRecord( mm ) ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedMethodUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000002735110037421054034251 0ustar drazzibdrazzib/* * @(#)ModifiedMethodUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BCELCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.junit.v1.SubTestTestCase; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.MethodGen; /** * Tests the ModifiedMethod class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 13, 2003 */ public class ModifiedMethodUTest extends SubTestTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ModifiedMethodUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ModifiedMethodUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new ModifiedMethod( (short)0, 0, 0, null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor2() throws Exception { try { new ModifiedMethod( (short)0, 0, 0, createJavaClass( THIS_CLASS ), null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor3() throws Exception { try { new ModifiedMethod( (short)0, 0, 0, null, getMethod( createJavaClass( THIS_CLASS ), 0 ), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor4() throws Exception { try { new ModifiedMethod( (short)0, 0, 0, null, null, createMethodGen( createJavaClass( THIS_CLASS ), 0 ) ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor5() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); try { new ModifiedMethod( (short)0, 0, 0, null, getMethod( jc, 0 ), createMethodGen( jc, 0 ) ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor6() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); try { new ModifiedMethod( (short)0, 0, 0, jc, null, createMethodGen( jc, 0 ) ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor7() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); try { new ModifiedMethod( (short)0, 0, 0, jc, getMethod( jc, 0 ), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testGetMethodName1() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); Method m = getMethod( jc, 2 ); MethodGen mg = createMethodGen( jc, m ); ModifiedMethod mm = createModifiedMethod( jc, 2, m, mg ); assertEquals( "Did not return correct method name.", m.getName() + m.getSignature(), mm.getMethodName() ); } public void testGetInstructionList1() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); Method m = getMethod( jc, 4 ); MethodGen mg = createMethodGen( jc, m ); ModifiedMethod mm = createModifiedMethod( jc, 4, m, mg ); ModifiedInstructionList mil = mm.getInstructionList(); assertNotNull( "Returned null instruction list.", mil ); assertEquals( "Instruction list size not correct.", mg.getInstructionList().size(), mil.getInstructionCount() ); } public void testGetOriginalClass1() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); Method m = getMethod( jc, 4 ); MethodGen mg = createMethodGen( jc, m ); ModifiedMethod mm = createModifiedMethod( jc, 4, m, mg ); assertSame( "Did not return the original java class.", jc, mm.getOriginalClass() ); } public void testGetOriginalMethod1() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); Method m = getMethod( jc, 4 ); MethodGen mg = createMethodGen( jc, m ); ModifiedMethod mm = createModifiedMethod( jc, 4, m, mg ); assertSame( "Did not return the original method.", m, mm.getOriginalMethod() ); } public void testCanAddMarks1() throws Exception { ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 14 ); // every method in the test class should be able to be marked. assertTrue( mm.canAddMarks() ); } public void testGetModifiedMethodGen1() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); Method m = getMethod( jc, 4 ); MethodGen mg = createMethodGen( jc, m ); ModifiedMethod mm = createModifiedMethod( jc, 4, m, mg ); assertSame( "Did not return the original MethodGen.", mg, mm.getModifiedMethodGen() ); } public void testGetNewMethod1() throws Exception { ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 7 ); try { mm.getNewMethod(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testGetNewMethod2() throws Exception { JavaClass jc = createJavaClass( THIS_CLASS ); Method m = getMethod( jc, 7 ); MethodGen mg = createMethodGen( jc, m ); ModifiedMethod mm = createModifiedMethod( jc, 7, m, mg ); mm.close(); Method m2 = mm.getNewMethod(); assertNotSame( "Returned the original object.", m, m2 ); assertEquals( "Method name was changed.", m.getName(), m2.getName() ); assertEquals( "Method signature was changed.", m.getSignature(), m2.getSignature() ); } public void testClose1() throws Exception { ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 1 ); mm.close(); try { mm.close(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testClose2() throws Exception { ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 1 ); mm.close(); try { mm.getInstructionList(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testClose3() throws Exception { ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 1 ); mm.close(); try { mm.getModifiedMethodGen(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } //------------------------------------------------------------------------- // Helpers protected ModifiedMethod createModifiedMethod( Class c, int methodIndex ) throws Exception { return CCCreatorUtil.createModifiedMethod( c, methodIndex ); } protected ModifiedMethod createModifiedMethod( JavaClass jc, int methodIndex, Method m, MethodGen mg ) { return CCCreatorUtil.createModifiedMethod( jc, methodIndex, m, mg ); } protected JavaClass createJavaClass( Class c ) throws Exception { return BCELCreatorUtil.createJavaClass( c ); } protected Method getMethod( JavaClass jc, int methodIndex ) { return BCELCreatorUtil.getMethod( jc, methodIndex ); } protected MethodGen createMethodGen( JavaClass jc, Method m ) { return BCELCreatorUtil.createMethodGen( jc, m ); } protected MethodGen createMethodGen( JavaClass jc, int methodIndex ) { return BCELCreatorUtil.createMethodGen( jc, methodIndex ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedInstructionListUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000002076710037421054034255 0ustar drazzibdrazzib/* * @(#)ModifiedInstructionListUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BCELCreatorUtil; import org.apache.bcel.generic.InstructionList; /** * Tests the ModifiedInstructionList class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 13, 2003 */ public class ModifiedInstructionListUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ModifiedInstructionListUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ModifiedInstructionListUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ModifiedInstructionList( (short)0, 0, 0, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor2() { new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); } public void testClose1() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); mil.close(); } public void testClose2() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); mil.close(); try { mil.close(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testClose3() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); mil.close(); try { mil.getInstructionAt(0); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testClose4() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); mil.close(); try { mil.getInstructionCount(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testClose5() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); mil.close(); try { mil.updateInstructionList(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception } } public void testUpdateInstructionList1() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); int origCount = mil.getInstructionCount(); mil.updateInstructionList(); assertEquals( "Changed instruction count!", origCount, mil.getInstructionCount() ); mil.updateInstructionList(); assertEquals( "Changed instruction count!", origCount, mil.getInstructionCount() ); mil.updateInstructionList(); assertEquals( "Changed instruction count!", origCount, mil.getInstructionCount() ); } public void testUpdateInstructionList2() { ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, createInstructionList(), createModifiedTargeters() ); int origCount = mil.getInstructionCount(); mil.getInstructionAt( origCount - 1 ). addMark( (short)1, Short.MAX_VALUE ); mil.updateInstructionList(); mil.getInstructionAt( origCount - 1 ). addMark( (short)1, Short.MAX_VALUE ); mil.updateInstructionList(); int count = mil.getInstructionCount(); mil.updateInstructionList(); assertEquals( "Changed instruction count!", count, mil.getInstructionCount() ); } public void testGetInstructionAt1() { // requirement: we need to be able to put a mark at the end of the // list. ModifiedInstructionList mil = new ModifiedInstructionList( (short)0, 0, 0, new InstructionList(), createModifiedTargeters() ); MarkedInstruction mi = mil.getInstructionAt( 0 ); assertNotNull( "Returned null end instruction.", mi ); assertTrue( "End instruction is not the NullInstruction.", mi.getInstruction() instanceof NullInstruction ); } //------------------------------------------------------------------------- // Helpers protected InstructionList createInstructionList() { InstructionList il = BCELCreatorUtil.createInstructionList(); BCELCreatorUtil.addInstructionHandle( il ); return il; } protected ModifiedTargeters createModifiedTargeters() { org.apache.bcel.classfile.JavaClass jc = null; try { jc = BCELCreatorUtil.createJavaClass( THIS_CLASS ); } catch (java.io.IOException ex) { ex.printStackTrace(); fail( ex.getMessage() ); } return new ModifiedTargeters( BCELCreatorUtil.createMethodGen( jc, 0 ) ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/PostCompileClassUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000003126610037421054034251 0ustar drazzibdrazzib/* * @(#)PostCompileClassUTest.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.logger.TestLogger; /** * Tests the PostCompileClass class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since December 28, 2002 */ public class PostCompileClassUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = PostCompileClassUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public PostCompileClassUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new PostCompileClass( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor2() { try { new PostCompileClass( createIMetaDataWriter(), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor3() { try { new PostCompileClass( null, createAnalysisModules() ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor4() { try { new PostCompileClass( null, new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor5() { try { new PostCompileClass( createIMetaDataWriter(), new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor6() { new PostCompileClass( createIMetaDataWriter(), createAnalysisModules() ); } //------------- public void testConstructor7() { try { new PostCompileClass( null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor8() { try { new PostCompileClass( null, createIMetaDataWriter(), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor9() { try { new PostCompileClass( null, null, createAnalysisModules() ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor10() { try { new PostCompileClass( null, null, new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor11() { try { new PostCompileClass( null, createIMetaDataWriter(), new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor12() { try { new PostCompileClass( null, createIMetaDataWriter(), createAnalysisModules() ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor13() { try { new PostCompileClass( createParseCoverageLogger(), createIMetaDataWriter(), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor14() { try { new PostCompileClass( createParseCoverageLogger(), null, createAnalysisModules() ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor15() { try { new PostCompileClass( createParseCoverageLogger(), null, new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor16() { try { new PostCompileClass( createParseCoverageLogger(), createIMetaDataWriter(), new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception? } } public void testConstructor17() { new PostCompileClass( createParseCoverageLogger(), createIMetaDataWriter(), createAnalysisModules() ); } //---------- private static class Sample1 {} public void testPostCompile1() throws Exception { PostCompileClass pcc = new PostCompileClass( createParseCoverageLogger(), createIMetaDataWriter(), createAnalysisModules() ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); String filename = getClassFilename( Sample1.class ); byte[] bytecode = loadBytecode( filename ); pcc.postCompile( filename, bytecode, baos ); assertTrue( "Output bytecode is empty.", baos.toByteArray().length > 0 ); } public void testPostCompile2() throws Exception { PostCompileClass pcc = new PostCompileClass( createIMetaDataWriter(), createAnalysisModules() ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); String filename = getClassFilename( Sample1.class ); byte[] bytecode = loadBytecode( filename ); pcc.postCompile( filename, bytecode, baos ); assertTrue( "Output bytecode is empty.", baos.toByteArray().length > 0 ); } private static abstract class Sample3 { public abstract void a(); } public void testPostCompile3() throws Exception { PostCompileClass pcc = new PostCompileClass( createIMetaDataWriter(), createAnalysisModules() ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); String filename = getClassFilename( Sample3.class ); byte[] bytecode = loadBytecode( filename ); pcc.postCompile( filename, bytecode, baos ); assertTrue( "Output bytecode is empty.", baos.toByteArray().length > 0 ); } //------------------------------------------------------------------------- // Helpers public static class MyClassMetaDataWriter implements IClassMetaDataWriter { private List records; public MyClassMetaDataWriter( List l ) { this.records = l; } public void writeClassRecord( ClassRecord cr ) { this.records.add( cr ); } public void close() { this.records = null; } } public static class MyMetaDataWriter implements IMetaDataWriter { public Map modulesToClassRecordList = new HashMap(); public IClassMetaDataWriter getClassWriter( IAnalysisModule module ) { List list = (List)this.modulesToClassRecordList.get( module ); if (list == null) { list = new LinkedList(); this.modulesToClassRecordList.put( module, list ); } return new MyClassMetaDataWriter( list ); } public void close() {} } //------------------------------------------------------------------------ protected ParseCoverageLogger createParseCoverageLogger() { return TestLogger.createPCL(); } protected MyMetaDataWriter createIMetaDataWriter() { return new MyMetaDataWriter(); } protected IAnalysisModule[] createAnalysisModules() { return new IAnalysisModule[] { CCCreatorUtil.createIAnalysisModule( 2 ), CCCreatorUtil.createIAnalysisModule( 3 ), CCCreatorUtil.createIAnalysisModule( 4 ), }; } protected static String getClassFilename( Class c ) { return BytecodeLoaderUtil.getClassFilename( c ); } protected static byte[] loadBytecode( String filename ) throws IOException { return BytecodeLoaderUtil.loadBytecode( filename ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLoggerUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000001767110037421054034255 0ustar drazzibdrazzib/* * @(#)ParseCoverageLoggerUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the ParseCoverageLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 13, 2003 */ public class ParseCoverageLoggerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ParseCoverageLoggerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ParseCoverageLoggerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new ParseCoverageLogger(); } public void testConstructor2() { try { new ParseCoverageLogger( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor3() { try { new ParseCoverageLogger( THIS_CLASS, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor4() { try { new ParseCoverageLogger( null, "" ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor5() { try { new ParseCoverageLogger( MyLogger.class, "not-exist" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor6() { try { new ParseCoverageLogger( MyLogger.class, "bad1" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor7() { try { new ParseCoverageLogger( MyLogger.class, "bad2" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor8() { try { new ParseCoverageLogger( MyLogger.class, "bad3" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor9() { try { new ParseCoverageLogger( MyLogger.class, "bad4" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor10() { try { new ParseCoverageLogger( MyLogger.class, "bad5" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor11() { try { new ParseCoverageLogger( MyLogger.class, "bad6" ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // test exception } } public void testConstructor12() { new ParseCoverageLogger( MyLogger.class, "good" ); } public void testGetClassName1() { ParseCoverageLogger pcl = new ParseCoverageLogger( MyLogger.class, "good" ); assertEquals( "Incorrect class name.", MyLogger.class.getName(), pcl.getClassName() ); } public void testGetMethodName1() { ParseCoverageLogger pcl = new ParseCoverageLogger( MyLogger.class, "good" ); assertEquals( "Incorrect method name.", "good", pcl.getMethodName() ); } public void testGetMethodSignature1() { ParseCoverageLogger pcl = new ParseCoverageLogger( MyLogger.class, "good" ); assertEquals( "Incorrect method signature.", "(Ljava/lang/String;SSS)V", pcl.getMethodSignature() ); } //------------------------------------------------------------------------- // Helpers public static class MyLogger { public static void good( String s, short a, short b, short c ) { } public static String bad1( String s, short a, short b, short c ) { return ""; } public void bad2( String s, short a, short b, short c ) { } protected static void bad3( String s, short a, short b, short c ) { } static void bad4( String s, short a, short b, short c ) { } protected void bad5( String s, short a, short b, short c ) { } void bad6( String s, short a, short b, short c ) { } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedClassUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000002457710037421054034260 0ustar drazzibdrazzib/* * @(#)ModifiedClassUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; /** * Tests the ModifiedClass class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 13, 2003 */ public class ModifiedClassUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ModifiedClassUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ModifiedClassUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new ModifiedClass( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor2() throws Exception { try { new ModifiedClass( "", null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor3() throws Exception { try { new ModifiedClass( null, new byte[0] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor4() throws Exception { try { new ModifiedClass( null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor5() throws Exception { try { new ModifiedClass( null, "", null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor6() throws Exception { try { new ModifiedClass( null, null, new byte[0] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor7() throws Exception { try { new ModifiedClass( new ParseCoverageLogger(), null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor8() throws Exception { try { new ModifiedClass( new ParseCoverageLogger(), "", null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor9() throws Exception { try { new ModifiedClass( new ParseCoverageLogger(), null, new byte[0] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor10() throws Exception { try { new ModifiedClass( new ParseCoverageLogger(), "", new byte[0] ); fail( "Did not throw an exception." ); } catch (IOException io) { // test exception } } public void testConstructor11() throws Exception { String filename = BytecodeLoaderUtil.getClassFilename( THIS_CLASS ); new ModifiedClass( filename, BytecodeLoaderUtil.loadBytecode( filename ) ); } public void testConstructor12() throws Exception { String filename = BytecodeLoaderUtil.getClassFilename( THIS_CLASS ); new ModifiedClass( new ParseCoverageLogger(), filename, BytecodeLoaderUtil.loadBytecode( filename ) ); } public void testGetClassName1() throws Exception { ModifiedClass mc = createModifiedClass( THIS_CLASS ); assertEquals( "Created class and returned classname don't match.", THIS_CLASS.getName(), mc.getClassName() ); } public void testGetClassCRC1() throws Exception { ModifiedClass mc = createModifiedClass( THIS_CLASS ); assertTrue( "Checksum is zero or -1.", mc.getClassCRC() != 0L && mc.getClassCRC() != -1L ); } public void testGetClassSignature1() throws Exception { ModifiedClass mc = createModifiedClass( THIS_CLASS ); long crc = mc.getClassCRC(); String name = THIS_CLASS.getName(); assertTrue( "Does not contain the class name.", mc.getClassSignature().indexOf( name ) >= 0 ); assertTrue( "Does not contain the class CRC.", mc.getClassSignature().indexOf( Long.toString( crc ) ) >= 0 ); } public void testCreateClassRecord1() throws Exception { ModifiedClass mc = createModifiedClass( THIS_CLASS ); ClassRecord cr = mc.createClassRecord( createAnalysisModuleSet() ); assertNotNull( "Returned null class record.", cr ); assertEquals( "Mismatch class name.", THIS_CLASS.getName(), cr.getClassName() ); assertEquals( "Mismatch class CRC.", mc.getClassCRC(), cr.getClassCRC() ); assertEquals( "Mismatch signature.", mc.getClassSignature(), cr.getClassSignature() ); assertEquals( "Mismatch method count.", mc.getMethods().length, cr.getMethodCount() ); } public void testGetMethods1() throws Exception { ModifiedClass mc = createModifiedClass( THIS_CLASS ); ModifiedMethod[] mmL = mc.getMethods(); assertNotNull( "Returned null method list.", mmL ); /* never could get this to work java.lang.reflect.Method mL[] = THIS_CLASS.getDeclaredMethods(); assertTrue( "Returned incorrect list size (found "+mmL.length+ ", expected close to "+mL.length+").", mmL.length == mL.length || mmL.length == mL.length + 1 ); */ } public void testGetModifiedClass1() throws Exception { ModifiedClass mc = createModifiedClass( THIS_CLASS ); byte[] orig = BytecodeLoaderUtil.loadBytecode( BytecodeLoaderUtil.getClassFilename( THIS_CLASS ) ); byte[] c = mc.getModifiedClass(); assertNotNull( "Returned null class bytecode.", c ); assertTrue( "Returned smaller length bytecode than the original.", c.length >= orig.length ); } //------------------------------------------------------------------------- // Helpers protected ModifiedClass createModifiedClass( Class c ) throws IOException { return CCCreatorUtil.createModifiedClass( c ); } protected AnalysisModuleSet createAnalysisModuleSet() { return CCCreatorUtil.createAnalysisModuleSet( 2 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/MeasureMarkUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000000750410037421054034247 0ustar drazzibdrazzib/* * @(#)MeasureMarkUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.apache.bcel.generic.InstructionList; /** * Tests the MeasureMark class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 13, 2003 */ public class MeasureMarkUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MeasureMarkUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public MeasureMarkUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers public void testConstructor1() { new MeasureMark( Integer.MAX_VALUE, 0, (short)-1, (short)-1, Short.MIN_VALUE ); } public void testAddToInstructionList1() { MeasureMark mm = new MeasureMark( Integer.MAX_VALUE, 0, (short)-1, (short)-1, Short.MIN_VALUE ); InstructionList list = new InstructionList(); mm.addToInstructionList( list ); assertEquals( "Did not insert currect number of instructions.", 5, list.size() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compiler/MarkedInstructionUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/compile0000644000175000017500000002163210037421054034245 0ustar drazzibdrazzib/* * @(#)MarkedInstructionUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BCELCreatorUtil; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; /** * Tests the MarkedInstruction class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 13, 2003 */ public class MarkedInstructionUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MarkedInstructionUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public MarkedInstructionUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests private static final int MARK_INSTRUCTION_COUNT = 5; public void testConstructor1() { try { new MarkedInstruction( (short)0, 0, 0, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test failure? } } public void testGetInstruction1() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); assertEquals( "Did not return expected instruction.", ih.getInstruction(), mi.getHandle().getInstruction() ); } public void testAddMark1() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( (short)1, Short.MIN_VALUE ); } public void testAddMark2() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( Short.MIN_VALUE, (short)1 ); } public void testAddMark3() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( (short)1, Short.MAX_VALUE ); } public void testAddMark4() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( Short.MAX_VALUE, (short)1 ); } public void testGetMarkedList1() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); InstructionList il = mi.getMarkedList(); assertNull( "Did not return a null marked list.", il ); } public void testGetMarkedList2() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( (short)1, (short)1 ); InstructionList il = mi.getMarkedList(); assertEquals( "Did not return a marked list of the expected size.", MARK_INSTRUCTION_COUNT, il.size() ); } public void testGetMarkedList3() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( (short)1, (short)1 ); mi.addMark( (short)1, (short)1 ); mi.addMark( (short)1, (short)1 ); InstructionList il = mi.getMarkedList(); assertEquals( "Did not return a marked list of the expected size.", MARK_INSTRUCTION_COUNT*3, il.size() ); } public void testGetMarkedList_state1() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.getMarkedList(); // repeat again without any mark changes InstructionList il = mi.getMarkedList(); assertNull( "Did not return a null marked list.", il ); } public void testGetMarkedList_state2() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( (short)1, (short)1 ); mi.addMark( (short)1, (short)1 ); mi.getMarkedList(); // repeat again without any mark changes InstructionList il = mi.getMarkedList(); assertNull( "Did not return a null marked list.", il ); } public void testGetMarkedList_state3() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.getMarkedList(); mi.addMark( (short)1, (short)1 ); mi.addMark( (short)1, (short)1 ); InstructionList il = mi.getMarkedList(); assertEquals( "Did not return a marked list of the expected size.", MARK_INSTRUCTION_COUNT*2, il.size() ); } public void testGetMarkedList_state4() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); mi.addMark( (short)0, (short)0 ); mi.addMark( (short)0, (short)1 ); mi.addMark( (short)0, (short)2 ); mi.getMarkedList(); mi.addMark( (short)1, (short)0 ); mi.addMark( (short)1, (short)1 ); InstructionList il = mi.getMarkedList(); assertEquals( "Did not return a marked list of the expected size.", MARK_INSTRUCTION_COUNT*2, il.size() ); } public void testGetHandle1() { InstructionHandle ih = createInstructionHandle(); MarkedInstruction mi = new MarkedInstruction( (short)0, 0, 0, ih ); assertSame( "Did not return same handle.", ih, mi.getHandle() ); } //------------------------------------------------------------------------- // Helpers protected InstructionHandle createInstructionHandle() { return BCELCreatorUtil.createInstructionHandle(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/CreateMainClassHelper.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/CreateM0000644000175000017500000001002410037421053034125 0ustar drazzibdrazzib/* * @(#)CreateMainClassHelper.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.ByteArrayOutputStream; import java.io.IOException; import org.apache.bcel.Constants; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.generic.ArrayType; import org.apache.bcel.generic.ClassGen; import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.InstructionFactory; import org.apache.bcel.generic.InstructionList; import org.apache.bcel.generic.MethodGen; import org.apache.bcel.generic.Type; /** * Helper for creating a main class through bytecode. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since May 2, 2003 */ public class CreateMainClassHelper { private static final Class THIS_CLASS = CreateMainClassHelper.class; private String className; private ClassGen cg; private MethodGen mg; private JavaClass jc; private byte[] bytecode; public ConstantPoolGen cp; public InstructionList il; public InstructionFactory factory; public CreateMainClassHelper( String className ) { this.className = className; this.cg = new ClassGen( className, Object.class.getName(), "", Constants.ACC_PUBLIC | Constants.ACC_SUPER, null ); this.cp = this.cg.getConstantPool(); this.il = new InstructionList(); this.mg = new MethodGen( Constants.ACC_STATIC | Constants.ACC_PUBLIC, // access flags Type.VOID, // return type new Type[] { // argument types new ArrayType(Type.STRING, 1) }, new String[] { "argv" }, // arg names "main", "HelloWorld", // method, class this.il, this.cp ); this.factory = new InstructionFactory( this.cg ); } public void close() throws IOException { this.mg.setMaxStack(); this.cg.addMethod( this.mg.getMethod() ); this.il.dispose(); this.cg.addEmptyConstructor( Constants.ACC_PUBLIC ); this.il = null; this.mg = null; this.cp = null; this.jc = cg.getJavaClass(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); this.jc.dump( baos ); this.bytecode = baos.toByteArray(); } public JavaClass getJavaClass() { return this.jc; } public byte[] getBytecode() { return this.bytecode; } public Class getGenClass() throws ClassNotFoundException { Class cc = BytecodeLoaderUtil.loadClassFromBytecode( this.className, this.bytecode ); return cc; } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/0000755000175000017500000000000011271425773034170 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/BranchCountMeasureUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/0000644000175000017500000001305010037421054034154 0ustar drazzibdrazzib/* * @(#)BranchCountMeasureUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModuleUTestI; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod; import net.sourceforge.groboutils.codecoverage.v2.logger.TestLogger; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the BranchCountMeasure class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 26, 2003 */ public class BranchCountMeasureUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = BranchCountMeasureUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public BranchCountMeasureUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyTestClass { public static void main( String[] args ) { int i = 0; i += 10; if (i > 1) { System.out.println( ""+i ); } } } public void testAnalyze1() throws Exception { BranchCountMeasure bcm = new BranchCountMeasure(); ModifiedClass mc = CCCreatorUtil.createModifiedClass( TestLogger.createPCL(), MyTestClass.class ); ModifiedMethod mm = CCCreatorUtil.getMainModifiedMethod( mc ); IMethodCode imc = createMethodCode( MyTestClass.class, mm, bcm ); // populate the method with marks bcm.analyze( imc ); // Generate the class from the modified bytecode, and run it. Class c = BytecodeLoaderUtil.loadClassFromBytecode( mc.getClassName(), mc.getModifiedClass() ); TestLogger.reset(); BytecodeLoaderUtil.runMain( c ); assertEquals( "Did not mark every bytecode in method.", 3, TestLogger.size() ); } //------------------------------------------------------------------------- // Helpers protected IMethodCode createMethodCode( Class c, ModifiedMethod mm, IAnalysisModule am ) { return CCCreatorUtil.createIMethodCode( c, mm, CCCreatorUtil.createAnalysisModuleSet( new IAnalysisModule[] { am } ), 0 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAnalysisModuleUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new BranchCountMeasure(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/BytecodeCountMeasureUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/0000644000175000017500000001313010037421054034153 0ustar drazzibdrazzib/* * @(#)BytecodeCountMeasureUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModuleUTestI; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod; import net.sourceforge.groboutils.codecoverage.v2.logger.TestLogger; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the BytecodeCountMeasure class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 26, 2003 */ public class BytecodeCountMeasureUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = BytecodeCountMeasureUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public BytecodeCountMeasureUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyTestClass { public static void main( String[] args ) { int i = 0; i += 10; System.out.println( ""+i ); } } public void testAnalyze1() throws Exception { BytecodeCountMeasure bcm = new BytecodeCountMeasure(); ModifiedClass mc = CCCreatorUtil.createModifiedClass( TestLogger.createPCL(), MyTestClass.class ); ModifiedMethod mm = CCCreatorUtil.getMainModifiedMethod( mc ); IMethodCode imc = createMethodCode( MyTestClass.class, mm, bcm ); int expectedCount = mm.getInstructionList().getInstructionCount(); // populate the method with marks bcm.analyze( imc ); // Generate the class from the modified bytecode, and run it. Class c = BytecodeLoaderUtil.loadClassFromBytecode( mc.getClassName(), mc.getModifiedClass() ); TestLogger.reset(); BytecodeLoaderUtil.runMain( c ); assertEquals( "Did not mark every bytecode in method.", expectedCount, TestLogger.size() ); } //------------------------------------------------------------------------- // Helpers protected IMethodCode createMethodCode( Class c, ModifiedMethod mm, IAnalysisModule am ) { return CCCreatorUtil.createIMethodCode( c, mm, CCCreatorUtil.createAnalysisModuleSet( new IAnalysisModule[] { am } ), 0 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAnalysisModuleUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new BytecodeCountMeasure(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/DefaultAnalysisMetaDataUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/0000644000175000017500000001417310037421054034163 0ustar drazzibdrazzib/* * @(#)DefaultAnalysisMetaDataUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaDataUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DefaultAnalysisMetaData class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DefaultAnalysisMetaDataUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultAnalysisMetaDataUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultAnalysisMetaDataUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultAnalysisMetaData( null, null, (byte)0 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor2() { try { new DefaultAnalysisMetaData( null, "", (byte)0 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor3() { try { new DefaultAnalysisMetaData( "", null, (byte)0 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor4() { new DefaultAnalysisMetaData( "", "", (byte)0 ); } public void testGetCoveredFormattedText1() { DefaultAnalysisMetaData damd = new DefaultAnalysisMetaData( "a", "b", (byte)100 ); assertEquals( "Did not return correct covered formatted text.", "a", damd.getCoveredFormattedText() ); } public void testGetNotCoveredFormattedText1() { DefaultAnalysisMetaData damd = new DefaultAnalysisMetaData( "a", "b", (byte)100 ); assertEquals( "Did not return correct not-covered formatted text.", "b", damd.getNotCoveredFormattedText() ); } public void testGetInstructionWeight1() { DefaultAnalysisMetaData damd = new DefaultAnalysisMetaData( "a", "b", (byte)100 ); assertEquals( "Did not return correct instruction weight.", (byte)100, damd.getInstructionWeight() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAnalysisMetaDataUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new DefaultAnalysisMetaData( "a", "b", (byte)0 ); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() throws IOException { return new DefaultAnalysisMetaData( "a", "b", Byte.MAX_VALUE ); } } ); suite.addFactory( new CxFactory( "C" ) { public Object createImplObject() throws IOException { return new DefaultAnalysisMetaData( "a", "b", Byte.MIN_VALUE ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/LineCountMeasureUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/module/0000644000175000017500000001671010037421054034162 0ustar drazzibdrazzib/* * @(#)LineCountMeasureUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.module; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.CreateMainClassHelper; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModuleUTestI; import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod; import net.sourceforge.groboutils.codecoverage.v2.logger.TestLogger; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import org.apache.bcel.Constants; import org.apache.bcel.generic.InstructionConstants; import org.apache.bcel.generic.ObjectType; import org.apache.bcel.generic.PUSH; import org.apache.bcel.generic.Type; /** * Tests the LineCountMeasure class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class LineCountMeasureUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = LineCountMeasureUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public LineCountMeasureUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyTestClass { public static void main( String[] args ) { int i = 0; i += 10; System.out.println( ""+i ); } } public void testAnalyze1() throws Exception { LineCountMeasure bcm = new LineCountMeasure(); ModifiedClass mc = CCCreatorUtil.createModifiedClass( TestLogger.createPCL(), MyTestClass.class ); ModifiedMethod mm = CCCreatorUtil.getMainModifiedMethod( mc ); IMethodCode imc = createMethodCode( MyTestClass.class, mm, bcm ); // populate the method with marks bcm.analyze( imc ); // Generate the class from the modified bytecode, and run it. Class c = BytecodeLoaderUtil.loadClassFromBytecode( mc.getClassName(), mc.getModifiedClass() ); TestLogger.reset(); BytecodeLoaderUtil.runMain( c ); assertEquals( "Did not mark every bytecode in method.", 2, TestLogger.size() ); } public void testAnalyze2() throws Exception { LineCountMeasure bcm = new LineCountMeasure(); CreateMainClassHelper cmch = createHelloWorld(); byte bytecode[] = cmch.getBytecode(); Class cc = cmch.getGenClass(); ModifiedClass mc = CCCreatorUtil.createModifiedClass( TestLogger.createPCL(), "test/HelloWorld.class", bytecode ); ModifiedMethod mm = CCCreatorUtil.getMainModifiedMethod( mc ); IMethodCode imc = createMethodCode( cc, mm, bcm ); // populate the method with marks bcm.analyze( imc ); // Generate the class from the modified bytecode, and run it. Class c = BytecodeLoaderUtil.loadClassFromBytecode( mc.getClassName(), mc.getModifiedClass() ); TestLogger.reset(); BytecodeLoaderUtil.runMain( c ); assertEquals( "Somehow we found a line number.", 0, TestLogger.size() ); } //------------------------------------------------------------------------- // Helpers protected IMethodCode createMethodCode( Class c, ModifiedMethod mm, IAnalysisModule am ) { return CCCreatorUtil.createIMethodCode( c, mm, CCCreatorUtil.createAnalysisModuleSet( new IAnalysisModule[] { am } ), 0 ); } protected CreateMainClassHelper createHelloWorld() throws IOException { CreateMainClassHelper cmch = new CreateMainClassHelper( "test.HelloWorld" ); ObjectType p_stream = new ObjectType("java.io.PrintStream"); cmch.il.append( cmch.factory.createFieldAccess("java.lang.System", "out", p_stream, Constants.GETSTATIC ) ); cmch.il.append( new PUSH(cmch.cp, "Hello, world.")) ; cmch.il.append( cmch.factory.createInvoke("java.io.PrintStream", "println", Type.VOID, new Type[] { Type.STRING }, Constants.INVOKEVIRTUAL ) ); cmch.il.append(InstructionConstants.RETURN); cmch.close(); return cmch; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAnalysisModuleUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new LineCountMeasure(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChannelLogReaderUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChanne0000644000175000017500000000756110037421053034126 0ustar drazzibdrazzib/* * @(#)IChannelLogReaderUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.codecoverage.v2; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IChannelLogReader interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IChannelLogReaderUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IChannelLogReaderUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IChannelLogReaderUTestI( String name, ImplFactory f ) { super( name, IChannelLogReader.class, f ); } public IChannelLogReader createIChannelLogReader() { return (IChannelLogReader)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetReaderForClassSignature1() throws Exception { IChannelLogReader clr = createIChannelLogReader(); IClassChannelLogReader cclr = clr.getReaderForClassSignature( null ); assertNotNull( "Returned null reader.", cclr ); assertNull( "Did not return null next.", cclr.nextRecord() ); } public void testGetReaderForClassSignature2() throws Exception { IChannelLogReader clr = createIChannelLogReader(); IClassChannelLogReader cclr = clr.getReaderForClassSignature( "" ); assertNotNull( "Returned null reader.", cclr ); assertNull( "Did not return null next.", cclr.nextRecord() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChannelLoggerFactoryUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChanne0000644000175000017500000001072010037421053034115 0ustar drazzibdrazzib/* * @(#)IChannelLoggerFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.codecoverage.v2; import java.util.Properties; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.AssertConstructor; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IChannelLoggerFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IChannelLoggerFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IChannelLoggerFactoryUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IChannelLoggerFactoryUTestI( String name, ImplFactory f ) { super( name, IChannelLoggerFactory.class, f ); } public IChannelLoggerFactory createIChannelLoggerFactory() { return (IChannelLoggerFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests // the factory MUST have a default constructor! public void testConstructor1() { IChannelLoggerFactory clf = createIChannelLoggerFactory(); AssertConstructor.assertHasDefaultConstructor( "All instances of IChannelLoggerFactory must have a default "+ "constructor.", clf ); } public void testCreateChannelLogger1() { IChannelLoggerFactory clf = createIChannelLoggerFactory(); IChannelLogger cl = clf.createChannelLogger( "", new Properties(), (short)0 ); assertNotNull( "Returned null logger.", cl ); } public void testCreateChannelLogger2() { IChannelLoggerFactory clf = createIChannelLoggerFactory(); IChannelLogger cl = clf.createChannelLogger( "", new Properties(), Short.MIN_VALUE ); assertNotNull( "Returned null logger.", cl ); } public void testCreateChannelLogger3() { IChannelLoggerFactory clf = createIChannelLoggerFactory(); IChannelLogger cl = clf.createChannelLogger( "", new Properties(), Short.MAX_VALUE ); assertNotNull( "Returned null logger.", cl ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/0000755000175000017500000000000011271425773033465 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/PropertyCheckUtil.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Pro0000644000175000017500000000713010037421053034133 0ustar drazzibdrazzib/* * @(#)PropertyCheckUtil.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.Properties; import junit.framework.Assert; /** * Checks for property files. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since March 9, 2004 */ public class PropertyCheckUtil extends Assert { public static void assertEquals( String text, Properties expected, Properties actual ) { StringBuffer missing = new StringBuffer( text ); int badCount = 0; Enumeration enum = expected.propertyNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); String value = expected.getProperty( key ); String actualValue = expected.getProperty( key ); if (!value.equals( actualValue )) { ++badCount; missing.append( "; expected property '" ). append( key ).append( "' to have value '" ). append( value ).append( "', but found '" ). append( actualValue ).append( "'" ); } } enum = actual.propertyNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); if (expected.getProperty( key ) == null) { ++badCount; missing.append( "; found extra property '" ). append( key ).append( "' = '" ). append( actual.getProperty( key ) ).append( "'" ); } } if (badCount > 0) { fail( missing.toString() ); } } public static Properties loadGroboProperties() throws IOException { return loadProperties( "./grobocoverage.properties" ); } public static Properties loadProperties( String file ) throws IOException { Properties props = new Properties(); InputStream is = new FileInputStream( file ); try { props.load( is ); } finally { is.close(); } return props; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/instrument.xmllibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/ins0000644000175000017500000004401610037142322034167 0ustar drazzibdrazzib Did not create the file a/A.class. Did not create the grobocoverage.properties file. Did not create the logs/data directory. Did not create the file a/A.class. Did not create the grobocoverage.properties file. Did not create the logs/data directory. Did not create the logs/data/moduleset file. Did not create the logs/data/LineCount directory. Did not create the file a/B.class on first pass. package a; public class A { class X { int x; } } package a; public class B extends A { class X { int x; } } Did not create the file a/A$$X.class on first pass. Did not create the file a/A.class on second pass. Did not create the file a/A$$X.class on second pass. Did not create the file a/B.class on second pass. Did not create the file a/B$$X.class on second pass. package a; public class A { class X { int x; } } Did not create the file a/A$$X.class on first pass. Did not create the file a/A.class on second pass. Did not create the file a/A$$X.class on second pass. package a; public class A { class X { int x; } A() { System.out.println("A"); } } package a; public class B extends A { class X { int x; } B() { super(); System.out.println("B"); } } Did not create the file a/A$$X.class on first pass. package a; public class A { class X { int x; } } Did not keep the file a/B.class on second pass. Did not create the file a/A$$X.class on second pass. Did not create the grobocoverage.properties file. Did not create the logs/data directory. Incorrectly created the grobocoverage.properties file. package a; import java.util.*; public class A { static final Hashtable H = new Hashtable(); static void x() { H.put("a", "B"); } public void y() { H.get("a"); } } package a; import java.util.*; public class B { static String s = null; static void x( String t ) { s = t + "x"; } public void y() { if (s != null) { s = s + s; } } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/report.xmllibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/rep0000644000175000017500000002526510072742300034172 0ustar drazzibdrazzib Did not create the file CoverageReport-LineCount.xml Did not create the file CoverageReport-BytecodeCount.xml Did not create the file CoverageReport-all.html Did not create the file CoverageReport-LineCount.html Did not create the file CoverageReport-BytecodeCount.html Did not create the file index.html Did not create the file index.html Did not keep the file a/A.java.html Did not keep the file a/B.java.html Did not keep the file a/package-classes.html Did not keep the file a/package-frame.html Did not create the file CoverageReport-LineCount.html Did not create the file CoverageReport-BytecodeCount.html package x; public class main { public static void main( String args[] ) { System.out.println("x.main start"); package a; import java.util.*; public class A { static final Hashtable H = new Hashtable(); static void x() { H.put("a", "B"); } public void y() { H.get("a"); } } System.out.println("x.main | a.A start"); a.A tA = new a.A(); // a.A.x(); tA.y(); System.out.println("x.main | a.A end"); package a; import java.util.*; public class B { static String s = null; public static void x( String t ) { s = t + "x"; } public void y() { if (s != null) { s = s + s; } } } System.out.println("x.main | a.B start"); a.B tB = new a.B(); tB.y(); a.B.x( "asdf" ); System.out.println("x.main | a.B end"); System.out.println("x.main end"); } } Source of ${x.main}: ${x.main.src} Did not create directory ${coverage.logs}/data Running java... Did not create directory ${coverage.logs}/logs Did not create directory ${coverage.logs}/logs/0 ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/GroboInstrumentTaskUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Gro0000644000175000017500000004044310037421053034126 0ustar drazzibdrazzib/* * @(#)GroboInstrumentTaskUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import java.util.Properties; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the GroboInstrumentTask class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since March 9, 2004 */ public class GroboInstrumentTaskUTest extends AntTestA { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = GroboInstrumentTaskUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public GroboInstrumentTaskUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests //........................... // Tests that pass private static final Properties EXPECTED_1 = new Properties(); static { EXPECTED_1.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory" ); EXPECTED_1.setProperty( "channel-count", "0" ); } public void testInstrument1() throws Exception { executeTarget( "instrument-1" ); EXPECTED_1.setProperty( "logger.dir", (new File( getCoverageDir(), "logs" + File.separator + "logs" )).getAbsolutePath() ); assertEquals( "Did not create the grobocoverage.properties file correctly", EXPECTED_1, loadGroboProperties() ); } private static final Properties EXPECTED_2 = new Properties(); static { EXPECTED_2.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory" ); EXPECTED_2.setProperty( "channel-count", "0" ); } public void testInstrument2() throws Exception { executeTarget( "instrument-2" ); EXPECTED_2.setProperty( "logger.dir", (new File( getCoverageDir(), "logs" + File.separator + "logs" )).getAbsolutePath() ); assertEquals( "Did not create the grobocoverage.properties file correctly", EXPECTED_2, loadGroboProperties() ); // Also, ensure that the data files were created... assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A" ); } public void testInstrument3() throws Exception { executeTarget( "instrument-3" ); // Ensure that only one data file type for each class was created... assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A" ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A$X" ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.B" ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.B$X" ); } public void testInstrument3a() throws Exception { executeTarget( "instrument-3a" ); // Ensure that only one data file type for each class was created... assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A" ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A$X" ); assertModuleData( "Did not remove the module data correctly:", "LineCount", "a.B", 0 ); } public void testInstrument4() throws Exception { executeTarget( "instrument-4" ); // Ensure that only one data file type for each class was created... //why is this failing? /* assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A", 2 ); */ assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A$X" ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.B", 2 ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.B$X" ); } public void testInstrument5() throws Exception { executeTarget( "instrument-5" ); // Ensure that only one data file type for each class was created... assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A" ); assertModuleData( "Did not keep the module data correctly:", "LineCount", "a.B" ); assertModuleData( "Did not create the module data correctly:", "LineCount", "a.A$X" ); } private static final Properties EXPECTED_6 = new Properties(); static { EXPECTED_6.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory" ); EXPECTED_6.setProperty( "channel-count", "0" ); EXPECTED_6.setProperty( "logger.1", "A" ); } public void testInstrument6() throws Exception { executeTarget( "instrument-6" ); EXPECTED_6.setProperty( "logger.dir", (new File( getCoverageDir(), "logs" + File.separator + "logs" )).getAbsolutePath() ); EXPECTED_6.setProperty( "logger.2", getCoverageDir().getAbsolutePath() ); assertEquals( "Did not create the grobocoverage.properties file correctly", EXPECTED_6, loadGroboProperties() ); } public void testInstrument7() throws Exception { // this does all of its own tests executeTarget( "instrument-7" ); } private static final Properties EXPECTED_8 = new Properties(); static { EXPECTED_8.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.MinDirChannelLoggerFactory" ); EXPECTED_8.setProperty( "channel-count", "0" ); } public void testInstrument8() throws Exception { executeTarget( "instrument-8" ); EXPECTED_8.setProperty( "logger.dir", (new File( getCoverageDir(), "logs" + File.separator + "logs" )).getAbsolutePath() ); assertEquals( "Did not create the grobocoverage.properties file correctly", EXPECTED_8, loadGroboProperties() ); } private static final Properties EXPECTED_9 = new Properties(); static { EXPECTED_9.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.X" ); EXPECTED_9.setProperty( "channel-count", "0" ); } public void testInstrument9() throws Exception { executeTarget( "instrument-9" ); EXPECTED_9.setProperty( "logger.dir", (new File( getCoverageDir(), "logs" + File.separator + "logs" )).getAbsolutePath() ); assertEquals( "Did not create the grobocoverage.properties file correctly", EXPECTED_9, loadGroboProperties() ); } private static final Properties EXPECTED_10 = new Properties(); static { EXPECTED_10.setProperty( "factory", "a.X" ); EXPECTED_10.setProperty( "channel-count", "0" ); } public void testInstrument10() throws Exception { executeTarget( "instrument-9" ); EXPECTED_10.setProperty( "logger.dir", (new File( getCoverageDir(), "logs" + File.separator + "logs" )).getAbsolutePath() ); assertEquals( "Did not create the grobocoverage.properties file correctly", EXPECTED_10, loadGroboProperties() ); } //........................... // Tests that fail public void testFInstrument1() throws Exception { expectBuildExceptionContaining( "f-instrument-1", "did not fail on no logdir specified", "Attribute 'logdir' was never set."); } public void testFInstrument2() throws Exception { expectBuildExceptionContaining( "f-instrument-2", "did not fail on no destdir specified", "Attribute 'destdir' was never set."); } public void testFInstrument3() throws Exception { expectBuildExceptionContaining( "f-instrument-3", "did not fail on no loggerprop value specified", "No value or location given for loggerprop key \"3\"."); } public void testFInstrument4() throws Exception { expectBuildExceptionContaining( "f-instrument-4", "did not fail on no loggerprop key specified", "No key given for loggerprop."); } public void testFInstrument5() throws Exception { expectBuildExceptionContaining( "f-instrument-5", "did not fail on no loggerprop key specified", "No key given for loggerprop."); } public void testFInstrument6() throws Exception { expectBuildExceptionContaining( "f-instrument-6", "did not fail on no loggerprop key specified", "No key given for loggerprop."); } //------------------------------------------------------------------------- // Helpers protected void assertEquals( String text, Properties expected, Properties actual ) { PropertyCheckUtil.assertEquals( text, expected, actual ); } protected Properties loadGroboProperties() throws IOException { return loadProperties( (new File( getCoverageDir(), "classes" + File.separator + "grobocoverage.properties")). getAbsolutePath() ); } protected Properties loadProperties( String file ) throws IOException { return PropertyCheckUtil.loadProperties( file ); } protected File getCoverageDir() { return new File( getProjectDir(), "instrument" + File.separator + "coverage" ); } protected void assertModuleData( String text, String moduleName, String className ) { StringBuffer errors = new StringBuffer( text ); errors.append( "(for class " ).append( className ). append( " in module " ).append( moduleName ). append( ")" ); boolean hasErrors = false; String prefix = className + "-"; File parent = new File( getCoverageDir(), "logs" + File.separator + "data" + File.separator + moduleName ); String contents[] = parent.list(); boolean classdata = false; boolean classmarks = false; for (int i = 0; i < contents.length; ++i) { if (contents[i].startsWith( prefix )) { if (contents[i].endsWith( ".classdata.txt" )) { System.out.println("Found class data file "+contents[i]); if (classdata) { errors.append( "; too many classdata files" ); hasErrors = true; } else { classdata = true; } } if (contents[i].endsWith( ".classmarks.txt" )) { System.out.println("Found class marks file "+contents[i]); if (classmarks) { errors.append( "; too many classmark files" ); hasErrors = true; } else { classmarks = true; } } } } if (!classdata) { errors.append( "; did not create classdata file" ); hasErrors = true; } if (!classmarks) { errors.append( "; did not create classmarks file" ); hasErrors = true; } assertFalse( errors.toString(), hasErrors ); } /** * Yes, it's duplication of code, but the first one will be used * more often, and gives a clearer error message set. */ protected void assertModuleData( String text, String moduleName, String className, int count ) { String baseErrorText = text + "(for class " + className + " in module " + moduleName + ") "; String prefix = className + "-"; File parent = new File( getCoverageDir(), "logs" + File.separator + "data" + File.separator + moduleName ); String contents[] = parent.list(); int classdata = 0; int classmarks = 0; for (int i = 0; i < contents.length; ++i) { if (contents[i].startsWith( prefix )) { if (contents[i].endsWith( ".classdata.txt" )) { ++classdata; } if (contents[i].endsWith( ".classmarks.txt" )) { ++classmarks; } } } assertEquals( baseErrorText + "incorrect number of classdata files.", count, classdata ); assertEquals( baseErrorText + "incorrect number of classmarks files.", count, classmarks ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up configureProject( "instrument.xml" ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down executeTarget( "test-teardown" ); super.tearDown(); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/rezip.xmllibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/rez0000644000175000017500000003747310120245525034211 0ustar drazzibdrazzib Didn't archive "1" Didn't archive "123/1" Didn't archive "1" Didn't archive "123/1" Didn't archive "2.1" Didn't archive "2.2" Didn't archive "2-zips/1.zip" Didn't archive "1.zip!1" Didn't archive "1.zip!abc/1" Didn't archive "1.zip!abc/2.1" Didn't archive "1.zip!abc/2.2" 3.1 3.2 Didn't keep "2.zip" Didn't archive "123/1" Didn't archive library "3.1" Didn't archive class "3.2" Didn't archive "1" Didn't archive "2.1" Didn't archive "2.2" Didn't archive "2-zips/1.zip" Didn't archive "1.zip!1" Didn't keep "1" Didn't replace "1" (contents are [${!contents-1}]) Didn't keep "2" Didn't replace "2" (contents are [${!contents-2}]) Incorectly added dir "y" Didn't keep "1" Didn't keep "2" Didn't replace "2" (contents are [${!contents-2}]) Didn't keep "3" Replaced "3" (contents are [${!contents-3}]) Didn't keep "4" Replaced "4" (contents are [${!contents-4}]) Didn't keep "5" Didn't replace "5" (contents are [${!contents-5}]) Didn't keep "1" Didn't replace "6" (contents are [${!contents-6}]) Didn't keep "7" Replaced "7" (contents are [${!contents-7}]) Didn't keep "8" Replaced "8" (contents are [${!contents-8}]) Incorrectly added "9" Incorrectly added "10" Incorrectly added "11" asdflaksjdlkjsdaf 1 2 3 4 4 3 2 1 ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/postcompiler.xmllibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/pos0000644000175000017500000000156110037142322034175 0ustar drazzibdrazzib ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/failon.xmllibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/fai0000644000175000017500000002427710072742300034145 0ustar drazzibdrazzib Did not set the 'failon-failed' property. Did not set the 'failon-failed' property. package x; public class main { public static void main( String args[] ) { System.out.println("x.main start"); package a; import java.util.*; public class A { static final Hashtable H = new Hashtable(); static void x() { H.put("a", "B"); } public void y() { H.get("a"); } } System.out.println("x.main | a.A start"); a.A tA = new a.A(); // a.A.x(); tA.y(); System.out.println("x.main | a.A end"); package a; import java.util.*; public class B { static String s = null; public static void x( String t ) { s = t + "x"; } public void y() { if (s != null) { s = s + s; } } } System.out.println("x.main | a.B start"); a.B tB = new a.B(); tB.y(); a.B.x( "asdf" ); System.out.println("x.main | a.B end"); System.out.println("x.main end"); } } Source of ${x.main}: ${x.main.src} Did not create directory ${coverage.logs}/data Running java... Did not create directory ${coverage.logs}/logs Did not create directory ${coverage.logs}/logs/0 ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/AntTestA.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Ant0000644000175000017500000001043210037421053034114 0ustar drazzibdrazzib/* * @(#)AntTestA.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.Vector; import org.apache.tools.ant.BuildFileTestA; /** * Framework extention to the Ant build file test class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since February 25, 2004 */ public abstract class AntTestA extends BuildFileTestA { private Vector tempFiles = new Vector(); public AntTestA( String name ) { super( name ); } protected void addTempFile( File f ) { if (f != null) { this.tempFiles.addElement( f ); } } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down Enumeration e = this.tempFiles.elements(); while (e.hasMoreElements()) { File f = (File)e.nextElement(); if (f.exists()) { f.delete(); } } super.tearDown(); } /** * Overload the parent. We'll use the resource stream to load the * XML file. */ protected void configureProject(String filename, int logLevel) { try { InputStream is = this.getClass().getResourceAsStream( filename ); try { File dir = new File( Long.toString( System.currentTimeMillis() ) ); dir.mkdirs(); File tmp = new File( dir, filename ); FileOutputStream fos = new FileOutputStream( tmp ); try { byte[] buff = new byte[ 4096 ]; int size = is.read( buff ); while (size > 0) { fos.write( buff, 0, size ); size = is.read( buff ); } } finally { fos.close(); } super.configureProject( tmp.getAbsolutePath(), logLevel ); } catch (IOException ioe) { ioe.printStackTrace(); fail( ioe.getMessage() ); } finally { try { is.close(); } catch (IOException ioe) { ioe.printStackTrace(); fail( ioe.getMessage() ); } } } catch (RuntimeException ex) { ex.printStackTrace(); throw ex; } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/AnalysisModuleTypeUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Ana0000644000175000017500000001430710037421053034076 0ustar drazzibdrazzib/* * @(#)AnalysisModuleTypeUTest.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModuleUTestI; import net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure; import net.sourceforge.groboutils.junit.v1.SubTestTestCase; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import org.apache.tools.ant.BuildException; /** * Tests the AnalysisModuleType class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class AnalysisModuleTypeUTest extends SubTestTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AnalysisModuleTypeUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AnalysisModuleTypeUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testSetName1() { AnalysisModuleType atm = createAnalysisModuleType(); atm.setName( null ); } public void testCreateModule1() { AnalysisModuleType atm = createAnalysisModuleType(); try { atm.getAnalysisModule(); fail( "Did not throw BuildException." ); } catch (BuildException be) { // check exception? } } public void testCreateModule2() { AnalysisModuleType atm = createAnalysisModuleType(); atm.setName( null ); try { atm.getAnalysisModule(); fail( "Did not throw BuildException." ); } catch (BuildException be) { // check exception? } } public void testCreateModule3() { AnalysisModuleType atm = createAnalysisModuleType(); atm.setName( "" ); try { atm.getAnalysisModule(); fail( "Did not throw BuildException." ); } catch (BuildException be) { // check exception? } } public void testCreateModule4() { AnalysisModuleType atm = createAnalysisModuleType(); atm.setName( "line" ); IAnalysisModule am = atm.getAnalysisModule(); assertNotNull( "returned null module.", am ); assertTrue( "Not a LineCountMeasure module.", am instanceof LineCountMeasure ); addAnalysisModuleTest( am, "CreateModule4" ); } public void testCreateModule5() { AnalysisModuleType atm = createAnalysisModuleType(); atm.setName( "linecount" ); IAnalysisModule am = atm.getAnalysisModule(); assertNotNull( "returned null module.", am ); assertTrue( "Not a LineCountMeasure module.", am instanceof LineCountMeasure ); addAnalysisModuleTest( am, "CreateModule5" ); } //------------------------------------------------------------------------- // Helpers protected AnalysisModuleType createAnalysisModuleType() { return new AnalysisModuleType(); } protected void addAnalysisModuleTest( final IAnalysisModule am, String testName ) { InterfaceTestSuite its = IAnalysisModuleUTestI.suite(); its.addFactory( new CxFactory( testName ) { public Object createImplObject() throws Exception { return am; } } ); addSubTest( its ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/GroboReportTaskUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Gro0000644000175000017500000001211010037421053034114 0ustar drazzibdrazzib/* * @(#)GroboReportTaskUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import java.util.Properties; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the GroboReportTask class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since March 13, 2004 */ public class GroboReportTaskUTest extends AntTestA { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = GroboReportTaskUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public GroboReportTaskUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests //........................... // Tests that pass public void testReport1() { executeTarget( "report-1" ); } public void testReport2() { executeTarget( "report-2" ); } public void testReport3() { try { executeTarget( "report-3" ); } finally { System.out.println( getFullLog() ); } } public void testReport4() { executeTarget( "report-4" ); } //........................... // Tests that fail public void testFReport1() { expectBuildExceptionContaining( "f-report-1", "Did not fail for no destdir attribute.", "Must set the 'destdir' attribute." ); } //------------------------------------------------------------------------- // Helpers protected void assertEquals( String text, Properties expected, Properties actual ) { PropertyCheckUtil.assertEquals( text, expected, actual ); } protected Properties loadGroboProperties() throws IOException { return loadProperties( (new File( getCoverageDir(), "classes" + File.separator + "grobocoverage.properties")). getAbsolutePath() ); } protected Properties loadProperties( String file ) throws IOException { return PropertyCheckUtil.loadProperties( file ); } protected File getCoverageDir() { return new File( getProjectDir(), "instrument" + File.separator + "coverage" ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up configureProject( "report.xml" ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down executeTarget( "test-teardown" ); super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/GroboReZipTaskUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Gro0000644000175000017500000001001310073140227034115 0ustar drazzibdrazzib/* * @(#)GroboReZipTaskUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the GroboReZipTask class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 23:23:04 $ * @since March 23, 2004 */ public class GroboReZipTaskUTest extends AntTestA { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = GroboReZipTaskUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public GroboReZipTaskUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests //........................... // Tests that pass public void testRezip1() { executeTarget( "rezip-1" ); } public void testRezip2() { executeTarget( "rezip-2" ); } public void testRezip3() { executeTarget( "rezip-3" ); } public void testRezip4() { executeTarget( "rezip-4" ); } public void testRezip5() { executeTarget( "rezip-5" ); } //........................... // Tests that fail //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up configureProject( "rezip.xml" ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down System.out.println( getFullLog() ); executeTarget( "test-teardown" ); super.tearDown(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/FailOnReportStyleUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Fai0000644000175000017500000004454310072742300034103 0ustar drazzibdrazzib/* * @(#)FailOnReportStyleUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import java.util.Properties; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.apache.tools.ant.BuildException; /** * Tests the FailOnReportStyle class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:12 $ * @since March 19, 2004 */ public class FailOnReportStyleUTest extends AntTestA { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = FailOnReportStyleUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public FailOnReportStyleUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests //........................... // Non-ant tests public void testClassFilterConstructor1() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( null ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterConstructor2() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( ".a" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterConstructor3() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterConstructor4() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a..b" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterConstructor5() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a//b" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterConstructor6() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a." ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterConstructor7() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.b*c" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter: a wildcard may "+ "only be present before and after a text part." ) >= 0 ); } } public void testClassFilterConstructor8() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.b**.c" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter: "+ "only 1 wildcard may be present between delimiters." ) >= 0 ); } } public void testClassFilterConstructor9() { try { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a/" ); fail( "Did not throw a BuildException." ); } catch (BuildException be) { assertTrue( "Does not contain correct exception text.", be.getMessage().indexOf( "Invalid class filter '" ) >= 0 ); } } public void testClassFilterMatch1() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.B" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.B$C" ) ); } public void testClassFilterMatch2() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.B" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.B.c" ) ); } public void testClassFilterMatch3() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.B" ); assertTrue( "Should have matched the filter.", cf.match( "a.B" ) ); } public void testClassFilterMatch4() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*" ); assertTrue( "Should have matched the filter.", cf.match( "a.B" ) ); } public void testClassFilterMatch5() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*" ); assertTrue( "Should have matched the filter.", cf.match( "a.B$C" ) ); } public void testClassFilterMatch6() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.B.C" ) ); } public void testClassFilterMatch7() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.b.c.C" ) ); } public void testClassFilterMatch8() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.b.C$" ) ); } public void testClassFilterMatch9() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.b.C" ) ); } public void testClassFilterMatch10() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.b*.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.b.C" ) ); } public void testClassFilterMatch11() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.b*.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.bc.C" ) ); } public void testClassFilterMatch12() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.b*.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.ab.C" ) ); } public void testClassFilterMatch13() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.b*.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.ba.D" ) ); } public void testClassFilterMatch14() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*bc.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.bca.C" ) ); } public void testClassFilterMatch15() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*bc.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.b.C" ) ); } public void testClassFilterMatch16() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*bc.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.bc.D" ) ); } public void testClassFilterMatch17() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*bc.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.bc.CD" ) ); } public void testClassFilterMatch18() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*bc.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.bc.C" ) ); } public void testClassFilterMatch19() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.*bc.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.adbbc.C" ) ); } public void testClassFilterMatch20() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.adbbc.C" ) ); } /** * Special case!!!! */ public void testClassFilterMatch21() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.C" ) ); } public void testClassFilterMatch22() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**.C" ); assertTrue( "Did not matched the filter.", cf.match( "a.B.a.a.a.a.a.a.a.a.a.a.C" ) ); } public void testClassFilterMatch23() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**.C" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a.B.a.C.a.a.a.a.a.a.a.a.C" ) ); } public void testClassFilterMatch24() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**" ); assertTrue( "Did not matched the filter.", cf.match( "a.B.a.a.a.a.a.a.a.a.a.a.C" ) ); } public void testClassFilterMatch25() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**" ); assertFalse( "Incorrectly matched the filter.", cf.match( "b.C" ) ); } public void testClassFilterMatch26() { FailOnReportStyle.ClassFilter cf = new FailOnReportStyle.ClassFilter( "a.**" ); assertFalse( "Incorrectly matched the filter.", cf.match( "a" ) ); } //........................... // Tests that pass public void testFailon1() { try { executeTarget( "failon-1" ); } finally { System.out.println( "--------------------------------" ); System.out.println( "failon-1:" ); System.out.println( getFullLog() ); } } public void testFailon2() { executeTarget( "failon-2" ); } public void testFailon3() { executeTarget( "failon-3" ); } public void testFailon4() { executeTarget( "failon-4" ); } public void testFailon5() { try { executeTarget( "failon-5" ); } finally { System.out.println( "--------------------------------" ); System.out.println( "failon-5:" ); System.out.println( getFullLog() ); } } //........................... // Tests that fail public void testFFailon1() { expectBuildException( "f-failon-1", "Did not fail for below coverage numbers." ); } public void testFFailon2() { expectBuildExceptionContaining( "f-failon-2", "Did not fail for invalid filter.", "Invalid class filter '" ); } public void testFFailon3() { expectBuildExceptionContaining( "f-failon-3", "Did not fail for invalid filter.", "Invalid class filter '" ); } public void testFFailon4() { expectBuildExceptionContaining( "f-failon-4", "Did not fail for invalid filter.", "Invalid class filter '" ); } public void testFFailon5() { expectBuildExceptionContaining( "f-failon-5", "Did not fail for invalid filter.", "Invalid class filter '" ); } public void testFFailon6() { expectBuildExceptionContaining( "f-failon-6", "Did not fail for invalid filter.", "Invalid class filter '" ); } public void testFFailon7() { expectBuildExceptionContaining( "f-failon-7", "Did not fail for nothing specified.", "One of 'module' or 'class' attributes must be specified in an include element." ); } public void testFFailon8() { expectBuildException( "f-failon-8", "Did not fail for below coverage numbers." ); } //------------------------------------------------------------------------- // Helpers protected void assertEquals( String text, Properties expected, Properties actual ) { PropertyCheckUtil.assertEquals( text, expected, actual ); } protected Properties loadGroboProperties() throws IOException { return loadProperties( (new File( getCoverageDir(), "classes" + File.separator + "grobocoverage.properties")). getAbsolutePath() ); } protected Properties loadProperties( String file ) throws IOException { return PropertyCheckUtil.loadProperties( file ); } protected File getCoverageDir() { return new File( getProjectDir(), "instrument" + File.separator + "coverage" ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up configureProject( "failon.xml" ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down executeTarget( "test-teardown" ); super.tearDown(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/CoveragePostCompilerTaskUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ant/Cov0000644000175000017500000001276710037421053034136 0ustar drazzibdrazzib/* * @(#)CoveragePostCompilerTaskUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.ant; import java.io.File; import java.io.IOException; import java.util.Properties; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the CoveragePostCompilerTask class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since February 25, 2004 */ public class CoveragePostCompilerTaskUTest extends AntTestA { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CoveragePostCompilerTaskUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public CoveragePostCompilerTaskUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests private static final Properties EXPECTED_1 = new Properties(); static { EXPECTED_1.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory" ); EXPECTED_1.setProperty( "channel-count", "16" ); } public void testConfiguration1() throws IOException { CoveragePostCompilerTask.Configuration c = new CoveragePostCompilerTask.Configuration(); addTempFile( new File( "./grobocoverage.properties" ) ); c.generatePropertyFile( new File("."), 16 ); Properties actual = loadGroboProperties(); assertEquals( "default values weren't set right", EXPECTED_1, actual ); } private static final Properties EXPECTED_2 = new Properties(); static { EXPECTED_2.setProperty( "factory", "net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory" ); EXPECTED_2.setProperty( "channel-count", "17" ); EXPECTED_2.setProperty( "logger.cache-size", "333" ); } public void testConfiguration2() throws IOException { DOC.getIT().testsIssue( 903797 ); CoveragePostCompilerTask.Configuration c = new CoveragePostCompilerTask.Configuration(); c.setCacheSize( 333 ); addTempFile( new File( "./grobocoverage.properties" ) ); c.generatePropertyFile( new File("."), 17 ); Properties actual = loadGroboProperties(); assertEquals( "cache-size set values weren't set right", EXPECTED_2, actual ); } //------------------------------------------------------------------------- // Helpers protected void assertEquals( String text, Properties expected, Properties actual ) { PropertyCheckUtil.assertEquals( text, expected, actual ); } protected Properties loadGroboProperties() throws IOException { return PropertyCheckUtil.loadGroboProperties(); } protected Properties loadProperties( String file ) throws IOException { return PropertyCheckUtil.loadProperties( file ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up configureProject( "postcompiler.xml" ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChannelLogRecordUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IChanne0000644000175000017500000000754210037421053034125 0ustar drazzibdrazzib/* * @(#)IChannelLogRecordUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.codecoverage.v2; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IChannelLogRecord interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IChannelLogRecordUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IChannelLogRecordUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IChannelLogRecordUTestI( String name, ImplFactory f ) { super( name, IChannelLogRecord.class, f ); } public IChannelLogRecord createIChannelLogRecord() { return (IChannelLogRecord)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetClassSignature1() { IChannelLogRecord clr = createIChannelLogRecord(); String s = clr.getClassSignature(); assertNotNull( "Null class signature.", s ); assertTrue( "Empty class signature.", s.length() > 0 ); } public void testGetMethodIndex1() { IChannelLogRecord clr = createIChannelLogRecord(); short s = clr.getMethodIndex(); assertTrue( "Method index is invalid.", s >= 0 ); } public void testGetMarkIndex1() { IChannelLogRecord clr = createIChannelLogRecord(); short s = clr.getMarkIndex(); // nothing really to assert with this. } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000755000175000017500000000000011271425773034263 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataReaderUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000000705510037421054034257 0ustar drazzibdrazzib/* * @(#)IMetaDataReaderUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IMetaDataReader interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since December 28, 2002 */ public class IMetaDataReaderUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IMetaDataReaderUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IMetaDataReaderUTestI( String name, ImplFactory f ) { super( name, IMetaDataReader.class, f ); } public IMetaDataReader createIMetaDataReader() { return (IMetaDataReader)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testNeedMore() { IMetaDataReader mdr = createIMetaDataReader(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecordUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000004753010037421054034261 0ustar drazzibdrazzib/* * @(#)ClassRecordUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Tests the ClassRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class ClassRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ClassRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ClassRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ClassRecord( null, 0L, null, null, null ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor2() { try { new ClassRecord( "A", 0L, null, null, null ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor3() { try { new ClassRecord( null, 0L, null, new String[0], null ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor4() { try { new ClassRecord( null, 0L, null, null, createAnalysisModuleSet( 4 ) ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor5() { try { new ClassRecord( "A", 0L, null, null, createAnalysisModuleSet( 4 ) ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor6() { try { new ClassRecord( null, 0L, "a", new String[0], createAnalysisModuleSet( 4 ) ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor7() { try { new ClassRecord( "A", 0L, "a", new String[1], createAnalysisModuleSet( 4 ) ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor8() { new ClassRecord( "A", 0L, "a", new String[0], createAnalysisModuleSet( 4 ) ); } public void testConstructor9() { new ClassRecord( "A", 0L, "a", new String[] { "m()V" }, createAnalysisModuleSet( 4 ) ); } public void testConstructor10() { try { new ClassRecord( "A", 0L, "a", new String[ Short.MAX_VALUE + 1 ], createAnalysisModuleSet( 4 ) ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ex) { assertTrue( "Did not raise exception for the correct reason.", ex.getMessage().toLowerCase(). indexOf( "too many methods" ) >= 0 ); } } public void testGetClassName1() { ClassRecord cr = new ClassRecord( "A", 0L, "a", new String[] { "m()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not return correct class name.", "A", cr.getClassName() ); } public void testGetClassCRC1() { ClassRecord cr = new ClassRecord( "A", 100L, "a", new String[] { "m()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not return correct class crc.", 100L, cr.getClassCRC() ); } public void testGetClassSignature1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not return correct class name.", "A--10", cr.getClassSignature() ); } public void testGetAnalysisModuleSet1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m()V" }, createAnalysisModuleSet( 4 ) ); AnalysisModuleSet ams = cr.getAnalysisModuleSet(); assertEquals( "Did not return the correct number of modules.", 4, ams.getAnalysisModuleCount() ); } public void testGetMethods1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[0], createAnalysisModuleSet( 4 ) ); String m[] = cr.getMethods(); assertEquals( "Did not return correct method set.", 0, m.length ); } public void testGetMethods2() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); String m[] = cr.getMethods(); assertEquals( "Did not return correct method set length.", 3, m.length ); assertEquals( "Did not return correct method [0], or resorted the list.", "m1()V", m[0] ); assertEquals( "Did not return correct method [1], or resorted the list.", "m2()V", m[1] ); assertEquals( "Did not return correct method [2], or resorted the list.", "m3()V", m[2] ); } public void testGetMethodIndex1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); try { cr.getMethodIndex( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetMethodIndex2() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not identify unknown method as not found.", (short)-1, cr.getMethodIndex( "m0()V" ) ); } public void testGetMethodIndex3() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not keep the original order, or couldn't find the index [0].", (short)0, cr.getMethodIndex( "m1()V" ) ); assertEquals( "Did not keep the original order, or couldn't find the index [1].", (short)1, cr.getMethodIndex( "m2()V" ) ); assertEquals( "Did not keep the original order, or couldn't find the index [2].", (short)2, cr.getMethodIndex( "m3()V" ) ); } public void testGetMethodCount1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not return correct count.", 3, cr.getMethodCount() ); } public void testGetMethodCount2() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[0], createAnalysisModuleSet( 4 ) ); assertEquals( "Did not return correct count.", 0, cr.getMethodCount() ); } public void testGetMethodAt1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[0], createAnalysisModuleSet( 4 ) ); try { cr.getMethodAt( (short)0 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetMethodAt2a() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); try { cr.getMethodAt( (short)3 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetMethodAt2b() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); try { cr.getMethodAt( (short)-1 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetMethodAt2c() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); try { cr.getMethodAt( (short)4 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetMethodAt3() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); assertEquals( "Did not return correct method name [0].", "m1()V", cr.getMethodAt( (short)0 ) ); assertEquals( "Did not return correct method name [1].", "m2()V", cr.getMethodAt( (short)1 ) ); assertEquals( "Did not return correct method name [2].", "m3()V", cr.getMethodAt( (short)2 ) ); } public void testAddMark1() { ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, createAnalysisModuleSet( 4 ) ); try { cr.addMark( null ); } catch (IllegalArgumentException ex) { // test exception } } public void testMarks1a() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); String moduleN = ams.getAnalysisModuleAt( (short)0 ).getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN, "m0()V", 1 ) ); MarkRecord mr[] = cr.getMarksForAnalysisModule( moduleN ); assertEquals( "Mark record length is wrong.", 1, mr.length ); try { mr[0].getMethodIndex(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ex) { // test exception } } public void testMarks1b() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); IAnalysisModule am = ams.getAnalysisModuleAt( (short)0 ); String moduleN = am.getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN, "m0()V", 1 ) ); MarkRecord mr[] = cr.getMarksForAnalysisModule( am ); assertEquals( "Mark record length is wrong.", 1, mr.length ); try { mr[0].getMethodIndex(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ex) { // test exception } } public void testMarks2a() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); String moduleN1 = ams.getAnalysisModuleAt( (short)0 ).getMeasureName(); String moduleN2 = ams.getAnalysisModuleAt( (short)1 ).getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN1, "m1()V", 1 ) ); cr.addMark( createMarkRecord( 0, moduleN2, "m1()V", 2 ) ); MarkRecord mr[] = cr.getMarksForAnalysisModule( moduleN1 ); assertEquals( "Mark record length is wrong.", 1, mr.length ); assertEquals( "Wrong method index.", (short)0, mr[0].getMethodIndex() ); assertEquals( "Wrong mark index.", (short)1, mr[0].getMarkIndex() ); mr = cr.getMarksForAnalysisModule( moduleN2 ); assertEquals( "Mark record length is wrong.", 1, mr.length ); assertEquals( "Wrong method index.", (short)0, mr[0].getMethodIndex() ); assertEquals( "Wrong mark index.", (short)2, mr[0].getMarkIndex() ); } public void testMarks2b() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); IAnalysisModule am1 = ams.getAnalysisModuleAt( (short)0 ); IAnalysisModule am2 = ams.getAnalysisModuleAt( (short)1 ); String moduleN1 = am1.getMeasureName(); String moduleN2 = am2.getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN1, "m1()V", 1 ) ); cr.addMark( createMarkRecord( 0, moduleN2, "m1()V", 2 ) ); MarkRecord mr[] = cr.getMarksForAnalysisModule( am1 ); assertEquals( "Mark record length is wrong.", 1, mr.length ); assertEquals( "Wrong method index.", (short)0, mr[0].getMethodIndex() ); assertEquals( "Wrong mark index.", (short)1, mr[0].getMarkIndex() ); mr = cr.getMarksForAnalysisModule( am2 ); assertEquals( "Mark record length is wrong.", 1, mr.length ); assertEquals( "Wrong method index.", (short)0, mr[0].getMethodIndex() ); assertEquals( "Wrong mark index.", (short)2, mr[0].getMarkIndex() ); } public void testMarks3a() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); String moduleN = ams.getAnalysisModuleAt( (short)0 ).getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN, "m1()V", 1 ) ); cr.addMark( createMarkRecord( 1, moduleN, "m1()V", 1 ) ); MarkRecord mr[] = cr.getMarksForAnalysisModule( moduleN ); assertEquals( "Mark record length is wrong.", 1, mr.length ); } public void testMarks3b() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); IAnalysisModule am = ams.getAnalysisModuleAt( (short)0 ); String moduleN = am.getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN, "m1()V", 1 ) ); cr.addMark( createMarkRecord( 1, moduleN, "m1()V", 1 ) ); MarkRecord mr[] = cr.getMarksForAnalysisModule( am ); assertEquals( "Mark record length is wrong.", 1, mr.length ); } public void testMarks4() { AnalysisModuleSet ams = createAnalysisModuleSet( 4 ); ClassRecord cr = new ClassRecord( "A", -10L, "a", new String[] { "m1()V", "m2()V", "m3()V" }, ams ); IAnalysisModule am = ams.getAnalysisModuleAt( (short)0 ); String moduleN = am.getMeasureName(); cr.addMark( createMarkRecord( 0, moduleN, "m1()V", 1 ) ); MarkRecord mr1[] = cr.getMarksForAnalysisModule( moduleN ); MarkRecord mr2[] = cr.getMarksForAnalysisModule( am ); assertSame( "Marks are wrong.", mr1[0], mr2[0] ); } //------------------------------------------------------------------------- // Helpers protected IAnalysisMetaData createAnalysisMetaData( int weight ) { return CCCreatorUtil.createIAnalysisMetaData( "a", "b", (byte)weight ); } protected AnalysisModuleSet createAnalysisModuleSet( int count ) { return CCCreatorUtil.createAnalysisModuleSet( count ); } protected MarkRecord createMarkRecord( int metaDataWeight, String am, String methSig, int markId ) { return new MarkRecord( createAnalysisMetaData( metaDataWeight ), am, methSig, (short)markId, 1 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataWriterUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001431110037421054034250 0ustar drazzibdrazzib/* * @(#)IClassMetaDataWriterUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IClassMetaDataWriter interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since December 28, 2002 */ public class IClassMetaDataWriterUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IClassMetaDataWriterUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IClassMetaDataWriterUTestI( String name, ImplFactory f ) { super( name, IClassMetaDataWriter.class, f ); } public IClassMetaDataWriter createIClassMetaDataWriter() { return (IClassMetaDataWriter)createImplObject(); } // This is the set that's used for creating the class records, if you // need it. Note that the DirMetaDataIO class needs to have its set // of AMS match the incoming class records. public final static AnalysisModuleSet AMS = CCCreatorUtil.createAnalysisModuleSet( 2 ); //------------------------------------------------------------------------- // Tests public void testWriteClassRecord1() throws Exception { IClassMetaDataWriter cmdw = createIClassMetaDataWriter(); try { cmdw.writeClassRecord( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testWriteClassRecord2() throws Exception { IClassMetaDataWriter cmdw = createIClassMetaDataWriter(); ModifiedClass mc = CCCreatorUtil.createModifiedClass( THIS_CLASS ); ClassRecord cr = mc.createClassRecord( AMS ); cmdw.writeClassRecord( cr ); // any way to check this? } public void testClose1() throws Exception { IClassMetaDataWriter cmdw = createIClassMetaDataWriter(); cmdw.close(); } public void testClose2() throws Exception { IClassMetaDataWriter cmdw = createIClassMetaDataWriter(); ModifiedClass mc = CCCreatorUtil.createModifiedClass( THIS_CLASS ); ClassRecord cr = mc.createClassRecord( AMS ); cmdw.close(); try { cmdw.writeClassRecord( cr ); fail( "Did not throw IOException." ); } catch (IOException ex) { // test exception } } public void testClose3() throws Exception { IClassMetaDataWriter cmdw = createIClassMetaDataWriter(); cmdw.close(); try { cmdw.writeClassRecord( null ); fail( "Did not throw IllegalArgumentException or IOException." ); } // either of these two exceptions could be thrown catch (IllegalArgumentException ex) { // test exception } catch (IOException ex) { // test exception } } public void testClose4() throws Exception { IClassMetaDataWriter cmdw = createIClassMetaDataWriter(); cmdw.close(); try { cmdw.close(); fail( "Did not throw IOException." ); } catch (IOException ex) { // test exception } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataIOUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001265610037421054034262 0ustar drazzibdrazzib/* * @(#)DirMetaDataIOUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.File; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Tests the DirMetaDataIO class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DirMetaDataIOUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirMetaDataIOUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirMetaDataIOUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { // fail( "Needs more tests." ); } public void testGetAnalysisModuleSet1() throws IOException { // ensure that working off a non-empy file doesn't kill us File f = CCCreatorUtil.createNewDirectory(); DirMetaDataIO dmd = new DirMetaDataIO( f ); AnalysisModuleSet ams = dmd.getAnalysisModuleSet(); assertEquals( "Somehow we created data from nothing.", 0, ams.getAnalysisModuleCount() ); } public void testPutAnalysisModuleSet1() throws IOException { // ensure that working off a brand-new file doesn't kill us. File f = CCCreatorUtil.createNewDirectory(); AnalysisModuleSet ams = CCCreatorUtil.createAnalysisModuleSet( 4 ); DirMetaDataIO dmd = new DirMetaDataIO( f ); dmd.getAnalysisModuleSet(); dmd.putAnalysisModuleSet( ams ); AnalysisModuleSet ams2 = dmd.getAnalysisModuleSet(); assertEquals( "Didn't recreate the four modules.", 4, ams2.getAnalysisModuleCount() ); } public void testPutAnalysisModuleSet2() throws IOException { // ensure that working off a brand-new file doesn't kill us. File f = CCCreatorUtil.createNewDirectory(); IAnalysisModule am = CCCreatorUtil.createIAnalysisModule( "a", "u", "text/plain" ); DirMetaDataIO dmd = new DirMetaDataIO( f ); dmd.getAnalysisModuleSet(); dmd.putAnalysisModuleSet( new AnalysisModuleSet( new IAnalysisModule[] { am } ) ); AnalysisModuleSet ams = dmd.getAnalysisModuleSet(); assertEquals( "Didn't recreate the one module.", 1, ams.getAnalysisModuleCount() ); assertTrue( "Bad module index.", ams.getAnalysisModuleIndex( am ) >= 0 ); assertTrue( "Bad measure index.", ams.getMeasureIndex( "a" ) >= 0 ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataWriterUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000000730410037421054034254 0ustar drazzibdrazzib/* * @(#)DirMetaDataWriterUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.File; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirMetaDataWriter class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DirMetaDataWriterUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirMetaDataWriterUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirMetaDataWriterUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testNeedMore() { } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IMetaDataWriterUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new DirMetaDataWriter( new File( "." ) ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataWriterUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000000677310037421054034265 0ustar drazzibdrazzib/* * @(#)IMetaDataWriterUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IMetaDataWriter interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since December 28, 2002 */ public class IMetaDataWriterUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IMetaDataWriterUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IMetaDataWriterUTestI( String name, ImplFactory f ) { super( name, IMetaDataWriter.class, f ); } public IMetaDataWriter createIMetaDataWriter() { return (IMetaDataWriter)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testNeedMore() { } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleIOUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001721510037421054034256 0ustar drazzibdrazzib/* * @(#)AnalysisModuleIOUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Tests the AnalysisModuleIO class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 7, 2003 */ public class AnalysisModuleIOUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AnalysisModuleIOUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AnalysisModuleIOUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testWriteAnalysisModule1() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringWriter sw = new StringWriter(); IAnalysisModule am = createIAnalysisModule( "n", "u", "m" ); amio.writeAnalysisModule( am, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote module ["+res+"]" ); assertEquals( "Incorrect result format.", "1:n,1:u,1:m", res ); } public void testWriteAnalysisModule2() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringWriter sw = new StringWriter(); IAnalysisModule am = createIAnalysisModule( "", "", "" ); amio.writeAnalysisModule( am, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote module ["+res+"]" ); assertEquals( "Incorrect result format.", "0:,0:,0:", res ); } public void testWriteAnalysisModule3() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringWriter sw = new StringWriter(); IAnalysisModule am = createIAnalysisModule( "aaaa", "bbbb", "1234" ); amio.writeAnalysisModule( am, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote module ["+res+"]" ); assertEquals( "Incorrect result format.", "4:aaaa,4:bbbb,4:1234", res ); } public void testReadAnalysisModule1() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringReader sr = new StringReader( "1:n,1:u,1:m" ); IAnalysisModule am = amio.readAnalysisModule( sr ); assertNotNull( "Returned null data.", am ); assertEquals( "name incorrect.", "n", am.getMeasureName() ); assertEquals( "unit incorrect.", "u", am.getMeasureUnit() ); assertEquals( "instruction weight incorrect.", "m", am.getMimeEncoding() ); } public void testReadAnalysisMetaData2() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringReader sr = new StringReader( "0: ,0:,0:asdf," ); IAnalysisModule am = amio.readAnalysisModule( sr ); assertNotNull( "Returned null data.", am ); assertEquals( "name incorrect.", "", am.getMeasureName() ); assertEquals( "unit incorrect.", "", am.getMeasureUnit() ); assertEquals( "instruction weight incorrect.", "", am.getMimeEncoding() ); } public void testReadAnalysisMetaData3() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringReader sr = new StringReader( "" ); try { amio.readAnalysisModule( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // verify ioe } } public void testReadAnalysisMetaData4() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringReader sr = new StringReader( "1" ); try { amio.readAnalysisModule( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // verify ioe } } public void testReadAnalysisMetaData5() throws Exception { AnalysisModuleIO amio = new AnalysisModuleIO(); StringReader sr = new StringReader( "a:a,1:1,1:1" ); try { amio.readAnalysisModule( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // verify ioe } } //------------------------------------------------------------------------- // Helpers protected IAnalysisModule createIAnalysisModule( String name, String unit, String mime ) { return CCCreatorUtil.createIAnalysisModule( name, unit, mime ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/ReadUtilUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001761210037421054034257 0ustar drazzibdrazzib/* * @(#)ReadUtilUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the ReadUtil class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class ReadUtilUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ReadUtilUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ReadUtilUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testReadTo1() { Reader r = new StringReader( "" ); try { ReadUtil.readTo( r, 'c' ); } catch (IOException ex) { assertTrue( "Did not reference 'c'.", ex.getMessage().indexOf( "'c'" ) >= 0 ); } } public void testReadTo2() throws Exception { Reader r = new StringReader( "c" ); String s = ReadUtil.readTo( r, 'c' ); assertEquals( "Didn't read correct string.", "", s ); } public void testReadTo3() throws Exception { Reader r = new StringReader( "ccc" ); String s = ReadUtil.readTo( r, 'c' ); assertEquals( "Didn't read correct string.", "", s ); } public void testReadTo4() throws Exception { Reader r = new StringReader( "abc" ); String s = ReadUtil.readTo( r, 'c' ); assertEquals( "Didn't read correct string.", "ab", s ); } public void testReadCount1() { Reader r = new StringReader( "" ); try { ReadUtil.readCount( r, 1 ); } catch (IOException ex) { assertTrue( "Didn't reference count.", ex.getMessage().indexOf( " 1 " ) >= 0 ); } } public void testReadCount2() throws Exception { Reader r = new StringReader( "a" ); try { ReadUtil.readCount( r, 4 ); } catch (IOException ex) { assertTrue( "Didn't reference count.", ex.getMessage().indexOf( " 3 " ) >= 0 ); } } public void testReadCount3() throws Exception { Reader r = new StringReader( "" ); String s = ReadUtil.readCount( r, 0 ); assertEquals( "Did not return expected string.", "", s ); } public void testReadCount4() throws Exception { Reader r = new StringReader( "a" ); String s = ReadUtil.readCount( r, 1 ); assertEquals( "Did not return expected string.", "a", s ); } public void testReadCount5() throws Exception { Reader r = new StringReader( "abc" ); String s = ReadUtil.readCount( r, 1 ); assertEquals( "Did not return expected string.", "a", s ); } public void testReadCount6() throws Exception { Reader r = new StringReader( "abc" ); String s = ReadUtil.readCount( r, 3 ); assertEquals( "Did not return expected string.", "abc", s ); } public void testToInt1() throws Exception { assertEquals( "Didn't convert right.", -1, ReadUtil.toInt( "-1" ) ); } public void testToInt2() throws Exception { assertEquals( "Didn't convert right.", 0, ReadUtil.toInt( "0" ) ); } public void testToInt3() { try { ReadUtil.toInt( "" ); } catch (IOException ex) { // test exception } } public void testToInt4() { try { ReadUtil.toInt( null ); } catch (IOException ex) { // test exception } } public void testToInt5() { try { ReadUtil.toInt( "ab" ); } catch (IOException ex) { // test exception } } public void testToLong1() throws Exception { assertEquals( "Didn't convert right.", -1L, ReadUtil.toLong( "-1" ) ); } public void testToLong2() throws Exception { assertEquals( "Didn't convert right.", 0L, ReadUtil.toLong( "0" ) ); } public void testToLong3() { try { ReadUtil.toLong( "" ); } catch (IOException ex) { // test exception } } public void testToLong4() { try { ReadUtil.toLong( null ); } catch (IOException ex) { // test exception } } public void testToLong5() { try { ReadUtil.toLong( "ab" ); } catch (IOException ex) { // test exception } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSetUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000002752010037421054034256 0ustar drazzibdrazzib/* * @(#)AnalysisModuleSetUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Tests the AnalysisModuleSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class AnalysisModuleSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AnalysisModuleSetUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AnalysisModuleSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new AnalysisModuleSet( (IAnalysisModule[])null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor2() { try { new AnalysisModuleSet( (AnalysisModuleSet)null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor3() { try { new AnalysisModuleSet( new IAnalysisModule[1] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor4() { try { new AnalysisModuleSet( new IAnalysisModule[] { createIAnalysisModule( "0" ), null } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // check exception } } public void testConstructor5() { new AnalysisModuleSet( new AnalysisModuleSet() ); } public void testAddAnalysisModule1() { AnalysisModuleSet ams = new AnalysisModuleSet(); IAnalysisModule a1 = createIAnalysisModule( "a" ); IAnalysisModule a2 = createIAnalysisModule( "a" ); assertEquals( a1.getMeasureName(), a2.getMeasureName() ); ams.addAnalysisModule( a1 ); try { ams.addAnalysisModule( a2 ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ex) { // test exception } } public void testAddAnalysisModule2() { AnalysisModuleSet ams = new AnalysisModuleSet(); try { ams.addAnalysisModule( null ); fail( "Did not throw IllegalStateException." ); } catch (IllegalArgumentException iae) { // check exception } } public void testJoinAnalysisModuleSet1() { AnalysisModuleSet ams = new AnalysisModuleSet(); try { ams.joinAnalysisModuleSet( null ); fail( "Did not throw IllegalStateException." ); } catch (IllegalArgumentException iae) { // check exception } } public void testJoinAnalysisModuleSet2() { IAnalysisModule a1 = createIAnalysisModule( "a" ); AnalysisModuleSet ams = new AnalysisModuleSet( new IAnalysisModule[] { a1 } ); ams.joinAnalysisModuleSet( ams ); } public void testJoinAnalysisModuleSet3() { IAnalysisModule a1 = createIAnalysisModule( "a" ); IAnalysisModule a2 = createIAnalysisModule( "b" ); AnalysisModuleSet ams = new AnalysisModuleSet( new IAnalysisModule[] { a1 } ); ams.joinAnalysisModuleSet( new AnalysisModuleSet( new IAnalysisModule[] { a2 } ) ); assertEquals( "Did not store correct number of modules.", 2, ams.getAnalysisModuleCount() ); } /* this test takes a VERY long time, and as such is not suitable for unit tests. If you want to increase unit test coverage, though, include this test to get 1 more branch and 1 more line. Not only that, but this is a rarely encountered situation, and encountering this situation may be a sign of a bug elsewhere. public void testAddAnalysisModule2() { // test the limits of the short index vs. int internal structure // counting system. AnalysisModuleSet ams = new AnalysisModuleSet(); IAnalysisModule amL[] = CCCreatorUtil.createAnalysisModules( (int)Short.MAX_VALUE ); ams.addAnalysisModules( amL ); IAnalysisModule a1 = createIAnalysisModule( "a" ); try { ams.addAnalysisModule( a1 ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ex) { // test exception } } */ public void testGetAnalysisModules1() { AnalysisModuleSet ams = new AnalysisModuleSet(); IAnalysisModule[] amL = ams.getAnalysisModules(); assertNotNull( "Returned null module list.", amL ); assertEquals( "Returned invalid module array length.", 0, amL.length ); } public void testGetAnalysisModules2() { IAnalysisModule orig = createIAnalysisModule( "a" ); AnalysisModuleSet ams = new AnalysisModuleSet( new IAnalysisModule[] { orig } ); IAnalysisModule[] amL = ams.getAnalysisModules(); assertNotNull( "Returned null module list.", amL ); assertEquals( "Returned invalid module array length.", 1, amL.length ); assertSame( "Returned invalid module.", orig, amL[0] ); } public void testGetMeasureIndex1() { AnalysisModuleSet ams = new AnalysisModuleSet(); short i = ams.getMeasureIndex( "b" ); assertEquals( "Returned invalid index.", -1, i ); } public void testGetMeasureIndex2() { IAnalysisModule orig = createIAnalysisModule( "b" ); AnalysisModuleSet ams = new AnalysisModuleSet( new IAnalysisModule[] { orig } ); short i = ams.getMeasureIndex( "b" ); assertEquals( "Returned invalid index.", 0, i ); } public void testGetMeasureIndex3() { AnalysisModuleSet ams = new AnalysisModuleSet(); try { ams.getMeasureIndex( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetAnalysisModuleIndex1() { AnalysisModuleSet ams = new AnalysisModuleSet(); try { ams.getAnalysisModuleIndex( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetAnalysisModuleIndex2() { IAnalysisModule orig = createIAnalysisModule( "b" ); AnalysisModuleSet ams = new AnalysisModuleSet(); short i = ams.getAnalysisModuleIndex( orig ); assertEquals( "Did not return correct index.", -1, i ); } public void testGetAnalysisModuleIndex3() { IAnalysisModule orig = createIAnalysisModule( "b" ); IAnalysisModule a = createIAnalysisModule( "a" ); AnalysisModuleSet ams = new AnalysisModuleSet( new IAnalysisModule[] { a } ); short i = ams.getAnalysisModuleIndex( orig ); assertEquals( "Did not return correct index.", -1, i ); } public void testGetAnalysisModuleIndex4() { IAnalysisModule orig1 = createIAnalysisModule( "b" ); AnalysisModuleSet ams = new AnalysisModuleSet( new IAnalysisModule[] { orig1 } ); short i = ams.getAnalysisModuleIndex( orig1 ); assertEquals( "Did not return correct index.", 0, i ); } public void testGetAnalysisModuleCount1() { AnalysisModuleSet ams = new AnalysisModuleSet(); assertEquals( "Did not return correct count.", 0, ams.getAnalysisModuleCount() ); } public void testGetAnalysisModuleCount2() { AnalysisModuleSet ams = new AnalysisModuleSet( CCCreatorUtil.createAnalysisModules( 15 ) ); assertEquals( "Did not return correct count.", 15, ams.getAnalysisModuleCount() ); } //------------------------------------------------------------------------- // Helpers protected IAnalysisModule createIAnalysisModule( String name ) { return CCCreatorUtil.createIAnalysisModule( name, "u", "m" ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecordIOUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000002117610037421054034257 0ustar drazzibdrazzib/* * @(#)ClassRecordIOUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.StringReader; import java.io.StringWriter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod; /** * Tests the ClassRecordIO class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class ClassRecordIOUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ClassRecordIOUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ClassRecordIOUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testWriteClass1() throws Exception { StringWriter sw = new StringWriter(); ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 0 ); ClassRecord cr = createClassRecord( THIS_CLASS, mm ); ClassRecordIO crio = new ClassRecordIO(); crio.writeClass( cr, sw ); String out = sw.toString(); assertTrue( "Did not write any data.", out.length() > 0 ); assertEquals( "Did not write the correct data.", THIS_CLASS.getName().length()+":"+THIS_CLASS.getName()+ ","+cr.getClassCRC()+","+cr.getSourceFileName().length()+ ":"+cr.getSourceFileName()+",1[("+mm.getMethodName().length()+":"+ mm.getMethodName()+")]", out ); } public void testWriteClass2() throws Exception { ClassRecord cr = new ClassRecord( "a.MyClass", 100, "MyClass.java", new String[ 0 ], createAnalysisModuleSet() ); StringWriter sw = new StringWriter(); ClassRecordIO crio = new ClassRecordIO(); crio.writeClass( cr, sw ); String out = sw.toString(); assertEquals( "Did not write the correct data.", "9:a.MyClass,100,12:MyClass.java,0[]", out ); } public void testReadClass1() throws Exception { StringReader sr = new StringReader( "9:a.MyClass,100,12:MyClass.java,2[(4:a()V)(6:b([S)V)]" ); ClassRecordIO crio = new ClassRecordIO(); ClassRecord cr = crio.readClass( createAnalysisModuleSet(), sr ); assertNotNull( "Returned null class record.", cr ); assertEquals( "Did not return correct class name.", "a.MyClass", cr.getClassName() ); assertEquals( "Did not return correct class check-sum.", 100L, cr.getClassCRC() ); assertEquals( "Did not return correct source file name.", "MyClass.java", cr.getSourceFileName() ); String methods[] = cr.getMethods(); assertEquals( "Did not find correct number of methods.", 2, methods.length ); assertEquals( "First method isn't correct signature.", "a()V", methods[0] ); assertEquals( "Second method isn't correct signature.", "b([S)V", methods[1] ); } public void testReadClass2() throws Exception { StringReader sr = new StringReader( "9:b.MyClass,100,13:MyClass2.java,0[]" ); ClassRecordIO crio = new ClassRecordIO(); ClassRecord cr = crio.readClass( createAnalysisModuleSet(), sr ); assertNotNull( "Returned null class record.", cr ); assertEquals( "Did not return correct class name.", "b.MyClass", cr.getClassName() ); assertEquals( "Did not return correct class check-sum.", 100L, cr.getClassCRC() ); assertEquals( "Did not return correct source file name.", "MyClass2.java", cr.getSourceFileName() ); assertEquals( "Created methods out of nothing.", 0, cr.getMethods().length ); } public void testReadWriteClass1() throws Exception { StringWriter sw = new StringWriter(); ModifiedMethod mm = createModifiedMethod( THIS_CLASS, 0 ); ClassRecord crIn = createClassRecord( THIS_CLASS, mm ); ClassRecordIO crio = new ClassRecordIO(); crio.writeClass( crIn, sw ); String out = sw.toString(); StringReader sr = new StringReader( out ); ClassRecord crOut = crio.readClass( createAnalysisModuleSet(), sr ); assertNotNull( "Returned null class record.", crOut ); assertEquals( "Did not return correct class name.", crIn.getClassName(), crOut.getClassName() ); assertEquals( "Did not return correct class check-sum.", crIn.getClassCRC(), crOut.getClassCRC() ); assertEquals( "Did not return correct method count.", crIn.getMethodCount(), crOut.getMethodCount() ); for (int i = 0; i < crIn.getMethodCount(); ++i) { assertEquals( "Did not return same method for index "+i+".", crIn.getMethodAt( (short)i ), crOut.getMethodAt( (short)i ) ); } } //------------------------------------------------------------------------- // Helpers protected ModifiedMethod createModifiedMethod( Class c, int index ) throws Exception { return CCCreatorUtil.createModifiedMethod( c, 0 ); } protected AnalysisModuleSet createAnalysisModuleSet() { return CCCreatorUtil.createAnalysisModuleSet( 3 ); } protected ClassRecord createClassRecord( Class c, ModifiedMethod mm ) throws Exception { return CCCreatorUtil.createClassRecord( c, mm, createAnalysisModuleSet() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/DirClassMetaDataWriterUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001244610037421054034257 0ustar drazzibdrazzib/* * @(#)DirClassMetaDataWriterUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirClassMetaDataWriter class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DirClassMetaDataWriterUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirClassMetaDataWriterUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirClassMetaDataWriterUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new DirClassMetaDataWriter( null, null ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor2() throws Exception { try { new DirClassMetaDataWriter( createIAnalysisModule( "a", "u", "text/plain" ), null ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor3() throws Exception { try { new DirClassMetaDataWriter( null, createDirMetaDataIO() ); } catch (IllegalArgumentException ex) { // test exception } } //------------------------------------------------------------------------- // Helpers protected static IAnalysisModule createIAnalysisModule( String name, String unit, String mime ) { return CCCreatorUtil.createIAnalysisModule( name, unit, mime ); } protected static DirMetaDataIO createDirMetaDataIO() throws IOException { DirMetaDataIO dmd = new DirMetaDataIO( CCCreatorUtil.createNewDirectory() ); return dmd; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IClassMetaDataWriterUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { DirMetaDataIO dmd = createDirMetaDataIO(); dmd.putAnalysisModuleSet( IClassMetaDataWriterUTestI.AMS ); return new DirClassMetaDataWriter( IClassMetaDataWriterUTestI.AMS.getAnalysisModuleAt( (short)0 ), dmd ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/DatastoreCreatorUtil.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000000367610037421054034264 0ustar drazzibdrazzib/* * @(#)DatastoreCreatorUtil.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Helper for creating code coverage test objects. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 23, 2003 */ public class DatastoreCreatorUtil { private static final Class THIS_CLASS = DatastoreCreatorUtil.class; public static IAnalysisModule createAnalysisModule( String n, String u, String m ) { IAnalysisModule am = new AnalysisModuleIO.StaleAnalysisModule( n, u, m ); return am; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecordUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000000700410037421054034251 0ustar drazzibdrazzib/* * @(#)MarkRecordUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the MarkRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class MarkRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MarkRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public MarkRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { MarkRecord mr = new MarkRecord( null, null, null, (short)0, 0 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ioe) { } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataReaderUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001136210037421054034253 0ustar drazzibdrazzib/* * @(#)DirMetaDataReaderUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.File; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirMetaDataReader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DirMetaDataReaderUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirMetaDataReaderUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirMetaDataReaderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new DirMetaDataReader( null ); fail( "Doesn't throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { } } public void testGetClassReader1() throws Exception { File f = CCCreatorUtil.createNewDirectory(); DirMetaDataReader dmdr = new DirMetaDataReader( f ); try { dmdr.getClassReader( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { } } public void testGetAnalysisModuleSet1() throws Exception { File f = CCCreatorUtil.createNewDirectory(); DirMetaDataReader dmdr = new DirMetaDataReader( f ); AnalysisModuleSet ams = dmdr.getAnalysisModuleSet(); assertEquals( "Created modules out of nothing.", 0, ams.getAnalysisModuleCount() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IMetaDataReaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new DirMetaDataReader( new File( "." ) ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataReaderUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001773510037421054034265 0ustar drazzibdrazzib/* * @(#)IClassMetaDataReaderUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IClassMetaDataReader interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since December 28, 2002 */ public class IClassMetaDataReaderUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IClassMetaDataReaderUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IClassMetaDataReaderUTestI( String name, ImplFactory f ) { super( name, IClassMetaDataReader.class, f ); } public IClassMetaDataReader createIClassMetaDataReader() { return (IClassMetaDataReader)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetClassSignatures1() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); String sigs1[] = cmdr.getClassSignatures(); assertNotNull( "Returned null sigs.", sigs1 ); String sigs2[] = cmdr.getClassSignatures(); assertNotNull( "Returned null sigs on second attempt.", sigs2 ); assertEquals( "Two consecutive calls returned different class signatures.", sigs1.length, sigs2.length ); } public void testGetClassSignatures2() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); cmdr.close(); try { cmdr.getClassSignatures(); fail( "Did not throw IOException." ); } catch (IOException ioe) { assertNotNull( "Null exception message.", ioe.getMessage() ); } } public void testGetClassSignatures3() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); String sigs1[] = cmdr.getClassSignatures(); cmdr.close(); try { cmdr.getClassSignatures(); fail( "Did not throw IOException." ); } catch (IOException ioe) { assertNotNull( "Null exception message.", ioe.getMessage() ); } } public void testGetClassSignatures4() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); String sigs[] = cmdr.getClassSignatures(); for (int i = 0; i < sigs.length; ++i) { assertNotNull( "Returned null signature at index "+i+".", sigs[i] ); } } public void testReadClass1() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); cmdr.close(); try { cmdr.readClass( "a" ); fail( "Did not throw IOException." ); } catch (IOException ioe) { assertNotNull( "Null exception message.", ioe.getMessage() ); } } public void testReadClass2() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); cmdr.close(); try { cmdr.readClass( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { assertNotNull( "Null exception message.", ex.getMessage() ); } } public void testReadClass3() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); String nonExistClassName = "a"; String sigs[] = cmdr.getClassSignatures(); boolean inSigs = true; while (inSigs) { nonExistClassName += "1"; inSigs = false; for (int i = 0; i < sigs.length; ++i) { if (sigs[i].equals( nonExistClassName )) { inSigs = true; break; } } } ClassRecord cr = cmdr.readClass( nonExistClassName ); assertNull( "Incorrectly returned a class for a non-existent class "+ "signature '"+nonExistClassName+"'.", cr ); } public void testReadAllClasses1() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); String sigs[] = cmdr.getClassSignatures(); assertNotNull( "Returned null sigs.", sigs ); for (int i = 0; i < sigs.length; ++i) { ClassRecord cr = cmdr.readClass( sigs[i] ); assertNotNull( "Read null class from returned class signature.", cr ); } } public void testClose1() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); cmdr.close(); } public void testClose2() throws Exception { IClassMetaDataReader cmdr = createIClassMetaDataReader(); cmdr.close(); try { cmdr.close(); fail( "Did not throw IOException." ); } catch (IOException ex) { assertNotNull( "Null exception message.", ex.getMessage() ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/DirClassMetaDataReaderUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000002252210037421054034253 0ustar drazzibdrazzib/* * @(#)DirClassMetaDataReaderUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.util.Vector; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirClassMetaDataReader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DirClassMetaDataReaderUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirClassMetaDataReaderUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirClassMetaDataReaderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new DirClassMetaDataReader( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor2() throws Exception { try { new DirClassMetaDataReader( createIAnalysisModule( "A", "B", "C" ), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor3() throws Exception { try { new DirClassMetaDataReader( null, createDirMetaDataIO( createIAnalysisModule( "A", "B", "C" ) ) ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetClassSignatures1() throws Exception { IAnalysisModule am = createIAnalysisModule( "A", "B", "C" ); DirMetaDataIO dmdio = createDirMetaDataIO( am ); String sig1 = addClassRecord( dmdio, THIS_CLASS, am ); DirClassMetaDataReader dcmdr = new DirClassMetaDataReader( am, dmdio ); String[] sigs = dcmdr.getClassSignatures(); assertNotNull( "Returned null signatures.", sigs ); assertEquals( "Returned incorrect number of signatures.", 1, sigs.length ); assertEquals( "Did not return the correct sig.", sig1, sigs[0] ); } public void testReadClass1() throws Exception { IAnalysisModule am = createIAnalysisModule( "A", "B", "C" ); DirMetaDataIO dmdio = createDirMetaDataIO( am ); String sig1 = addClassRecord( dmdio, THIS_CLASS, am ); DirClassMetaDataReader dcmdr = new DirClassMetaDataReader( am, dmdio ); ClassRecord cr = dcmdr.readClass( sig1 ); assertNotNull( "Returned null class record.", cr ); assertEquals( "Returned incorrect class record.", sig1, cr.getClassSignature() ); } public void testClose1() throws Exception { IAnalysisModule am = createIAnalysisModule( "A", "B", "C" ); DirMetaDataIO dmdio = createDirMetaDataIO( am ); DirClassMetaDataReader dcmdr = new DirClassMetaDataReader( am, dmdio ); dcmdr.close(); assertFalse( "Reader closed the underlying IO object.", dmdio.isClosed() ); } //------------------------------------------------------------------------- // Helpers protected static IAnalysisModule createIAnalysisModule( String name, String unit, String mime ) { return CCCreatorUtil.createIAnalysisModule( name, unit, mime ); } protected static DirMetaDataIO createDirMetaDataIO( IAnalysisModule am ) throws IOException { DirMetaDataIO dmd = new DirMetaDataIO( CCCreatorUtil.createNewDirectory() ); dmd.putAnalysisModuleSet( new AnalysisModuleSet( new IAnalysisModule[] { am } ) ); return dmd; } protected String addClassRecord( DirMetaDataIO dmd, Class c, IAnalysisModule am ) throws IOException { ModifiedClass mc = CCCreatorUtil.createModifiedClass( c ); ClassRecord cr = mc.createClassRecord( new AnalysisModuleSet( new IAnalysisModule[] { am } ) ); dmd.putClassRecord( am, cr ); return cr.getClassSignature(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IClassMetaDataReaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { Vector v = new Vector(); public Object createImplObject() throws IOException { IAnalysisModule am = createIAnalysisModule( "a", "u", "text/plain" ); DirMetaDataIO dmd = createDirMetaDataIO( am ); v.addElement( dmd ); return new DirClassMetaDataReader( am, dmd ); } } ); suite.addFactory( new CxFactory( "B" ) { Vector v = new Vector(); public Object createImplObject() throws IOException { IAnalysisModule am = createIAnalysisModule( "a", "u", "text/plain" ); DirMetaDataReader dmdr = CCCreatorUtil.createDirMetaDataReader( CCCreatorUtil.createNewDirectory(), new Class[0], new IAnalysisModule[] { am } ); DirClassMetaDataReader dcmdr = (DirClassMetaDataReader) dmdr.getClassReader( am ); // prevent the closing of the DMDR v.addElement( dmdr ); return dcmdr; } } ); suite.addFactory( new CxFactory( "C" ) { Vector v = new Vector(); public Object createImplObject() throws IOException { IAnalysisModule am = createIAnalysisModule( "a", "u", "text/plain" ); DirMetaDataReader dmdr = CCCreatorUtil.createDirMetaDataReader( CCCreatorUtil.createNewDirectory(), new Class[] { THIS_CLASS, String.class, Short.class }, new IAnalysisModule[] { am } ); DirClassMetaDataReader dcmdr = (DirClassMetaDataReader) dmdr.getClassReader( am ); // prevent the closing of the DMDR v.addElement( dmdr ); return dcmdr; } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSetIOUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000002176610037421054034264 0ustar drazzibdrazzib/* * @(#)AnalysisModuleSetIOUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; /** * Tests the AnalysisModuleSetIO class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 7, 2003 */ public class AnalysisModuleSetIOUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AnalysisModuleSetIOUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AnalysisModuleSetIOUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testWriteAnalysisModuleSet1() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringWriter sw = new StringWriter(); AnalysisModuleSet ams = new AnalysisModuleSet(); amsio.writeAnalysisModuleSet( ams, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote module set ["+res+"]" ); assertEquals( "Incorrect result format.", "0{}", res ); } public void testWriteAnalysisModuleSet2() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringWriter sw = new StringWriter(); AnalysisModuleSet ams = createAnalysisModuleSet( new IAnalysisModule[] { createIAnalysisModule( "n", "u", "m" ), } ); amsio.writeAnalysisModuleSet( ams, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote module set ["+res+"]" ); assertEquals( "Incorrect result format.", "1{[0;11;1:n,1:u,1:m]}", res ); } public void testWriteAnalysisModuleSet3() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringWriter sw = new StringWriter(); AnalysisModuleSet ams = createAnalysisModuleSet( new IAnalysisModule[] { createIAnalysisModule( "n", "u", "m" ), createIAnalysisModule( "", "", "" ), createIAnalysisModule( "aaaa", "bbbb", "1234" ), } ); amsio.writeAnalysisModuleSet( ams, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote module set ["+res+"]" ); assertEquals( "Incorrect result format.", "3{[0;11;1:n,1:u,1:m][1;8;0:,0:,0:][2;20;4:aaaa,4:bbbb,4:1234]}", res ); } public void testReadAnalysisModuleSet1() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringReader sr = new StringReader( "0{}" ); AnalysisModuleSet ams = amsio.readAnalysisModuleSet( sr ); IAnalysisModule[] amL = ams.getAnalysisModules(); assertNotNull( "Returned null data list.", amL ); assertEquals( "Did not return an empty data set.", 0, amL.length ); } public void testReadAnalysisModuleSet2() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringReader sr = new StringReader( "1{[0;11;1:n,1:u,1:m]}" ); AnalysisModuleSet ams = amsio.readAnalysisModuleSet( sr ); IAnalysisModule[] amL = ams.getAnalysisModules(); assertNotNull( "Returned null data list.", amL ); assertEquals( "Did not return an empty data set.", 1, amL.length ); IAnalysisModule am = amL[0]; assertNotNull( "Returned null module 0.", am ); assertEquals( "name incorrect.", "n", am.getMeasureName() ); assertEquals( "unit incorrect.", "u", am.getMeasureUnit() ); assertEquals( "encoding incorrect.", "m", am.getMimeEncoding() ); } public void testReadAnalysisModuleSet3() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringReader sr = new StringReader( "2{[0;11;1:n,1:u,1:m][1;8;0:,0:,0:]}" ); AnalysisModuleSet ams = amsio.readAnalysisModuleSet( sr ); IAnalysisModule[] amL = ams.getAnalysisModules(); assertNotNull( "Returned null data list.", amL ); assertEquals( "Did not return an empty data set.", 2, amL.length ); IAnalysisModule am = amL[0]; assertNotNull( "Returned null module 0.", am ); assertEquals( "0: name incorrect.", "n", am.getMeasureName() ); assertEquals( "0: unit incorrect.", "u", am.getMeasureUnit() ); assertEquals( "0: encoding incorrect.", "m", am.getMimeEncoding() ); am = amL[1]; assertNotNull( "Returned null module 1.", am ); assertEquals( "1: name incorrect.", "", am.getMeasureName() ); assertEquals( "1: unit incorrect.", "", am.getMeasureUnit() ); assertEquals( "1: encoding incorrect.", "", am.getMimeEncoding() ); } public void testReadAnalysisModuleSet4() throws Exception { AnalysisModuleSetIO amsio = new AnalysisModuleSetIO(); StringReader sr = new StringReader( "{}" ); try { amsio.readAnalysisModuleSet( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // test exception } } //------------------------------------------------------------------------- // Helpers protected AnalysisModuleSet createAnalysisModuleSet( IAnalysisModule amL[] ) { return CCCreatorUtil.createAnalysisModuleSet( amL ); } protected IAnalysisModule createIAnalysisModule( String name, String unit, String mime ) { return CCCreatorUtil.createIAnalysisModule( name, unit, mime ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisMetaDataIOUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/datasto0000644000175000017500000001660710037421054034262 0ustar drazzibdrazzib/* * @(#)AnalysisMetaDataIOUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.datastore; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; /** * Tests the AnalysisMetaDataIO class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since December 28, 2002 */ public class AnalysisMetaDataIOUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AnalysisMetaDataIOUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AnalysisMetaDataIOUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testWriteAnalysisMetaData1() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringWriter sw = new StringWriter(); IAnalysisMetaData amd = createIAnalysisMetaData( "c", "n", (byte)-1 ); amdio.writeAnalysisMetaData( amd, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote meta-data ["+res+"]" ); assertEquals( "Incorrect result format.", "1:c,1:n,-1,", res ); } public void testWriteAnalysisMetaData2() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringWriter sw = new StringWriter(); IAnalysisMetaData amd = createIAnalysisMetaData( "123", "12345", (byte)100 ); amdio.writeAnalysisMetaData( amd, sw ); String res = sw.toString(); DOC.getLog().info( "Wrote meta-data ["+res+"]" ); assertEquals( "Incorrect result format.", "3:123,5:12345,100,", res ); } public void testReadAnalysisMetaData1() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringReader sr = new StringReader( "1:c,1:n,-1," ); IAnalysisMetaData amd = amdio.readAnalysisMetaData( sr ); assertNotNull( "Returned null data.", amd ); assertEquals( "Covered formatted text incorrect.", "c", amd.getCoveredFormattedText() ); assertEquals( "Not covered formatted text incorrect.", "n", amd.getNotCoveredFormattedText() ); assertEquals( "instruction weight incorrect.", (byte)-1, amd.getInstructionWeight() ); } public void testReadAnalysisMetaData2() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringReader sr = new StringReader( "3:123,5:12345,100," ); IAnalysisMetaData amd = amdio.readAnalysisMetaData( sr ); assertNotNull( "Returned null data.", amd ); assertEquals( "Covered formatted text incorrect.", "123", amd.getCoveredFormattedText() ); assertEquals( "Not covered formatted text incorrect.", "12345", amd.getNotCoveredFormattedText() ); assertEquals( "instruction weight incorrect.", (byte)100, amd.getInstructionWeight() ); } public void testReadAnalysisMetaData3() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringReader sr = new StringReader( "" ); try { amdio.readAnalysisMetaData( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // verify ioe } } public void testReadAnalysisMetaData4() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringReader sr = new StringReader( "1" ); try { amdio.readAnalysisMetaData( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // verify ioe } } public void testReadAnalysisMetaData5() throws Exception { AnalysisMetaDataIO amdio = new AnalysisMetaDataIO(); StringReader sr = new StringReader( "a:a" ); try { amdio.readAnalysisMetaData( sr ); fail( "Did not throw IOException." ); } catch (IOException ioe) { // verify ioe } } //------------------------------------------------------------------------- // Helpers protected IAnalysisMetaData createIAnalysisMetaData( String c, String nc, byte w ) { return CCCreatorUtil.createIAnalysisMetaData( c, nc, w ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IMethodCodeUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IMethod0000644000175000017500000001734210037421053034150 0ustar drazzibdrazzib/* * @(#)IMethodCodeUTestI.java * * Copyright (C) 2002,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import org.apache.bcel.classfile.Method; /** * Tests the IMethodCode interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IMethodCodeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IMethodCodeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IMethodCodeUTestI( String name, ImplFactory f ) { super( name, IMethodCode.class, f ); } public IMethodCode createIMethodCode() { return (IMethodCode)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetOriginalMethod1() { IMethodCode mc = createIMethodCode(); Method m = mc.getOriginalMethod(); assertNotNull( "Must not return null original method.", m ); } public void testGetMethod1() { IMethodCode mc = createIMethodCode(); assertNotNull( "Method name is null.", mc.getMethodName() ); } public void testGetClassName1() { IMethodCode mc = createIMethodCode(); assertNotNull( "Class name is null.", mc.getClassName() ); } public void testGetInstructionCount1() { IMethodCode mc = createIMethodCode(); int count = mc.getInstructionCount(); assertTrue( "Count is not valid", count >= 0 ); } public void testMethodName1() { IMethodCode mc = createIMethodCode(); Method m = mc.getOriginalMethod(); String name = mc.getMethodName(); assertEquals( "Method name doesn't match returned method's name", m.getName()+m.getSignature(), name ); } public void testInstructionConsistency1() { IMethodCode mc = createIMethodCode(); int count = mc.getInstructionCount(); for (int i = 0; i < count; ++i) { assertNotNull( "Null instruction at position "+i+".", mc.getInstructionAt( i ) ); } } public void testInstructionConsistency2() { IMethodCode mc = createIMethodCode(); int count = mc.getInstructionCount(); try { mc.getInstructionAt( -1 ); fail( "Did not throw excption w/ -1 index." ); } catch (IndexOutOfBoundsException e) { // test exception } try { mc.getInstructionAt( count ); fail( "Did not throw exception w/ "+count+" index." ); } catch (IndexOutOfBoundsException e) { // test exception } } public void testMarkInstruction1() { IMethodCode mc = createIMethodCode(); int count = mc.getInstructionCount(); if (count <= 0) { DOC.getLog().warn( "No instructions to mark for '"+mc+"'." ); return; } // something to test // note: we can mark the last index + one over it! for (int i = 0; i <= count; ++i) { IAnalysisMetaData meta = new DefaultAnalysisMetaData( "", "", (byte)0 ); mc.markInstruction( i, meta ); } } public void testMarkInstruction2() { IMethodCode mc = createIMethodCode(); try { IAnalysisMetaData meta = new DefaultAnalysisMetaData( "", "", (byte)0 ); mc.markInstruction( -1, meta ); fail( "Did not throw IndexOutOfBoundsException." ); } catch (IndexOutOfBoundsException e) { // test exception } } public void testMarkInstruction4() { IMethodCode mc = createIMethodCode(); int count = mc.getInstructionCount(); try { IAnalysisMetaData meta = new DefaultAnalysisMetaData( "", "", (byte)0 ); mc.markInstruction( count+1, meta ); fail( "Did not throw IndexOutOfBoundsException." ); } catch (IndexOutOfBoundsException e) { // test exception } } public void testMarkInstruction5() { IMethodCode mc = createIMethodCode(); int count = mc.getInstructionCount(); // even if the instruction count is == 0, we can still mark it, // hence this will be a valid test for 'null' metadata. // something to test try { mc.markInstruction( 0, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/0000755000175000017500000000000011271425773034216 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/AnalysisModuleDataUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/0000644000175000017500000002154010037421055034206 0ustar drazzibdrazzib/* * @(#)AnalysisModuleDataUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.File; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogReader; /** * Tests the AnalysisModuleData class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:29 $ * @since January 22, 2003 */ public class AnalysisModuleDataUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AnalysisModuleDataUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AnalysisModuleDataUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new AnalysisModuleData( null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testConstructor2() throws Exception { try { new AnalysisModuleData( createIAnalysisModule( "a", "b", "c" ), null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testConstructor3() throws Exception { File f = CCCreatorUtil.createNewDirectory(); try { new AnalysisModuleData( createIAnalysisModule( "a", "b", "c" ), createDirMetaDataReader( f ), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testConstructor4() throws Exception { File f = CCCreatorUtil.createNewDirectory(); try { new AnalysisModuleData( null, createDirMetaDataReader( f ), createDirectoryChannelLogReader( f, createClassLogData(4) ) ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testConstructor5() throws Exception { File f = CCCreatorUtil.createNewDirectory(); try { new AnalysisModuleData( createIAnalysisModule( "a", "b", "c" ), null, createDirectoryChannelLogReader( f, createClassLogData(2) ) ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testGetClassSignatures1() throws Exception { File f = CCCreatorUtil.createNewDirectory(); AnalysisModuleData amd = new AnalysisModuleData( createIAnalysisModule( "a", "b", "c" ), createDirMetaDataReader( f ), createDirectoryChannelLogReader( f, createClassLogData( 1 ) ) ); String sigs[] = amd.getClassSignatures(); assertNotNull( "Got null sigs.", sigs ); DOC.getLog().warn( "this test is failing due to incorrect class generation logic." ); /* assertEquals( "Didn't get correct number of classes.", 1, sigs.length ); assertEquals( "Did not return correct class name.", "a.MyClass-112", sigs[0] ); */ } public void testGetClassSignatures2() throws Exception { File f = CCCreatorUtil.createNewDirectory(); AnalysisModuleData amd = new AnalysisModuleData( createIAnalysisModule( "a", "b", "c" ), createDirMetaDataReader( f ), createDirectoryChannelLogReader( f, createClassLogData( 2 ) ) ); String sigs[] = amd.getClassSignatures(); assertNotNull( "Got null sigs.", sigs ); DOC.getLog().warn( "this test is failing due to incorrect class generation logic." ); /* assertEquals( "Didn't get correct number of classes.", 2, sigs.length ); */ } public void testGetClassSignatures3() throws Exception { File f = CCCreatorUtil.createNewDirectory(); AnalysisModuleData amd = new AnalysisModuleData( createIAnalysisModule( "a", "b", "c" ), createDirMetaDataReader( f ), createDirectoryChannelLogReader( f, createClassLogData( 0 ) ) ); String sigs[] = amd.getClassSignatures(); assertNotNull( "Got null sigs.", sigs ); assertEquals( "Didn't get correct number of classes.", 0, sigs.length ); } //------------------------------------------------------------------------- // Helpers protected IAnalysisModule createIAnalysisModule( String name, String unit, String mime ) { return CCCreatorUtil.createIAnalysisModule( name, unit, mime ); } protected DirMetaDataReader createDirMetaDataReader( File basedir ) throws IOException { return CCCreatorUtil.createDirMetaDataReader( basedir, new Class[] { THIS_CLASS, String.class }, CCCreatorUtil.createAnalysisModules( 2 ) ); } protected DirectoryChannelLogReader createDirectoryChannelLogReader( File basedir, CCCreatorUtil.SimpleClassLogData[] data ) { return CCCreatorUtil.createDirectoryChannelLogReader( basedir, data, (short)100 ); } protected CCCreatorUtil.SimpleClassLogData[] createClassLogData( int count ) { CCCreatorUtil.SimpleClassLogData[] scld = new CCCreatorUtil.SimpleClassLogData[ count ]; for (int i = 0; i < count; ++i) { scld[i] = new CCCreatorUtil.SimpleClassLogData( (char)('a' + i)+".MyClass-112", new int[] { 1,2,1 }, new int[] { 11, 2, 13 } ); } return scld; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/IReportGeneratorUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/0000644000175000017500000001673010037421055034213 0ustar drazzibdrazzib/* * @(#)IReportGeneratorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.io.File; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogReader; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import org.w3c.dom.Element; /** * Tests the IReportGenerator interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:29 $ * @since December 28, 2002 */ public class IReportGeneratorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IReportGeneratorUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IReportGeneratorUTestI( String name, ImplFactory f ) { super( name, IReportGenerator.class, f ); } public IReportGenerator createIReportGenerator() { return (IReportGenerator)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testWriteReport1() throws Exception { IReportGenerator rg = createIReportGenerator(); try { rg.createReport( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testWriteReport2() throws Exception { IReportGenerator rg = createIReportGenerator(); try { rg.createReport( createIAnalysisModule( "a", "b", "c"), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testWriteReport3() throws Exception { IReportGenerator rg = createIReportGenerator(); try { rg.createReport( null, createAnalysisModuleData() ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testWriteReport4() throws Exception { IReportGenerator rg = createIReportGenerator(); rg.createReport( createIAnalysisModule( "a", "b", "c"), createAnalysisModuleData() ); } public void testWriteReport8() throws Exception { IReportGenerator rg = createIReportGenerator(); Element el = rg.createReport( createIAnalysisModule( "a", "b", "c" ), createAnalysisModuleData() ); DOC.getLog().info( "Retrieved report: ["+el+"]" ); assertNotNull( "Didn't create an element.", el ); } //public void writeReport( IAnalysisModule module, AnalysisModuleData data, // Writer out ) // throws IOException; //------------------------------------------------------------------------- // Helpers protected IAnalysisModule createIAnalysisModule( String name, String unit, String mime ) { return CCCreatorUtil.createIAnalysisModule( name, unit, mime ); } /** * This is actually an extended test of DirMetaDataReader: even if the * DirMetaDataReader instance goes out of scope and its generated * DirClassMetaDataReader instances are still in scope, the DirMetaDataIO * won't close on us. */ protected AnalysisModuleData createAnalysisModuleData() throws IOException { IAnalysisModule am = createIAnalysisModule( "a", "b", "text/plain" ); CCCreatorUtil.SimpleClassLogData[] scld = new CCCreatorUtil.SimpleClassLogData[] { new CCCreatorUtil.SimpleClassLogData( "a.MyClass-1138", new int[] { 1,2,1 }, new int[] { 11, 2, 13 } ), }; File basedir = CCCreatorUtil.createNewDirectory(); return CCCreatorUtil.createAnalysisModuleData( am, createDirMetaDataReader( basedir ), createDirectoryChannelLogReader( basedir, scld ) ); } protected DirMetaDataReader createDirMetaDataReader( File basedir ) throws IOException { return CCCreatorUtil.createDirMetaDataReader( basedir, new Class[] { THIS_CLASS, String.class }, CCCreatorUtil.createAnalysisModules( 2 ) ); } protected DirectoryChannelLogReader createDirectoryChannelLogReader( File basedir, CCCreatorUtil.SimpleClassLogData[] data ) { return CCCreatorUtil.createDirectoryChannelLogReader( basedir, data, (short)100 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/XmlReportGeneratorUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/0000644000175000017500000001641010037421055034206 0ustar drazzibdrazzib/* * @(#)XmlReportGeneratorUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the XmlReportGenerator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:29 $ * @since January 22, 2003 */ public class XmlReportGeneratorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = XmlReportGeneratorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public XmlReportGeneratorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new XmlReportGenerator(); } public void testTranslate1() { assertEquals( "Does not translate null.", null, XmlReportGenerator.translate( null ) ); } public void testTranslate2() { assertEquals( "Does not translate empty string.", "", XmlReportGenerator.translate( "" ) ); } public void testTranslate3() { assertEquals( "Does not translate no parms.", "x", XmlReportGenerator.translate( "x" ) ); } public void testTranslate4() { assertEquals( "Does not translate bad parms.", "x(", XmlReportGenerator.translate( "x(" ) ); } public void testTranslate5() { assertEquals( "Does not translate only parms.", "(boolean)", XmlReportGenerator.translate( "(Z)" ) ); } public void testTranslate6() { assertEquals( "Does not translate empty parms.", "x()", XmlReportGenerator.translate( "x()" ) ); } public void testTranslate7() { assertEquals( "Does not translate object.", "x(me.my.Oh)", XmlReportGenerator.translate( "x(Lme/my/Oh;)" ) ); } public void testTranslate8() { assertEquals( "Does not translate object.", "x(me.my.Oh, boolean)", XmlReportGenerator.translate( "x(Lme/my/Oh;Z)" ) ); } public void testTranslate9() { assertEquals( "Does not strip return.", "x()", XmlReportGenerator.translate( "x()V" ) ); } public void testTranslate10() { assertEquals( "Does not strip return.", "x(boolean)", XmlReportGenerator.translate( "x(Z)V" ) ); } public void testTranslate11() { assertEquals( "Does not keep as is.", "", XmlReportGenerator.translate( "" ) ); } public void testTranslate12() { assertEquals( "Does not keep ( as is.", "(", XmlReportGenerator.translate( "(" ) ); } public void testTranslate13() { assertEquals( "Does not translate () right.", "[constructor]()", XmlReportGenerator.translate( "()" ) ); } public void testTranslate14() { assertEquals( "Does not translate (ZZ) right.", "[constructor](boolean, boolean)", XmlReportGenerator.translate( "(ZZ)" ) ); } public void testTranslate15() { assertEquals( "Does not keep as is.", "", XmlReportGenerator.translate( "" ) ); } public void testTranslate16() { assertEquals( "Does not keep ( as is.", "(", XmlReportGenerator.translate( "(" ) ); } public void testTranslate17() { assertEquals( "Does not translate () right.", "[static initializer]", XmlReportGenerator.translate( "()" ) ); } public void testTranslate18() { assertEquals( "Does not translate (Z) right.", "[static initializer]", XmlReportGenerator.translate( "(Z)" ) ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IReportGeneratorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new XmlReportGenerator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSetUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/0000644000175000017500000005336710037421055034222 0ustar drazzibdrazzib/* * @(#)ClassMarkSetUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord; import net.sourceforge.groboutils.codecoverage.v2.logger.DefaultChannelLogRecord; /** * Tests the ClassMarkSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:29 $ * @since January 22, 2003 */ public class ClassMarkSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ClassMarkSetUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ClassMarkSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ClassMarkSet( null, null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor2() { try { new ClassMarkSet( "a", new String[] { "1", "2" }, new MarkRecord[] { createMarkRecord( 0, "1", "2", 3 ), }, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor3() { try { new ClassMarkSet( "a", new String[] { "1", "2" }, null, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 0 ), } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor4() { try { new ClassMarkSet( "a", new String[] { "1", "2" }, new MarkRecord[ 1 ], new IChannelLogRecord[ 1 ] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor5() { try { new ClassMarkSet( "a.Name", new String[] { "1", "2" }, processMarks( "a.Name", new MarkRecord[] { createMarkRecord( 0, "1", "2", 3 ), } ), new IChannelLogRecord[ 1 ] ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor5a() { try { new ClassMarkSet( "a", new String[] { "1", "2" }, new MarkRecord[] { createMarkRecord( 0, "1", "2", 3 ), }, new IChannelLogRecord[ 1 ] ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ex) { // test exception assertTrue( "Did not fail due to process.", ex.getMessage().indexOf( "process" ) >= 0 ); } } public void testConstructor6() { try { new ClassMarkSet( "a", new String[] { "1", "2" }, new MarkRecord[ 1 ], new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 0 ), } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } //ClassMarkSet( MarkRecord[] marks, IChannelLogRecord[] classLogs ) } public void testConstructor7() { try { new ClassMarkSet( "a.M", new String[] { "1", "2" }, processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "2", 10 ), } ), new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 0 ), } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { /* assertTrue( "Did not mention mark 0 ["+iae.getMessage()+"].", iae.getMessage().indexOf( "mark 0" ) >= 0 ); */ } } public void testConstructor8() { new ClassMarkSet( "a.M", new String[] { "2", "1" }, processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "2", 0 ), } ), new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 0 ), } ); } public void testConstructor9() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 3 ), createMarkRecord( 0, "1", "m2()V", 3 ), createMarkRecord( 0, "1", "m2()V", 1 ), } ); try { new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 1 ), } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { assertTrue( "Did not mention mark 1 ["+iae.getMessage()+"].", iae.getMessage().indexOf( "mark 1" ) >= 0 ); } } public void testConstructor10() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 3 ), createMarkRecord( 0, "1", "m2()V", 3 ), createMarkRecord( 0, "1", "m2()V", 1 ), } ); try { new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 1 ), createChannelLogRecord( "a.M", 0, 5 ), } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { assertTrue( "Did not mention mark 1 or 5 ["+iae.getMessage()+"].", iae.getMessage().indexOf( "mark 1" ) >= 0 || iae.getMessage().indexOf( "mark 5" ) >= 0 ); } } public void testConstructor11() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 1 ), createMarkRecord( 0, "1", "m1()V", 2 ), createMarkRecord( 0, "1", "m1()V", 3 ), createMarkRecord( 0, "1", "m2()V", 1 ), createMarkRecord( 0, "1", "m2()V", 2 ), createMarkRecord( 0, "1", "m2()V", 3 ), } ); try { new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 3 ), createChannelLogRecord( "a.M", 0, 4 ), createChannelLogRecord( "a.M", 1, 1 ), createChannelLogRecord( "a.M", 1, 2 ), } ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { assertTrue( "Did not mention mark 4 ["+iae.getMessage()+"].", iae.getMessage().indexOf( "mark 4" ) >= 0 ); } } public void testGetMethodSignatures1() { ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] {}, new MarkRecord[0], new IChannelLogRecord[ 0 ] ); String[] methods = cms.getMethodSignatures(); assertNotNull( "Returned null method signature list.", methods ); assertEquals( "Created methods out of nothing.", 0, methods.length ); } public void testGetMethodSignatures1a() { try { ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, new MarkRecord[0], new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 1 ), } ); } catch (IllegalArgumentException ex) { /* assertTrue( "Did not mention method 0 ["+ex.getMessage()+"].", ex.getMessage().indexOf( "method 0" ) >= 0 ); assertTrue( "Did not mention mark 1 ["+ex.getMessage()+"].", ex.getMessage().indexOf( "mark 1" ) >= 0 ); */ } } public void testGetMethodSignatures2() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m()V", 0 ), } ); ClassMarkSet cms = new ClassMarkSet("a.M", new String[] { "m()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 0 ), } ); String[] methods = cms.getMethodSignatures(); assertEquals( "Did not return the right number of methods.", 1, methods.length ); assertEquals( "Did not return the right method.", "m()V", methods[0] ); } public void testGetMethodSignatures3() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 0 ), createMarkRecord( 0, "1", "m1()V", 1 ), createMarkRecord( 0, "1", "m1()V", 2 ), createMarkRecord( 0, "1", "m2()V", 3 ), createMarkRecord( 0, "1", "m2()V", 2 ), createMarkRecord( 0, "1", "m2()V", 1 ), createMarkRecord( 0, "1", "m2()V", 0 ), } ); ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 1, 1 ), } ); String[] methods = cms.getMethodSignatures(); assertEquals( "Did not return the right number of methods.", 2, methods.length ); assertTrue( "Did not return the right methods.", ( methods[0].equals( "m1()V" ) && methods[1].equals( "m2()V" ) ) || ( methods[0].equals( "m2()V" ) && methods[1].equals( "m1()V" ) ) ); } public void testGetMethodSignatures4() { ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "1", "2" }, new MarkRecord[0], new IChannelLogRecord[ 0 ] ); String[] methods = cms.getMethodSignatures(); assertNotNull( "Returned null method signature list.", methods ); assertEquals( "Did not return right methods.", 2, methods.length ); } public void testGetCoveredMarksForMethod3() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 0 ), createMarkRecord( 0, "1", "m1()V", 1 ), createMarkRecord( 0, "1", "m1()V", 2 ), createMarkRecord( 0, "1", "m1()V", 3 ), createMarkRecord( 0, "1", "m2()V", 0 ), createMarkRecord( 0, "1", "m2()V", 1 ), createMarkRecord( 0, "1", "m2()V", 2 ), createMarkRecord( 0, "1", "m2()V", 3 ), } ); ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 3 ), } ); MarkRecord covered[] = cms.getCoveredMarksForMethod( "m1()V" ); assertEquals( "Returned incorrect coverage list.", 1, covered.length ); assertEquals( "Returned bad mark method.", "m1()V", covered[0].getMethodSignature() ); assertEquals( "Returned bad mark id.", (short)3, covered[0].getMarkIndex() ); } public void testGetCoveredMarksForMethod4() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 0 ), createMarkRecord( 0, "1", "m1()V", 1 ), createMarkRecord( 0, "1", "m1()V", 2 ), createMarkRecord( 0, "1", "m1()V", 3 ), createMarkRecord( 0, "1", "m2()V", 0 ), createMarkRecord( 0, "1", "m2()V", 1 ), createMarkRecord( 0, "1", "m2()V", 2 ), createMarkRecord( 0, "1", "m2()V", 3 ), } ); ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 3 ), //createChannelLogRecord( "a.M", 0, 4 ), createChannelLogRecord( "a.M", 1, 1 ), createChannelLogRecord( "a.M", 1, 2 ), } ); MarkRecord covered[] = cms.getCoveredMarksForMethod( "m2()V" ); assertEquals( "Returned incorrect coverage list.", 2, covered.length ); assertEquals( "Returned bad mark method [0].", "m2()V", covered[0].getMethodSignature() ); assertEquals( "Returned bad mark method [1].", "m2()V", covered[1].getMethodSignature() ); assertTrue( "Returned bad mark ids.", ( covered[0].getMarkIndex() == (short)1 && covered[1].getMarkIndex() == (short)2 ) || ( covered[0].getMarkIndex() == (short)2 && covered[1].getMarkIndex() == (short)1 ) ); } public void testGetNotCoveredMarksForMethod1() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 0 ), createMarkRecord( 0, "1", "m1()V", 1 ), createMarkRecord( 0, "1", "m1()V", 2 ), createMarkRecord( 0, "1", "m1()V", 3 ), createMarkRecord( 0, "1", "m2()V", 0 ), createMarkRecord( 0, "1", "m2()V", 1 ), createMarkRecord( 0, "1", "m2()V", 2 ), createMarkRecord( 0, "1", "m2()V", 3 ), } ); ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 3 ), //createChannelLogRecord( "a.M", 0, 4 ), createChannelLogRecord( "a.M", 1, 0 ), createChannelLogRecord( "a.M", 1, 1 ), createChannelLogRecord( "a.M", 1, 2 ), } ); MarkRecord nc[] = cms.getNotCoveredMarksForMethod( "m2()V" ); assertEquals( "Returned incorrect coverage list.", 1, nc.length ); assertEquals( "Returned bad mark method.", "m2()V", nc[0].getMethodSignature() ); assertEquals( "Returned bad mark id.", (short)3, nc[0].getMarkIndex() ); } public void testGetNotCoveredMarksForMethod2() { MarkRecord mr[] = processMarks( "a.M", new MarkRecord[] { createMarkRecord( 0, "1", "m1()V", 0 ), createMarkRecord( 0, "1", "m1()V", 1 ), createMarkRecord( 0, "1", "m1()V", 2 ), createMarkRecord( 0, "1", "m1()V", 3 ), } ); ClassMarkSet cms = new ClassMarkSet( "a.M", new String[] { "m1()V", "m2()V" }, mr, new IChannelLogRecord[] { createChannelLogRecord( "a.M", 0, 0 ), createChannelLogRecord( "a.M", 0, 1 ), createChannelLogRecord( "a.M", 0, 2 ), createChannelLogRecord( "a.M", 0, 3 ), //createChannelLogRecord( "a.M", 0, 4 ), } ); MarkRecord nc[] = cms.getNotCoveredMarksForMethod( "m1()V" ); assertNotNull( "Returned null not-covered list.", nc ); assertEquals( "Returned incorrect not-coverage list length.", 0, nc.length ); } //------------------------------------------------------------------------- // Helpers protected IAnalysisMetaData createAnalysisMetaData( int weight ) { return CCCreatorUtil.createIAnalysisMetaData( "a", "b", (byte)weight ); } protected MarkRecord createMarkRecord( int metaDataWeight, String am, String methSig, int markId ) { MarkRecord mr = new MarkRecord( createAnalysisMetaData( metaDataWeight ), am, methSig, (short)markId, 1 ); return mr; } protected MarkRecord[] processMarks( String className, MarkRecord mr[] ) { // don't use a real set so we can keep the original order List methodSet = new ArrayList(); List measureSet = new ArrayList(); for (int i = 0; i < mr.length; ++i) { if (!methodSet.contains( mr[i].getMethodSignature() )) { methodSet.add( mr[i].getMethodSignature() ); } if (!measureSet.contains( mr[i].getAnalysisModule() )) { measureSet.add( mr[i].getAnalysisModule() ); } } // create measures IAnalysisModule modules[] = new IAnalysisModule[ measureSet.size() ]; for (int i = 0; i < modules.length; ++i) { modules[i] = CCCreatorUtil.createIAnalysisModule( (String)measureSet.get( i ), "a", "b" ); } String methods[] = (String[])methodSet.toArray( new String[ methodSet.size() ] ); ClassRecord cr = new ClassRecord( className, 100L, "a", methods, CCCreatorUtil.createAnalysisModuleSet( modules ) ); for (int i = 0; i < mr.length; ++i) { cr.addMark( mr[i] ); } return mr; } protected IChannelLogRecord createChannelLogRecord( String classSig, int methodIndex, int markIndex ) { return new DefaultChannelLogRecord( classSig, (short)methodIndex, (short)markIndex ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/PackageSorterUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/report/0000644000175000017500000001540510037421055034211 0ustar drazzibdrazzib/* * @(#)PackageSorterUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.report; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the PackageSorter class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:29 $ * @since January 22, 2003 */ public class PackageSorterUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = PackageSorterUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public PackageSorterUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new PackageSorter(); } public void testAddClassSignatures1() { PackageSorter ps = new PackageSorter(); try { ps.addClassSignatures( null ); fail( "Didn't throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { } } public void testAddClassSignatures2() { PackageSorter ps = new PackageSorter(); try { ps.addClassSignatures( new String[2] ); fail( "Didn't throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { } } public void testAddClassSignature1() { PackageSorter ps = new PackageSorter(); try { ps.addClassSignature( null ); fail( "Didn't throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { } } public void testAddClassSignature2() { PackageSorter ps = new PackageSorter(); ps.addClassSignature( "a.b" ); } public void testAddClassSignature3() { PackageSorter ps = new PackageSorter(); ps.addClassSignature( "a" ); } public void testAddClassSignature4() { PackageSorter ps = new PackageSorter(); ps.addClassSignature( "" ); } public void testAddClassSignature5() { PackageSorter ps = new PackageSorter(); ps.addClassSignature( "." ); } public void testGetPackages1() { PackageSorter ps = new PackageSorter(); String s[] = ps.getPackages(); assertNotNull( "Got null package list.", s ); assertEquals( "Created packages out of nothing.", 0, s.length ); } public void testClassSignaturesForPackage1() { PackageSorter ps = new PackageSorter(); String s[] = ps.getClassSignaturesForPackage( null ); assertNotNull( "Got null package list.", s ); assertEquals( "Created packages out of nothing.", 0, s.length ); } public void testClassSignaturesForPackage2() { PackageSorter ps = new PackageSorter(); String s[] = ps.getClassSignaturesForPackage( "" ); assertNotNull( "Got null package list.", s ); assertEquals( "Created packages out of nothing.", 0, s.length ); } public void testGetPackageName1() { assertEquals( "a", PackageSorter.getPackageName( "a.b" ) ); } public void testGetPackageName2() { assertEquals( "", PackageSorter.getPackageName( ".b" ) ); } public void testGetPackageName3() { assertEquals( "", PackageSorter.getPackageName( "b" ) ); } public void testGetPackageName4() { assertEquals( "", PackageSorter.getPackageName( "." ) ); } public void testGetPackageName5() { assertEquals( "a.b.c.d", PackageSorter.getPackageName( "a.b.c.d.e" ) ); } public void testGetPackageName6() { assertEquals( "a.b.c.d.e", PackageSorter.getPackageName( "a.b.c.d.e." ) ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IClassChannelLogReaderUTestI.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/IClassC0000644000175000017500000000657210037421053034103 0ustar drazzibdrazzib/* * @(#)IClassChannelLogReaderUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.codecoverage.v2; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the IClassChannelLogReader interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 28, 2002 */ public class IClassChannelLogReaderUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IClassChannelLogReaderUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IClassChannelLogReaderUTestI( String name, ImplFactory f ) { super( name, IClassChannelLogReader.class, f ); } public IClassChannelLogReader createIClassChannelLogReader() { return (IClassChannelLogReader)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testNextRecord1() throws Exception { IClassChannelLogReader cclr = createIClassChannelLogReader(); IChannelLogRecord clr; do { clr = cclr.nextRecord(); } while (clr != null); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/CCCreatorUtil.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/CCCreat0000644000175000017500000003117510037421053034063 0ustar drazzibdrazzib/* * @(#)CCCreatorUtil.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.File; import java.io.IOException; import junit.framework.Assert; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.compiler.CompilerCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass; import net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod; import net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger; import net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet; import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; import net.sourceforge.groboutils.codecoverage.v2.datastore.DatastoreCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader; import net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogger; import net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData; import net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.MethodGen; /** * Helper for creating code coverage test objects. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since January 23, 2003 */ public class CCCreatorUtil { private static final Class THIS_CLASS = CCCreatorUtil.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public static AnalysisModuleSet createAnalysisModuleSet( int count ) { return createAnalysisModuleSet( createAnalysisModules( count ) ); } public static AnalysisModuleSet createAnalysisModuleSet( IAnalysisModule[] amL ) { Assert.assertNotNull( amL ); AnalysisModuleSet ams = new AnalysisModuleSet( amL ); return ams; } public static IAnalysisModule[] createAnalysisModules( int count ) { IAnalysisModule amL[] = new IAnalysisModule[ count ]; for (int i = 0; i < count; ++i) { amL[i] = createIAnalysisModule( 0 ); }; return amL; } private static int moduleIndex = 0; public static IAnalysisModule createIAnalysisModule( int type ) { IAnalysisModule am; switch (type) { case 0: am = createIAnalysisModule( "n"+(moduleIndex++), "u", "text/plain" ); break; case 1: am = createIAnalysisModule( "a", "b", "text/html" ); break; case 2: am = new LineCountMeasure(); break; case 3: am = new BytecodeCountMeasure(); break; case 4: am = new BranchCountMeasure(); break; default: am = null; } return am; } public static IAnalysisModule createIAnalysisModule( String n, String u, String m ) { IAnalysisModule am = DatastoreCreatorUtil.createAnalysisModule( n, u, m ); return am; } public static ClassRecord createClassRecord( Class c, ModifiedMethod mm, AnalysisModuleSet ams ) { Assert.assertNotNull( "Null method.", mm ); Assert.assertNotNull( "Null class.", c ); ClassRecord cr = new ClassRecord( c.getName(), 0, "Source.java", new String[] { mm.getMethodName() }, ams ); return cr; } public static ModifiedClass createModifiedClass( Class c ) throws IOException { Assert.assertNotNull( c ); String filename = BytecodeLoaderUtil.getClassFilename( c ); ModifiedClass mc = new ModifiedClass( filename, BytecodeLoaderUtil.loadBytecode( filename ) ); return mc; } public static ModifiedClass createModifiedClass( ParseCoverageLogger pcl, Class c ) throws IOException { Assert.assertNotNull( c ); String filename = BytecodeLoaderUtil.getClassFilename( c ); ModifiedClass mc = createModifiedClass( pcl, filename, BytecodeLoaderUtil.loadBytecode( filename ) ); return mc; } public static ModifiedClass createModifiedClass( ParseCoverageLogger pcl, String classFilename, byte[] bytecode ) throws IOException { Assert.assertNotNull( bytecode ); ModifiedClass mc = new ModifiedClass( pcl, classFilename, bytecode ); return mc; } public static ModifiedMethod getMainModifiedMethod( ModifiedClass mc ) { ModifiedMethod mm[] = mc.getMethods(); for (int i = 0; i < mm.length; ++i) { if ("main([Ljava/lang/String;)V".equals( mm[i].getMethodName() )) { return mm[i]; } } Assert.fail( "Class "+mc.getClassName()+ " does not have a main method." ); // needs a return throw new IllegalStateException("Unreachable statement."); } public static ModifiedMethod createModifiedMethod( JavaClass jc, int methodIndex, Method m, MethodGen mg ) { return CompilerCreatorUtil.createModifiedMethod( jc, methodIndex, m, mg ); } public static ModifiedMethod createModifiedMethod( Class c, int methodIndex ) throws IOException { JavaClass jc = BCELCreatorUtil.createJavaClass( c ); Method m = BCELCreatorUtil.getMethod( jc, methodIndex ); MethodGen mg = BCELCreatorUtil.createMethodGen( jc, methodIndex ); ModifiedMethod mm = createModifiedMethod( jc, methodIndex, m, mg ); return mm; } public static IMethodCode createIMethodCode( Class c, int methodIndex, AnalysisModuleSet ams, int measureIndex ) throws IOException { ModifiedMethod mm = createModifiedMethod( c, methodIndex ); return createIMethodCode( c, mm, ams, measureIndex ); } public static IMethodCode createIMethodCode( Class c, ModifiedMethod mm, AnalysisModuleSet ams, int measureIndex ) { IMethodCode mc = CompilerCreatorUtil.createIMethodCode( (short)measureIndex, mm, createClassRecord( c, mm, ams ) ); return mc; } public static IAnalysisMetaData createIAnalysisMetaData( String c, String nc, byte w ) { DefaultAnalysisMetaData damd = new DefaultAnalysisMetaData( c, nc, w ); return damd; } public static AnalysisModuleData createAnalysisModuleData( IAnalysisModule module, IMetaDataReader mdr, IChannelLogReader clr ) throws IOException { AnalysisModuleData amd = new AnalysisModuleData( module, mdr, clr ); return amd; } public synchronized static File createNewDirectory() { File f = null; while (f == null || f.exists()) { f = new File( ".", Long.toString( System.currentTimeMillis() ) ); } f.mkdirs(); Assert.assertTrue( "Did not generate a directory.", f.isDirectory() ); return f; } public static class SimpleClassLogData { public String classSig; public int methods[]; public int marks[]; public SimpleClassLogData( String cs, int me[], int ma[] ) { this.classSig = cs; this.methods = me; this.marks = ma; validate(); } public void validate() { Assert.assertNotNull( this.classSig ); Assert.assertNotNull( this.methods ); Assert.assertNotNull( this.marks ); Assert.assertEquals( this.methods.length, this.marks.length ); } } public static void populateLogger( IChannelLogger cl, SimpleClassLogData inputData[] ) { Assert.assertNotNull( cl ); Assert.assertNotNull( inputData ); for (int i = 0; i < inputData.length; ++i) { inputData[i].validate(); DOC.getLog().info( "Logging class "+inputData[i].classSig+"." ); for (int j = 0; j < inputData[i].methods.length; ++j) { DOC.getLog().debug( "-- mark "+inputData[i].methods[j]+"-"+ inputData[i].marks[j]+"." ); cl.cover( inputData[i].classSig, (short)inputData[i].methods[j], (short)inputData[i].marks[j] ); } } } /** * Creates a DirChannelLogReader suitable for testing. You need to * pass in an array of channel datas (classes above) to create the * base data. */ public static DirectoryChannelLogReader createDirectoryChannelLogReader( File basedir, SimpleClassLogData inputData[], int channel ) { short sc = (short)channel; File channelDir = new File( basedir, Short.toString( sc ) ); DirectoryChannelLogger dcl = new DirectoryChannelLogger( channelDir ); DOC.getLog().info( "Putting log data into dir '"+channelDir+"'." ); populateLogger( dcl, inputData ); DirectoryChannelLogReader dclr = new DirectoryChannelLogReader( basedir, sc ); return dclr; } public static void populateMetaData( IMetaDataWriter mdw, Class set[], IAnalysisModule modules[] ) throws IOException { Assert.assertNotNull( mdw ); Assert.assertNotNull( set ); Assert.assertNotNull( modules ); AnalysisModuleSet ams = createAnalysisModuleSet( modules ); for (int i = 0; i < modules.length; ++i) { IClassMetaDataWriter cmdw = mdw.getClassWriter( modules[i] ); try { for (int j = 0; j < set.length; ++j) { ModifiedClass mc = createModifiedClass( set[j] ); cmdw.writeClassRecord( mc.createClassRecord( ams ) ); } } finally { cmdw.close(); } } } public static DirMetaDataReader createDirMetaDataReader( File basedir, Class populateSet[], IAnalysisModule modules[] ) throws IOException { IMetaDataWriter mdw = new DirMetaDataWriter( basedir ); try { populateMetaData( mdw, populateSet, modules ); } finally { mdw.close(); } DirMetaDataReader dmdr = new DirMetaDataReader( basedir ); return dmdr; } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000755000175000017500000000000011271425773034162 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/CacheDirChannelLoggerUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000000761010046634537034167 0ustar drazzibdrazzib/* * @(#)CacheDirChannelLoggerUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.ant.AntTestA; /** * Tests the CacheDirChannelLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/05/07 06:14:31 $ * @since April 20, 2004 */ public class CacheDirChannelLoggerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CacheDirChannelLoggerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public CacheDirChannelLoggerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testBug1a() { DOC.getIT().testsIssue( 923349 ); // ensure a <= 0 size doesn't cause an error. new CacheDirChannelLogger( new File("."), -1 ); } public void testBug1b() { DOC.getIT().testsIssue( 923349 ); // ensure a <= 0 size doesn't cause an error. new CacheDirChannelLogger( new File("."), 0 ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryClassChannelLogReaderUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001356110072742301034155 0ustar drazzibdrazzib/* * @(#)DirectoryClassChannelLogReaderUTest.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.FileWriter; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReaderUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirectoryClassChannelLogReader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:13 $ * @since January 22, 2003 */ public class DirectoryClassChannelLogReaderUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirectoryClassChannelLogReaderUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirectoryClassChannelLogReaderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testNextRecord1() throws Exception { String sig = "MySig-1"; File log = new File( CCCreatorUtil.createNewDirectory(), "test.log" ); FileWriter fw = new FileWriter( log ); fw.write( "1 0\n2 2\n0002 0002\n3 1\n" ); fw.close(); DirectoryClassChannelLogReader dcclr = new DirectoryClassChannelLogReader( log, sig ); IChannelLogRecord clr; assertChannelLogRecord( dcclr.nextRecord(), sig, 1, 0 ); assertChannelLogRecord( dcclr.nextRecord(), sig, 2, 2 ); assertChannelLogRecord( dcclr.nextRecord(), sig, 2, 2 ); assertChannelLogRecord( dcclr.nextRecord(), sig, 3, 1 ); assertNull( "Didn't return null clr.", dcclr.nextRecord() ); } //------------------------------------------------------------------------- // Helpers protected void assertChannelLogRecord( IChannelLogRecord clr, String sig, int methodIndex, int markIndex ) { assertNotNull( "Returned null record.", clr ); assertEquals( "Didn't return correct signature.", sig, clr.getClassSignature() ); assertEquals( "Didn't return correct method index.", methodIndex, clr.getMethodIndex() ); assertEquals( "Didn't return correct mark index.", markIndex, clr.getMarkIndex() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IClassChannelLogReaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { File log = new File( CCCreatorUtil.createNewDirectory(), "test.log" ); FileWriter fw = new FileWriter( log ); fw.write( "1 0\n2 2\n0002 0002\n3 1\n" ); fw.close(); return new DirectoryClassChannelLogReader( log, "MySig-1" ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLoggerFactoryUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001104210037421054034145 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLoggerFactoryUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.IOException; import java.util.Properties; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactoryUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirectoryChannelLoggerFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DirectoryChannelLoggerFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirectoryChannelLoggerFactoryUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirectoryChannelLoggerFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testLoadProperties1() { Properties props = new Properties(); props.put( "x-dir", "1" ); DirectoryChannelLoggerFactory f = new DirectoryChannelLoggerFactory(); assertEquals( "Did not get the right directory name.", "1", f.getDirectory( "x-", props ) ); } public void testLoadProperties2() { Properties props = new Properties(); props.put( "x.dir", "1" ); DirectoryChannelLoggerFactory f = new DirectoryChannelLoggerFactory(); assertEquals( "Did not get the right directory name.", DirectoryChannelLoggerFactory.DEFAULT_DIRECTORY, f.getDirectory( "x-", props ) ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IChannelLoggerFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new DirectoryChannelLoggerFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/EmptyClassChannelLogReaderUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001010510037421054034144 0ustar drazzibdrazzib/* * @(#)EmptyClassChannelLogReaderUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReaderUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the EmptyClassChannelLogReader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class EmptyClassChannelLogReaderUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = EmptyClassChannelLogReaderUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public EmptyClassChannelLogReaderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new EmptyClassChannelLogReader(); } public void testNextRecord1() throws Exception { EmptyClassChannelLogReader ecclr = new EmptyClassChannelLogReader(); assertNull( "Didn't return null.", ecclr.nextRecord() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IClassChannelLogReaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new EmptyClassChannelLogReader(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/NoOpChannelLoggerFactoryUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000000750610037421054034157 0ustar drazzibdrazzib/* * @(#)NoOpChannelLoggerFactoryUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactoryUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the NoOpChannelLoggerFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class NoOpChannelLoggerFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = NoOpChannelLoggerFactoryUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public NoOpChannelLoggerFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new NoOpChannelLoggerFactory(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IChannelLoggerFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new NoOpChannelLoggerFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/DefaultChannelLogRecordUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001107010037421054034146 0ustar drazzibdrazzib/* * @(#)DefaultChannelLogRecordUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecordUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DefaultChannelLogRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class DefaultChannelLogRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultChannelLogRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultChannelLogRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultChannelLogRecord( null, (short)0, (short)1 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor2() { DefaultChannelLogRecord clr = new DefaultChannelLogRecord( "A", (short)100, (short)-30 ); assertEquals( "Incorrect class signature.", "A", clr.getClassSignature() ); assertEquals( "Incorrect method index.", (short)100, clr.getMethodIndex() ); assertEquals( "Incorrect mark index.", (short)-30, clr.getMarkIndex() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IChannelLogRecordUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new DefaultChannelLogRecord( "S", (short)0, (short)1 ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLoggerUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001423010072742301034147 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLoggerUTest.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; /** * Tests the DirectoryChannelLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:13 $ * @since January 22, 2003 */ public class DirectoryChannelLoggerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirectoryChannelLoggerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirectoryChannelLoggerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new DirectoryChannelLogger( null ); } public void testNullDir1() { DirectoryChannelLogger dcl = new DirectoryChannelLogger( null ); short a = (short)1; dcl.cover( "a", a, a ); dcl.cover( "b", a, a ); dcl.cover( "c", a, a ); } public void testCreateFile1() { // test the base directory + one up not existing File basedir = CCCreatorUtil.createNewDirectory(); File otherDir = new File( basedir, "1" ); otherDir = new File( otherDir, "2" ); DirectoryChannelLogger dcl = new DirectoryChannelLogger( otherDir ); dcl.cover( "a", (short)1, (short)1 ); File outputFile = new File( otherDir, "a.class.log" ); assertTrue( "Incorrectly was able to create output file.", !outputFile.exists() ); } public void testCreateFile2() { // test the base directory already existing File basedir = CCCreatorUtil.createNewDirectory(); DirectoryChannelLogger dcl = new DirectoryChannelLogger( basedir ); dcl.cover( "a", (short)1, (short)1 ); File outputFile = new File( basedir, "a.class.log" ); assertTrue( "Did not create output file.", outputFile.exists() ); } public void testCreateFile3() { // test the base directory not existing, but the one up does File basedir = CCCreatorUtil.createNewDirectory(); File otherDir = new File( basedir, "1" ); DirectoryChannelLogger dcl = new DirectoryChannelLogger( otherDir ); dcl.cover( "a", (short)1, (short)1 ); File outputFile = new File( otherDir, "a.class.log" ); assertTrue( "Did not create output file.", outputFile.exists() ); } public void testCreateCoverString1() { assertEquals( "Didn't convert right", "0001 0004\n", coverString( 0x1, 0x4 ) ); } public void testCreateCoverString2() { assertEquals( "Didn't convert right", "0030 FFDD\n", coverString( 0x30, 0xFFDD ) ); } public void testCreateCoverString3() { assertEquals( "Didn't convert right", "0000 0000\n", coverString( 0x0, 0x0 ) ); } //------------------------------------------------------------------------- // Helpers protected String coverString( int a, int b ) { char c[] = DirectoryChannelLogger.createCoverString( (short)a, (short)b ); return new String( c ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/NoOpChannelLoggerUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000000741410037421054034155 0ustar drazzibdrazzib/* * @(#)NoOpChannelLoggerUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerUTestI; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the NoOpChannelLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class NoOpChannelLoggerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = NoOpChannelLoggerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public NoOpChannelLoggerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new NoOpChannelLogger(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IChannelLoggerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { return new NoOpChannelLogger(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/TestLogger.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000000734710037421054034162 0ustar drazzibdrazzib/* * @(#)TestLogger.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger; /** * Replacement logger. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 27, 2003 */ public class TestLogger { public static class MarkData { public String classSig; public short measureIndex; public short methodIndex; public short markIndex; public MarkData( String sig, short meaI, short metI, short marI ) { this.classSig = sig; this.measureIndex = meaI; this.methodIndex = metI; this.markIndex = marI; } public String toString() { return "[Class Sig="+this.classSig+";measure="+ this.measureIndex+";method="+this.methodIndex+ ";mark="+this.markIndex+"]"; } } private static HashMap marksPerThread = new HashMap(); public static ParseCoverageLogger createPCL() { return new ParseCoverageLogger( TestLogger.class, "cover" ); } public static void cover( String classSig, short methodIndex, short channel, short markIndex ) { //DOC.getLog().info( "Inside cover" ); List list = getThreadList(); MarkData md = new MarkData( classSig, channel, methodIndex, markIndex ); synchronized( list ) { //DOC.getLog().info( "adding mark: "+md ); list.add( md ); } } public static void reset() { List list = getThreadList(); synchronized( list ) { list.clear(); } } public static int size() { return getThreadList().size(); } public static Iterator getMarkData() { return getThreadList().iterator(); } private static List getThreadList() { List list; synchronized( TestLogger.class ) { list = (List)marksPerThread.get( Thread.currentThread() ); if (list == null) { list = new ArrayList(); marksPerThread.put( Thread.currentThread(), list ); } } return list; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/CoverageLoggerUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001016310037421054034150 0ustar drazzibdrazzib/* * @(#)CoverageLoggerUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the CoverageLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:28 $ * @since January 22, 2003 */ public class CoverageLoggerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CoverageLoggerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public CoverageLoggerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testDescription1() { DOC.getLog().warn( "The CoverageLogger class is very difficult to test if we "+ "assume that the class is being code covered, as it creates a "+ "chicken-and-the-egg scenario. If we allow ourselves to test "+ "this class, then we must temporarily corrupt the state of the "+ "testing." ); DOC.getLog().warn( "One way to test is through reflection by loading another "+ "instance of the class. This would use difficult (and fragile) "+ "manipulation of the class and its static state. Another would "+ "be to only run this unit test without code coverage running." ); DOC.getLog().warn( "Perhaps the correct solution is to rearchitect the class such "+ "that it is easier to test." ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLogReaderUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/logger/0000644000175000017500000001661010072742301034153 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLogReaderUTest.java * * Copyright (C) 2003-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import java.io.FileWriter; import java.io.IOException; import junit.framework.Test; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogReaderUTestI; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader; import net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReaderUTestI; import net.sourceforge.groboutils.junit.v1.SubTestTestCase; import net.sourceforge.groboutils.junit.v1.iftc.CxFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; /** * Tests the DirectoryChannelLogReader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:13 $ * @since January 22, 2003 */ public class DirectoryChannelLogReaderUTest extends SubTestTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirectoryChannelLogReaderUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirectoryChannelLogReaderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { Thread.sleep( 100 ); File base = new File( ".", Long.toString( System.currentTimeMillis() ) ); try { new DirectoryChannelLogReader( base, (short)0 ); fail( "Didn't throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testConstructor2() throws Exception { Thread.sleep( 100 ); File base = CCCreatorUtil.createNewDirectory(); try { new DirectoryChannelLogReader( base, (short)0 ); fail( "Didn't throw IllegalArgumentException." ); } catch (IllegalArgumentException ex) { // test exception } } public void testGetReaderForClassSignature1() throws IOException { String classSig = "a.MyClass-1"; File outdir = CCCreatorUtil.createNewDirectory(); File fd1 = new File( outdir, "0" ); fd1.mkdirs(); File cd1 = new File( fd1, classSig + DirectoryChannelLogger.CLASS_LOG_EXTENTION ); FileWriter fw = new FileWriter( cd1 ); fw.write( "0001 0002\n" ); fw.close(); DirectoryChannelLogReader dclr = new DirectoryChannelLogReader( outdir, (short)0 ); final IClassChannelLogReader cclr = dclr. getReaderForClassSignature( classSig ); assertNotNull( "Returned null class channel log reader.", cclr ); assertTrue( "Not correct type (was "+cclr.getClass().getName()+").", cclr instanceof DirectoryClassChannelLogReader ); InterfaceTestSuite suite = IClassChannelLogReaderUTestI.suite(); suite.addFactory( new CxFactory( "GetReader1" ) { public Object createImplObject() throws IOException { return cclr; } } ); addSubTest( suite ); } public void testGetReaderForClassSignature2() throws IOException { String classSig = "a.MyClass-1"; File outdir = CCCreatorUtil.createNewDirectory(); File fd1 = new File( outdir, "0" ); fd1.mkdirs(); DirectoryChannelLogReader dclr = new DirectoryChannelLogReader( outdir, (short)0 ); final IClassChannelLogReader cclr = dclr. getReaderForClassSignature( classSig ); assertNotNull( "Returned null class channel log reader.", cclr ); assertTrue( "Not correct type (was "+cclr.getClass().getName()+").", cclr instanceof EmptyClassChannelLogReader ); InterfaceTestSuite suite = IClassChannelLogReaderUTestI.suite(); suite.addFactory( new CxFactory( "GetReader2" ) { public Object createImplObject() throws IOException { return cclr; } } ); addSubTest( suite ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IChannelLogReaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() throws IOException { File base = CCCreatorUtil.createNewDirectory(); File zero = new File( base, "0" ); zero.mkdirs(); return new DirectoryChannelLogReader( base, (short)0 ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ArrayClassLoader.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/ArrayCl0000644000175000017500000000524607616056235034173 0ustar drazzibdrazzibpackage net.sourceforge.groboutils.codecoverage.v2; import java.util.Hashtable; public class ArrayClassLoader extends ClassLoader { //---------------------------- // Public data //---------------------------- // Private data private Hashtable m_classList = new Hashtable(); private Hashtable m_classCache = new Hashtable(); //---------------------------- // constructors /** * Default constructor */ public ArrayClassLoader() { // do nothing } //---------------------------- // Public methods /** * Add a new class to the internal list. */ public void addClass( String name, byte[] bytecode ) { if (name == null || bytecode == null) { throw new IllegalArgumentException("no null args"); } this.m_classList.put( name, bytecode ); } // inherited from ClassLoader /** * @exception ClassNotFoundException thrown if the given class name * could not be found, or if there was a problem loading the * bytecode for the class. */ public Class loadClass( String name, boolean resolve ) throws ClassNotFoundException { Class c; if (name == null) { throw new IllegalArgumentException("classname is null"); } c = (Class)this.m_classCache.get( name ); if (c == null) { byte bytecode[] = getBytecode( name ); if (bytecode == null) { c = findSystemClass( name ); } else { try { c = defineClass( name, bytecode, 0, bytecode.length ); this.m_classCache.put( name, c ); } catch (Exception ex2) { // something wrong with the class format throw new ClassNotFoundException( "Bad class format for class "+name ); } } } if (resolve) { resolveClass( c ); } return c; } //---------------------------- // Protected methods /** * Retrieves the internal bytecode for the given class. If not known, * then null is returned. * * @param className a non-null class name. */ protected byte[] getBytecode( String className ) { byte bytecode[] = (byte[])this.m_classList.get( className ); return bytecode; } //---------------------------- // Private methods } libgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/0000755000175000017500000000000011271425773033660 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/ClassSignatureUtilUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/Cl0000644000175000017500000001302610037421074034130 0ustar drazzibdrazzib/* * @(#)ClassSignatureUtilUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the ClassSignatureUtil class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:44 $ * @since Feb 4, 2002 */ public class ClassSignatureUtilUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ClassSignatureUtilUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ClassSignatureUtilUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testGetInstance1() { assertNotNull( "Returned a null instance.", ClassSignatureUtil.getInstance() ); } public void testCreateClassSignature1() { try { ClassSignatureUtil.getInstance().createClassSignature( null, -1 ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testCreateClassSignature2() { String sig = ClassSignatureUtil.getInstance(). createClassSignature( "a.b.C", 1L ); assertEquals( "Did not create correct signature.", "a.b.C-1", sig ); } public void testCreateClassSignature3() { String sig = ClassSignatureUtil.getInstance(). createClassSignature( "", 100L ); assertEquals( "Did not create correct signature.", "-100", sig ); } public void testGetClassName1() { try { ClassSignatureUtil.getInstance().getClassName( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception } } public void testGetClassName2() { String name = ClassSignatureUtil.getInstance(). getClassName( "" ); assertEquals( "Did not return correct class name.", "", name ); } public void testGetClassName3() { String name = ClassSignatureUtil.getInstance(). getClassName( "a.b.C" ); assertEquals( "Did not return correct class name.", "a.b.C", name ); } public void testGetClassName4() { String name = ClassSignatureUtil.getInstance(). getClassName( "a.b.C--100" ); assertEquals( "Did not return correct class name.", "a.b.C", name ); } public void testGetClassName5() { String name = ClassSignatureUtil.getInstance(). getClassName( "a.b.C D-100" ); assertEquals( "Did not return correct class name.", "a.b.C D", name ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/HexUtilUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/He0000644000175000017500000001522010072742302034123 0ustar drazzibdrazzib/* * @(#)HexUtilUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.util.zip.CRC32; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the ChecksumUtil class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:14 $ * @since July 7, 2004 */ public class HexUtilUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = HexUtilUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public HexUtilUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testGetInstance() { assertNotNull( "getInstance must never return null.", HexUtil.getInstance() ); } public void testParseTwoHex1() { assertFalse( "Null TS", HexUtil.getInstance().parseTwoHex( "a a", null, ' ', 0 ) ); } public void testParseTwoHex2() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertFalse( "Null string", HexUtil.getInstance().parseTwoHex( null, ts, ' ', 0 )); } public void testParseTwoHex3() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertFalse( "Negative start", HexUtil.getInstance().parseTwoHex( "a a", ts, ' ', -1 ) ); } public void testParseTwoHex4() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertFalse( "No separator", HexUtil.getInstance().parseTwoHex( "a", ts, ' ', 0 ) ); } public void testParseTwoHex5() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertFalse( "No separator after start", HexUtil.getInstance().parseTwoHex( "a a", ts, ' ', 2 ) ); } public void testParseTwoHex6() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertFalse( "Start is after string length", HexUtil.getInstance().parseTwoHex( "x x", ts, ' ', 12 ) ); } public void testParseTwoHex7() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertTrue( "Should have parsed correctly", HexUtil.getInstance().parseTwoHex( "0AAA F", ts, ' ', 0 ) ); assertEquals( "Bad first string translate", 0x0AAA, ts.a ); assertEquals( "Bad second string translate", 0xF, ts.b ); } public void testParseTwoHex8() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertTrue( "Should have parsed correctly", HexUtil.getInstance().parseTwoHex( " 0BB 12", ts, ' ', 1 ) ); assertEquals( "Bad first string translate", 0x0BB, ts.a ); assertEquals( "Bad second string translate", 0x12, ts.b ); } public void testParseTwoHex9() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); assertTrue( "Should have parsed correctly", HexUtil.getInstance().parseTwoHex( "1 2 ", ts, ' ', 0 ) ); assertEquals( "Bad first string translate", 0x1, ts.a ); assertEquals( "Bad second string translate", 0x2, ts.b ); } public void testParseTwoHex10() { HexUtil.TwoShorts ts = new HexUtil.TwoShorts(); ts.a = ts.b = -1; assertTrue( "Should have parsed correctly", HexUtil.getInstance().parseTwoHex( "0 0", ts, ' ', 0 ) ); assertEquals( "Bad first string translate", 0x0, ts.a ); assertEquals( "Bad second string translate", 0x0, ts.b ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/ChecksumUtilUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/Ch0000644000175000017500000001027610037421055034127 0ustar drazzibdrazzib/* * @(#)ChecksumUtilUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import java.util.zip.CRC32; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the ChecksumUtil class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:29 $ * @since Feb 4, 2002 */ public class ChecksumUtilUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ChecksumUtilUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ChecksumUtilUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testGetInstance() { assertNotNull( "getInstance must never return null.", ChecksumUtil.getInstance() ); } public void testNullBytes() { // should not throw an exception CRC32 crc = new CRC32(); assertEquals( "null bytes CRC should match empty CRC.", crc.getValue(), ChecksumUtil.getInstance().checksum( (byte[])null ) ); } public void testEmptyBytes() { CRC32 crc = new CRC32(); assertEquals( "null bytes CRC should match empty CRC.", crc.getValue(), ChecksumUtil.getInstance().checksum( new byte[0] ) ); } public void testSimpleBytes() { byte b[] = "George Washington".getBytes(); CRC32 crc = new CRC32(); crc.update( b, 0, b.length ); assertEquals( "null bytes CRC should match empty CRC.", crc.getValue(), ChecksumUtil.getInstance().checksum( b ) ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/ConvertSingleLogUTest.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/util/Co0000644000175000017500000002637110072742302034141 0ustar drazzibdrazzib/* * @(#)ConvertSingleLogUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.util; import net.sourceforge.groboutils.codecoverage.v2.IChannelLogger; import java.io.Reader; import java.io.BufferedReader; import java.io.IOException; import java.util.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the ConvertSingleLog class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:14 $ * @since April 16, 2004 */ public class ConvertSingleLogUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ConvertSingleLogUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ConvertSingleLogUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ConvertSingleLog( null ); fail( "Didn't throw IllegalArgumentException" ); } catch (IllegalArgumentException e) { // check exception } } public void testConstructor2() { try { new ConvertSingleLog( new IChannelLogger[0] ); fail( "Didn't throw IllegalArgumentException" ); } catch (IllegalArgumentException e) { // check exception } } public void testConstructor3() { try { new ConvertSingleLog( new IChannelLogger[1] ); fail( "Didn't throw IllegalArgumentException" ); } catch (IllegalArgumentException e) { // check exception } } public void testParseShort1() { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); try { csl.parseShort( "1,", "0,1,2" ); fail( "Did not throw IOE" ); } catch (IOException e) { // check output } } public void testParseShort2() { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); try { csl.parseShort( "asdfasdf", "0,1,2" ); fail( "Did not throw IOE" ); } catch (IOException e) { // check output } } public void testParseShort3() throws IOException { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); assertEquals( "Didn't convert right", 12, csl.parseShort( "12", "0,1,2" ) ); } public void testNextElement1() { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); try { int pos[] = { 0, 0 }; csl.nextElement( pos, "asdf" ); fail("Did not throw IOE."); } catch (IOException e) { // check exception } } public void testProcessLine1() { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); try { csl.processLine( null, true ); fail("Did not throw IOE"); } catch (IOException e) { assertTrue( "Bad exception text", e.getMessage().indexOf("End of stream: line is null") >= 0 ); } } public void testProcessLine2() { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); try { csl.processLine( "1,asdf,1,1", false ); fail("Did not throw IOE"); } catch (IOException e) { assertTrue( "Bad exception text", e.getMessage().indexOf("Invalid channel:") >= 0 ); } } public void testProcessLine3() throws IOException { MyChannelLogger mclL[] = { new MyChannelLogger(), new MyChannelLogger(), new MyChannelLogger() }; ConvertSingleLog csl = new ConvertSingleLog( mclL ); csl.processLine( "1,asdf1,1 2", false ); csl.processLine( "0,asdf2,0006 000C", false ); csl.processLine( "2,asdf3,9 3", false ); assertEquals( "did not store all class IDs for c0", new String[] { "asdf2" }, mclL[0].getClassIDs() ); assertEquals( "did not store all marks for c0", new String[] { "6,12" }, mclL[0].getMarks("asdf2") ); assertEquals( "did not store all class IDs for c1", new String[] { "asdf1" }, mclL[1].getClassIDs() ); assertEquals( "did not store all marks for c1", new String[] { "1,2" }, mclL[1].getMarks("asdf1") ); assertEquals( "did not store all class IDs for c2", new String[] { "asdf3" }, mclL[2].getClassIDs() ); assertEquals( "did not store all marks for c2", new String[] { "9,3" }, mclL[2].getMarks("asdf3") ); } public void testProcessLine4() throws IOException { MyChannelLogger mcl = new MyChannelLogger(); ConvertSingleLog csl = new ConvertSingleLog( new IChannelLogger[] { mcl } ); csl.processLine( "0,A,0001 0002", false ); csl.processLine( "0,B,0005 000C", false ); csl.processLine( "0,C,03E7 0006", false ); csl.processLine( "0,D,0012 0004", false ); csl.processLine( "0,D,0017 004E", false ); csl.processLine( "0,D,0017 0000", false ); assertEquals( "did not store all class IDs", new String[] { "A", "B", "C", "D" }, mcl.getClassIDs() ); assertEquals( "did not store all marks for A", new String[] { "1,2" }, mcl.getMarks("A") ); assertEquals( "did not store all marks for B", new String[] { "5,12" }, mcl.getMarks("B") ); assertEquals( "did not store all marks for C", new String[] { "999,6" }, mcl.getMarks("C") ); assertEquals( "did not store all marks", new String[] { "23,78", "23,0", "18,4" }, mcl.getMarks("D") ); } //------------------------------------------------------------------------- // Helpers private static class MyChannelLogger implements IChannelLogger { private Map classToMark = new HashMap(); public void cover( String classID, short methodIndex, short markIndex ) { List s = (List)this.classToMark.get( classID ); if (s == null) { s = new ArrayList(); this.classToMark.put( classID, s ); } s.add( ""+methodIndex+','+markIndex ); } public String[] getClassIDs() { Set s = this.classToMark.keySet(); return (String[])s.toArray( new String[ s.size() ] ); } public String[] getMarks( String classID ) { List s = (List)this.classToMark.get( classID ); if (s == null) { return new String[0]; } return (String[])s.toArray( new String[ s.size() ] ); } } private static void assertEquals( String msg, String[] a, String[] b ) { if (a == null) { assertNull( msg, b ); return; } if (b == null) { fail(msg+": actual array is null, but expected isn't."); return; } assertEquals( msg+": lengths don't match;", a.length, b.length ); Arrays.sort( a ); Arrays.sort( b ); for (int i = 0; i < a.length; ++i) { assertEquals( msg+": contents aren't equal", a[i], b[i] ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/BytecodeLoaderUtil.javalibgroboutils-java-5.orig/codecoverage/sources/ut/net/sourceforge/groboutils/codecoverage/v2/Bytecod0000644000175000017500000001277010037421053034210 0ustar drazzibdrazzib/* * @(#)BytecodeLoaderUtil.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import junit.framework.Assert; import net.sourceforge.groboutils.util.io.v1.ReadByteStream; import org.apache.bcel.classfile.ClassParser; import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.generic.ConstantPoolGen; /** * Helper for loading bytecode. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since January 7, 2003 */ public class BytecodeLoaderUtil { private static final Class THIS_CLASS = BytecodeLoaderUtil.class; public static String getClassFilename( Class c ) { Assert.assertNotNull( "Null class.", c ); return getClassFilename( c.getName() ); } public static String getClassFilename( String name ) { Assert.assertNotNull( "Null class name.", name ); String filename = name.replace( '.', '/' )+".class"; return filename; } public static InputStream loadBytecodeStream( String filename ) throws IOException { Assert.assertNotNull( "Null filename.", filename ); ClassLoader cl = THIS_CLASS.getClassLoader(); InputStream is = cl.getSystemResourceAsStream( filename ); Assert.assertNotNull( "resource '"+filename+"' could not be found.", is ); return is; } public static byte[] loadBytecode( String filename ) throws IOException { Assert.assertNotNull( "Null filename.", filename ); InputStream is = loadBytecodeStream( filename ); return ReadByteStream.readByteStream( is ); } public static JavaClass loadJavaClass( String className ) throws IOException { String filename = getClassFilename( className ); InputStream is = loadBytecodeStream( filename ); ClassParser cp = new ClassParser( is, filename ); JavaClass jc = cp.parse(); return jc; } public static JavaClass loadJavaClass( String className, byte[] bytecode ) throws IOException { String filename = getClassFilename( className ); ByteArrayInputStream is = new ByteArrayInputStream( bytecode ); ClassParser cp = new ClassParser( is, filename ); JavaClass jc = cp.parse(); return jc; } public static Class loadClassFromBytecode( String className, byte[] b ) throws ClassNotFoundException { ArrayClassLoader acl = new ArrayClassLoader(); acl.addClass( className, b ); Class c = acl.loadClass( className ); return c; } public static void runMain( Class cz ) throws Exception { String s[] = new String[0]; java.lang.reflect.Method m = cz.getMethod( "main", new Class[] { s.getClass() } ); m.invoke( null, new Object[] { s } ); } public static void verifyClass( String className, byte[] b ) throws Exception { JavaClass jc = loadJavaClass( className, b ); // ensure the integrety of the class file. org.apache.bcel.generic.ClassGen modClass = new org.apache.bcel.generic.ClassGen( jc ); ConstantPoolGen constantPool = modClass.getConstantPool(); org.apache.bcel.classfile.Method mL[] = modClass.getMethods(); for (int i = 0; i < mL.length; ++i) { verifyMethod( mL[i], constantPool ); } } public static void verifyMethod( org.apache.bcel.classfile.Method m, ConstantPoolGen cp ) throws Exception { Code c = m.getCode(); org.apache.bcel.classfile.CodeException ce[] = c.getExceptionTable(); for (int i = 0; i < ce.length; ++i) { /* this isn't an error - it can really happen Assert.assertTrue( "Method "+m+" includes a '0' catch type in code exception.", ce[i].getCatchType() != 0); */ // a better test is to check this catch type against the // original catch type. } } } libgroboutils-java-5.orig/codecoverage/sources/ut/org/0000755000175000017500000000000010017105323023172 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/org/apache/0000755000175000017500000000000010017105357024422 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/org/apache/tools/0000755000175000017500000000000010017105376025563 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/org/apache/tools/ant/0000755000175000017500000000000011271425773026356 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/ut/org/apache/tools/ant/BuildFileTestA.java0000644000175000017500000003560510037413774032027 0ustar drazzibdrazzib/* * Copyright 2001-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.tools.ant; import java.io.File; import java.io.PrintStream; import java.net.URL; import junit.framework.TestCase; /** * (note: name changed from BuildFileTest to ensure the abstract test isn't * run). * * A BuildFileTest is a TestCase which executes targets from an Ant buildfile * for testing. * * This class provides a number of utility methods for particular build file * tests which extend this class. * * @author Nico Seessle * @author Conor MacNeill */ public abstract class BuildFileTestA extends TestCase { protected Project project; private StringBuffer logBuffer; private StringBuffer fullLogBuffer; private StringBuffer outBuffer; private StringBuffer errBuffer; private BuildException buildException; /** * Constructor for the BuildFileTest object * *@param name string to pass up to TestCase constructor */ public BuildFileTestA(String name) { super(name); } /** * run a target, expect for any build exception * *@param target target to run *@param cause information string to reader of report */ protected void expectBuildException(String target, String cause) { expectSpecificBuildException(target, cause, null); } /** * Assert that only the given message has been logged with a * priority >= INFO when running the given target. */ protected void expectLog(String target, String log) { executeTarget(target); String realLog = getLog(); assertEquals(log, realLog); } /** * Assert that the given substring is in the log messages */ protected void assertLogContaining(String substring) { String realLog = getLog(); assertTrue("expecting log to contain \"" + substring + "\" log was \"" + realLog + "\"", realLog.indexOf(substring) >= 0); } /** * Assert that the given message has been logged with a priority * >= INFO when running the given target. */ protected void expectLogContaining(String target, String log) { executeTarget(target); assertLogContaining(log); } /** * Gets the log the BuildFileTest object. * only valid if configureProject() has * been called. * @pre logBuffer!=null * @return The log value */ protected String getLog() { return logBuffer.toString(); } /** * Assert that the given message has been logged with a priority * >= DEBUG when running the given target. */ protected void expectDebuglog(String target, String log) { executeTarget(target); String realLog = getFullLog(); assertEquals(log, realLog); } /** * Gets the log the BuildFileTest object. * only valid if configureProject() has * been called. * @pre fullLogBuffer!=null * @return The log value */ protected String getFullLog() { return fullLogBuffer.toString(); } /** * execute the target, verify output matches expectations * *@param target target to execute *@param output output to look for */ protected void expectOutput(String target, String output) { executeTarget(target); String realOutput = getOutput(); assertEquals(output, realOutput.trim()); } /** * execute the target, verify output matches expectations * and that we got the named error at the end *@param target target to execute *@param output output to look for *@param error Description of Parameter */ protected void expectOutputAndError(String target, String output, String error) { executeTarget(target); String realOutput = getOutput(); assertEquals(output, realOutput); String realError = getError(); assertEquals(error, realError); } protected String getOutput() { return cleanBuffer(outBuffer); } protected String getError() { return cleanBuffer(errBuffer); } protected BuildException getBuildException() { return buildException; } private String cleanBuffer(StringBuffer buffer) { StringBuffer cleanedBuffer = new StringBuffer(); boolean cr = false; for (int i = 0; i < buffer.length(); i++) { char ch = buffer.charAt(i); if (ch == '\r') { cr = true; continue; } if (!cr) { cleanedBuffer.append(ch); } else { cleanedBuffer.append(ch); } } return cleanedBuffer.toString(); } /** * set up to run the named project * * @param filename name of project file to run */ protected void configureProject(String filename) throws BuildException { configureProject(filename, Project.MSG_DEBUG); } /** * set up to run the named project * * @param filename name of project file to run */ protected void configureProject(String filename, int logLevel) throws BuildException { logBuffer = new StringBuffer(); fullLogBuffer = new StringBuffer(); project = new Project(); project.init(); project.setUserProperty( "ant.file" , new File(filename).getAbsolutePath() ); project.addBuildListener(new AntTestListener(logLevel)); ProjectHelper.configureProject(project, new File(filename)); } /** * execute a target we have set up * @pre configureProject has been called * @param targetName target to run */ protected void executeTarget(String targetName) { PrintStream sysOut = System.out; PrintStream sysErr = System.err; try { sysOut.flush(); sysErr.flush(); outBuffer = new StringBuffer(); PrintStream out = new PrintStream(new AntOutputStream(outBuffer)); System.setOut(out); errBuffer = new StringBuffer(); PrintStream err = new PrintStream(new AntOutputStream(errBuffer)); System.setErr(err); logBuffer = new StringBuffer(); fullLogBuffer = new StringBuffer(); buildException = null; project.executeTarget(targetName); } finally { System.setOut(sysOut); System.setErr(sysErr); } } /** * Get the project which has been configured for a test. * * @return the Project instance for this test. */ protected Project getProject() { return project; } /** * get the directory of the project * @return the base dir of the project */ protected File getProjectDir() { return project.getBaseDir(); } /** * run a target, wait for a build exception * *@param target target to run *@param cause information string to reader of report *@param msg the message value of the build exception we are waiting for set to null for any build exception to be valid */ protected void expectSpecificBuildException(String target, String cause, String msg) { try { executeTarget(target); } catch (org.apache.tools.ant.BuildException ex) { buildException = ex; if ((null != msg) && (!ex.getMessage().equals(msg))) { fail("Should throw BuildException because '" + cause + "' with message '" + msg + "' (actual message '" + ex.getMessage() + "' instead)"); } return; } fail("Should throw BuildException because: " + cause); } /** * run a target, expect an exception string * containing the substring we look for (case sensitive match) * *@param target target to run *@param cause information string to reader of report *@param contains substring of the build exception to look for */ protected void expectBuildExceptionContaining(String target, String cause, String contains) { try { executeTarget(target); } catch (org.apache.tools.ant.BuildException ex) { buildException = ex; if ((null != contains) && (ex.getMessage().indexOf(contains) == -1)) { fail("Should throw BuildException because '" + cause + "' with message containing '" + contains + "' (actual message '" + ex.getMessage() + "' instead)"); } return; } fail("Should throw BuildException because: " + cause); } /** * call a target, verify property is as expected * * @param target build file target * @param property property name * @param value expected value */ protected void expectPropertySet(String target, String property, String value) { executeTarget(target); assertPropertyEquals(property, value); } /** * assert that a property equals a value; comparison is case sensitive. * @param property property name * @param value expected value */ protected void assertPropertyEquals(String property, String value) { String result = project.getProperty(property); assertEquals("property " + property,value,result); } /** * assert that a property equals "true" * @param property property name */ protected void assertPropertySet(String property) { assertPropertyEquals(property, "true"); } /** * assert that a property is null * @param property property name */ protected void assertPropertyUnset(String property) { assertPropertyEquals(property, null); } /** * call a target, verify named property is "true". * * @param target build file target * @param property property name */ protected void expectPropertySet(String target, String property) { expectPropertySet(target, property, "true"); } /** * call a target, verify property is null * @param target build file target * @param property property name */ protected void expectPropertyUnset(String target, String property) { expectPropertySet(target, property, null); } /** * Retrieve a resource from the caller classloader to avoid * assuming a vm working directory. The resource path must be * relative to the package name or absolute from the root path. * @param resource the resource to retrieve its url. * @throws AssertionFailureException if resource is not found. */ protected URL getResource(String resource){ URL url = getClass().getResource(resource); assertNotNull("Could not find resource :" + resource, url); return url; } /** * an output stream which saves stuff to our buffer. */ private static class AntOutputStream extends java.io.OutputStream { private StringBuffer buffer; public AntOutputStream( StringBuffer buffer ) { this.buffer = buffer; } public void write(int b) { buffer.append((char)b); } } /** * our own personal build listener */ private class AntTestListener implements BuildListener { private int logLevel; /** * Constructs a test listener which will ignore log events * above the given level */ public AntTestListener(int logLevel) { this.logLevel = logLevel; } /** * Fired before any targets are started. */ public void buildStarted(BuildEvent event) { } /** * Fired after the last target has finished. This event * will still be thrown if an error occured during the build. * * @see BuildEvent#getException() */ public void buildFinished(BuildEvent event) { } /** * Fired when a target is started. * * @see BuildEvent#getTarget() */ public void targetStarted(BuildEvent event) { //System.out.println("targetStarted " + event.getTarget().getName()); } /** * Fired when a target has finished. This event will * still be thrown if an error occured during the build. * * @see BuildEvent#getException() */ public void targetFinished(BuildEvent event) { //System.out.println("targetFinished " + event.getTarget().getName()); } /** * Fired when a task is started. * * @see BuildEvent#getTask() */ public void taskStarted(BuildEvent event) { //System.out.println("taskStarted " + event.getTask().getTaskName()); } /** * Fired when a task has finished. This event will still * be throw if an error occured during the build. * * @see BuildEvent#getException() */ public void taskFinished(BuildEvent event) { //System.out.println("taskFinished " + event.getTask().getTaskName()); } /** * Fired whenever a message is logged. * * @see BuildEvent#getMessage() * @see BuildEvent#getPriority() */ public void messageLogged(BuildEvent event) { if (event.getPriority() > logLevel) { // ignore event return; } if (event.getPriority() == Project.MSG_INFO || event.getPriority() == Project.MSG_WARN || event.getPriority() == Project.MSG_ERR) { logBuffer.append(event.getMessage()); logBuffer.append( "\n" ); } fullLogBuffer.append(event.getMessage()); fullLogBuffer.append( "\n" ); } } } libgroboutils-java-5.orig/codecoverage/sources/iut/0000755000175000017500000000000010011472720022556 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/iut/net/0000755000175000017500000000000010011472720023344 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/0000755000175000017500000000000010011472720025667 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/0000755000175000017500000000000010011472720030060 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/0000755000175000017500000000000010120240420032475 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/0000755000175000017500000000000010027746411033045 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/libgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000755000175000017500000000000011271425773034260 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/MultipleAnalyzersIUTest.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000002137310037421053034252 0ustar drazzibdrazzib/* * @(#)MultipleAnalyzersIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.codecoverage.v2.CCCreatorUtil; import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; import net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter; import net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure; import net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure; import net.sourceforge.groboutils.junit.v1.SubTestTestCase; /** * Attempts to load a collection of simple class files, add in all known * analyzer module markings on them, and run the recompiled classes. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since May 2, 2003 */ public class MultipleAnalyzersIUTest extends SubTestTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MultipleAnalyzersIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public MultipleAnalyzersIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MyLogger2 { public static void cover( String classSig, short methodIndex, short channel, short markIndex ) { System.out.println( "MyLogger2.cover" ); DOC.getLog().info( getMeasureName( channel ) ); } } private static final String COVER_METHOD_NAME = "cover"; private static final String CLASSFILE_PATH = "net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/"; private static final String CLASSNAME_PACKAGE = "net.sourceforge.groboutils.codecoverage.v2.compiler.testcode."; private static final String MAIN_SIG = "main([Ljava/lang/String;)V"; public static final String[] TESTCLASSNAMES = { "Main1", "If1", "If2", "If3", "Case1", "Case2", "Case3", "Case4", "Case5", "Except1", "Except2", "Finally1", "Finally2", "Finally3", "Finally4", "Finally5", "Synchronized1", "Synchronized2", "Synchronized3", }; public void testRebuildMain() throws Exception { File metadir = CCCreatorUtil.createNewDirectory(); for (int i = 0; i < TESTCLASSNAMES.length; ++i) { addSubTest( new Recompile( TESTCLASSNAMES[i], metadir ) ); } } public static class Recompile extends TestCase { public String TESTNAME; public File dir; public Recompile( String testname, File dir ) { super( "testRecompile" ); this.TESTNAME = testname; this.dir = dir; DOC.getLog().info("===== Adding test for "+testname); } public String getName() { return "testRecompile:"+TESTNAME; } public void testRecompile() throws Exception { File f = new File( TESTNAME+".passed" ); if (f.exists()) f.delete(); String filename = CLASSFILE_PATH+TESTNAME+".class"; String classname = CLASSNAME_PACKAGE+TESTNAME; byte[] bytecode = compileClass( dir, filename ); //DOC.getLog().info( "Original Classfile:" ); //RebuildClassIUTest.debugClass( origClassBytes, filename ); DOC.getLog().info( "Recompiled Classfile:" ); RebuildClassIUTest.debugClass( bytecode, filename ); BytecodeLoaderUtil.verifyClass( classname, bytecode ); Class clazz = BytecodeLoaderUtil.loadClassFromBytecode( classname, bytecode ); BytecodeLoaderUtil.runMain( clazz ); // check for errors assertTrue( TESTNAME+" failed: recompilation didn't work.", f.exists() ); } } //------------------------------------------------------------------------- // helpers protected static byte[] compileClass( File metadir, String filename ) throws IOException { byte[] bytecode = null; DirMetaDataWriter dmdw = new DirMetaDataWriter( metadir ); try { PostCompileClass pcc = new PostCompileClass( new ParseCoverageLogger( MyLogger2.class, COVER_METHOD_NAME ), dmdw, getAnalysisModules() ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] origBytecode = BytecodeLoaderUtil.loadBytecode( filename ); pcc.postCompile( filename, origBytecode, baos ); bytecode = baos.toByteArray(); } finally { dmdw.close(); } return bytecode; } /** * */ private static IAnalysisModule[] getAnalysisModules() { final IAnalysisModule[] amL = new IAnalysisModule[] { new BranchCountMeasure(), new BytecodeCountMeasure(), new CallPairMeasure(), new FunctionMeasure(), new LineCountMeasure() }; return amL; } private static String getMeasureName( short i ) { if (i < 0) return null; String s[] = getMeasureNames(); if (s.length <= i) return null; return s[i]; } private static String[] getMeasureNames() { IAnalysisModule[] am = getAnalysisModules(); String s[] = new String[ am.length ]; for (int i = 0; i < am.length; ++i) { s[i] = am[i].getMeasureName(); } return s; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/libgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000755000175000017500000000000011271425773034260 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Finally3.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000366707654627543034307 0ustar drazzibdrazzib/* * @(#)Finally3.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Finally3 { static int j = 1; public static void main( String[] args ) { try { System.out.println("3"); } catch (Exception ex) { System.out.println("2"); return; } finally { System.out.println("a"); Passed.passed( "Finally3" ); System.out.println("b"); } } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Case4.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000367407654627543034305 0ustar drazzibdrazzib/* * @(#)Case4.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Case4 { static final int a = 1; static final int b = 2; static final int c = 3; static final int d = 4; static int j = -1; public static void main( String[] args ) { String res = null; switch (j) { case 0: case a: case b: case c: case d: return; } Passed.passed( "Case4" ); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/If3.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000333107654627543034273 0ustar drazzibdrazzib/* * @(#)If3.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class If3 { static int j = 1; public static void main( String[] args ) { if (j == 2) { // failed return; } Passed.passed( "If3" ); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Finally5.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000413207654627543034273 0ustar drazzibdrazzib/* * @(#)Finally5.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Finally5 { static int j = 1; public static void main( String[] args ) { try { try { throw new Exception(); } catch (IllegalArgumentException ex) { System.out.println("2"); } } catch (Throwable ex) { System.out.println("2"); return; } finally { System.out.println("a"); Passed.passed( "Finally5" ); System.out.println("b"); } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Finally2.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000366707654627543034307 0ustar drazzibdrazzib/* * @(#)Finally2.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Finally2 { static int j = 1; public static void main( String[] args ) { try { throw new Exception(""); } catch (Exception ex) { System.out.println("2"); return; } finally { System.out.println("a"); Passed.passed( "Finally2" ); System.out.println("b"); } } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/If1.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000333107654627543034273 0ustar drazzibdrazzib/* * @(#)If1.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class If1 { static int j = 1; public static void main( String[] args ) { if (j == 0) { // failed return; } Passed.passed( "If1" ); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Finally1.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000364307654627543034301 0ustar drazzibdrazzib/* * @(#)Finally1.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Finally1 { static int j = 1; public static void main( String[] args ) { try { throw new Exception(""); } catch (Exception ex) { System.out.println("1"); } finally { System.out.println("a"); Passed.passed( "Finally1" ); System.out.println("b"); } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Synchronized1.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000445307654627543034301 0ustar drazzibdrazzib/* * @(#)Synchronized1.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Synchronized1 implements Runnable { static int j = 0; public static void main( String[] args ) throws Exception { Thread t1 = new Thread( new Synchronized1() ); Thread t2 = new Thread( new Synchronized1() ); t1.start(); t2.start(); t1.join(); t2.join(); if (j == 20) { Passed.passed( "Synchronized1" ); } } public void run() { for (int i = 0; i < 10; ++i) { synchronized( this.getClass() ) { ++j; } try { Thread.sleep( 100 ); } catch (InterruptedException ie) { return; } } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Synchronized2.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000445207654627543034300 0ustar drazzibdrazzib/* * @(#)Synchronized2.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Synchronized2 implements Runnable { int j = 0; public static void main( String[] args ) throws Exception { Synchronized2 s2 = new Synchronized2(); Thread t1 = new Thread( s2 ); Thread t2 = new Thread( s2 ); t1.start(); t2.start(); t1.join(); t2.join(); if (s2.j == 20) { Passed.passed( "Synchronized2" ); } } public void run() { for (int i = 0; i < 10; ++i) { synchronized( this ) { ++j; } try { Thread.sleep( 100 ); } catch (InterruptedException ie) { return; } } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Synchronized3.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000463307654627543034301 0ustar drazzibdrazzib/* * @(#)Synchronized3.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Synchronized3 implements Runnable { int j = 0; public static void main( String[] args ) throws Exception { Synchronized3 s2 = new Synchronized3(); Thread t1 = new Thread( s2 ); Thread t2 = new Thread( s2 ); t1.start(); t2.start(); t1.join(); t2.join(); if (s2.j == 6) { Passed.passed( "Synchronized3" ); } } public void run() { for (int i = 0; i < 10; ++i) { synchronized( this ) { if (i == 3) { throw new RuntimeException(); } ++j; } try { Thread.sleep( 100 ); } catch (InterruptedException ie) { return; } } } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Case2.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000433507654627543034300 0ustar drazzibdrazzib/* * @(#)Case2.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Case2 { static final int a = 1; static final int b = 2; static final int c = 3; static final int d = 4; static int j = -1; public static void main( String[] args ) { String res = null; switch (j) { case 0: res = "0"; break; case a: res = "1"; break; case b: res = null; break; case c: res = "3"; break; case d: res = "4"; break; default: Passed.passed( "Case2" ); } System.out.println(res); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Main1.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000426610037421053034254 0ustar drazzibdrazzib/* * @(#)Main1.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 20, 2002 */ public class Main1 { private static final Class THIS_CLASS = Main1.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public static void main( String[] args ) { System.out.println( THIS_CLASS ); DOC.getLog().info( "Inside Main1" ); cover( "test", (short)0, Short.MAX_VALUE, Short.MIN_VALUE ); Passed.passed( "Main1" ); } public static void cover( String classSig, short methodIndex, short channel, short markIndex ) { System.out.println( "Main1.cover: "+classSig ); DOC.getLog().info( "!!cover!!" ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Case5.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000433307654627543034276 0ustar drazzibdrazzib/* * @(#)Case5.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Case5 { static final int a = 1; static final int b = 2; static final int c = 3; static final int d = 4; static int j = 2; public static void main( String[] args ) { String res = null; switch (j) { case 0: res = "0"; break; case a: res = "1"; break; case b: res = "2"; Passed.passed( "Case5" ); break; case c: res = "3"; break; case d: res = "4"; break; default: res = "default"; } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Passed.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000364510037421053034254 0ustar drazzibdrazzib/* * @(#)Passed.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; import java.io.File; import java.io.FileWriter; /** * Utility to mark that a recompiled class worked. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since May 2, 2003 */ public class Passed { public static void passed( String name ) { File f = new File( name + ".passed" ); try { FileWriter fw = new FileWriter( f ); fw.write( name ); fw.close(); } catch (Exception ex) { } System.out.println( name+" Passed!" ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Case1.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000430507654627543034275 0ustar drazzibdrazzib/* * @(#)Case1.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Case1 { static final int a = 1; static final int b = 2; static final int c = 3; static final int d = 4; static int j = 2; public static void main( String[] args ) { String res = null; switch (j) { case 0: res = "0"; break; case a: res = "1"; break; case b: res = null; Passed.passed( "Case1" ); case c: res = "3"; break; case d: res = "4"; break; default: res = "default"; } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Except2.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000341307654627543034274 0ustar drazzibdrazzib/* * @(#)Except2.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Except2 { static int j = 1; public static void main( String[] args ) { try { j = 2; } catch (Exception ex) { return; } Passed.passed( "Except2" ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Case3.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000424307654627543034276 0ustar drazzibdrazzib/* * @(#)Case3.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Case3 { static final int a = 1; static final int b = 2; static final int c = 3; static final int d = 4; static int j = -1; public static void main( String[] args ) { String res = null; switch (j) { case 0: res = "0"; return; case a: res = "1"; return; case b: res = "2"; return; case c: res = "3"; return; case d: res = "4"; return; } Passed.passed( "Case3" ); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Except1.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000341507654627543034276 0ustar drazzibdrazzib/* * @(#)Except1.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Except1 { static int j = 1; public static void main( String[] args ) { try { throw new Exception(""); } catch (Exception ex) { Passed.passed( "Except1" ); } } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/If2.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000326307654627543034277 0ustar drazzibdrazzib/* * @(#)If2.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class If2 { static int j = 1; public static void main( String[] args ) { if (j == 1) { Passed.passed( "If2" ); } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/Finally4.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000000416207654627543034276 0ustar drazzibdrazzib/* * @(#)Finally4.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler.testcode; /** * Simple class to be recompiled. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/03 02:54:27 $ * @since May 2, 2003 */ public class Finally4 { static int j = 1; public static void main( String[] args ) { try { try { throw new Exception(); } catch (IllegalArgumentException ex) { System.out.println("2"); } finally { System.out.println("a"); Passed.passed( "Finally4" ); System.out.println("b"); } } catch (Exception ex) { System.out.println("2"); return; } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compiler/RebuildClassIUTest.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/compil0000644000175000017500000003136210037421053034251 0ustar drazzibdrazzib/* * @(#)RebuildClassIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.compiler; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.ArrayClassLoader; import net.sourceforge.groboutils.codecoverage.v2.BytecodeLoaderUtil; import net.sourceforge.groboutils.util.io.v1.ReadByteStream; /** * Attempts to load a classfile, disassemble it, modify the class file with * the logging, rebuild it to a new file, then load the new class file and * run it to ensure that everything's kosher with it. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/15 05:48:27 $ * @since December 19, 2002 */ public class RebuildClassIUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = RebuildClassIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public RebuildClassIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public static class MarkData { public String classSig; public short measureIndex; public short methodIndex; public short markIndex; public MarkData( String sig, short meaI, short metI, short marI ) { this.classSig = sig; this.measureIndex = meaI; this.methodIndex = metI; this.markIndex = marI; } public String toString() { return "[Class Sig="+this.classSig+";measure="+ this.measureIndex+";method="+this.methodIndex+ ";mark="+this.markIndex+"]"; } } public static class MyLogger { public static List marks = new ArrayList(); public synchronized static void cover( String classSig, short methodIndex, short channel, short markIndex ) { DOC.getLog().info( "Inside cover" ); MarkData md = new MarkData( classSig, channel, methodIndex, markIndex ); DOC.getLog().info( "adding mark: "+md ); marks.add( md ); } public synchronized static void reset() { marks.clear(); } } public static class MyLogger2 { public static void cover( String classSig, short methodIndex, short channel, short markIndex ) { System.out.println( "MyLogger2.cover" ); DOC.getLog().info( "!!cover!!" ); } } private static final String COVER_METHOD_NAME = "cover"; private static final String CLASSFILE_PATH = "net/sourceforge/groboutils/codecoverage/v2/compiler/testcode/"; private static final String CLASSNAME_PACKAGE = "net.sourceforge.groboutils.codecoverage.v2.compiler.testcode."; private static final String MAIN_SIG = "main([Ljava/lang/String;)V"; public void testRebuild1() throws Exception { final String classFileName = CLASSFILE_PATH+"Main1.class"; final String className = CLASSNAME_PACKAGE+"Main1"; byte[] origClassBytes = loadBytecode( classFileName ); // ModifiedClass mc = new ModifiedClass( new ParseCoverageLogger( // Main1.class, COVER_METHOD_NAME ), classFileName, origClassBytes ); ModifiedClass mc = new ModifiedClass( new ParseCoverageLogger( MyLogger.class, COVER_METHOD_NAME ), classFileName, origClassBytes ); ModifiedMethod[] mmL = mc.getMethods(); assertNotNull( "Returned null method list.", mmL ); ModifiedMethod mm = null; for (int i = 0; i < mmL.length; ++i) { assertNotNull( "Method "+i+" is null.", mmL[i] ); DOC.getLog().info("Method "+i+": "+mmL[i].getMethodName()); if (mmL[i].getMethodName().equals( MAIN_SIG )) { mm = mmL[i]; } } assertNotNull( "Did not find a main method.", mm ); DOC.getLog().info( "Modifying method "+mm.getMethodName()+"." ); ModifiedInstructionList mil = mm.getInstructionList(); assertNotNull( "Null instruction list returned.", mil ); DOC.getLog().info( "Instruction count: "+mil.getInstructionCount() ); assertTrue( "Do not have any instructions to mark.", mil.getInstructionCount() > 0 ); MarkedInstruction mi = mil.getInstructionAt( 0 ); assertNotNull( "Null instruction returned.", mi ); // set measure, mark, and modify method mi.addMark( (short)0, (short)1 ); // recompile!!!! final byte[] newClassfile = mc.getModifiedClass(); assertNotNull( "Returned null classfile array.", newClassfile ); DOC.getLog().info( "Original Classfile:" ); debugClass( origClassBytes, classFileName ); DOC.getLog().info( "Recompiled Classfile:" ); debugClass( newClassfile, classFileName ); // clean-up mc = null; mi = null; mil = null; mm = null; mmL = null; // load new, modified class. ArrayClassLoader acl = new ArrayClassLoader(); acl.addClass( className, newClassfile ); // acl.addClass( className, origClassBytes ); Class clazz = acl.loadClass( className ); // run the class MyLogger.reset(); runMain( clazz ); // check results Iterator iter = MyLogger.marks.iterator(); assertTrue( "Did not record any marks in MyLogger.", iter.hasNext() ); MarkData md = (MarkData)iter.next(); assertNotNull( "Returned null mark data entry.", md ); DOC.getLog().info( "First mark is: "+md ); assertEquals( "Did not set correct measure.", (short)0, md.measureIndex ); assertEquals( "Did not set correct mark.", (short)1, md.markIndex ); } //------------------------------------------------------------------------- // helpers protected byte[] loadBytecode( String classFileName ) throws IOException { ClassLoader cl = this.getClass().getClassLoader(); InputStream is = cl.getSystemResourceAsStream( classFileName ); assertNotNull( "resource '"+classFileName+"' could not be found.", is ); return ReadByteStream.readByteStream( is ); } protected void runMain( Class cz ) throws Exception { String s[] = new String[0]; java.lang.reflect.Method m = cz.getMethod( "main", new Class[] { s.getClass() } ); m.invoke( null, new Object[] { s } ); } protected static void debugClass( byte[] classBytes, String filename ) throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream( classBytes ); org.apache.bcel.classfile.ClassParser cp = new org.apache.bcel.classfile.ClassParser( bais, filename ); org.apache.bcel.classfile.JavaClass origClass = cp.parse(); String className = origClass.getClassName(); org.apache.bcel.generic.ClassGen modClass = new org.apache.bcel.generic.ClassGen( origClass ); org.apache.bcel.generic.ConstantPoolGen constantPool = modClass.getConstantPool(); org.apache.bcel.classfile.Method mL[] = modClass.getMethods(); DOC.getLog().debug( "-->> Class "+className+":" ); /* DOC.getLog().debug( " ClassGen ["+modClass+"]" ); DOC.getLog().debug( " Class Version ["+modClass.getMajor()+"."+ modClass.getMinor()+"]" ); DOC.getLog().debug( " ConstantPoolGen:" ); for (int i = 0; i < constantPool.getSize(); ++i) { DOC.getLog().debug( " "+i+": ["+ printConstant( constantPool.getConstant( i ) )+"]" ); } */ for (int i = 0; i < mL.length; ++i) { BytecodeLoaderUtil.verifyMethod( mL[i], constantPool ); if (mL[i].getName().equals( "main" )) { int nameIndex = mL[i].getNameIndex(); int sigIndex = mL[i].getSignatureIndex(); DOC.getLog().debug( " main name["+nameIndex+"] = ["+ printConstant(constantPool.getConstant( nameIndex ))+"]" ); DOC.getLog().debug( " main signature["+sigIndex+"] = ["+ printConstant(constantPool.getConstant( sigIndex ))+"]" ); org.apache.bcel.classfile.Attribute attr[] = mL[i].getCode().getAttributes(); DOC.getLog().debug( " code attributes:" ); for (int j = 0; j < attr.length; ++j) { nameIndex = attr[j].getNameIndex(); DOC.getLog().debug( " "+ printConstant(constantPool.getConstant( nameIndex ))+ " ("+j+") ["+attr[j].getTag()+"] = ["+ attr[j]+"] ("+attr[j].getClass().getName()+")" ); } } org.apache.bcel.generic.MethodGen mg = new org.apache.bcel.generic.MethodGen( mL[i], className, constantPool ); DOC.getLog().debug( " Method "+i+" ["+mg+"]" ); /* org.apache.bcel.generic.InstructionList il = mg.getInstructionList(); DOC.getLog().debug( " Code [\n"+il+"]" ); */ } DOC.getLog().debug( "<<--" ); } protected static String printConstant( org.apache.bcel.classfile.Constant c ) { if (c == null) { return null; } StringBuffer sb = new StringBuffer( "Tag " ); sb.append( c.getTag() ). append( '\'' ).append( c.toString() ).append( '\'' ); return sb.toString(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/logger/libgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/logger0000755000175000017500000000000011271425773034254 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/logger/CacheDirChannelLoggerIUTest.javalibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001012210041354101034226 0ustar drazzibdrazzib/* * @(#)CacheDirChannelLoggerIUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import java.io.File; import junit.framework.Test; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.codecoverage.v2.ant.AntTestA; /** * Tests the CacheDirChannelLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/04/21 02:11:13 $ * @since March 22, 2004 */ public class CacheDirChannelLoggerIUTest extends AntTestA { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CacheDirChannelLoggerIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public CacheDirChannelLoggerIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests //........................... // Tests that pass // test bug 902884 public void testBug1() { DOC.getIT().testsIssue( 902884 ); try { executeTarget( "bug-1" ); } finally { System.out.println( getFullLog() ); } } //........................... // Tests that fail //------------------------------------------------------------------------- // Helpers protected File getCoverageDir() { return new File( getProjectDir(), "instrument" + File.separator + "coverage" ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up configureProject( "cachelogger.xml" ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down executeTarget( "test-teardown" ); super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/logger/cachelogger.xmllibgroboutils-java-5.orig/codecoverage/sources/iut/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001512410027751677034264 0ustar drazzibdrazzib package x; public class main { public static void main( String args[] ) { System.out.println("x.main start"); package a; import java.util.*; public class A { static final Hashtable H = new Hashtable(); static void x() { H.put("a", "B"); } public void y() { H.get("a"); } } System.out.println("x.main | a.A start"); a.A tA = new a.A(); // a.A.x(); tA.y(); System.out.println("x.main | a.A end"); package a; import java.util.*; public class B { static String s = null; public static void x( String t ) { s = t + "x"; } public void y() { if (s != null) { s = s + s; } } } System.out.println("x.main | a.B start"); a.B tB = new a.B(); tB.y(); a.B.x( "asdf" ); System.out.println("x.main | a.B end"); package a; public class C { } package a; public class C_NoCover { static C x = new C(); } System.out.println("x.main | a.C start"); // force the static constructor to run // see bug 902884 a.C_NoCover.class.getName(); System.out.println("x.main | a.C end"); System.out.println("x.main end"); } } Source of ${x.main}: ${x.main.src} Did not create directory ${coverage.logs}/data Running java... Did not create directory ${coverage.logs}/logs Did not create directory ${coverage.logs}/logs/0 libgroboutils-java-5.orig/codecoverage/sources/example1/0000755000175000017500000000000011271425773023510 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/eut/0000755000175000017500000000000011271425773022571 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/eut/net/0000755000175000017500000000000010072736020023343 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/0000755000175000017500000000000010072736047025677 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/0000755000175000017500000000000010072736063030066 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/codecoverage/0000755000175000017500000000000010072736134032513 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/codecoverage/v2/0000755000175000017500000000000010072737531033044 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/codecoverage/v2/logger/libgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/codecoverage/v2/logger0000755000175000017500000000000011271425773034250 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/codecoverage/v2/logger/DirectoryChannelLoggerEUTest.javalibgroboutils-java-5.orig/codecoverage/sources/eut/net/sourceforge/groboutils/codecoverage/v2/logger0000644000175000017500000001043110072742300034233 0ustar drazzibdrazzib/* * @(#)DirectoryChannelLoggerEUTest.java * * Copyright (C) 2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.codecoverage.v2.logger; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the DirectoryChannelLogger class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2004/07/07 09:39:12 $ * @since January 22, 2003 */ public class DirectoryChannelLoggerEUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DirectoryChannelLoggerEUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DirectoryChannelLoggerEUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testArithmeticShiftLeft1() { short in = (short)0xF000; in >>= 4; assertEquals( (short)0xFF00, in ); } public void testBitwiseShiftLeft1() { short in = (short)0xF000; in >>>= 4; // one would think that this results in 0F00, since we did a // bitwise shift. HOWEVER: the ">>>" operator promotes the // value to an integer, which expands F000 into FFFFF000, then // performs the bitwise shift (forming 0FFFFF00), then converts it // back to a short, which is FF00. assertEquals( (short)0xFF00, in ); } public void testBitwiseShiftLeft2() { int in = 0xF0000000; in >>>= 4; assertEquals( 0x0F000000, in ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/codecoverage/sources/eut/about.txt0000644000175000017500000000015307600160002024421 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/0000755000175000017500000000000011271425773024376 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/maven-plugin/project.properties0000644000175000017500000000052207736373516030171 0ustar drazzibdrazzib# ------------------------------------------------------------------- # P R O J E C T P R O P E R T I E S # ------------------------------------------------------------------- maven.xdoc.date=left maven.xdoc.version=${pom.currentVersion} maven.license.licenseFile=${basedir}/../../LICENSE.txt maven.repo.local=${basedir}/../../repositorylibgroboutils-java-5.orig/codecoverage/sources/maven-plugin/plugin.jelly0000644000175000017500000002166607736373515026757 0ustar drazzibdrazzib ${GroboCoverage.postcompile.analysis} No java class files to post-compile. ${pom.getPluginContext('maven-test-plugin').setVariable('maven.build.dest',tmp)} libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/plugin.properties0000644000175000017500000000206607736373516030026 0ustar drazzibdrazzib# ------------------------------------------------------------------- # P L U G I N P R O P E R T I E S # ------------------------------------------------------------------- # Base directory to place all coverage information grobocoverage.coverage.dir=${maven.build.dir}/coverage # where to put post-compiled files grobocoverage.postcompile.classes=${grobocoverage.coverage.dir}/classes grobocoverage.postcompile.details=${grobocoverage.coverage.dir}/details grobocoverage.postcompile.analysis=linecoverage,function # where to put runtime coverage files grobocoverage.runtime.logs=${grobocoverage.coverage.dir}/logs # details for the runtime coverage output grobocoverage.runtime.factory=net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLoggerFactory # reporting output details grobocoverage.report.xsl=coverage-report-html.xsl maven.junit.fork=no maven.junit.dir=${basedir} maven.junit.usefile=true maven.test.dest=${maven.build.dir}/test-classes maven.test.reportsDirectory=${maven.build.dir}/test-reports maven.test.skip=false maven.junit.jvmargs= libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/project.xml0000644000175000017500000000323507736373516026601 0ustar drazzibdrazzib ../project.xml 3 net.sourceforge.groboutils maven-GroboCoverage-plugin GroboUtils CodeCoverage Plug-in 1.0.0-SNAPSHOT Java Project Management Tools http://groboutils.sourceforge.net/grobocoverage/maven-plugin.html /www/maven.apache.org/reference/plugins/java/ scm:cvs:pserver:anonymous@cvs.sourceforge.net:/home/cvspublic:projects/codecoverage/sources/maven-plugin/ http://cvs.sourceforge.net/viewcvs.py/groboutils/projects/codecoverage/sources/maven-plugin/ Matt Albrecht groboclown groboclown@users.sourceforge.net Sourceforge Lead Developer net.sourceforge.groboutils GroboCodeCoverage-ant 1.0.0RC1 http://groboutils.sourceforge.net net.sourceforge.groboutils GroboCodeCoverage-runtime 1.0.0RC1 http://groboutils.sourceforge.net libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/0000755000175000017500000000000010011472722025150 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/plugin-resources/0000755000175000017500000000000011271425773030473 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/plugin-resources/coverage-report-html.xsllibgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/plugin-resources/coverage-report-htm0000644000175000017500000002266007736373564034331 0ustar drazzibdrazzib This file was auto-generated. Code Coverage Report - <xsl:value-of select="@measure" />

    Coverage Report for

    All units are in .

    Totals

    All Packages


    Classes By Package


    Methods By Class


    Method Details

    Package

    Class

    Class

    Method

    Units Not Covered
    Index Details
    All units were covered
    Covered Total % Covered Weighted % # PerfectGoodWarnFail libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/0000755000175000017500000000000011271425773026305 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/futures.xml0000644000175000017500000000075107736373567030545 0ustar drazzibdrazzib Matt ALbrecht Futures for the GroboCoverage Plug-in

    The following is a list of things that are being contemplated for the Maven GroboCoverage Plug-in.

    1. Get the thing to work
    libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/properties.xml0000644000175000017500000000352307736373567031244 0ustar drazzibdrazzib Vincent Massol Maven GroboCoverage Plug-in Properties Documentation

    The following is an overview of the various properties (and default values) used by the Maven GroboCoverage Plug-in build file. Most of these properties are optional and have defaults; however, there are mandatory properties that must be set as described in this document.

    These properties can be overridden to change the default behavior of the Maven GroboCoverage Plug-in. If you need to override any of these properties, please refer to the Integration document for the preferred method of setting properties in your project.

    SectionDescription
    Misc These properties specify various settings that control the behaviour of the GroboCoverage Plug-in.
    PropertyOptional?Description
    GroboCoverage.dir No Specifies the location of the GroboCoverage base output files. The default value is ${maven.build.dir}/GroboCoverage.
    libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/navigation.xml0000644000175000017500000000122207736373567031201 0ustar drazzibdrazzib Maven libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/build-file.xml0000644000175000017500000000627407736373567031072 0ustar drazzibdrazzib Matt Albrecht Maven GroboCoverage Plug-in Build File Documentation

    Maven utilizes Ant to provide users with an easy-to-use and familiar interface to manage projects that have been described with a valid Maven project descriptor. The build files that Maven installs are stored in ${maven.home} directory.

    This document describes the Ant build file and targets that are available when using the GroboCoverage Plug-in with Maven.

    The current recommended approach to using Maven is to add delegators to these Maven-provided targets in your project's main build file. This will enable you to use your existing build file with the additional Maven functionality. In addition, it is also recommended that you load a standard set of property files. The property files will setup your environment, ${lib.repo} and ${maven.home}, and allow you to override Maven defaults properties. Please refer to the Integration document for more information on how to integrate these build targets into your project.

    The following table contains a brief overview of the build file that is installed as part of the Maven GroboCoverage Plug-in in the ${maven.home}/plugin/grobocoverage directory. In addition, the various Ant targets in this file is discussed.

    Build FileDescription
    build.xml Contains targets to generate GroboCoverage test coverage reports.

    The build file utilizes various properties for default and user-configurable settings. All GroboCoverage Plug-in properties are described in the Properties document. The rest of this document assumes your project follows the standard Directory Layout; however, it is possible to override many of these defaults.

    TargetDescription
    maven:clover-report-html Generates HTML GroboCoverage Test coverage reports.

    blah blah description.

    libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/goals.xml0000644000175000017500000000063607736373567030157 0ustar drazzibdrazzib Matt ALbrecht Maven GroboCoverage Plug-in Goals GroboCoverage Generate HTML test coverage reports libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/changes.xml0000644000175000017500000000057707736373567030466 0ustar drazzibdrazzib Matt ALbrecht Changes Initial release of the plug-in. libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/index.xml0000644000175000017500000000531707736373567030162 0ustar drazzibdrazzib Matt ALbrecht Maven GroboCoverage Plug-in

    This document provides an overview of the Maven GroboCoverage Plug-in.

    The documents presented here are references, if you are looking for more verbose usage material, please refer to the Getting Started section.

    The GroboCoverage Plug-in is the place where GroboCoverage tools are found in Maven.

    GroboCoverage is a tool that generates Test Coverage reports. It is free for non-commercial use. If your project is a commercial project you will need to get a license for the GroboCoverage jar before using this Plug-in.

    DocumentDescription
    Build File This document provides detailed information on the various targets that are available as part of the Maven GroboCoverage Plug-in. These targets can be delegated to by your project's local build file.
    Properties The behavior of the Maven GroboCoverage Plug-in can be altered via properties. This document describes each property available as the default used.
    Directory Layout The preferred directory layout structure is documented here. This is a useful document if you are trying to determine what a particular component of your directory hierarchy is used for.
    Futures These are the current thoughts on additional items that could or should be added to the plug-in. They may or may not make it to an actual task list of a developer.
    libgroboutils-java-5.orig/codecoverage/sources/maven-plugin/src/xdocs/dirlayout.xml0000644000175000017500000000274707736373567031073 0ustar drazzibdrazzib Matt ALbrecht Maven GroboCoverage Plug-in Directory Layout

    Having a common directory layout would allow for users familiar with one Maven project to immediately feel at home in another Maven project. The advantages are analogous to adopting a site-wide look-and-feel. Common Maven procedures strengthen the Maven brand.

    The next two sections document the directory layout expected by Maven and the directory layout created by Maven. Please try to conform to this structure as much as possible; however, if you must these settings can be overridden via properties as documented in the Integration document.

    Directory name Content Comment
    target/grobocoverage Contains instrumented code and clover database. This directory is used by the GroboCoverage Plug-in as ...
    libgroboutils-java-5.orig/codecoverage/CHANGES.TXT0000644000175000017500000001574710073140107021760 0ustar drazzibdrazzibv1.1.0 * Change in log format: in order to further reduce the time spent writing to the files, the old [methodIndex,markIndex] format has been replaced with outputting those numbers in hexidecimal format with a space between them. Also, the DirectoryChannelLogger API has changed; the createCoverString method now returns char[] instead of String. * Fixed bug 874029: All Packages and All Classes pages not sorted. * Fixed bug 894999: GroboCodeCoverage reports changed class twice * Fixed bug 902884: CacheDirChannelLoggerFactory fails in UT static initializer. * Fixed bug 903797: Coveragepostcompiler fails to correctly set cache-size. * Fixed bug 903837: Class files: Duplicate instrumentation * Fixed bug 906198: Incorrect probe placement for branch. * Fixed bug 906200: "else" and "if" labels reversed for branch. * Fixed bug 906203: JSR instructions should not be branch probed. * Fixed bug 906207: analyzers wrongly put multiple probes on a one instruction. * Fixed bug 906316: coveragepostcompiler: Need parent dir. * Fixed bug 907800: CacheDirChannelLogger truncates files. * Fixed bug 922773: Terrifying slowdowns once the unit tests start writing xml. * Fixed bug 923349: CacheDirChannelLoggerFactory causes underlying error if cache-size <= 0. * Fixed bug 929332: PostCompile doesn't handle source dir = output dir. * Fixed bug 938439: ArrayIndexOutOfBoundException in AspectJ compiled code. * Fixed bug 950025: Totals are generated even when not needed. * Implemented FR 860294: codecoverage:expand srcdir to srcdirset in sourcestyle. * Implemented FR 863052: Improve code coverage report HTML. * Implemented FR 891199: Do not embed CSS styles, use external stylesheets. * Implemented FR 901586: Add failure condition on reports. * Implemented FR 901590: Redo GroboCoverage site docs. * Implemented FR 903489: Make coveragereport less verbose. * Implemented FR 912366: New task to alter zip files to be coverage-enabled. * Implemented FR 914410: Ant task for unit test coverage enforcement. * Initial fix for bug 947857: Codecoverage takes very long to generate the report. v1.0.0 * Went "gold", even though there are known issues with the linked report. * Fixed bug 874024: CodeCoverage report fails with some Xalan. * Added a command-line tool to evaluate differences between classfiles. * Fixed bug 874031: Exception blocks not copied to covered classes correctly. v1.0.0 RC5 * Removed double DOCTYPE and fixed backslash issues in source-linking document (bug #860420). * Added ability to specify multiple source directories for source-linking document (feature #860294). * Added another test in examples for a special case (bug #859159). * Made the method signature in the reports more human readable (bug #860420). v1.0.0 RC4 * Added XSL transformation into the report generator. * Added framed transformations for source-coverage linking. * Added a new logger: MinDirChannelLogger, a JDK 1.2 logger that caches in memory the marks to reduce the log file sizes. * Updated v2_antdoc.xml to reflect the new changes. v1.0.0 RC3 * Added new documentation generation for a stand-alone distributable zip file. * Added ability in coveragepostcompiler task to generate grobocoverage.properties automatically. * Added property file to ease the addition of Ant tasks into build files. * coveragereport now generates the required directories, to remove a head-beating build issue. * The XmlReportGenerator now uses DOM to generate the XML, for a more accurate output (see bug 847334). As a result, some of the method signatures have changed. * Adding support for embedding the style task inside the report. This may take a while before it is fully supported. v1.0.0 RC2 * Updated documentation. * Added XSL stylesheet which removes classes and/or methods from the report files that have no coverage information (i.e. interfaces and abstract methods). v1.0.0 RC1 * Corrected minor documentation errors. * Moved ParseCoverageLogger to have a larger prominence, such that tests can change which logger they use (for easier testing). * Removed some residual JDI references. * Added debug logging. * Created "runtime" jar file that contains the minimal set of files to run precompiled classes with for correct execution of inserted code. * Moved the license from LGPL to MIT. * Added another logger called "CacheDirChannelLogger", which doesn't have the overhead of closing and opening the file streams, but takes up more memory. v1.0.0 alpha2 * Changed build to reflect new version. * Updated documentation. * Removed obsolete v1 from code, since it never did work right. * Added v2 using new technique of post-compilation. v0.9.3 * Changed build to reflect new version. * Moved code coverage into its own project. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/codecoverage/xdocs/0000755000175000017500000000000011271425773021431 5ustar drazzibdrazziblibgroboutils-java-5.orig/codecoverage/xdocs/v2_design.xml0000644000175000017500000001413607714257302024036 0ustar drazzibdrazzib Code Coverage Design (V2) $Date: 2003/08/06 20:02:10 $ Matt Albrecht
    Overview

    The goal of the codecoverage package is to capture the lines of code that were executed in a Java VM. Traditional Java-based code coverage tools fall into four categories:
    Type Speed Needs Source Special In-Process Setup Examples
    Monitor VM Slow No VM must have monitoring enabled GroboCodeCoverage V1
    ClassLoader Dynamic Class Analysis Moderate No Running VM must use specific classloader, and code can't load covered classes in a new classloader. Quilt, Hansel
    Source Recompilation Fast Yes No (just extra classes in classpath) Clover
    Bytecode Recompilation Fast No No (just extra classes in classpath) Gretel

    The V2 design extends the standard ClassLoader analysis tools and moves the bytecode analysis and recompilation to a step outside the actual runtime analysis. The disadvantages include:

    • there's an extra step in the coverage analysis;
    • there are two copies of the class files (the differences from the outside being the size of the classes), which can lead to confusion;
    • the pre-runtime recompilation generates extra files which must be used with the exact class files generated;
    • additional system properties must be specified in the runtime engine, along with an additional class library in the classpath.
    Using an automated build tool such as Ant along with a structured build process can lead to considering the first three disadvantages as inconsequential; additional disk-drive space becomes the only worrysome factor (which, more and more, this is a minimal factor). The fourth factor requires adding additional information to the runtime setup scripts.

    The perceived advantages far outweigh these manageable deficiencies:

    • the run-time processing is sped up, since the analysis of the class files and bytecode restructuring is performed outside the execution;
    • there is no more need to have a specially setup execution environment to ensure the proper class loader is generated, and no special care is needed to ensure that the executed code doesn't use its own class loader;
    • the additional classes needed to accompany the altered classes is minimal, since they do the equivalent of logging.

    The reason why the author decided to create his own code coverage tool, rather than use Gretel, is that Gretel requires a Gretel-compiled "main" method to be executed first. This is rarely possible in application servers or other such environments.

    Architecture

    This package breaks the general code-coverage problem into four parts:

      performs post-source code compilation on the bytecode (a "post-compiler", if you will), and dynamically allows the analysis modules to pre-process the class files. parse the bytecode methods for all classes, mark bytecode instructions as under analysis, and generate data necessary for creating a report. the generated bytecode adds logging statements for each analysis module. The logging is directed towards one "channel" per module during the runtime execution. These loggers must be minimal in runtime overhead, and must be separately jarred for easy inclusion into the runtime. parses the post-compilation data along with the runtime channel logs to generate reports for each analysis module. If the modules and post-compilation engine were constructed correctly, this part does not need to interact with the analysis modules directly. organizes the post-compilation meta-data and channel logs. Allows for easy and efficient query of per-analysis module and per-class data.

    This package does not need to be classloader aware. If the recompiled classes log the classname with a checksum, then each part can uniquely identify each class file. Even though, technically under the JVM spec, that if two class files are loaded by different class loaders then they are different classes, the actual coverage numbers do not split with this differentiation.

    Details of Analysis Modules

    Analysis modules provide the actual value to the coverage tool. They can report number of bytecodes covered, number of lines covered, or branch coverage.

    A proper module knows how to decode the BCEL object format for methods, marks individual bytecode instructions as "check for coverage", and generates associated meta-data for each mark, so that the report engine can easily create a report without having to refer back to the module.

    The post-compilation engine will provide objects that simplify the matter of inserting the marks. It will also generate a data store for each method for the module to record all the meta-data.

    libgroboutils-java-5.orig/codecoverage/xdocs/summary.xml0000644000175000017500000000154010037421250023631 0ustar drazzibdrazzib codecoverage net.sourceforge.groboutils.codecoverage.v2 There are several commercially available code coverage tools for Java, but they all require a large fee to use. This is a 100% Pure Java implementation of a Code Coverage tool. It uses Jakarta's BCEL platform to post-compile class files to add logging statements for tracking coverage. 16-Apr-2004: Final changes to the documentation before release of the next version. libgroboutils-java-5.orig/codecoverage/xdocs/cactus-sample-build-coverage.xml.txt0000644000175000017500000004727010040155466030422 0ustar drazzibdrazzib Missing property or property pointing to an invalid file (check your build.properties file) At least one test failed! libgroboutils-java-5.orig/codecoverage/xdocs/v2_antdoc_grobo-instrument.xml0000644000175000017500000003317710040560331027422 0ustar drazzibdrazzib grobo-instrument: GroboCoverage Ant Tasks $Date: 2004/04/18 20:11:05 $ Matt Albrecht

    All Tasks

    Recompiles the provided class files to a separate directory, and stores the compilation generated data (for use in report generation) to another directory. the FileSet to use for defining all the class files to recompile. Note that no matter what is specified in the file sets, only files ending in ".class" (case-insensitive) will be recompiled. There may be multiple of these file sets specified. Defines a single analysis module to use in the analysis of each class file that is recompiled. An analysis module creates coverage details for the class specific to its measure, such as line-count or branch count. Multiple of these modules may be specified. Each analysis module will have its own report generated. Measure's classpath attribute is a PATH like structure and can also be set via a nested classpath element. name the name of the analysis module to load. The only current acceptable values are:
      counts the source code line coverage. This requires the line information to be stored in the class file. counts the coverage of the class file's bytecode. This is the most detailed look at exactly what amount of code is and is not being covered, but can be hard to read. counts the coverage of each branch by looking at the bytecode branching instructions. counts the coverage of each method invocation. counts the "function" or "method" entry coverage; when the execution enters a method, that method is marked as covered.
    One of name (alternatively, type) or classname must be specified
    type an alternative to the name attribute. One of name (alternatively, type) or classname must be specified classname Loads a non-standard analysis module, using this parameter as a the fully-qualified class name of the analysis module class. If this is specified, then it will use the classpathref parameter, embedded classpath element, or loaderref parameter to reference the classpath from which to load the module, if any are provided. If none are provided, then the classloader for the task will be used instead. One of name (alternatively, type) or classname must be specified classpathref Reference to a classpath to use when looking up classname. No loaderRef the name of the loader that is used to load the class, constructed from the specified classpath. Use this to allow multiple tasks/types to be loaded with the same loader, so they can call each other. No
    Adds a property to be used by the logger specified. Currently, this is only needed if you need to set a property outside the logging output dir. key The key for the name-value pair. Yes value The value for the name-value pair. One of value or location must be specified. location The value for the name-value pair describing a file location; will be translated into an OS-specific file name. One of value or location must be specified. destdir The name of the directory in which the recompiled class files are saved. This directory should never be confused with the original classes: these classes are slower and "fatter" than the originals. Yes logger the kind of logger used during coverage runtime to gather the code coverage metrics. These are the supported types:
      (default) This is the safest logger, but the slowest (really slow). On each logging request, it opens the log file, writes the log element, then closes the log file, all in a VM-wide synchronized block. Using this logger, you will likely see a very large amount of disk write access. This keeps a sized cache of open log files in memory, each log file being a buffered file. This has a danger of possibly not closing or flushing its open log files on VM shutdown. If the VM is JDK 1.3 compatible, the logger will add a shutdown hook to attempt to close its opened files. Using this logger, you should see large disk access when the VM ends. Use the cachesize logging parameter to defines the maximum number of opened files stored in the cache per channel (default size is 25, but you should match this to the limitations of the operating system).

      There's a pending issue with this logger (bug 902884). As such, this isn't a recommended logger.

      The fastest logger that comes with GroboCoverage. This operates identically to safe, but caches the encountered covered items, and only writes new elements to the log files. This is JDK 1.2 dependent, and may eat up lots of memory. Reports from various users indicate that using this logger causes a 90x speed-up over the safe method. (currently still experimental) instead of creating the standard log directory structure, this method outputs everything to a single file in the log directory. The code still needs some optimization, and may be a bottleneck for threaded applications. Using this logger requires you to use the <logfilter type="single"> tag inside the <grobo-report> task.
    No
    loggerFactory the factory class to handle the logging. If no package is specified, then this property will prepend "net.sourceforge.groboutils.codecoverage.v2.logger." to the given factory name. The logger class must be in the classpath of the code covered classes. Use this instead of logger if you want to use a different logger. No logDir the directory that will contain data relating to the coverage numbers (gathered during this task and during runtime). Must match the report task's logDir parameter. No ifExists what to do if the task encounters an existing instrumented class file in the destdir directory. Possible values include:
      default replace the old class data files if a new version of the class file is being post-compiled. remove all files in the destdir and class file data directory under logDir before post-compiling the code. keep the original class data files, as well as create new ones for the new post-compiled class files. This method can lead to confusion in the reports if you're not careful.
    No
    <grobo-instrument logger="fast" destdir="coverage/classes" logdir="coverage/logs" > <measure name="linecount" /> <fileset dir="${dirs.classes}" /> <fileset dir="${dirs.classes2}"> <excludes name="dont/cover/these/*.class" /> </fileset> </grobo-instrument> Recompiles all the classes located in ${dirs.classes} using the linecount analysis module, and recompiles all the classes from ${dirs.classes2} except those in the dont.cover.these package. All the recompiled classes are stored in coverage/classes, and the data used by the code coverage tasks are stored under the coverage/logs directory. The fast logger will be used during runs. <grobo-instrument logger="cache" destdir="coverage/classes" logdir="coverage/logs" > <measure type="bytecode" /> <measure classname="org.mine.MeasureType" classpathref="myclasspath" /> <fileset dir="${dirs.classes}" /> <loggerprop key="cachesize" value="100" /> </grobo-instrument> Recompiles all the classes located in ${dirs.classes} using the bytecode analysis module as well as the user-defined org.mine.MeasureType analysis module. Uses the cache logger, setting the "cachesize" logger property to 100.

    All Tasks

    libgroboutils-java-5.orig/codecoverage/xdocs/v2_antdoc_grobo-rezip.xml0000644000175000017500000001700710052047206026341 0ustar drazzibdrazzib grobo-rezip: GroboCoverage Ant Tasks $Date: 2004/05/13 00:15:47 $ Matt Albrecht

    All Tasks

    Alters zip and zip-like files to contain new files. Also, alters zips within zips. Used for modifying deployment archives (such as EAR files) to include coverage-compiled classes and the GroboCoverage runtime library.

    The task is really a container for many alteration sub-tasks. Each top-level sub-task takes a source, and outputs a destination to a file. They may each have their own alteration sub-tasks, but these will output the altered zip file to the owning sub-task's zip file.

    The primary alteration sub-task. All other alter sub-tasks are based on this one, and so have the same attributes and nested elements as this one (plus a few more).

    All alter sub-tasks can include other alter sub-tasks inside them. This means that a zip file inside another zip file will be altered.

    (aliased as zipfileset) the ZipFileSet to define new entries to put into the modified zip file. This will overwrite any existing file in the modified zip file with the same name and path. replaceOnly If set to "true", then only the files in this fileset that are already in the original zip file will be included. Default is "false". Useful for including covered classes that are in the original, but no others. No src For top-level alter sub-tasks, this refers to the location of the original source zip file. For inner alter sub-tasks, this refers to the zip file location inside the owning zip file's directory structure. Yes dest For top-level alter sub-tasks, this refers to the output location of the modified zip file; this defaults to the src parameter, overwriting the original. This isn't used for inner alter sub-tasks. No
    A variation of the alterZip sub-task, designed for use with .war files.

    It has the same parameters and nested elements as alterZip, except for:

    A short-hand for a ZipFileSet that presets the path prefix to WEB-INF/classes/. By default, the "replaceOnly" attribute is set to "true", but this can be altered. A short-hand for a ZipFileSet that presets the path prefix to WEB-INF/lib/.
    A variation of the alterZip sub-task, designed for use with .jar files.

    Currently, there is no difference between this nested element and the alterZip element. Eventually, alterJar will allow for modifications to the META-INF/MANIFEST.MF file (for jobs such as appending to the classpath list, and so on).

    A variation of the alterZip sub-task, designed for use with .ear files.

    Currently, there is no difference between this nested element and the alterZip element. Eventually, alterEar will allow for modifications to the application.xml file (for jobs such as appending to the classpath list, and so on).

    <grobo-rezip> <alterEar src="${outdir}/myapp.ear"> <alterWar src="web1.war"> <lib file="${3rdparty}/GroboCoverage-1.1.0-runtime.jar" /> <classes dir="${coverage.classes}" /> <alterJar src="WEB-INF/lib/myfiles.jar"> <fileset dir="${coverage.classes}"> <includes name="com/my/files/**" /> </fileset> </alterJar> </alterWar> <fileset file="${testdir}/9cactus.war" /> </alterEar> </grobo-rezip> This task alters the contents of ${outdir}/myapp.ear, and replaces the original when complete.

    The contents of the .ear file remain the same, except for web1.war, which gets modified, and a new file, 9cactus.war, gets added to the root of the EAR directory structure.

    web1.war gets modified to reference the code-coverage enabled files. The contents remain the same, except for the following:

    • the required runtime library for GroboCoverage coverage-enabled class files gets included in the WAR file lib directory structure;
    • the coverage-enabled class files replace the originals, but any original class file not coverage-enabled will remain in place (since the non-coverage-enabled files do not exist in ${coverage.classes});
    • the inner jar file, WEB-INF/lib/myfiles.jar gets modified, by replacing the com.my.files package and sub-package classes with the coverage-enabled versions.

    All Tasks

    libgroboutils-java-5.orig/codecoverage/xdocs/v1_design.xml0000644000175000017500000002074407655132712024040 0ustar drazzibdrazzib Code Coverage Design (V1) $Date: 2003/05/04 06:40:10 $ Matt Albrecht
    Overview

    The goal of the codecoverage package is to capture the lines of code that were executed in a Java VM. Thanks to the JPDA (Java Platform Debugger Architecture), Java code can now monitor Java VMs to discover which lines of code were executed.

    This package breaks the general code-coverage problem into three parts:

    • tracker: tracks the remote VM as the code is executed. This is written to a file or other data source for later parsing.
    • counter: discovers the actual number of lines in each class. This output can be written to a file or other data source for later parsing.
    • collator: parses the tracker and counter output, and creates output which displays the actual number of lines, and those which were covered. This depends upon the other two parts.

    This package must be classloader aware. That is, multiple classes with the same name may be loaded in a single VM. Currently, this is handled by calculating the CRC of each class. This not only detects different class files, but also allows the package to detect if there are differences between a tracked class and a counted class.

    Definitions

    As the code coverage package deals with multiple VMs, I need to establish some lingo such that others, as well as myself, may understand more clearly the ideas I am attempting to state. First, I will state the common design. Then, I will assign definitions to the entities in the design.

    The general flow of the application is:

    1. Either the code coverage tool or another tool starts a Java Virtual Machine (VM), which is listening for Java Debug Wire Protocol (JDWP) connections; this VM will execute the Java bytecode which will be analyzed for the code it executes. Let's call this the Remote VM, since it is remote to the code coverage tool.
    2. The code coverage tool is executed within another Virtual Machine. Since this document analyzes the process flow from the perspective of the code coverage tool, let us call this the Local VM.

    Current Design Assumptions

    The current design assumes that the bytecode retrieved by BCEL is identical to the bytecode that JPDA returns. If this assumption fails, then the class checksums won't match, causing the actual class lines not to be found in the counter.

    Recent experiments found that this assumption is wrong. There is a temporary work-around (via ignoring checksums during collation), however a better solution will need to be found.

    Current Poorly Designed Parts

    The IMethodLinesRecord and IClassLinesRecord both merge the marshalling and unmarshalling code together. It is useful in that one can observe from within the same file that one's logic is the reverse of the other. However, this is a poor design choice in that a code section can't tell if a record can read or write. This needs to be split apart (however, the marshall/unmarshall code can remain in the same class, since it will be implementing interfaces).

    Dealing with JPDA Problems

    I have found JPDA to be incredibly flakey as of JDK 1.4:

    1. There is a chance, on entry to any native code, that inspection of the StepEvent encountered by the Local VM will cause the Remote VM JPDA implementation will not understand the stack, causing a VM Death in the Remote VM.

      I have discovered this to occur commonly in calls to System.exit( int ), but it has also occured within java.util.jar.Attributes$Name.isValid: [java] FATAL ERROR in native method: JDWP "stepControl.c" (Feb 7 2002), li ne 152: Unable to get frame location, error code = 32 (JVMDI_ERROR_OPAQUE_FRAME) [java] [java] at java.util.jar.Attributes$Name.isValid(Attributes.java:410) [java] at java.util.jar.Attributes$Name.isValid(Attributes.java:402) [java] at java.util.jar.Attributes$Name.<init>(Attributes.java:390) [java] at java.util.jar.Attributes.putValue(Attributes.java:144) [java] at java.util.jar.Attributes.read(Attributes.java:362) [java] at java.util.jar.Manifest.read(Manifest.java:162) [java] at java.util.jar.Manifest.<init>(Manifest.java:52) [java] at java.util.jar.JarFile.getManifest(JarFile.java:147) [java] at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.jav a:712) [java] at sun.misc.URLClassPath.getLoader(URLClassPath.java:224) [java] - locked <02A937C8> (a sun.misc.URLClassPath) [java] at sun.misc.URLClassPath.getResource(URLClassPath.java:134) [java] at sun.misc.URLClassPath.getResource(URLClassPath.java:144) [java] at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:8 80) [java] at java.lang.ClassLoader.getResource(ClassLoader.java:784) [java] at java.lang.ClassLoader.getResource(ClassLoader.java:782) [java] at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:94 8) [java] at java.lang.Class.getResourceAsStream(Class.java:1284) [java] at org.apache.tools.ant.Main.getAntVersion(Main.java:564) [java] - locked <06B0E6F8> (a java.lang.Class) [java] at org.apache.tools.ant.Main.printVersion(Main.java:555) [java] at org.apache.tools.ant.Main.<init>(Main.java:200) [java] at org.apache.tools.ant.Main.start(Main.java:138) [java] at org.apache.tools.ant.Main.main(Main.java:176) [java] Java Result: 1 [echo] Stopping JUnit.

    2. There are times when the JPDA events received by the Local VM from the Remote VM do not properly portray the suspended state of the Remote VM (this may actually be a result of insufficiently detailed documentation describing what events actually suspend), causing the Local VM to not receive events.
    3. At times, the StepRequest.setEnabled( true ) method will hang. This is currently under investigation.
    4. The "includes" and "excludes" methods for StepRequests fail to work as described.
    Here are the current work-arounds for each part:
    1. The exception is trapped, and interpreted to mean the equivalent of a VM Death notice. Not implemented yet.
    2. If no events have been received over a period of time, then attempts will be made to resume each thread in the Remote VM. "Over a period of time" means that the pull events method does not return any events after a specified number of attempts, and each attempt with a certain time-out period.
    3. A proposed solution will execute the setEnabled call in a separate thread, and kill that thread if it does not return after a period of several seconds. Not implemented yet.
    In the future, these should be abstracted out to per-JPDA implementation classes for a better design.

    JPDA Bugs of Interest
    • - JPDA: vm-wide suspend does not suspend all threads (zombie, dead, new, ...)

      In all likelyhood the thread in question is a zombie thread.

      HotSpot will return a thread status of unknown and a zero suspend status for threads it doesn't know about (which includes threads that haven't run yet, threads being initialized or threads that have completed running). HotSpot will return a thread status of zombie and a zero suspend status for threads being shutdown. The code of ThreadReference has code in it to do it's own accounting for suspends of zombies (this code is currently broken).

      It may be that the correct approach is to spec in all interfaces (JVMDI/JDWP/JDI) that new/zombie threads cannot be suspended (or "may" be incapable of being suspended).

    libgroboutils-java-5.orig/codecoverage/xdocs/v2_antdoc_coveragereport.xml0000644000175000017500000002601210034416205027124 0ustar drazzibdrazzib CoverageReport: GroboCoverage Ant Tasks $Date: 2004/04/06 02:57:09 $ Matt Albrecht

    All Tasks

    deprecated - use grobo-report instead.

    Generates an XML report describing all the coverage tallies for the classes that were logged during runtime execution. The report combines the runtime coverage logs with the post-compilation generated data. One report is created per analysis module. Currently, this task supports all included channel outputs (DirectoryChannelLoggerFactory, CacheDirChannelLoggerFactory, and MinDirChannelLoggerFactory).

    Generates one HTML file for each analysis module, which look something like this. Used to pass a parameter to the underlying XSL stylesheet. The usage is exactly like the param structure for the style Ant task. name Name of the XSL parameter Yes expression Text value to be placed into the param. Yes if The param will only pass if this property is set. No if The param will only pass unless this property is set. No prefix The text to prepend all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. No suffix The text to append to all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. Default suffix is .html. No destdir The output directory to place the HTML files. Default directory is .. No removeEmpty A boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No Generates a JavaDoc-like collection of HTML files for all the analysis modules, linking the coverage reports to the source files. This report shows the contents of the source files and highlights whichever lines were not covered. title The title text to be placed on the top of every HTML file. Default is Summary Coverage Report. No srcdir Directory containing the source files. Yes destdir The output directory to place the HTML files. Default directory is .. No footertext Text to be put at the bottom of every center frame's page (default is an advertisement for GroboUtils). No footerhref Link to have the footertext point to (default is an advertisement for GroboUtils). No stylesheet Stylesheet file to use in replacement of the default. No removeEmpty A boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No In addition to the srcdir attribute, you can include multiple source directories for searching. The first directory containing the source file will be used in the report. name The name of the directory containing a source tree. Yes datadir The name of the directory to read the analysis module generated data from. This same directory should be specified in the coveragepostcompiler task's datadir attribute as well. Yes logDir The name of the directory to read the log output generated from running the code. This same directory should be specified in the grobocoverage.properties file. Yes outdir The name of the directory that will contain the generated XML documents. Yes reportfileprefix Text that will prepend each outputted XML document's file name (default is Coverage-). No reportfileextension Text that will append each outputted XML document's file name (default is .xml). No failonerror Boolean describing if an error in this task should cause the build to fail (default is false). No <coveragereport datadir="${dirs.test-output}/coverage-data" logdir="${dirs.test-output}/coverage-log" outdir="${dirs.test-output}"> </coveragereport> The <coveragereport> task generates one .xml file for each analysis module that has data in the ${dirs.test-output}/coverage-data directory, using the runtime log data found in the ${dirs.test-output}/coverage-log directory. It also places in the same directory an .xml file that contains all the analysis module data. <coveragereport datadir="${dirs.test-output}/coverage-data" logdir="${dirs.test-output}/coverage-log" outdir="${dirs.test-output}"> <simplestyle destdir="${dirs.test-output}" removeempty="true" /> <sourcestyle destdir="${dirs.test-output}/source-report" removeempty="true" srcdir="src" title="Summary Coverage Report of My Code"> <srcdir name="${dirs.temp}/generated-source-1" /> <srcdir name="${dirs.temp}/generated-source-2" /> </sourcestyle> </coveragereport> Same as above, but this also generates two human-readable reports. The first (simplestyle) generates one HTML file in the ${dirs.test-output} directory for each analysis module XML report. The generated file will look something like this.

    The second (sourcestyle) generates a directory hierarchy of framed HTML pages in the ${dirs.test-output}/source-report directory. It links the original Java source files into the HTML by looking in the directories src, ${dirs.temp}/generated-source-1, and ${dirs.temp}/generated-source-2 for the source files corresponding to the covered class files, in that order.

    All Tasks

    libgroboutils-java-5.orig/codecoverage/xdocs/cactus-sample-build.xml.txt0000644000175000017500000004233407760263620026634 0ustar drazzibdrazzib Missing property or property pointing to an invalid file (check your build.properties file) At least one test failed! libgroboutils-java-5.orig/codecoverage/xdocs/whats_new.xml0000644000175000017500000000631010040164710024132 0ustar drazzibdrazzib What's New With CodeCoverage $Date: 2004/04/17 08:24:40 $ Matt Albrecht
    v1.1.0

    The source-linked report has been changed to look "neater". Also, the documentation has been improved to be (hopefully) more useful.

    The "grobocoverage.properties" file, used for loading the Ant tasks, has moved to the root directory and has a new name. Now, you can load the tasks with:

        <taskdef resource="ant-grobocoverage.properties"/>
    
    Using this file will allow for the use of the new Ant tasks (the old ones are deprecated, but still exist).

    These new Ant tasks are:

      replaces coveragepostcompiler similar to the original, but includes more robust support for handling existing post-compiled class files and their data files. replaces coveragereport a bit like the original, but now better supports custom reporting styles, and failure cases (where the coverage totals do not meet the build requirements). allows for the updating of zip-like files, similar to the original Ant <zip> task, but also supports updating zips within zips (for EAR file support). This allows deployable archives to be easily modified to gather coverage numbers during unit tests.

    Migration path for the new tasks:

      Remove the "datadir" attribute. Change the "logdir" attribute to point to the base directory of both the old "datadir" and "logdir". Change "outputclassdir" to "destdir". Replace the <logsettings> tag with a "logger" attribute. Remove the "datadir" attribute. Change the "logdir" attribute to point to the base directory of both the old "datadir" and "logdir". Remove the "outdir" attribute. Strip off the "style" part of the name from the "simplestyle" and "sourcestyle" tags.
    This is just an outline. See their corresponding Ant documentation for more details.

    v1.0.0

    There haven't been changes to the Ant tasks, but the generated reports and code coverage collectors have been improved to get more accurate results.

    v1.0.0RC4

    As of version 1.0.0RC4, the <coveragereport> task can now performs the style operation. It also generates another XML report that contains all the coverage reports in one. Another style has been created, that generates a JavaDoc-like website that links the source code to the coverage reports.

    libgroboutils-java-5.orig/codecoverage/xdocs/requirements.xml0000644000175000017500000000527307655132712024704 0ustar drazzibdrazzib Requirements $Date: 2003/05/04 06:40:10 $ Matt Albrecht Create one or more Java tools which:
    1. Generate code coverage information for an execution of one or more Java classes. Code Coverage refers to a collection of data based on source files, class files, and step tracing of the execution:
      1. which unique source lines and/or bytecode instructions that were visited within the execution process for each class under consideration.
      2. source lines and/or bytecode instructions that exist within the classes under consideration.
      A class is classified as "under consideration" if the user specifies that the class is to be included in the code coverage statistics results.
    2. The two types of data above must be stored external to the tools. This allows for greater performance, and easier bug checking. It also leads to a more UN*X like tool chain.
    3. Generate statistics based on the the collected code coverage data:
      1. ratio between the number of unique lines that were visited in the execution process to the number of lines in the classes under consideration, grouped by methods.
      2. ratio between the number of bytecode instructions that were visited in the execution process to the number of bytecode instructions in the classes under consideration, grouped by methods.
      3. Additional statistics derived from the above data. This includes per package, per class, and per method breakdown of the statistics. Also included is ratios of covered lines to total lines.
    4. The tools must be aware of the ClassLoader considerations: different classes with the same name may be loaded by separate ClassLoaders. Thus, the tools must have a method to discover differences between classes other than class name alone.
    5. The tools must generate a final human-readable document, preferably HTML.
    6. There is no restriction in the requirements as to the earliest model of a JVM. This is left as an implementation detail.
    libgroboutils-java-5.orig/codecoverage/xdocs/complex_setup.xml0000644000175000017500000001547310040164710025034 0ustar drazzibdrazzib Integrating GroboCoverage With Complex Build Environments $Date: 2004/04/17 08:24:40 $ Matt Albrecht
    Overview

    This document attempts to describe what changes to the build file need to happen before you can get code-coverage reports with GroboCoverage.

    The document will follow the generation of coverage numbers for an EJB site that uses Cactus to execute its JUnit tests. For simplicity, this will modify the sample application that comes packaged with Cactus (version 1.5, J2EE 1.2).

    You can see the original version here, and the coverage-enabled version here.

    Setup

    You can download the Cactus package from the Jakarta binaries page. The sample application is located in the jakarta-cactus-12-1.5/samples/servlet directory.

    You need to first copy the GroboCoverage libraries (GroboCodeCoverage-1.1.0-ant.jar and GroboCodeCoverage-1.1.0-runtime.jar) into the jakarta-cactus-12-1.5/lib directory so that our modified build file can reference it.

    The build file will need more target directories:

      <property name="target.classes.coverage.dir"
          location="${target.classes.dir}/coverage"/>
      <property name="target.coverage.dir"
          location="${target.dir}/coverage"/>
      <property name="target.coveragereports.dir"
          location="${target.dir}/coverage-reports"/>
    
    We also need to add a reference to the GroboCoverage runtime library:
      <property name="grobocoverage.jar"
          location="../../lib/GroboCodeCoverage-1.1.0-runtime.jar"/>
    
    Then, right after the Cactus taskdef, we'll define the additional coverage tasks:
      <taskdef resource="ant-grobocoverage.properties"
            classpath="../../lib/GroboCodeCoverage-1.1.0-ant.jar" />
    

    We also need a new target for post-compiling the Java class files:

      <!-- Instruments the java sources -->
      <target name="postcompile.java" depends="compile.java">
        
        <mkdir dir="${target.classes.coverage.dir}"/>
        <grobo-instrument logdir="${target.coverage.dir}"
            destdir="${target.classes.coverage.dir}"
            logger="fast">
          <fileset dir="${target.classes.java.dir}" />
          <measure type="linecount" />
        </grobo-instrument>
      </target>
    
    which requires the "compile" target to change:
      <target name="compile" depends="compile.java, compile.cactus, postcompile.java"
          description="Compile the sources"/>
    
    and the "test.prepare" target to also change its dependencies:
      <target name="test.prepare" 
          depends="war, compile.cactus, postcompile.java, test.prepare.logging">
    

    Let's go ahead and add in the report generation steps after the <junitreport> tasks have run:

        <grobo-report logdir="${target.coverage.dir}">
          <source destdir="${target.coveragereports.dir}" removeempty="true"
              srcdir="${src.dir}" title="Sample Cactus Coverage Report" />
        </grobo-report>
    
    This puts the source-linked report into the "target/coverage-reports" directory. This means that the report directory must already exist. So, at the end of the "test.prepare" target, add the lines:
        <!-- Prepare the directories for the coverage reports -->
        <mkdir dir="${target.coveragereports.dir}"/>
    
    which will keep an I/O exception from being thrown during the report generation phase.

    Augmenting The War File

    So far, the changes to the build file have post-compiled the Java class files and generated a report.

    The hard part still remains: alter the deployed war file so that it uses the post-compiled class files before it uses the Java class files.

    Fortunately, this example "cactifies" the war file, so that the unit tests use a different war file than the distributable one.

    Also, GroboCoverage provides a task that helps modify existing zip files. Add this immediately after the <cactifywar> task runs:

        
        <grobo-rezip>
            <alterWar src="${target.dir}/${project.name.file}-cactified.war"
                dest="${target.dir}/${project.name.file}-cactified-covered.war">
              <classes dir="${target.classes.coverage.dir}" />
              <lib file="${grobocoverage.jar}" />
            </alterWar>
        </grobo-rezip>
    
    In this case, all we're modifying is the WAR file itself; a judicious use of a <zip> task could have accomplished the same thing. However, if instead of a WAR file, it used an EAR file, we'd have to unzip the EAR, alter the WAR, and rezip the EAR. Not too much fun.

    Or, we could have put these classes and lib files into the <cactifywar> task. However, the rezip task was used for the sake of showing how to integrate GroboCoverage into complex sites, not just Cactus sites.

    Then, we need to modify the <cactus> task. First, we replace the referenced war file:

        <cactus warfile="${target.dir}/${project.name.file}-cactified-coverage.war"
    
    then alter the classpath so that it uses the post-compiled classes before the originals, and includes the GroboCoverage library file:
          <classpath>
            <path refid="project.classpath"/>
            <pathelement location="${httpunit.jar}"/>
            <pathelement location="${nekohtml.jar}"/>
            <pathelement location="${target.classes.coverage.dir}"/>
            <pathelement location="${target.classes.java.dir}"/>
            <pathelement location="${target.classes.cactus.dir}"/>
            <pathelement location="${log4j.jar}"/>
            <pathelement location="${grobocoverage.dir}"/>
          </classpath>
    
    (yes, I chopped out that clover.jar reference; yuck!)

    What We Learned

    What did we learn from this lesson? If you attempt to gather code-coverage numbers from a deployed process, you need to make another deployable file using the post-compiled classes, rather than the originals. Also, to ensure that the client-side part of the tests have coverage numbers gathered, the same classpath steps must be taken as usual.

    libgroboutils-java-5.orig/codecoverage/xdocs/getting_started.xml0000644000175000017500000002216310040560331025325 0ustar drazzibdrazzib Using GroboCoverage With Ant $Date: 2004/04/18 20:11:05 $ Matt Albrecht
    Getting Started

    This document describes how to get up and running with simple build files. The ant task guide describes each Ant task in detail. If your build environment is "complex", then this document should help your more basic questions. If you need more detailed information regarding the operation of GroboCoverage, try this document.

    Downloading the GroboCoverage Files

    Before you get started, download the latest GroboCoverage zip file (you can find it here), which, at the time of this document, is called GroboUtils-5-codecoverage.zip.

    Inside are two JAR files, the "ant" and "runtime" code-coverage files. The "ant" file contains the code-coverage files required for compiling the coverage probes into your class files and all the dependent libraries, while the "runtime" jar only contains those class files necessary to run the recompiled class files.

    Changing Your Ant Build File

    To test with the coverage-enabled class files, you'll need to change your build files.

    Referencing the New Tasks

    First off, before using any of the provided Ant tasks, you'll need to tell Ant about them. You have two options:

    1. Copy --ant.jar to the lib directory of your Ant installation. Then add the next lines to your build file before you reference the tasks:
      <taskdef resource="ant-grobocoverage.properties"/>
      
    2. Keep --ant.jar in a separate location. You now have to tell Ant explicitly where to find it (say in /usr/share/java/lib):
      <taskdef resource="ant-grobocoverage.properties">
        <classpath>
          <pathelement location="/usr/share/java/lib/--ant.jar"/>
        </classpath>
      </taskdef>
      

    In order to use the <grobo-report> task, you need to have a Xalan-2 compatible XSL processor in the classpath. If one is not in your Ant classpath, then it needs to be referenced in the <taskdef> classpath. Ant versions 1.5 and above come with one by default.

    Post-Compile Your Classes

    Next, you'll need to "post-compile" your classes, after they've been compiled. This "post-compilation" stage inserts probes into your class files to tell when lines of code have been encountered.

    Since post-compilation makes different class files that will most probably be slower than the original, the author recommends putting these into a different directory, separate from the original class files.

    So, let's say you have a compilation step that looks like this:

        <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on">
            <classpath>
                <path refid="classpath.base" />
            </classpath>
        </javac>
    
    You would then add after it the <grobo-instrument> task:
        <grobo-instrument logdir="coverage/logs" logger="fast"
                destdir="coverage/classes">
            <fileset dir="${classes.dir}">
                <exclude name="dont/check/coverage/*.class" />
            </fileset>
            
            <measure type="linecount" />
            <measure type="function" />
        </grobo-instrument>
    
    which would put all the coverage-enabled class files into the coverage/classes directory. It will insert probes into the classes to check for Java code-lines executed, and which Java functions were called, but only for the classes that were post-compiled. In this case, none of the classes in the package "dont.check.coverage" were post-compiled. Also, this task puts all the data discovered for the compilation into the coverage/data directory. It also sets up the logging properties in the output classes directory, describing the directory to put the log files in, and to use the "fast" logger.

    This task is described in the Ant task documentation.

    Note: if you want the coverage report to include line numbers (showing a trace back to the original Java source files), then you must enable debugging during the <javac> task. See the Ant task reference for details.

    Running Your Tests With the Post-Compiled Classes

    If you want to run your tests with code coverage enabled, and you're using JUnit, here's an easy method.

    Let's say you run your tests with JUnit using the optional Ant junit task like this:

        <junit printsummary="yes" fork="yes" dir="${test-output.dir}">
            <classpath>
                <pathelement location="${classes.dir}" />
                <pathelement location="${test-classes.dir}" />
                <path refid="classpath.base" />
            </classpath>
            <formatter type="xml" usefile="yes" />
            <batchtest todir="${test-output.dir}">
                <fileset dir="${test-classes.dir}">
                    <include name="*Test.class" />
                </fileset>
            </batchtest>
        </junit>
    
    Since the post-compilation step above only puts coverage-enabled versions of the specified classes into the directory coverage/classes, this class directory, then, doesn't contain any special files or classes excluded from coverage. So, we need to tell the JUnit task to reference these covered classes, but also to include the other files. We do this by replacing the JUnit task's classpath with this:
            <classpath>
                <pathelement location="coverage/classes" />
                <pathelement location="${classes.dir}" />
                <pathelement location="${test-classes.dir}" />
                <path refid="classpath.base" />
                <pathelement location="--runtime.jar" />
            </classpath>
    
    We added the coverage-enabled classes before everything else (so they have priority in the class loader), and we also added the runtime jar, as the coverage-enabled classes require these to run.

    The <grobo-instrument> task told the logger running these tests will put all the coverage log information into the coverage/logs directory, and to use the "fast" logger.

    Generating a Report

    Now that coverage numbers are being generated, we need to add in additional Ant script to generate a coverage-number report.

    If you're using the <junit> task, then you're probably also using the <junitreport> task. If not, check it out. The ant documentation for it can be found here

    Whether you use the <junitreport> task or not, we can add in the coverage report task after the <junit> task, when the reports should be generated:

        <grobo-report logdir="coverage/logs">
            <simple destdir="coverage" removeempty="true" />
            <source destdir="coverage/source-report" removeempty="true"
                srcdir="src" title="Summary Coverage Report of My Code" />
        </grobo-report>
    
    The <grobo-report> task takes all the different generated data from the data and log directories (as specified in the <grobo-instrument> task above) and generates reports.

    The embedded style tags define what kind of reports to generate. The "simple" tag generates one HTML file for each measure, and the "source" tag generates a JavaDoc-style collection of web pages that link the Java souce code to the coverage reports.

    On large class-file systems, this report generator may consume large amounts of memory. If you see Ant generate an OutOfMemoryError, then you can increase the amount of memory that the JVM uses with the environment variable ANT_OPTS. For instance, to increase the memory usage to 128 MB, on a 1.4 JVM, you would use:

        > set ANT_OPTS=-Xmx128M
    
    on Windows, and
        $ ANT_OPTS=-Xmx128M
        $ export ANT_OPTS
    
    on the Bourne shell.

    libgroboutils-java-5.orig/codecoverage/xdocs/CoverageReport-LineCount.html0000644000175000017500000111226607713530155027152 0ustar drazzibdrazzib Code Coverage Report - LineCount

    Coverage Report for LineCount

    All units are in lines.

    Totals

    CoveredTotal% Covered
    All Packages1,1251,45677.27

    All Packages

    PackageCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.ant1915312.42
    net.sourceforge.groboutils.codecoverage.v2.report16626363.12
    net.sourceforge.groboutils.codecoverage.v2.module14316288.27
    net.sourceforge.groboutils.codecoverage.v2.datastore45050888.58
    net.sourceforge.groboutils.codecoverage.v2.compiler32534893.39
    net.sourceforge.groboutils.codecoverage.v2.util2222100.00
    net.sourceforge.groboutils.codecoverage.v200100.00

    Classes By Package

    Package net.sourceforge.groboutils.codecoverage.v2

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData00100.00
    net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule00100.00
    net.sourceforge.groboutils.codecoverage.v2.IChannelLogger00100.00
    net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory00100.00
    net.sourceforge.groboutils.codecoverage.v2.IChannelLogReader00100.00
    net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord00100.00
    net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader00100.00
    net.sourceforge.groboutils.codecoverage.v2.IMethodCode00100.00

    Package net.sourceforge.groboutils.codecoverage.v2.ant

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask$ClassFile050.00
    net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask0630.00
    net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask0630.00
    net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType192286.36

    Package net.sourceforge.groboutils.codecoverage.v2.compiler

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger445284.62
    net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass222491.67
    net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass838993.26
    net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList606493.75
    net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode343694.44
    net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod454697.83
    net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction2424100.00
    net.sourceforge.groboutils.codecoverage.v2.compiler.MeasureMark1212100.00
    net.sourceforge.groboutils.codecoverage.v2.compiler.NullInstruction11100.00

    Package net.sourceforge.groboutils.codecoverage.v2.datastore

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord293778.38
    net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter192479.17
    net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO556979.71
    net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader172180.95
    net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO8210082.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule7887.50
    net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet555993.22
    net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil283093.33
    net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSetIO262796.30
    net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord585998.31
    net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO$StaleAnalysisMetaData77100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO1212100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO1313100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader1919100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter2323100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataReader00100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataWriter00100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader00100.00
    net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataWriter00100.00

    Package net.sourceforge.groboutils.codecoverage.v2.module

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil476671.21
    net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure2929100.00
    net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure99100.00
    net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure1313100.00
    net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData99100.00
    net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure77100.00
    net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure2929100.00

    Package net.sourceforge.groboutils.codecoverage.v2.report

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount51827.78
    net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData82138.10
    net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator368940.45
    net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$DidCover4666.67
    net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet243275.00
    net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet414591.11
    net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet222491.67
    net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter262892.86
    net.sourceforge.groboutils.codecoverage.v2.report.IReportGenerator00100.00

    Package net.sourceforge.groboutils.codecoverage.v2.util

    ClassCoveredTotal% Covered
    net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil1010100.00
    net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil1212100.00

    Methods By Class

    Class net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType

    MethodCoveredTotal% Covered
    getRef()Lnet/sourceforge/groboutils/codecoverage/v2/ant/AnalysisModuleType;010.00
    getAnalysisModule()Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;7977.78
    <init>()V11100.00
    setName(Ljava/lang/String;)V11100.00
    <clinit>()V1010100.00

    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask$ClassFile

    MethodCoveredTotal% Covered
    <init>(Ljava/io/File;Ljava/lang/String;)V050.00

    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    MethodCoveredTotal% Covered
    <init>()V050.00
    addFileSet(Lorg/apache/tools/ant/types/FileSet;)V010.00
    setDataDir(Ljava/io/File;)V010.00
    setOutClassDir(Ljava/io/File;)V010.00
    createAnalysisModule()Lnet/sourceforge/groboutils/codecoverage/v2/ant/AnalysisModuleType;030.00
    execute()V0240.00
    getAnalysisModules()[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;090.00
    getFilenames()[Lnet/sourceforge/groboutils/codecoverage/v2/ant/CoveragePostCompilerTask$ClassFile;0150.00
    readFile(Ljava/io/File;)[B040.00

    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    MethodCoveredTotal% Covered
    <init>()V070.00
    setDataDir(Ljava/io/File;)V010.00
    setLogDir(Ljava/io/File;)V010.00
    setOutDir(Ljava/io/File;)V010.00
    setReportFilePrefix(Ljava/lang/String;)V010.00
    setReportFileExtension(Ljava/lang/String;)V010.00
    setFailOnError(Z)V010.00
    execute()V0310.00
    createReport(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/report/AnalysisModuleData;Lnet/sourceforge/groboutils/codecoverage/v2/report/IReportGenerator;)Z0110.00
    createReportFile(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Ljava/io/File;030.00
    createChannelLogReader(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogReader;030.00
    createMetaDataReader()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataReader;020.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    MethodCoveredTotal% Covered
    <init>(SLnet/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedMethod;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)V151788.24
    getOriginalMethod()Lorg/apache/bcel/classfile/Method;11100.00
    getMethodName()Ljava/lang/String;11100.00
    getClassName()Ljava/lang/String;11100.00
    getInstructionCount()I11100.00
    getInstructionAt(I)Lorg/apache/bcel/generic/Instruction;44100.00
    markInstruction(ILnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;)V99100.00
    toString()Ljava/lang/String;11100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    MethodCoveredTotal% Covered
    <init>(SIILorg/apache/bcel/generic/InstructionHandle;)V99100.00
    getMarkedList()Lorg/apache/bcel/generic/InstructionList;1010100.00
    getInstruction()Lorg/apache/bcel/generic/Instruction;11100.00
    addMark(SS)V22100.00
    getHandle()Lorg/apache/bcel/generic/InstructionHandle;11100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MeasureMark

    MethodCoveredTotal% Covered
    <init>(IISSS)V66100.00
    addToInstructionList(Lorg/apache/bcel/generic/InstructionList;)V55100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    MethodCoveredTotal% Covered
    checkClose()V1250.00
    addClassSignature(Lorg/apache/bcel/generic/ConstantPoolGen;)V4666.67
    updateChecksum([B)V2366.67
    addMethodRef(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;Lorg/apache/bcel/generic/ConstantPoolGen;)V4580.00
    getModifiedClass()[B91090.00
    <init>(Ljava/lang/String;[B)V11100.00
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;Ljava/lang/String;[B)V55100.00
    getClassName()Ljava/lang/String;11100.00
    getClassCRC()J11100.00
    getClassSignature()Ljava/lang/String;11100.00
    createClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;55100.00
    getMethods()[Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedMethod;1212100.00
    updateClass()V1818100.00
    updateClassGen(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;[BLjava/lang/String;)V77100.00
    allowModification(Lorg/apache/bcel/classfile/Method;)Z77100.00
    isMarkable(Lorg/apache/bcel/classfile/Method;)Z11100.00
    createSignature(Lorg/apache/bcel/classfile/Method;)Ljava/lang/String;22100.00
    <clinit>()V22100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    MethodCoveredTotal% Covered
    isValidInstructionList(Lorg/apache/bcel/generic/InstructionList;)Z3475.00
    updateInstructionList()V141687.50
    <init>(SIILorg/apache/bcel/generic/InstructionList;)V101190.91
    getInstructionCount()I22100.00
    getInstructionAt(I)Lnet/sourceforge/groboutils/codecoverage/v2/compiler/MarkedInstruction;22100.00
    close()V55100.00
    setupMarkList()V77100.00
    checkClose()V22100.00
    updateTargeters(Lorg/apache/bcel/generic/InstructionHandle;Lorg/apache/bcel/generic/InstructionHandle;)V77100.00
    isSpecialtyTarget(Lorg/apache/bcel/generic/InstructionTargeter;Lorg/apache/bcel/generic/InstructionHandle;)Z77100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    MethodCoveredTotal% Covered
    createInstructionList()V3475.00
    <init>(SIILorg/apache/bcel/classfile/JavaClass;Lorg/apache/bcel/classfile/Method;Lorg/apache/bcel/generic/MethodGen;)V1010100.00
    getMethodIndex()S11100.00
    getMethodName()Ljava/lang/String;11100.00
    getInstructionList()Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedInstructionList;44100.00
    getOriginalClass()Lorg/apache/bcel/classfile/JavaClass;11100.00
    getOriginalMethod()Lorg/apache/bcel/classfile/Method;11100.00
    canAddMarks()Z11100.00
    getModifiedMethodGen()Lorg/apache/bcel/generic/MethodGen;22100.00
    getNewMethod()Lorg/apache/bcel/classfile/Method;33100.00
    close()V1515100.00
    checkClose()V22100.00
    adjustStartPC()V00100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.NullInstruction

    MethodCoveredTotal% Covered
    <init>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    MethodCoveredTotal% Covered
    getType(Ljava/lang/Class;)Lorg/apache/bcel/generic/Type;111764.71
    storeData(Ljava/lang/String;Ljava/lang/String;)V5771.43
    <init>()V22100.00
    <init>(Ljava/lang/Class;Ljava/lang/String;)V55100.00
    getClassName()Ljava/lang/String;11100.00
    getMethodName()Ljava/lang/String;11100.00
    getMethodSignature()Ljava/lang/String;11100.00
    parseCoverageLoggerType(Ljava/lang/Class;Ljava/lang/String;)V1111100.00
    createSignature([Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/String;55100.00
    <clinit>()V22100.00

    Class net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass

    MethodCoveredTotal% Covered
    postCompile(Ljava/lang/String;[BLjava/io/OutputStream;)V151788.24
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataWriter;[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V11100.00
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataWriter;[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V66100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO$StaleAnalysisMetaData

    MethodCoveredTotal% Covered
    <init>(Ljava/lang/String;Ljava/lang/String;B)V44100.00
    getCoveredFormattedText()Ljava/lang/String;11100.00
    getNotCoveredFormattedText()Ljava/lang/String;11100.00
    getInstructionWeight()B11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO

    MethodCoveredTotal% Covered
    <init>()V11100.00
    writeAnalysisMetaData(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;Ljava/io/Writer;)V33100.00
    readAnalysisMetaData(Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;88100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule

    MethodCoveredTotal% Covered
    analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V010.00
    <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V44100.00
    getMeasureName()Ljava/lang/String;11100.00
    getMeasureUnit()Ljava/lang/String;11100.00
    getMimeEncoding()Ljava/lang/String;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO

    MethodCoveredTotal% Covered
    <init>()V11100.00
    writeAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/io/Writer;)V33100.00
    readAnalysisModule(Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;99100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    MethodCoveredTotal% Covered
    addAnalysisModules([Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V3475.00
    getAnalysisModuleAt(S)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;3475.00
    getAnalysisModules()[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;5683.33
    addAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V111291.67
    <init>()V33100.00
    <init>([Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V66100.00
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V66100.00
    joinAnalysisModuleSet(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V88100.00
    getMeasureIndex(Ljava/lang/String;)S66100.00
    getAnalysisModuleIndex(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)S33100.00
    getAnalysisModuleCount()I11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSetIO

    MethodCoveredTotal% Covered
    readAnalysisModuleSet(Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;141593.33
    <init>()V11100.00
    writeAnalysisModuleSet(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Ljava/io/Writer;)V1111100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    MethodCoveredTotal% Covered
    getMarksForAnalysisModule(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;5683.33
    <init>(Ljava/lang/String;J[Ljava/lang/String;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V2020100.00
    getClassName()Ljava/lang/String;11100.00
    getClassCRC()J11100.00
    getClassSignature()Ljava/lang/String;11100.00
    getAnalysisModuleSet()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;11100.00
    getMethods()[Ljava/lang/String;44100.00
    getMethodIndex(Ljava/lang/String;)S66100.00
    getMethodCount()I11100.00
    getMethodAt(S)Ljava/lang/String;44100.00
    addMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V1313100.00
    getMarksForAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    MethodCoveredTotal% Covered
    readMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;090.00
    readMarks(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Ljava/io/Reader;)V71258.33
    <init>()V11100.00
    writeClass(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Ljava/io/Writer;)V1111100.00
    readClass(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;1313100.00
    writeMarksForAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/io/Writer;)V11100.00
    writeMarksForMeasure(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Ljava/lang/String;Ljava/io/Writer;)V1010100.00
    writeMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;Ljava/io/Writer;)V1212100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    MethodCoveredTotal% Covered
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataIO;)V66100.00
    readClass(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;44100.00
    getClassSignatures()[Ljava/lang/String;22100.00
    close()V22100.00
    checkClose()V22100.00
    finalize()V33100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    MethodCoveredTotal% Covered
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataIO;)V66100.00
    writeClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)V55100.00
    close()V22100.00
    getAMClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;55100.00
    checkClose()V22100.00
    finalize()V33100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    MethodCoveredTotal% Covered
    getClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;010.00
    checkClosed()V1250.00
    <init>(Ljava/io/File;)V5862.50
    getClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;162176.19
    putAnalysisModuleSet(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V7977.78
    putClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)V111478.57
    getAnalysisModuleDir(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Ljava/io/File;5683.33
    getClassSigsForAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)[Ljava/lang/String;7887.50
    getAnalysisModuleSet()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;91090.00
    getAnalysisModuleSetFile()Ljava/io/File;22100.00
    getClassDataFileForModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Ljava/io/File;33100.00
    getClassMarkFileForModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Ljava/io/File;33100.00
    close()V22100.00
    isClosed()Z11100.00
    finalize()V77100.00
    <clinit>()V33100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    MethodCoveredTotal% Covered
    close()V030.00
    checkClose()V1250.00
    <init>(Ljava/io/File;)V44100.00
    getClassReader(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataReader;44100.00
    getAnalysisModuleSet()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;22100.00
    finalize()V66100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    MethodCoveredTotal% Covered
    checkClose()V1250.00
    finalize()V4666.67
    <init>(Ljava/io/File;)V3475.00
    getClassWriter(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataWriter;4580.00
    close()V33100.00
    addModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V44100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataReader

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataWriter

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReader

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataWriter

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    MethodCoveredTotal% Covered
    hashCode()I010.00
    toString()Ljava/lang/String;010.00
    processMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V4666.67
    getAnalysisModuleIndex()S2366.67
    equals(Ljava/lang/Object;)Z6875.00
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;Ljava/lang/String;Ljava/lang/String;S)V101190.91
    getAnalysisMetaData()Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;11100.00
    getAnalysisModule()Ljava/lang/String;11100.00
    getMethodSignature()Ljava/lang/String;11100.00
    getMethodIndex()S33100.00
    getMarkIndex()S11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil

    MethodCoveredTotal% Covered
    <init>()V010.00
    readCount(Ljava/io/Reader;I)Ljava/lang/String;101190.91
    readTo(Ljava/io/Reader;C)Ljava/lang/String;88100.00
    toInt(Ljava/lang/String;)I55100.00
    toLong(Ljava/lang/String;)J55100.00

    Class net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IChannelLogger

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactory

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IChannelLogReader

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecord

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReader

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.IMethodCode

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    MethodCoveredTotal% Covered
    <init>()V11100.00
    getMeasureName()Ljava/lang/String;11100.00
    getMeasureUnit()Ljava/lang/String;11100.00
    getMimeEncoding()Ljava/lang/String;11100.00
    analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V2121100.00
    markTarget(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;Lorg/apache/bcel/generic/InstructionHandle;Lnet/sourceforge/groboutils/codecoverage/v2/module/BytecodeLineUtil;Ljava/lang/String;)V22100.00
    createBranchData(Ljava/lang/String;II)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;11100.00
    createElseData(IILjava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    MethodCoveredTotal% Covered
    <init>()V11100.00
    getMeasureName()Ljava/lang/String;11100.00
    getMeasureUnit()Ljava/lang/String;11100.00
    getMimeEncoding()Ljava/lang/String;11100.00
    analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V44100.00
    createAnalysisMetaData(I)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    MethodCoveredTotal% Covered
    <init>(Lorg/apache/bcel/classfile/Method;)V040.00
    getInstructionPosForBytecodePos(I)I5955.56
    sort(Lorg/apache/bcel/classfile/LineNumberTable;)[Lorg/apache/bcel/classfile/LineNumber;101662.50
    getLineNumber(Lorg/apache/bcel/generic/InstructionHandle;)I2366.67
    getLineNumberForInstructionPos(I)I2366.67
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V3475.00
    initialize(Lorg/apache/bcel/classfile/Method;)V5683.33
    getLinenoForBytePos([Lorg/apache/bcel/classfile/LineNumber;I)I5683.33
    getHandles()[Lorg/apache/bcel/generic/InstructionHandle;11100.00
    getLineNumberForBytecodePos(I)I22100.00
    getInstructionPositions(Lorg/apache/bcel/classfile/Method;)[I88100.00
    getInstructionLines([Lorg/apache/bcel/classfile/LineNumber;[I)[I44100.00

    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    MethodCoveredTotal% Covered
    <init>()V11100.00
    getMeasureName()Ljava/lang/String;11100.00
    getMeasureUnit()Ljava/lang/String;11100.00
    getMimeEncoding()Ljava/lang/String;11100.00
    analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V88100.00
    createMetaData(II)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData

    MethodCoveredTotal% Covered
    <init>(Ljava/lang/String;Ljava/lang/String;B)V66100.00
    getCoveredFormattedText()Ljava/lang/String;11100.00
    getNotCoveredFormattedText()Ljava/lang/String;11100.00
    getInstructionWeight()B11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    MethodCoveredTotal% Covered
    <init>()V11100.00
    getMeasureName()Ljava/lang/String;11100.00
    getMeasureUnit()Ljava/lang/String;11100.00
    getMimeEncoding()Ljava/lang/String;11100.00
    analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V22100.00
    createAnalysisMetaData(Ljava/lang/String;Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    MethodCoveredTotal% Covered
    <init>()V11100.00
    getMeasureName()Ljava/lang/String;11100.00
    getMeasureUnit()Ljava/lang/String;11100.00
    getMimeEncoding()Ljava/lang/String;11100.00
    analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V2222100.00
    createAnalysisMetaData(Lorg/apache/bcel/classfile/LineNumber;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;22100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    MethodCoveredTotal% Covered
    getClassRecord(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;010.00
    getAllClassMarks(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;010.00
    getChannelLogRecords(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord;080.00
    createClassMarkSet(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet;030.00
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataReader;Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogReader;)V66100.00
    getClassSignatures()[Ljava/lang/String;22100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$DidCover

    MethodCoveredTotal% Covered
    toString()Ljava/lang/String;010.00
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V3475.00
    cover()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    MethodCoveredTotal% Covered
    addMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V4666.67
    <init>(Ljava/lang/String;S)V44100.00
    getMethodName()Ljava/lang/String;11100.00
    getMethodIndex()S11100.00
    coverMark(S)V44100.00
    getMark(S)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$DidCover;11100.00
    getMarksOfType(Z)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;77100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    MethodCoveredTotal% Covered
    getMethodCount()I010.00
    getMethodIndex(Ljava/lang/String;)S040.00
    getMethodByIndex(S)Ljava/lang/String;4580.00
    <init>([Ljava/lang/String;[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V161888.89
    getMethodNames()[Ljava/lang/String;11100.00
    nameIterator()Ljava/util/Iterator;11100.00
    get(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MarkSet;11100.00
    get(S)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MarkSet;11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    MethodCoveredTotal% Covered
    getCoveredMarksForMethod(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;3475.00
    getNotCoveredMarksForMethod(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;3475.00
    coverMarks(Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MethodSet;[Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord;)V81080.00
    <init>(Ljava/lang/String;[Ljava/lang/String;[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;[Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord;)V88100.00
    getMethodSignatures()[Ljava/lang/String;66100.00
    getMarksOfType(Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MethodSet;Z)Ljava/util/Map;77100.00
    copyStringArray([Ljava/lang/String;)[Ljava/lang/String;44100.00
    access$000([Ljava/lang/String;)[Ljava/lang/String;11100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.IReportGenerator

    MethodCoveredTotal% Covered

    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    MethodCoveredTotal% Covered
    getClassSignaturesForPackage(Ljava/lang/String;)[Ljava/lang/String;3475.00
    getPackageName(Ljava/lang/String;)Ljava/lang/String;6785.71
    <init>()V22100.00
    addClassSignatures([Ljava/lang/String;)V44100.00
    addClassSignature(Ljava/lang/String;)V88100.00
    getPackages()[Ljava/lang/String;33100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount

    MethodCoveredTotal% Covered
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator;ZB)V080.00
    add(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;)V030.00
    getCoveredPercent()D2366.67
    getWeightedValue()D2366.67
    <init>(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator;)V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    MethodCoveredTotal% Covered
    writeClass(Ljava/lang/String;Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet;Ljava/lang/StringBuffer;)Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;080.00
    writePackage(Ljava/lang/String;Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;Ljava/lang/StringBuffer;)V050.00
    writeMethods(Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet;Ljava/lang/StringBuffer;)Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;0200.00
    writeMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;ZLjava/lang/StringBuffer;)Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;060.00
    getPackageName(Ljava/lang/String;)Ljava/lang/String;010.00
    getClassName(Ljava/lang/String;)Ljava/lang/String;010.00
    writeReport(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/report/AnalysisModuleData;Ljava/io/Writer;)V142360.87
    writeHeader(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/StringBuffer;)V2366.67
    writeCoverage(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;Ljava/lang/String;Ljava/lang/StringBuffer;)V2366.67
    loadPackageCounts([Ljava/lang/String;)Ljava/util/Map;6785.71
    <init>()V11100.00
    writeFooter(Ljava/lang/StringBuffer;)V11100.00
    toXml(Ljava/lang/String;)Ljava/lang/String;11100.00
    format(I)Ljava/lang/String;11100.00
    format(D)Ljava/lang/String;11100.00
    <clinit>()V77100.00

    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    MethodCoveredTotal% Covered
    <init>()V22100.00
    getInstance()Lnet/sourceforge/groboutils/codecoverage/v2/util/ChecksumUtil;11100.00
    checksum([B)J33100.00
    createChecksum()Ljava/util/zip/Checksum;11100.00
    update(Ljava/util/zip/Checksum;[B)V22100.00
    <clinit>()V11100.00

    Class net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil

    MethodCoveredTotal% Covered
    <init>()V11100.00
    getInstance()Lnet/sourceforge/groboutils/codecoverage/v2/util/ClassSignatureUtil;11100.00
    createClassSignature(Ljava/lang/String;J)Ljava/lang/String;33100.00
    getClassName(Ljava/lang/String;)Ljava/lang/String;66100.00
    <clinit>()V11100.00

    Method Details

    Class net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType

    Method setName(Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType

    Method getAnalysisModule()Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;

    Units Not Covered
    IndexDetails
    1Line 88
    8Line 110
    Class net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType

    Method getRef()Lnet/sourceforge/groboutils/codecoverage/v2/ant/AnalysisModuleType;

    Units Not Covered
    IndexDetails
    0Line 119
    Class net.sourceforge.groboutils.codecoverage.v2.ant.AnalysisModuleType

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask$ClassFile

    Method <init>(Ljava/io/File;Ljava/lang/String;)V

    Units Not Covered
    IndexDetails
    0Line 252
    1Line 253
    2Line 255
    3Line 257
    4Line 258
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method <init>()V

    Units Not Covered
    IndexDetails
    0Line 62
    1Line 66
    2Line 67
    3Line 68
    4Line 69
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method addFileSet(Lorg/apache/tools/ant/types/FileSet;)V

    Units Not Covered
    IndexDetails
    0Line 83
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method setDataDir(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    0Line 94
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method setOutClassDir(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    0Line 105
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method createAnalysisModule()Lnet/sourceforge/groboutils/codecoverage/v2/ant/AnalysisModuleType;

    Units Not Covered
    IndexDetails
    0Line 114
    1Line 115
    2Line 116
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method execute()V

    Units Not Covered
    IndexDetails
    0Line 128
    1Line 130
    2Line 132
    3Line 134
    4Line 138
    5Line 141
    6Line 143
    7Line 146
    8Line 148
    9Line 150
    10Line 151
    11Line 155
    12Line 156
    13Line 158
    14Line 159
    15Line 161
    16Line 163
    17Line 167
    18Line 168
    19Line 171
    20Line 174
    21Line 177
    22Line 179
    23Line 182
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method getAnalysisModules()[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;

    Units Not Covered
    IndexDetails
    0Line 195
    1Line 196
    2Line 197
    3Line 199
    4Line 200
    5Line 201
    6Line 203
    7Line 204
    8Line 205
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method getFilenames()[Lnet/sourceforge/groboutils/codecoverage/v2/ant/CoveragePostCompilerTask$ClassFile;

    Units Not Covered
    IndexDetails
    0Line 220
    1Line 221
    2Line 222
    3Line 224
    4Line 225
    5Line 226
    6Line 227
    7Line 228
    8Line 229
    9Line 231
    10Line 232
    11Line 235
    12Line 240
    13Line 241
    14Line 242
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask

    Method readFile(Ljava/io/File;)[B

    Units Not Covered
    IndexDetails
    0Line 269
    1Line 272
    2Line 273
    3Line 277
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method <init>()V

    Units Not Covered
    IndexDetails
    0Line 60
    1Line 62
    2Line 63
    3Line 64
    4Line 65
    5Line 66
    6Line 67
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method setDataDir(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    0Line 72
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method setLogDir(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    0Line 78
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method setOutDir(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    0Line 84
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method setReportFilePrefix(Ljava/lang/String;)V

    Units Not Covered
    IndexDetails
    0Line 90
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method setReportFileExtension(Ljava/lang/String;)V

    Units Not Covered
    IndexDetails
    0Line 96
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method setFailOnError(Z)V

    Units Not Covered
    IndexDetails
    0Line 102
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method execute()V

    Units Not Covered
    IndexDetails
    0Line 111
    1Line 113
    2Line 115
    3Line 117
    4Line 119
    5Line 121
    6Line 123
    7Line 125
    8Line 128
    9Line 129
    10Line 130
    11Line 133
    12Line 134
    13Line 135
    14Line 139
    15Line 141
    16Line 143
    17Line 145
    18Line 147
    19Line 150
    20Line 151
    21Line 152
    22Line 155
    23Line 158
    24Line 163
    25Line 165
    26Line 166
    27Line 169
    28Line 172
    29Line 176
    30Line 178
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method createReport(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/report/AnalysisModuleData;Lnet/sourceforge/groboutils/codecoverage/v2/report/IReportGenerator;)Z

    Units Not Covered
    IndexDetails
    0Line 189
    1Line 190
    2Line 191
    3Line 194
    4Line 195
    5Line 202
    6Line 203
    7Line 204
    8Line 205
    9Line 208
    10Line 211
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method createReportFile(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Ljava/io/File;

    Units Not Covered
    IndexDetails
    0Line 217
    1Line 219
    2Line 221
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method createChannelLogReader(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogReader;

    Units Not Covered
    IndexDetails
    0Line 229
    1Line 230
    2Line 232
    Class net.sourceforge.groboutils.codecoverage.v2.ant.CoverageReportTask

    Method createMetaDataReader()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataReader;

    Units Not Covered
    IndexDetails
    0Line 241
    1Line 245
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method <init>(SLnet/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedMethod;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)V

    Units Not Covered
    IndexDetails
    14Line 86
    16Line 93
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method getOriginalMethod()Lorg/apache/bcel/classfile/Method;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method getMethodName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method getClassName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method getInstructionCount()I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method getInstructionAt(I)Lorg/apache/bcel/generic/Instruction;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method markInstruction(ILnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method toString()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.DefaultMethodCode

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    Method <init>(SIILorg/apache/bcel/generic/InstructionHandle;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    Method getMarkedList()Lorg/apache/bcel/generic/InstructionList;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    Method getInstruction()Lorg/apache/bcel/generic/Instruction;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    Method addMark(SS)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    Method getHandle()Lorg/apache/bcel/generic/InstructionHandle;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MarkedInstruction

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MeasureMark

    Method <init>(IISSS)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MeasureMark

    Method addToInstructionList(Lorg/apache/bcel/generic/InstructionList;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.MeasureMark

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method <init>(Ljava/lang/String;[B)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;Ljava/lang/String;[B)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method getClassName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method getClassCRC()J

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method getClassSignature()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method createClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method getMethods()[Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedMethod;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method getModifiedClass()[B

    Units Not Covered
    IndexDetails
    6Line 234
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method updateClass()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method updateClassGen(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;[BLjava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method addClassSignature(Lorg/apache/bcel/generic/ConstantPoolGen;)V

    Units Not Covered
    IndexDetails
    1Line 332
    3Line 338
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method addMethodRef(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;Lorg/apache/bcel/generic/ConstantPoolGen;)V

    Units Not Covered
    IndexDetails
    1Line 356
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method updateChecksum([B)V

    Units Not Covered
    IndexDetails
    1Line 377
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method checkClose()V

    Units Not Covered
    IndexDetails
    1Line 390
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method allowModification(Lorg/apache/bcel/classfile/Method;)Z

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method isMarkable(Lorg/apache/bcel/classfile/Method;)Z

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method createSignature(Lorg/apache/bcel/classfile/Method;)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method <init>(SIILorg/apache/bcel/generic/InstructionList;)V

    Units Not Covered
    IndexDetails
    8Line 95
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method isValidInstructionList(Lorg/apache/bcel/generic/InstructionList;)Z

    Units Not Covered
    IndexDetails
    2Line 117
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method updateInstructionList()V

    Units Not Covered
    IndexDetails
    10Line 148
    11Line 149
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method getInstructionCount()I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method getInstructionAt(I)Lnet/sourceforge/groboutils/codecoverage/v2/compiler/MarkedInstruction;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method close()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method setupMarkList()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method checkClose()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method updateTargeters(Lorg/apache/bcel/generic/InstructionHandle;Lorg/apache/bcel/generic/InstructionHandle;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method isSpecialtyTarget(Lorg/apache/bcel/generic/InstructionTargeter;Lorg/apache/bcel/generic/InstructionHandle;)Z

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedInstructionList

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method <init>(SIILorg/apache/bcel/classfile/JavaClass;Lorg/apache/bcel/classfile/Method;Lorg/apache/bcel/generic/MethodGen;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getMethodIndex()S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getMethodName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getInstructionList()Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ModifiedInstructionList;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getOriginalClass()Lorg/apache/bcel/classfile/JavaClass;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getOriginalMethod()Lorg/apache/bcel/classfile/Method;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method canAddMarks()Z

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getModifiedMethodGen()Lorg/apache/bcel/generic/MethodGen;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method getNewMethod()Lorg/apache/bcel/classfile/Method;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method close()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method createInstructionList()V

    Units Not Covered
    IndexDetails
    3Line 240
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method checkClose()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method adjustStartPC()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedMethod

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.NullInstruction

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method <init>(Ljava/lang/Class;Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method storeData(Ljava/lang/String;Ljava/lang/String;)V

    Units Not Covered
    IndexDetails
    3Line 112
    6Line 119
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method getClassName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method getMethodName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method getMethodSignature()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method parseCoverageLoggerType(Ljava/lang/Class;Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method createSignature([Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method getType(Ljava/lang/Class;)Lorg/apache/bcel/generic/Type;

    Units Not Covered
    IndexDetails
    3Line 214
    5Line 218
    9Line 226
    11Line 230
    13Line 234
    15Line 238
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.ParseCoverageLogger

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataWriter;[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/compiler/ParseCoverageLogger;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataWriter;[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass

    Method postCompile(Ljava/lang/String;[BLjava/io/OutputStream;)V

    Units Not Covered
    IndexDetails
    1Line 107
    14Line 133
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO$StaleAnalysisMetaData

    Method <init>(Ljava/lang/String;Ljava/lang/String;B)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO$StaleAnalysisMetaData

    Method getCoveredFormattedText()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO$StaleAnalysisMetaData

    Method getNotCoveredFormattedText()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO$StaleAnalysisMetaData

    Method getInstructionWeight()B

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO

    Method writeAnalysisMetaData(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisMetaDataIO

    Method readAnalysisMetaData(Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule

    Method <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule

    Method getMeasureName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule

    Method getMeasureUnit()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule

    Method getMimeEncoding()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO$StaleAnalysisModule

    Method analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    IndexDetails
    0Line 71
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO

    Method writeAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleIO

    Method readAnalysisModule(Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method <init>([Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method addAnalysisModules([Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V

    Units Not Covered
    IndexDetails
    1Line 103
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method addAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V

    Units Not Covered
    IndexDetails
    8Line 141
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method joinAnalysisModuleSet(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method getAnalysisModules()[Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;

    Units Not Covered
    IndexDetails
    5Line 191
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method getMeasureIndex(Ljava/lang/String;)S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method getAnalysisModuleIndex(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method getAnalysisModuleCount()I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSet

    Method getAnalysisModuleAt(S)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;

    Units Not Covered
    IndexDetails
    2Line 264
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSetIO

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSetIO

    Method writeAnalysisModuleSet(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.AnalysisModuleSetIO

    Method readAnalysisModuleSet(Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;

    Units Not Covered
    IndexDetails
    7Line 91
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method <init>(Ljava/lang/String;J[Ljava/lang/String;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getClassName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getClassCRC()J

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getClassSignature()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getAnalysisModuleSet()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getMethods()[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getMethodIndex(Ljava/lang/String;)S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getMethodCount()I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getMethodAt(S)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method addMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getMarksForAnalysisModule(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    IndexDetails
    2Line 258
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

    Method getMarksForAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method writeClass(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method readClass(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method writeMarksForAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method writeMarksForMeasure(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Ljava/lang/String;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method readMarks(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Ljava/io/Reader;)V

    Units Not Covered
    IndexDetails
    6Line 168
    7Line 169
    8Line 171
    9Line 172
    10Line 173
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method writeMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;Ljava/io/Writer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecordIO

    Method readMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Ljava/io/Reader;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    IndexDetails
    0Line 216
    1Line 217
    2Line 218
    3Line 219
    4Line 220
    5Line 221
    6Line 222
    7Line 223
    8Line 225
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataIO;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    Method readClass(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    Method getClassSignatures()[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    Method close()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    Method checkClose()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataReader

    Method finalize()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/DirMetaDataIO;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    Method writeClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    Method close()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    Method getAMClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    Method checkClose()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirClassMetaDataWriter

    Method finalize()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method <init>(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    2Line 74
    4Line 78
    6Line 83
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getAnalysisModuleSet()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;

    Units Not Covered
    IndexDetails
    8Line 112
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method putAnalysisModuleSet(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V

    Units Not Covered
    IndexDetails
    1Line 127
    8Line 139
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getClassSigsForAnalysisModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)[Ljava/lang/String;

    Units Not Covered
    IndexDetails
    1Line 152
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    IndexDetails
    0Line 172
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    IndexDetails
    1Line 185
    11Line 209
    15Line 220
    16Line 221
    19Line 230
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method putClassRecord(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;)V

    Units Not Covered
    IndexDetails
    1Line 245
    8Line 257
    13Line 269
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getAnalysisModuleSetFile()Ljava/io/File;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getAnalysisModuleDir(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Ljava/io/File;

    Units Not Covered
    IndexDetails
    2Line 293
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getClassDataFileForModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Ljava/io/File;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method getClassMarkFileForModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/String;)Ljava/io/File;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method close()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method checkClosed()V

    Units Not Covered
    IndexDetails
    1Line 350
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method isClosed()Z

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method finalize()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataIO

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    Method <init>(Ljava/io/File;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    Method getClassReader(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataReader;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    Method getAnalysisModuleSet()Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    Method close()V

    Units Not Covered
    IndexDetails
    0Line 99
    1Line 100
    2Line 101
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    Method checkClose()V

    Units Not Covered
    IndexDetails
    1Line 110
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataReader

    Method finalize()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    Method <init>(Ljava/io/File;)V

    Units Not Covered
    IndexDetails
    2Line 58
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    Method getClassWriter(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IClassMetaDataWriter;

    Units Not Covered
    IndexDetails
    1Line 73
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    Method close()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    Method addModule(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    Method checkClose()V

    Units Not Covered
    IndexDetails
    1Line 123
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.DirMetaDataWriter

    Method finalize()V

    Units Not Covered
    IndexDetails
    2Line 135
    5Line 143
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;Ljava/lang/String;Ljava/lang/String;S)V

    Units Not Covered
    IndexDetails
    6Line 64
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method processMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/AnalysisModuleSet;)V

    Units Not Covered
    IndexDetails
    1Line 81
    3Line 85
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method equals(Ljava/lang/Object;)Z

    Units Not Covered
    IndexDetails
    1Line 96
    3Line 100
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method hashCode()I

    Units Not Covered
    IndexDetails
    0Line 118
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method getAnalysisMetaData()Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method getAnalysisModule()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method getAnalysisModuleIndex()S

    Units Not Covered
    IndexDetails
    1Line 140
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method getMethodSignature()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method getMethodIndex()S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method getMarkIndex()S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.MarkRecord

    Method toString()Ljava/lang/String;

    Units Not Covered
    IndexDetails
    0Line 174
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil

    Method <init>()V

    Units Not Covered
    IndexDetails
    0Line 42
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil

    Method readTo(Ljava/io/Reader;C)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil

    Method readCount(Ljava/io/Reader;I)Ljava/lang/String;

    Units Not Covered
    IndexDetails
    9Line 88
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil

    Method toInt(Ljava/lang/String;)I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.datastore.ReadUtil

    Method toLong(Ljava/lang/String;)J

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method getMeasureName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method getMeasureUnit()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method getMimeEncoding()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method markTarget(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;Lorg/apache/bcel/generic/InstructionHandle;Lnet/sourceforge/groboutils/codecoverage/v2/module/BytecodeLineUtil;Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method createBranchData(Ljava/lang/String;II)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BranchCountMeasure

    Method createElseData(IILjava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    Method getMeasureName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    Method getMeasureUnit()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    Method getMimeEncoding()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    Method analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeCountMeasure

    Method createAnalysisMetaData(I)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method <init>(Lorg/apache/bcel/classfile/Method;)V

    Units Not Covered
    IndexDetails
    0Line 56
    1Line 57
    2Line 59
    3Line 61
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    IndexDetails
    2Line 69
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getHandles()[Lorg/apache/bcel/generic/InstructionHandle;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getLineNumber(Lorg/apache/bcel/generic/InstructionHandle;)I

    Units Not Covered
    IndexDetails
    1Line 85
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getLineNumberForBytecodePos(I)I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getLineNumberForInstructionPos(I)I

    Units Not Covered
    IndexDetails
    2Line 105
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getInstructionPosForBytecodePos(I)I

    Units Not Covered
    IndexDetails
    2Line 117
    6Line 126
    7Line 128
    8Line 131
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method initialize(Lorg/apache/bcel/classfile/Method;)V

    Units Not Covered
    IndexDetails
    1Line 145
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method sort(Lorg/apache/bcel/classfile/LineNumberTable;)[Lorg/apache/bcel/classfile/LineNumber;

    Units Not Covered
    IndexDetails
    1Line 159
    4Line 164
    11Line 177
    12Line 178
    13Line 179
    14Line 180
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getInstructionPositions(Lorg/apache/bcel/classfile/Method;)[I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getInstructionLines([Lorg/apache/bcel/classfile/LineNumber;[I)[I

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.BytecodeLineUtil

    Method getLinenoForBytePos([Lorg/apache/bcel/classfile/LineNumber;I)I

    Units Not Covered
    IndexDetails
    1Line 221
    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    Method getMeasureName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    Method getMeasureUnit()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    Method getMimeEncoding()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    Method analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.CallPairMeasure

    Method createMetaData(II)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData

    Method <init>(Ljava/lang/String;Ljava/lang/String;B)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData

    Method getCoveredFormattedText()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData

    Method getNotCoveredFormattedText()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.DefaultAnalysisMetaData

    Method getInstructionWeight()B

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    Method getMeasureName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    Method getMeasureUnit()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    Method getMimeEncoding()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    Method analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.FunctionMeasure

    Method createAnalysisMetaData(Ljava/lang/String;Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method getMeasureName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method getMeasureUnit()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method getMimeEncoding()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method analyze(Lnet/sourceforge/groboutils/codecoverage/v2/IMethodCode;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method createAnalysisMetaData(Lorg/apache/bcel/classfile/LineNumber;)Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisMetaData;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.module.LineCountMeasure

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/datastore/IMetaDataReader;Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogReader;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    Method getClassSignatures()[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    Method getClassRecord(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/datastore/ClassRecord;

    Units Not Covered
    IndexDetails
    0Line 97
    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    Method getAllClassMarks(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    IndexDetails
    0Line 107
    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    Method getChannelLogRecords(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord;

    Units Not Covered
    IndexDetails
    0Line 117
    1Line 118
    2Line 120
    3Line 121
    4Line 123
    5Line 124
    6Line 127
    7Line 129
    Class net.sourceforge.groboutils.codecoverage.v2.report.AnalysisModuleData

    Method createClassMarkSet(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet;

    Units Not Covered
    IndexDetails
    0Line 140
    1Line 141
    2Line 146
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$DidCover

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V

    Units Not Covered
    IndexDetails
    2Line 77
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$DidCover

    Method cover()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$DidCover

    Method toString()Ljava/lang/String;

    Units Not Covered
    IndexDetails
    0Line 90
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method <init>(Ljava/lang/String;S)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method getMethodName()Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method getMethodIndex()S

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method addMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V

    Units Not Covered
    IndexDetails
    1Line 130
    5Line 140
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method coverMark(S)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method getMark(S)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$DidCover;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MarkSet

    Method getMarksOfType(Z)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method <init>([Ljava/lang/String;[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;)V

    Units Not Covered
    IndexDetails
    5Line 211
    14Line 228
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method getMethodCount()I

    Units Not Covered
    IndexDetails
    0Line 249
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method getMethodNames()[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method getMethodIndex(Ljava/lang/String;)S

    Units Not Covered
    IndexDetails
    0Line 259
    1Line 260
    2Line 262
    3Line 264
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method getMethodByIndex(S)Ljava/lang/String;

    Units Not Covered
    IndexDetails
    3Line 273
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method nameIterator()Ljava/util/Iterator;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method get(Ljava/lang/String;)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MarkSet;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet$MethodSet

    Method get(S)Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MarkSet;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method <init>(Ljava/lang/String;[Ljava/lang/String;[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;[Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method getMethodSignatures()[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method getCoveredMarksForMethod(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    IndexDetails
    2Line 348
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method getNotCoveredMarksForMethod(Ljava/lang/String;)[Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;

    Units Not Covered
    IndexDetails
    2Line 364
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method coverMarks(Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MethodSet;[Lnet/sourceforge/groboutils/codecoverage/v2/IChannelLogRecord;)V

    Units Not Covered
    IndexDetails
    3Line 383
    9Line 404
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method getMarksOfType(Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet$MethodSet;Z)Ljava/util/Map;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method copyStringArray([Ljava/lang/String;)[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method access$000([Ljava/lang/String;)[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.ClassMarkSet

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    Method addClassSignatures([Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    Method addClassSignature(Ljava/lang/String;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    Method getPackages()[Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    Method getClassSignaturesForPackage(Ljava/lang/String;)[Ljava/lang/String;

    Units Not Covered
    IndexDetails
    3Line 112
    Class net.sourceforge.groboutils.codecoverage.v2.report.PackageSorter

    Method getPackageName(Ljava/lang/String;)Ljava/lang/String;

    Units Not Covered
    IndexDetails
    1Line 120
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount

    Method <init>(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator;ZB)V

    Units Not Covered
    IndexDetails
    0Line 70
    1Line 71
    2Line 72
    3Line 73
    4Line 75
    5Line 77
    6Line 78
    7Line 79
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount

    Method add(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;)V

    Units Not Covered
    IndexDetails
    0Line 89
    1Line 90
    2Line 92
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount

    Method getCoveredPercent()D

    Units Not Covered
    IndexDetails
    2Line 102
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator$CoverageCount

    Method getWeightedValue()D

    Units Not Covered
    IndexDetails
    2Line 113
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeReport(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Lnet/sourceforge/groboutils/codecoverage/v2/report/AnalysisModuleData;Ljava/io/Writer;)V

    Units Not Covered
    IndexDetails
    7Line 142
    8Line 143
    9Line 144
    10Line 145
    11Line 147
    15Line 154
    16Line 155
    17Line 157
    18Line 158
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeHeader(Lnet/sourceforge/groboutils/codecoverage/v2/IAnalysisModule;Ljava/lang/StringBuffer;)V

    Units Not Covered
    IndexDetails
    1Line 176
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeClass(Ljava/lang/String;Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet;Ljava/lang/StringBuffer;)Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;

    Units Not Covered
    IndexDetails
    0Line 193
    1Line 195
    2Line 198
    3Line 200
    4Line 208
    5Line 210
    6Line 213
    7Line 215
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writePackage(Ljava/lang/String;Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;Ljava/lang/StringBuffer;)V

    Units Not Covered
    IndexDetails
    0Line 222
    1Line 224
    2Line 227
    3Line 230
    4Line 231
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeMethods(Lnet/sourceforge/groboutils/codecoverage/v2/report/ClassMarkSet;Ljava/lang/StringBuffer;)Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;

    Units Not Covered
    IndexDetails
    0Line 237
    1Line 239
    2Line 242
    3Line 243
    4Line 244
    5Line 246
    6Line 247
    7Line 249
    8Line 255
    9Line 256
    10Line 258
    11Line 259
    12Line 265
    13Line 266
    14Line 268
    15Line 269
    16Line 272
    17Line 274
    18Line 276
    19Line 280
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeMark(Lnet/sourceforge/groboutils/codecoverage/v2/datastore/MarkRecord;ZLjava/lang/StringBuffer;)Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;

    Units Not Covered
    IndexDetails
    0Line 287
    1Line 289
    2Line 292
    3Line 293
    4Line 303
    5Line 305
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeCoverage(Lnet/sourceforge/groboutils/codecoverage/v2/report/XmlReportGenerator$CoverageCount;Ljava/lang/String;Ljava/lang/StringBuffer;)V

    Units Not Covered
    IndexDetails
    1Line 314
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method writeFooter(Ljava/lang/StringBuffer;)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method toXml(Ljava/lang/String;)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method loadPackageCounts([Ljava/lang/String;)Ljava/util/Map;

    Units Not Covered
    IndexDetails
    5Line 355
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method getPackageName(Ljava/lang/String;)Ljava/lang/String;

    Units Not Covered
    IndexDetails
    0Line 363
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method getClassName(Ljava/lang/String;)Ljava/lang/String;

    Units Not Covered
    IndexDetails
    0Line 369
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method format(I)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method format(D)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.report.XmlReportGenerator

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    Method getInstance()Lnet/sourceforge/groboutils/codecoverage/v2/util/ChecksumUtil;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    Method checksum([B)J

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    Method createChecksum()Ljava/util/zip/Checksum;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    Method update(Ljava/util/zip/Checksum;[B)V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ChecksumUtil

    Method <clinit>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil

    Method <init>()V

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil

    Method getInstance()Lnet/sourceforge/groboutils/codecoverage/v2/util/ClassSignatureUtil;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil

    Method createClassSignature(Ljava/lang/String;J)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil

    Method getClassName(Ljava/lang/String;)Ljava/lang/String;

    Units Not Covered
    All units were covered
    Class net.sourceforge.groboutils.codecoverage.v2.util.ClassSignatureUtil

    Method <clinit>()V

    Units Not Covered
    All units were covered
    libgroboutils-java-5.orig/codecoverage/xdocs/index.xml0000644000175000017500000000363710040164710023253 0ustar drazzibdrazzib Welcome $Date: 2004/04/17 08:24:40 $

    The CodeCoverage package contains a tool to help you discover what parts of your code have not executed during unit tests.

    You can find an article on the various code-coverage techniques in the on-line article by Steve Cornet at Bullseye Testing Technology.

  • Getting Started with GroboCoverage
  • Advanced usage of GroboCoverage
  • Detailed Ant task documentation
    • grobo-instrument
    • grobo-report
    • grobo-rezip
    • coveragepostcompile (deprecated)
    • coveragereport (deprecated)
  • Integrating GroboCoverage with complex build environments
  • What's new
  • Documents you may not care about
  • Requirements
  • Design
  • Original Design (for those who want to know about alternatives to BCEL-based code-coverage solutions)
  • libgroboutils-java-5.orig/codecoverage/xdocs/v2_antdoc_grobo-report.xml0000644000175000017500000006514710040560331026527 0ustar drazzibdrazzib grobo-report: GroboCoverage Ant Tasks $Date: 2004/04/18 20:11:05 $ Matt Albrecht

    All Tasks

    Tallies the coverage log data from the classes that were logged during runtime execution, and combines it with the post-compilation generated data, to allow for a set of different reports to be created. Reports are specified as a set of sub-tasks. Currently, this task supports all included channel outputs (safe, cache, and fast) natively. Other formats will need a <logFilter> tag to translate its format to the standard.

    Note that there are two different categories of reports: simple and complex. The simple report types generate one report per analysis module. The complex reports generate one report that's based on all the analysis modules.

    Translates the probe log format from the one used by the logger specified in the <grobo-instrument> task to the standard format. Currently, this only needs to be specified if you use the "single" logger. type the logger native format to translate from. Defaults to "none". Alternate value is "single". No Simply copies the XML passed to all report types to disk. prefix The text to prefix all output XML files (defaults to CoverageReport-). No suffix The text to suffix all output XML files (defaults to .xml). No destDir The directory to place the XML report files. Yes Uses an XSL-T stylesheet to transform the simple XML reports into another format. It accepts parameters to pass to the XSL-T stylesheet in the form of param tags. Used to pass a parameter to the underlying XSL stylesheet. The usage is exactly like the param structure for the style Ant task. name Name of the XSL parameter Yes expression Text value to be placed into the param. Yes if The param will only pass if this property is set. No unless The param will only pass unless this property is set. No style The XSL-T file. One of style or styleURL must be specified. styleURL A URL pointing to the XSL-T file. One of style or styleURL must be specified. prefix The text to prepend all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. No suffix The text to append to all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. Default suffix is .html. No destdir The output directory to place the HTML files. Default directory is .. No removeEmpty A boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No Based on the XSL report task above. This uses a built-in XSL-T stylesheet to generate one HTML file for each analysis module, which look something like this.

    All of the attributes and nested elements are identical to the XSL style above, except that this will fail if either style or styleURL are specified.

    This report task is also aliased as simple.

    Uses a set of XSL-T styesheets to transform several XML files into reports. The XML files include the complex XML report, a per-package XML report, and an XML report per Java source file that includes the Java source (if available). This allows the user to generate their own source-linked reports.

    This report task takes param tags just as the xsl report task above. All defined parameters will be passed to every stylesheet.

    Defines an XSL stylesheet that runs against the base complex XML report, and puts its files into the root report output directory. file file location of the stylesheet One of file or url must be specified url URL location of the stylesheet One of file or url must be specified dest text appended to the root report output directory name for the output file name (be sure to include the leading '/') Yes Defines a file that will be copied into the root report output directory. file location of the file One of file or url must be specified url URL location of the file One of file or url must be specified dest text appended to the root report output directory name for the output file name (be sure to include the leading '/') Yes Defines an XSL stylesheet that runs against the package XML report, once per package, and puts its files into the package directory, under the root report output directory. file file location of the stylesheet One of file or url must be specified url URL location of the stylesheet One of file or url must be specified dest Text appended to the package directory file name for the output file name. Be sure to include the leading '/' if this output file is unique per package. Yes Defines an XSL stylesheet that runs against the source-linked XML report, once per Java source file, and puts its files into the package directory, under the root report output directory. file file location of the stylesheet One of file or url must be specified url URL location of the stylesheet One of file or url must be specified dest The output file name will be in the form of (root report output directory)/(package subdirectory/(java class name without package) appended by the contents of this attribute. Yes srcdir Directory containing the source files. Yes destdir The output directory to place the HTML files. Default directory is .. No removeEmpty A boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No In addition to the srcdir attribute, you can include multiple source directories for searching. The first directory containing the source file will be used in the report. name The name of the directory containing a source tree. Yes
    Generates a JavaDoc-like collection of HTML files for all the analysis modules, linking the coverage reports to the source files. This report shows the contents of the source files and highlights whichever lines were not covered.

    All of the attributes and nested elements are identical to the sourcexsl style above, except that it includes some helper parameters for the underlying XSL stylesheets.

    This report task is also aliased as source.

    title The title text to be placed on the top of every HTML file. Default is Summary Coverage Report. No footertext Text to be put at the bottom of every center frame's page (default is an advertisement for GroboUtils). No footerhref Link to have the footertext point to (default is an advertisement for GroboUtils). No stylesheet Stylesheet file to use in replacement of the default. No
    Checks the coverage numbers to see if they meet or exceed a build requirement. If the coverage numbers do not meet the specified percentage, then it's a failure. A failure means that the property will be set to the actual coverage percentage (if property is specified), and the grobo-report task will fail after generating its reports if the grobo-report task's failonerror is turned on. If the grobo-report task's failonerror is turned off, then the build file can fail later by checking if the property is set. property The property to set if the coverage number check fails. If it fails, then the property will be set to the actual coverage percentage. No percentage The minimum percent coverage required for the build to pass. If the percentage is not met, then the failOn report task will process its failure conditions (see above). Yes Much like a FileSet's include tag. This specifies a classname filter that will be included in the coverage percentage totals. If no include tag is given, then there's an implicit include that matches everything. module The module to include in the checks. You can use a '*' at the beginning or at the end of the parameter text as a wildcard (but not both). Modules not included will be ignored when processing the total coverage percentage. One of module or class is required. class The fully-qualified class name to include in the checks. The class filter allows for wildcards ('*') in the place of class names or package names (the parts dividing the '.' separators), or you can use a double-wildcard ('**') do mean that any class in any sub-package will match. The wildcard ('*') may be by itself, at the beginning, or at the end of a package name or class name. One of module or class is required. Much like a FileSet's exclude tag. This specifies a classname filter that will be ignored in the coverage percentage totals. module The module to exclude from the checks. You can use a '*' at the beginning or at the end of the parameter text as a wildcard (but not both). Modules not included will be ignored when processing the total coverage percentage. One of module or class is required. class The fully-qualified class name to exclude from the checks. The class filter allows for wildcards ('*') in the place of class names or package names (the parts dividing the '.' separators), or you can use a double-wildcard ('**') do mean that any class in any sub-package will match. The wildcard ('*') may be by itself, at the beginning, or at the end of a package name or class name. One of module or class is required. logDir The name of the directory containing the coverage data, as specified in the grobo-instrument task. Yes failonerror Boolean describing if an error in this task should cause the build to fail (default is false). This has particular importance with the FailOn sub-task. No <grobo-report logdir="coverage/log" > <xml destdir="coverage/reports" /> </grobo-report> Generates one .xml file for each analysis module used while generating the class files, and one .xml file that combines all the analysis module data. <grobo-report logdir="coverage/log"> <simplestyle destdir="${dirs.test-output}" removeempty="true" /> <sourcestyle destdir="${dirs.test-output}/source-report" removeempty="true" srcdir="src" title="Summary Coverage Report of My Code"> <srcdir name="${dirs.temp}/generated-source-1" /> <srcdir name="${dirs.temp}/generated-source-2" /> </sourcestyle> </grobo-report> Generates two human-readable reports. The first (simplestyle) generates one HTML file in the ${dirs.test-output} directory for each analysis module XML report. The generated file will look something like this.

    The second (sourcestyle) generates a directory hierarchy of framed HTML pages in the ${dirs.test-output}/source-report directory. It links the original Java source files into the HTML by looking in the directories src, ${dirs.temp}/generated-source-1, and ${dirs.temp}/generated-source-2 for the source files corresponding to the covered class files, in that order.

    <grobo-report logdir="coverage/log" > <failon property="coverage-failed" percentage="80"> <exclude module="bytecode" /> <include class="net.sf.**" /> <exclude class="net.sf.**.*Test" /> <include class="org.apache.tools.ant.Proj*" /> <include class="org.apache.tools.ant.taskdefs.*" /> </failon> </grobo-report> <fail if="coverage-failed"> Code coverage was not sufficient: expected 80%, but found ${coverage-failed}%. </fail> Checks if the percent coverage on the qualified classes in the qualified modules was at or above 80%. If the percentage is at or above 80%, then the property coverage-failed is not set, and the build succeeds. If the percentage is below 80%, then the property coverage-failed is set, the task grob-report does not fail (the default value of the failonerror parameter is false), but the "if" condition on the fail task is fulfilled and the build fails there.

    Since the failon report task only excludes the "bytecode" module, all other modules used by the grobo-instrument task will have their coverage numbers included in the tally. Implicitly, the report task includes all modules and excludes the ones given.

    As for the included classes, that gets tricky. All classes under the "net.sf" package (and in that package) are included, except for classes that end with the text "Test". All classes in the "org.apache.tools.ant" package that start with the text "Proj" are included. All classes in the "org.apache.tools.ant.taskdefs" are included, but none of the classes in the sub-packages.

    <grobo-report logdir="coverage/log" failonerror="true"> <failon percentage="65.2"> <include module="bytecode" /> </failon> <failon percentage="70"> <include module="linecount" /> </failon> </grobo-report> Checks if the percent coverage on the qualified classes in the qualified modules was at or above 65.2% for the bytecode module, and at or above 70% for the linecount module. If the percentage counts are both met, then the build continues. However, if either check fails, then the grobo-report task fails with the error details; if both fail, then both reports details are given.

    All Tasks

    libgroboutils-java-5.orig/codecoverage/xdocs/advanced_users.xml0000644000175000017500000000775610040164710025140 0ustar drazzibdrazzib Advanced Usage of GroboCoverage $Date: 2004/04/17 08:24:40 $ Matt Albrecht
    How GroboCoverage Works

    GroboCoverage works by inserting "probes" into the post-compiled class files. These probes call out to a logger (more on that later), telling it which class, method index, and probe index was invoked.

    During the post-compilation of the class files, a set of data files get generated, which record what a method index and probe index translate into with regards to the source file.

    The reporting phase combines the post-compilation data files with the log data from the loggers to generate XML reports, and from that HTML reports using XSL-T.

    The Logger

    The base logger class (net.sourceforge.groboutils.codecoverage.v2.logger.CoverageLogger) gets called at each probe point through invoking its cover method, and redirects these invocations to the different registered channels (a channel in the logger corresponds to an analysis measure during post-compilation).

    This static class discovers the registered channels at class load time through the /grobocoverage.properties file (relative to the classpath). If that resource isn't found, then the initialization uses the system properties.

    The initialization routine creates a number of channels from the specified logger factory (whose fully-qualified class name is given in the properties with the key "factory"). The number of channels comes from the key "channel-count". All property keys starting with "logger." are passed to the factory class for initialization.

    Currently, all logger implementations output the probe information to plain text files in a logging directory (specified by the key "logger.dir"), one file per class. The format of this file is simply a series of lines, each specifying a single probe:

        methodIndex,probeIndex
    

    There can be duplicates of these method/probe pairs, which will be condensed down during report parsing. The filename reflects the class name with a CRC check (so different class files with the same name don't confuse the logger), and each channel outputs to its own sub-directory in this logging directory.

    This means that if you have several coverage runs, logging to different directories (or even across machines), all you need to do is concatenate the files with the same name together (order isn't important), and copy the one-off log files into those directories. The reporting task will do the rest

    However, an alternate logger style, called the "single" style, puts all the logging data into a single file. It requires modifying the <grobo-report> task slightly, but makes for a much easier merge on the files. In order to prevent some classloader problems, this style can create multiple output files inside the log directory. Due to this, the report filter will scan that directory for all "single" files. This makes the task of merging multiple files moot - just copy all the "single" style files into the log directory, and generate the report. The output format looks like:

        channel,class signature,methodIndex,probeIndex
    
    per line.

    The Probes

    Each probe added to the post-compiled class files adds several instructions to the bytecode. They setup the invocation to the static method in the CoverageLogger (see above) to reflect the current probe and current method.

    libgroboutils-java-5.orig/codecoverage/xdocs/todo.xml0000644000175000017500000000107510007774015023113 0ustar drazzibdrazzib What's Left To Do $Date: 2004/02/03 19:35:41 $ Matt Albrecht This is a wish-list of new features for this project:
    1. Make the tool easier to use: I need to simplify the Ant tasks. In particular, this can be done using the Ant references to store some state.
    2. Enhance Reporting: Reporting needs to be enhanced, and made cleaner.
    libgroboutils-java-5.orig/codecoverage/xdocs/v2_old_antdoc.xml0000644000175000017500000004554310025427262024672 0ustar drazzibdrazzib GroboCoverage Ant Tasks $Date: 2004/03/15 22:31:14 $ Matt Albrecht
    A Guide To The Ant Tasks

    The following is a listing of all ant tasks contained in this package.

    Recompiles the provided class files to a separate directory, and stores the compilation generated data (for use in report generation) to another directory. the FileSet to use for defining all the class files to recompile. Note that no matter what is specified in the file sets, only files ending in ".class" (case-insensitive) will be recompiled. There may be multiple of these file sets specified. Defines a single analysis module to use in the analysis of each class file that is recompiled. An analysis module creates coverage details for the class specific to its measure, such as line-count or branch count. Multiple of these modules may be specified. Each analysis module will have its own report generated. Analysismodule's classpath attribute is a PATH like structure and can also be set via a nested classpath element. name the name of the analysis module to load. The only current acceptable values are:
      counts the source code line coverage. This requires the line information to be stored in the class file. counts the coverage of the class file's bytecode. This is the most detailed look at exactly what amount of code is and is not being covered, but can be hard to read. counts the coverage of each branch by looking at the bytecode branching instructions. counts the coverage of each method invocation. counts the "function" or "method" entry coverage; when the execution enters a method, that method is marked as covered.
    One of name or classname must be specified
    classname Loads a non-standard analysis module, using this parameter as a the fully-qualified class name of the analysis module class. If this is specified, then it will use the classpathref parameter, embedded classpath element, or loaderref parameter to reference the classpath from which to load the module, if any are provided. If none are provided, then the classloader for the task will be used instead. One of name or classname must be specified classpathref Reference to a classpath to use when looking up classname. No loaderRef the name of the loader that is used to load the class, constructed from the specified classpath. Use this to allow multiple tasks/types to be loaded with the same loader, so they can call each other. No
    Sets up how the logs are generated by the covered classes. This allows for configuration of the grobocoverage.properties file (which tells the coverage-enabled classes everything they need during operation to run correctly), and generates that properties file for you. factory the factory class to handle the logging. If no package is specified, then this property will prepend "net.sourceforge.groboutils.codecoverage.v2.logger." to the given factory name. Currently, there are two types of loggers:
      (default) This is the safest logger, but the slowest. On each logging request, it opens the log file, writes the log element, then closes the log file, all in a VM-wide synchronized block. Using this logger, you will likely see a large amount of disk access. The logDir parameter (below) defines the directory to place all the channel log data (default directory is "./.cover-logs"). This is a faster logger. It keeps a sized cache of open log files in memory, each log file being a buffered file. This has a danger of possibly not closing or flushing its open log files on VM shutdown. If the VM is JDK 1.3 compatible, the logger will add a shutdown hook to attempt to close its opened files. Using this logger, you should see large disk access when the VM ends. It uses the logDir parameter (below) that the DirectoryChannelLoggerFactory uses, and also uses the cachesize parameter, which defines the maximum number of opened files stored in the cache per channel (default size is 25, but you should match this to the limitations of the operating system).

      There's a pending issue with this logger (bug 902884).

      This operates identically to DirectoryChannelLoggerFactory, but caches the encountered covered items, and only writes new elements to the log files. This is JDK 1.2 dependent, and may eat up lots of memory. However, for those that are encountering issues due to enormous log files, moving to this logger should fix the problem. Also, this should reduce file I/O.
    No
    logDir the directory that all the coverage logging data will be put. Must match the report task's logDir parameter. No cachesize the number of concurrent files to keep open. Only used by the CacheDirChannelLoggerFactory. No
    datadir the name of the directory to send the analysis module generated data to. This same directory should be specified in the coveragereport task's datadir attribute as well. Yes outclassdir The name of the directory in which the recompiled class files are saved. This directory should never be confused with the original classes: these classes are slower and "fatter" than the originals. Yes <coveragepostcompiler outclassdir="coverage/classes" datadir="coverage/data" > <analysismodule name="linecount" /> <fileset dir="${dirs.classes}" /> <fileset dir="${dirs.classes2}"> <excludes name="dont/cover/these/*.class" /> </fileset> <logsettings logdir="coverage/logs" /> </coveragepostcompiler> Recompiles all the classes located in ${dirs.classes} using the linecount analysis module, and recompiles all the classes from ${dirs.classes2} except those in the dont.cover.these package. All the recompiled classes are stored in coverage/classes, and the analysis module generated data is stored under the coverage/data directory. The default logger factory (DirectoryChannelLoggerFactory) will be used during runs, outputting log data to coverage/logs.

    Generates an XML report describing all the coverage tallies for the classes that were logged during runtime execution. The report combines the runtime coverage logs with the post-compilation generated data. One report is created per analysis module. Currently, this task supports all included channel outputs (DirectoryChannelLoggerFactory, CacheDirChannelLoggerFactory, and MinDirChannelLoggerFactory). Generates one HTML file for each analysis module, which look something like this. prefix The text to prepend all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. No suffix The text to append to all output HTML file names. The output name will look like prefixModuleNamesuffix. Default prefix is CoverageReport-. Default suffix is .html. No destdir The output directory to place the HTML files. Default directory is .. No removeEmpty A boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No Generates a JavaDoc-like collection of HTML files for all the analysis modules, linking the coverage reports to the source files. This report shows the contents of the source files and highlights whichever lines were not covered. title The title text to be placed on the top of every HTML file. Default is Summary Coverage Report. No srcdir Directory containing the source files. Yes destdir The output directory to place the HTML files. Default directory is .. No removeEmpty A boolean value. This describes whether the output report should remove all methods and classes that don't have any code attributed to them (such as interfaces and abstract methods). Default is false. No In addition to the srcdir attribute, you can include multiple source directories for searching. The first directory containing the source file will be used in the report. name The name of the directory containing a source tree. Yes datadir The name of the directory to read the analysis module generated data from. This same directory should be specified in the coveragepostcompiler task's datadir attribute as well. Yes logDir The name of the directory to read the log output generated from running the code. This same directory should be specified in the grobocoverage.properties file. Yes outdir The name of the directory that will contain the generated XML documents. Yes reportfileprefix Text that will prepend each outputted XML document's file name (default is Coverage-). No reportfileextension Text that will append each outputted XML document's file name (default is .xml). No <coveragereport datadir="${dirs.test-output}/coverage-data" logdir="${dirs.test-output}/coverage-log" outdir="${dirs.test-output}"> </coveragereport> The <coveragereport> task generates one .xml file for each analysis module that has data in the ${dirs.test-output}/coverage-data directory, using the runtime log data found in the ${dirs.test-output}/coverage-log directory. It also places in the same directory an .xml file that contains all the analysis module data. <coveragereport datadir="${dirs.test-output}/coverage-data" logdir="${dirs.test-output}/coverage-log" outdir="${dirs.test-output}"> <simplestyle destdir="${dirs.test-output}" removeempty="true" /> <sourcestyle destdir="${dirs.test-output}/source-report" removeempty="true" srcdir="src" title="Summary Coverage Report of My Code"> <srcdir name="${dirs.temp}/generated-source-1" /> <srcdir name="${dirs.temp}/generated-source-2" /> </sourcestyle> </coveragereport> Same as above, but this also generates two human-readable reports. The first (simplestyle) generates one HTML file in the ${dirs.test-output} directory for each analysis module XML report. The generated file will look something like this.

    The second (sourcestyle) generates a directory hierarchy of framed HTML pages in the ${dirs.test-output}/source-report directory. It links the original Java source files into the HTML by looking in the directories src, ${dirs.temp}/generated-source-1, and ${dirs.temp}/generated-source-2 for the source files corresponding to the covered class files, in that order.

    libgroboutils-java-5.orig/codecoverage/xdocs/v2_antdoc_coveragepostcompile.xml0000644000175000017500000002631710034416205030157 0ustar drazzibdrazzib CoveragePostCompiler: GroboCoverage Ant Tasks $Date: 2004/04/06 02:57:09 $ Matt Albrecht

    All Tasks

    Deprecated - use grobo-instrument instead.

    Recompiles the provided class files to a separate directory, and stores the compilation generated data (for use in report generation) to another directory.

    the FileSet to use for defining all the class files to recompile. Note that no matter what is specified in the file sets, only files ending in ".class" (case-insensitive) will be recompiled. There may be multiple of these file sets specified. Defines a single analysis module to use in the analysis of each class file that is recompiled. An analysis module creates coverage details for the class specific to its measure, such as line-count or branch count. Multiple of these modules may be specified. Each analysis module will have its own report generated. Analysismodule's classpath attribute is a PATH like structure and can also be set via a nested classpath element. name the name of the analysis module to load. The only current acceptable values are:
      counts the source code line coverage. This requires the line information to be stored in the class file. counts the coverage of the class file's bytecode. This is the most detailed look at exactly what amount of code is and is not being covered, but can be hard to read. counts the coverage of each branch by looking at the bytecode branching instructions. counts the coverage of each method invocation. counts the "function" or "method" entry coverage; when the execution enters a method, that method is marked as covered.
    One of name (alternatively, type) or classname must be specified
    type an alternative to the name attribute. One of name (alternatively, type) or classname must be specified classname Loads a non-standard analysis module, using this parameter as a the fully-qualified class name of the analysis module class. If this is specified, then it will use the classpathref parameter, embedded classpath element, or loaderref parameter to reference the classpath from which to load the module, if any are provided. If none are provided, then the classloader for the task will be used instead. One of name (alternatively, type) or classname must be specified classpathref Reference to a classpath to use when looking up classname. No loaderRef the name of the loader that is used to load the class, constructed from the specified classpath. Use this to allow multiple tasks/types to be loaded with the same loader, so they can call each other. No
    Sets up how the logs are generated by the covered classes. This allows for configuration of the grobocoverage.properties file (which tells the coverage-enabled classes everything they need during operation to run correctly), and generates that properties file for you. factory the factory class to handle the logging. If no package is specified, then this property will prepend "net.sourceforge.groboutils.codecoverage.v2.logger." to the given factory name. Currently, there are two types of loggers:
      (default) This is the safest logger, but the slowest. On each logging request, it opens the log file, writes the log element, then closes the log file, all in a VM-wide synchronized block. Using this logger, you will likely see a large amount of disk access. The logDir parameter (below) defines the directory to place all the channel log data (default directory is "./.cover-logs"). This is a faster logger. It keeps a sized cache of open log files in memory, each log file being a buffered file. This has a danger of possibly not closing or flushing its open log files on VM shutdown. If the VM is JDK 1.3 compatible, the logger will add a shutdown hook to attempt to close its opened files. Using this logger, you should see large disk access when the VM ends. It uses the logDir parameter (below) that the DirectoryChannelLoggerFactory uses, and also uses the cachesize parameter, which defines the maximum number of opened files stored in the cache per channel (default size is 25, but you should match this to the limitations of the operating system).

      There's a pending issue with this logger (bug 902884).

      This operates identically to DirectoryChannelLoggerFactory, but caches the encountered covered items, and only writes new elements to the log files. This is JDK 1.2 dependent, and may eat up lots of memory. However, for those that are encountering issues due to enormous log files, moving to this logger should fix the problem. Also, this should reduce file I/O.
    No
    logDir the directory that all the coverage logging data will be put. Must match the report task's logDir parameter. No cachesize the number of concurrent files to keep open. Only used by the CacheDirChannelLoggerFactory. No
    datadir the name of the directory to send the analysis module generated data to. This same directory should be specified in the coveragereport task's datadir attribute as well. Yes outclassdir The name of the directory in which the recompiled class files are saved. This directory should never be confused with the original classes: these classes are slower and "fatter" than the originals. Yes <coveragepostcompiler outclassdir="coverage/classes" datadir="coverage/data" > <analysismodule name="linecount" /> <fileset dir="${dirs.classes}" /> <fileset dir="${dirs.classes2}"> <excludes name="dont/cover/these/*.class" /> </fileset> <logsettings logdir="coverage/logs" /> </coveragepostcompiler> Recompiles all the classes located in ${dirs.classes} using the linecount analysis module, and recompiles all the classes from ${dirs.classes2} except those in the dont.cover.these package. All the recompiled classes are stored in coverage/classes, and the analysis module generated data is stored under the coverage/data directory. The default logger factory (DirectoryChannelLoggerFactory) will be used during runs, outputting log data to coverage/logs.

    All Tasks

    libgroboutils-java-5.orig/codecoverage/xdocs/v2_antdoc.xml0000644000175000017500000000176510037142325024027 0ustar drazzibdrazzib GroboCoverage Ant Tasks $Date: 2004/04/06 02:57:09 $ Matt Albrecht
    A Guide To The Ant Tasks

    The following is a listing of all ant tasks contained in this package.

    • grobo-instrument
    • grobo-report
    • grobo-rezip
    • coveragepostcompile (deprecated)
    • coveragereport (deprecated)

    To add the tasks into your Ant build script, see the Referencing New Tasks section of the Getting Started page.

    libgroboutils-java-5.orig/_shared/0000755000175000017500000000000011271425773017270 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/common-ant/0000755000175000017500000000000011271425773021340 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/common-ant/common-ant.ant-ent.xml0000644000175000017500000000220507521075237025475 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-deploy.ant-inc.xml0000644000175000017500000000351607521075231030075 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/common-ant/common-ant-replace.ant-inc.xml0000644000175000017500000000636607655132707027111 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-jar.ant-inc.xml0000644000175000017500000000774607671416674027406 0ustar drazzibdrazzib
    libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-javac.ant-inc.xml0000644000175000017500000001275107521075237027674 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-init.ant-inc.xml0000644000175000017500000000627210052047205027537 0ustar drazzibdrazzib ********************************************** Start of Compilation for ${product}-${version} ********************************************** global.offline=${global.offline} libgroboutils-java-5.orig/_shared/common-ant/common-ant.ant-inc.xml0000644000175000017500000002063610040164706025456 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-doc.ant-inc.xml0000644000175000017500000001262207737323756027365 0ustar drazzibdrazzib <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <!-- *********************************************************************** This file is automatically generated. Do not edit. *********************************************************************** --> <set> <type name="Testing" /> <type name="Utility" /> </set> &inc.javadoc.ant.1_6beta; &inc.javadoc.bcel.5_1; &inc.javadoc.easymock.0_8; &inc.javadoc.jdk.1_4; &inc.javadoc.junit.3_8_1; &inc.javadoc.log4j.1_2_8; &inc.javadoc.mockobjects.0_4rc1; &inc.javadoc.sax.2_0_1; &inc.javadoc.xalan.2_5_1; &inc.javadoc.xerces.2_4_0; libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-test.ant-inc.xml0000644000175000017500000003312410052047205027547 0ustar drazzibdrazzib *** The AIT tests did not run. *** To run them, execute the target "run-ait-tests" *** The AIT tests did not run. *** Must pass 'test-ait.function.name' to this target to run an AIT test. libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-jdkdepend.ant-inc.xml0000644000175000017500000000323507521075237030535 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/common-ant/common-ant-tasks-clean.ant-inc.xml0000644000175000017500000000230107655375167027675 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/license/0000755000175000017500000000000011271425773020712 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/license/license.ant-inc.xml0000644000175000017500000000026007622026354024401 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/license/COPYING.txt0000644000175000017500000000201207627540473022563 0ustar drazzibdrazzibPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libgroboutils-java-5.orig/_shared/license/license.ant-ent.xml0000644000175000017500000000035307521075241024416 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/bootstrap/0000755000175000017500000000000011271425773021305 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/0000755000175000017500000000000011271425773021040 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/bcel/0000755000175000017500000000000011271425773021745 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/bcel/5.1/0000755000175000017500000000000011271425773022250 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/bcel/5.1/package-list0000644000175000017500000000033307654621035024535 0ustar drazzibdrazziborg.apache.bcel org.apache.bcel.classfile org.apache.bcel.generic org.apache.bcel.util org.apache.bcel.verifier org.apache.bcel.verifier.exc org.apache.bcel.verifier.statics org.apache.bcel.verifier.structurals libgroboutils-java-5.orig/_shared/3rdparty/bcel/5.1/javadoc-links.ant-inc.xml0000644000175000017500000000032607655264776027067 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/bcel/bcel.ant-ent.xml0000644000175000017500000000045407705025233024736 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/bcel/bcel.ant-inc.xml0000644000175000017500000000137607705025233024725 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/junit/0000755000175000017500000000000011271425773022171 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/junit/3.7/0000755000175000017500000000000011271425773022500 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/junit/3.7/package-list0000644000175000017500000000004107521074172024756 0ustar drazzibdrazzibjunit.extensions junit.framework libgroboutils-java-5.orig/_shared/3rdparty/junit/3.7/javadoc-links.ant-inc.xml0000644000175000017500000000033007521074154027267 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/junit/3.8.1/0000755000175000017500000000000011271425773022640 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/junit/3.8.1/package-list0000644000175000017500000000004107550316414025116 0ustar drazzibdrazzibjunit.extensions junit.framework libgroboutils-java-5.orig/_shared/3rdparty/junit/3.8.1/javadoc-links.ant-inc.xml0000644000175000017500000000033407550316414027433 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/junit/3.8.1/cpl-v10.html0000644000175000017500000003531007550316414024706 0ustar drazzibdrazzib Common Public License - v 1.0

    Common Public License - v 1.0

    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

    1. DEFINITIONS

    "Contribution" means:

      a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
      b) in the case of each subsequent Contributor:
      i) changes to the Program, and
      ii) additions to the Program;
      where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

    "Contributor" means any person or entity that distributes the Program.

    "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

    "Program" means the Contributions distributed in accordance with this Agreement.

    "Recipient" means anyone who receives the Program under this Agreement, including all Contributors.

    2. GRANT OF RIGHTS

      a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
      b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
      c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
      d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.

    3. REQUIREMENTS

    A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

      a) it complies with the terms and conditions of this Agreement; and
      b) its license agreement:
      i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
      ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
      iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
      iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.

    When the Program is made available in source code form:

      a) it must be made available under this Agreement; and
      b) a copy of this Agreement must be included with each copy of the Program.

    Contributors may not remove or alter any copyright notices contained within the Program.

    Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.

    4. COMMERCIAL DISTRIBUTION

    Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.

    For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.

    5. NO WARRANTY

    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.

    6. DISCLAIMER OF LIABILITY

    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    7. GENERAL

    If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

    If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.

    All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.

    Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.

    This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

    libgroboutils-java-5.orig/_shared/3rdparty/junit/junit.ant-ent.xml0000644000175000017500000000060407550316352025406 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/junit/junit.ant-inc.xml0000644000175000017500000000234707550316352025377 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/sax/0000755000175000017500000000000011271425773021633 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/sax/sax.ant-inc.xml0000644000175000017500000000134507521074370024477 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/sax/2.0.1/0000755000175000017500000000000011271425773022271 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/sax/2.0.1/package-list0000644000175000017500000000006007521074372024552 0ustar drazzibdrazziborg.xml.sax org.xml.sax.ext org.xml.sax.helpers libgroboutils-java-5.orig/_shared/3rdparty/sax/2.0.1/javadoc-links.ant-inc.xml0000644000175000017500000000033007521074370027060 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/sax/sax.ant-ent.xml0000644000175000017500000000046407521074370024515 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/easymock/0000755000175000017500000000000011271425773022653 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/easymock/easymock.ant-ent.xml0000644000175000017500000000050407521074154026550 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/easymock/0.8/0000755000175000017500000000000011271425773023160 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/easymock/0.8/package-list0000644000175000017500000000001507521074154025437 0ustar drazzibdrazziborg.easymock libgroboutils-java-5.orig/_shared/3rdparty/easymock/0.8/javadoc-links.ant-inc.xml0000644000175000017500000000033607521074154027755 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/easymock/easymock.ant-inc.xml0000644000175000017500000000143607521074154026540 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/0000755000175000017500000000000011271425773021610 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/jdk/jdk.ant-ent.xml0000644000175000017500000000077707521074154024456 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/jdk.ant-inc.xml0000644000175000017500000000304507521074154024430 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.2/0000755000175000017500000000000011271425773022110 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/jdk/1.2/javadoc-links.ant-inc.xml0000644000175000017500000000032407521074154026702 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.2/package-list.jdk0000644000175000017500000000201307521074154025136 0ustar drazzibdrazzibjava.applet java.awt java.awt.color java.awt.datatransfer java.awt.dnd java.awt.event java.awt.font java.awt.geom java.awt.im java.awt.image java.awt.image.renderable java.awt.print java.beans java.beans.beancontext java.io java.lang java.lang.ref java.lang.reflect java.math java.net java.rmi java.rmi.activation java.rmi.dgc java.rmi.registry java.rmi.server java.security java.security.acl java.security.cert java.security.interfaces java.security.spec java.sql java.text java.util java.util.jar java.util.zip javax.accessibility javax.swing javax.swing.border javax.swing.colorchooser javax.swing.event javax.swing.filechooser javax.swing.plaf javax.swing.plaf.basic javax.swing.plaf.metal javax.swing.plaf.multi javax.swing.table javax.swing.text javax.swing.text.html javax.swing.text.html.parser javax.swing.text.rtf javax.swing.tree javax.swing.undo org.omg.CORBA org.omg.CORBA.DynAnyPackage org.omg.CORBA.ORBPackage org.omg.CORBA.portable org.omg.CORBA.TypeCodePackage org.omg.CosNaming org.omg.CosNaming.NamingContextPackage libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.3/0000755000175000017500000000000011271425773022111 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/jdk/1.3/javadoc-links.ant-inc.xml0000644000175000017500000000032407521074154026703 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.3/package-list.jdk0000644000175000017500000000251507521074154025146 0ustar drazzibdrazzibjava.applet java.awt java.awt.color java.awt.datatransfer java.awt.dnd java.awt.event java.awt.font java.awt.geom java.awt.im java.awt.im.spi java.awt.image java.awt.image.renderable java.awt.print java.beans java.beans.beancontext java.io java.lang java.lang.ref java.lang.reflect java.math java.net java.rmi java.rmi.activation java.rmi.dgc java.rmi.registry java.rmi.server java.security java.security.acl java.security.cert java.security.interfaces java.security.spec java.sql java.text java.util java.util.jar java.util.zip javax.accessibility javax.naming javax.naming.directory javax.naming.event javax.naming.ldap javax.naming.spi javax.rmi javax.rmi.CORBA javax.sound.midi javax.sound.midi.spi javax.sound.sampled javax.sound.sampled.spi javax.swing javax.swing.border javax.swing.colorchooser javax.swing.event javax.swing.filechooser javax.swing.plaf javax.swing.plaf.basic javax.swing.plaf.metal javax.swing.plaf.multi javax.swing.table javax.swing.text javax.swing.text.html javax.swing.text.html.parser javax.swing.text.rtf javax.swing.tree javax.swing.undo javax.transaction org.omg.CORBA org.omg.CORBA_2_3 org.omg.CORBA_2_3.portable org.omg.CORBA.DynAnyPackage org.omg.CORBA.ORBPackage org.omg.CORBA.portable org.omg.CORBA.TypeCodePackage org.omg.CosNaming org.omg.CosNaming.NamingContextPackage org.omg.SendingContext org.omg.stub.java.rmi libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.3/package-list.jdi0000644000175000017500000000010607521074154025136 0ustar drazzibdrazzibcom.sun.jdi com.sun.jdi.connect com.sun.jdi.event com.sun.jdi.request libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.4/0000755000175000017500000000000011271425773022112 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/jdk/1.4/javadoc-links.ant-inc.xml0000644000175000017500000000032407521074154026704 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.4/package-list.jdk0000644000175000017500000000520707521074154025150 0ustar drazzibdrazzibjava.applet java.awt java.awt.color java.awt.datatransfer java.awt.dnd java.awt.event java.awt.font java.awt.geom java.awt.im java.awt.im.spi java.awt.image java.awt.image.renderable java.awt.print java.beans java.beans.beancontext java.io java.lang java.lang.ref java.lang.reflect java.math java.net java.nio java.nio.channels java.nio.channels.spi java.nio.charset java.nio.charset.spi java.rmi java.rmi.activation java.rmi.dgc java.rmi.registry java.rmi.server java.security java.security.acl java.security.cert java.security.interfaces java.security.spec java.sql java.text java.util java.util.jar java.util.logging java.util.prefs java.util.regex java.util.zip javax.accessibility javax.crypto javax.crypto.interfaces javax.crypto.spec javax.imageio javax.imageio.event javax.imageio.metadata javax.imageio.plugins.jpeg javax.imageio.spi javax.imageio.stream javax.naming javax.naming.directory javax.naming.event javax.naming.ldap javax.naming.spi javax.net javax.net.ssl javax.print javax.print.attribute javax.print.attribute.standard javax.print.event javax.rmi javax.rmi.CORBA javax.security.auth javax.security.auth.callback javax.security.auth.kerberos javax.security.auth.login javax.security.auth.spi javax.security.auth.x500 javax.security.cert javax.sound.midi javax.sound.midi.spi javax.sound.sampled javax.sound.sampled.spi javax.sql javax.swing javax.swing.border javax.swing.colorchooser javax.swing.event javax.swing.filechooser javax.swing.plaf javax.swing.plaf.basic javax.swing.plaf.metal javax.swing.plaf.multi javax.swing.table javax.swing.text javax.swing.text.html javax.swing.text.html.parser javax.swing.text.rtf javax.swing.tree javax.swing.undo javax.transaction javax.transaction.xa javax.xml.parsers javax.xml.transform javax.xml.transform.dom javax.xml.transform.sax javax.xml.transform.stream org.ietf.jgss org.omg.CORBA org.omg.CORBA_2_3 org.omg.CORBA_2_3.portable org.omg.CORBA.DynAnyPackage org.omg.CORBA.ORBPackage org.omg.CORBA.portable org.omg.CORBA.TypeCodePackage org.omg.CosNaming org.omg.CosNaming.NamingContextExtPackage org.omg.CosNaming.NamingContextPackage org.omg.Dynamic org.omg.DynamicAny org.omg.DynamicAny.DynAnyFactoryPackage org.omg.DynamicAny.DynAnyPackage org.omg.IOP org.omg.IOP.CodecFactoryPackage org.omg.IOP.CodecPackage org.omg.Messaging org.omg.PortableInterceptor org.omg.PortableInterceptor.ORBInitInfoPackage org.omg.PortableServer org.omg.PortableServer.CurrentPackage org.omg.PortableServer.POAManagerPackage org.omg.PortableServer.POAPackage org.omg.PortableServer.portable org.omg.PortableServer.ServantLocatorPackage org.omg.SendingContext org.omg.stub.java.rmi org.w3c.dom org.xml.sax org.xml.sax.ext org.xml.sax.helpers libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.4/package-list.jdi0000644000175000017500000000010607521074154025137 0ustar drazzibdrazzibcom.sun.jdi com.sun.jdi.connect com.sun.jdi.event com.sun.jdi.request libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.1/0000755000175000017500000000000011271425773022107 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/jdk/1.1/javadoc-links.ant-inc.xml0000644000175000017500000000032407521074154026701 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/jdk/1.1/package-list.jdk0000644000175000017500000000044707521074154025146 0ustar drazzibdrazzibjava.applet java.awt java.awt.datatransfer java.awt.event java.awt.image java.beans java.io java.lang java.lang.reflect java.math java.net java.rmi java.rmi.dgc java.rmi.registry java.rmi.server java.security java.security.acl java.security.interfaces java.sql java.text java.util java.util.zip libgroboutils-java-5.orig/_shared/3rdparty/3rdparty.ant-ent.xml0000644000175000017500000000236107705025200024665 0ustar drazzibdrazzib %ent._shared.3rdparty.ant; %ent._shared.3rdparty.bcel; %ent._shared.3rdparty.easymock; %ent._shared.3rdparty.junit; %ent._shared.3rdparty.log4j; %ent._shared.3rdparty.mockobjects; %ent._shared.3rdparty.sax; %ent._shared.3rdparty.xalan; %ent._shared.3rdparty.xerces; %ent._shared.3rdparty.jdk; libgroboutils-java-5.orig/_shared/3rdparty/ant/0000755000175000017500000000000011271425773021622 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/ant/ant.ant-inc.xml0000644000175000017500000000261010073140077024443 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/0000755000175000017500000000000011271425773022762 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/package-list0000644000175000017500000000530707737303444025260 0ustar drazzibdrazziborg.apache.tools.ant org.apache.tools.ant.filters org.apache.tools.ant.filters.util org.apache.tools.ant.helper org.apache.tools.ant.input org.apache.tools.ant.launch org.apache.tools.ant.listener org.apache.tools.ant.loader org.apache.tools.ant.taskdefs org.apache.tools.ant.taskdefs.compilers org.apache.tools.ant.taskdefs.condition org.apache.tools.ant.taskdefs.cvslib org.apache.tools.ant.taskdefs.email org.apache.tools.ant.taskdefs.optional org.apache.tools.ant.taskdefs.optional.ccm org.apache.tools.ant.taskdefs.optional.clearcase org.apache.tools.ant.taskdefs.optional.depend org.apache.tools.ant.taskdefs.optional.depend.constantpool org.apache.tools.ant.taskdefs.optional.dotnet org.apache.tools.ant.taskdefs.optional.ejb org.apache.tools.ant.taskdefs.optional.extension org.apache.tools.ant.taskdefs.optional.extension.resolvers org.apache.tools.ant.taskdefs.optional.i18n org.apache.tools.ant.taskdefs.optional.ide org.apache.tools.ant.taskdefs.optional.image org.apache.tools.ant.taskdefs.optional.j2ee org.apache.tools.ant.taskdefs.optional.javacc org.apache.tools.ant.taskdefs.optional.jdepend org.apache.tools.ant.taskdefs.optional.jlink org.apache.tools.ant.taskdefs.optional.jsp org.apache.tools.ant.taskdefs.optional.jsp.compilers org.apache.tools.ant.taskdefs.optional.junit org.apache.tools.ant.taskdefs.optional.metamata org.apache.tools.ant.taskdefs.optional.net org.apache.tools.ant.taskdefs.optional.perforce org.apache.tools.ant.taskdefs.optional.pvcs org.apache.tools.ant.taskdefs.optional.scm org.apache.tools.ant.taskdefs.optional.script org.apache.tools.ant.taskdefs.optional.sitraka org.apache.tools.ant.taskdefs.optional.sitraka.bytecode org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.attributes org.apache.tools.ant.taskdefs.optional.sos org.apache.tools.ant.taskdefs.optional.sound org.apache.tools.ant.taskdefs.optional.splash org.apache.tools.ant.taskdefs.optional.ssh org.apache.tools.ant.taskdefs.optional.starteam org.apache.tools.ant.taskdefs.optional.unix org.apache.tools.ant.taskdefs.optional.vss org.apache.tools.ant.taskdefs.optional.windows org.apache.tools.ant.taskdefs.rmic org.apache.tools.ant.types org.apache.tools.ant.types.optional org.apache.tools.ant.types.optional.depend org.apache.tools.ant.types.optional.image org.apache.tools.ant.types.resolver org.apache.tools.ant.types.selectors org.apache.tools.ant.types.selectors.modifiedselector org.apache.tools.ant.util org.apache.tools.ant.util.depend org.apache.tools.ant.util.depend.bcel org.apache.tools.ant.util.facade org.apache.tools.ant.util.optional org.apache.tools.ant.util.regexp org.apache.tools.bzip2 org.apache.tools.mail org.apache.tools.tar org.apache.tools.zip libgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/javadoc-links.ant-inc.xml0000644000175000017500000000033407737303444027563 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/bin/0000755000175000017500000000000011271425773023532 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/etc/0000755000175000017500000000000011271425773023535 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/lib/0000755000175000017500000000000011271425773023530 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/ant/1.6beta/lib/README0000644000175000017500000000125207737303444024412 0ustar drazzibdrazzibPlease refer to the Ant manual under Installing Ant / Library Dependencies for a list of the jar requirements for various optional tasks and features. This directory contains xercesImpl.jar from the 2.5.0 release of Apache Xerces. For more information or newer releases see . See the file LICENSE.xerces for the terms of distribution. It also contains xml-apis.jar, an Apache-controlled collection of standard classes from the 1.0b2 release of the Apache XML-Commons release. For more information or newer releases see . See the files LICENSE.dom and LICENSE.sax for the terms of distribution. libgroboutils-java-5.orig/_shared/3rdparty/ant/ant.ant-ent.xml0000644000175000017500000000047007737323756024506 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/ant/1.5.1/0000755000175000017500000000000010120240420022234 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/ant/1.5.1/lib/0000755000175000017500000000000010073140105023010 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/log4j/0000755000175000017500000000000011271425773022057 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/log4j/log4j.ant-ent.xml0000644000175000017500000000047407705025233025164 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/log4j/1.2.8/0000755000175000017500000000000011271425773022525 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/log4j/1.2.8/package-list0000644000175000017500000000062607671457537025034 0ustar drazzibdrazziborg.apache.log4j org.apache.log4j.chainsaw org.apache.log4j.config org.apache.log4j.helpers org.apache.log4j.jdbc org.apache.log4j.jmx org.apache.log4j.lf5 org.apache.log4j.net org.apache.log4j.nt org.apache.log4j.or org.apache.log4j.or.jms org.apache.log4j.or.sax org.apache.log4j.performance org.apache.log4j.spi org.apache.log4j.varia org.apache.log4j.xml org.apache.log4j.xml.examples libgroboutils-java-5.orig/_shared/3rdparty/log4j/1.2.8/javadoc-links.ant-inc.xml0000644000175000017500000000033407671457537027340 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/log4j/log4j.ant-inc.xml0000644000175000017500000000143207705025233025142 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/3rdparty.ant-inc.xml0000644000175000017500000000113607705025200024647 0ustar drazzibdrazzib &inc._shared.3rdparty.ant; &inc._shared.3rdparty.bcel; &inc._shared.3rdparty.easymock; &inc._shared.3rdparty.junit; &inc._shared.3rdparty.log4j; &inc._shared.3rdparty.mockobjects; &inc._shared.3rdparty.sax; &inc._shared.3rdparty.xalan; &inc._shared.3rdparty.xerces; &inc._shared.3rdparty.jdk; libgroboutils-java-5.orig/_shared/3rdparty/xerces/0000755000175000017500000000000011271425773022331 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/xerces/2.4.0/0000755000175000017500000000000011271425773022772 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/xerces/2.4.0/package-list0000644000175000017500000000036107671457543025272 0ustar drazzibdrazzibjavax.xml.parsers org.w3c.dom org.w3c.dom.css org.w3c.dom.events org.w3c.dom.html org.w3c.dom.ls org.w3c.dom.ranges org.w3c.dom.stylesheets org.w3c.dom.traversal org.w3c.dom.views org.xml.sax org.xml.sax.ext org.xml.sax.helpers libgroboutils-java-5.orig/_shared/3rdparty/xerces/2.4.0/javadoc-links.ant-inc.xml0000644000175000017500000000033607671457543027604 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/xerces/xerces.ant-ent.xml0000644000175000017500000000050007705025237025702 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/xerces/xerces.ant-inc.xml0000644000175000017500000000200707705025237025671 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/xalan/0000755000175000017500000000000011271425773022143 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/xalan/xalan.ant-inc.xml0000644000175000017500000000141407777607731025334 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/xalan/xalan.ant-ent.xml0000644000175000017500000000047407705025235025336 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/xalan/2.5.1/0000755000175000017500000000000011271425773022606 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/xalan/2.5.1/package-list0000644000175000017500000000272707671457540025113 0ustar drazzibdrazzibjavax.xml.parsers javax.xml.transform javax.xml.transform.dom javax.xml.transform.sax javax.xml.transform.stream org.apache.xalan org.apache.xalan.client org.apache.xalan.extensions org.apache.xalan.lib org.apache.xalan.lib.sql org.apache.xalan.processor org.apache.xalan.res org.apache.xalan.serialize org.apache.xalan.templates org.apache.xalan.trace org.apache.xalan.transformer org.apache.xalan.xslt org.apache.xalan.xsltc org.apache.xalan.xsltc.cmdline org.apache.xalan.xsltc.cmdline.getopt org.apache.xalan.xsltc.compiler org.apache.xalan.xsltc.compiler.util org.apache.xalan.xsltc.dom org.apache.xalan.xsltc.runtime org.apache.xalan.xsltc.runtime.output org.apache.xalan.xsltc.trax org.apache.xalan.xsltc.util org.apache.xml.dtm org.apache.xml.dtm.ref org.apache.xml.dtm.ref.dom2dtm org.apache.xml.dtm.ref.sax2dtm org.apache.xml.res org.apache.xml.serializer org.apache.xml.utils org.apache.xml.utils.res org.apache.xml.utils.synthetic org.apache.xml.utils.synthetic.reflection org.apache.xmlcommons org.apache.xpath org.apache.xpath.axes org.apache.xpath.compiler org.apache.xpath.domapi org.apache.xpath.functions org.apache.xpath.objects org.apache.xpath.operations org.apache.xpath.patterns org.apache.xpath.res org.w3c.dom org.w3c.dom.css org.w3c.dom.events org.w3c.dom.html org.w3c.dom.ranges org.w3c.dom.stylesheets org.w3c.dom.traversal org.w3c.dom.views org.w3c.dom.xpath org.xml.sax org.xml.sax.ext org.xml.sax.helpers libgroboutils-java-5.orig/_shared/3rdparty/xalan/2.5.1/javadoc-links.ant-inc.xml0000644000175000017500000000033407671457540027413 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/mockobjects/0000755000175000017500000000000011271425773023343 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/mockobjects/mockobjects.ant-inc.xml0000644000175000017500000000463207705025235027721 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/mockobjects/mockobjects.ant-ent.xml0000644000175000017500000000052607705025235027734 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/3rdparty/mockobjects/0.4rc1/0000755000175000017500000000000011271425773024252 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/3rdparty/mockobjects/0.4rc1/package-list0000644000175000017500000000060307521074370026534 0ustar drazzibdrazzibalt.java.io alt.java.net alt.java.rmi alt.javax.mail alt.javax.mail.internet com.mockobjects com.mockobjects.beans com.mockobjects.io com.mockobjects.jms com.mockobjects.mail com.mockobjects.mail.internet com.mockobjects.naming com.mockobjects.naming.directory com.mockobjects.net com.mockobjects.rmi com.mockobjects.servlet com.mockobjects.sql com.mockobjects.test com.mockobjects.util libgroboutils-java-5.orig/_shared/3rdparty/mockobjects/0.4rc1/javadoc-links.ant-inc.xml0000644000175000017500000000035207521074342031044 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/deployed/0000755000175000017500000000000011271425773021075 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/deployed/deployed.ant-ent.xml0000644000175000017500000000443307521075237024774 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/changeLicenseAndCopyright.pl0000644000175000017500000001102507622026273024665 0ustar drazzibdrazzib#! /usr/bin/perl use strict; my $year = 2003; # Usage: # find ... -exec gpl2mit.pl {} \; # # Global constants my $LGPLHeader1 = qq[ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ ]; my $LGPLHeader2 = qq[ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ ]; my $MITHeader = qq[ * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ ]; die "You must specify a source file to parse as the first argument." if ($#ARGV < 0); my $file = $ARGV[0]; open ORIG, $file || die "Could not open file $file for reading."; # Read in the file my $contents = ""; while () { $contents .= $_; } close ORIG; my $changed = 0; my $pos = index( $contents, $LGPLHeader1 ); if ($pos >= 0) { substr( $contents, $pos, length( $LGPLHeader1 ) ) = $MITHeader; $changed = 1; } $pos = index( $contents, $LGPLHeader2 ); if ($pos >= 0) { substr( $contents, $pos, length( $LGPLHeader2 ) ) = $MITHeader; $changed = 1; } #print STDERR "File $file does not contain a LGPL License.\n" if (!$changed); if ($contents =~ /^(\s+\*\s+Copyright\s+\(C\)\s+[0-9,-]+\s+.+)$/m) { my $cpline = "$1"; my $cplineIndex = index( $contents, $cpline ); my $cplineLen = length( $cpline ); $cpline =~ /^\s+\*\s+Copyright\s+\(C\)\s+([^\s]+)\s+.+$/; my $dates = "$1"; my $datesIndex = index( $cpline, $dates ); my $datesLen = length( $dates ); my $prevyear = $year - 1; my $yearRE = $year . "\$"; my $prevyearRE = $prevyear . "\$"; if ($dates !~ /$yearRE/) { if ($dates !~ /$prevyearRE/) { $dates .= ",$year"; } else { # comma and dash logic if ($dates =~ /-$prevyearRE/) { $dates = s/-$prevyearRE/-$yearRE/; } else { # stand-alone date or comma then date $dates .= "-$year"; } } # replace the copyright substr( $cpline, $datesIndex, $datesLen ) = $dates; substr( $contents, $cplineIndex, $cplineLen ) = $cpline; $changed = 1; } # else copyright is up-to-date } if ($changed) { open ORIG, ">".$file || die "Could not open file $file for writing."; print ORIG $contents; close ORIG; } libgroboutils-java-5.orig/_shared/_shared.ant-inc.xml0000644000175000017500000000431407705101442022740 0ustar drazzibdrazzib &inc._shared.3rdparty; &inc._shared.license; &inc._shared.xdocs; &inc._shared.common-ant; libgroboutils-java-5.orig/_shared/_shared.ant-ent.xml0000644000175000017500000000136507521073301022756 0ustar drazzibdrazzib %ent._shared.3rdparty; %ent._shared.license; %ent._shared.common-ant; %ent._shared.xdocs; %ent._shared.deployed; libgroboutils-java-5.orig/_shared/xdocs/0000755000175000017500000000000011271425773020410 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/xdocs/style/0000755000175000017500000000000011271425773021550 5ustar drazzibdrazziblibgroboutils-java-5.orig/_shared/xdocs/style/addToSummary.xsl0000644000175000017500000001021607550673565024722 0ustar drazzibdrazzib [error] 0.0 Found list. Found project-id ''. Found type ''. Found input summary category ''. (owning type is '') libgroboutils-java-5.orig/_shared/xdocs/style/style.xsl0000644000175000017500000003604710040164706023437 0ustar drazzibdrazzib WARNING: DO NOT EDIT THIS FILE This file was auto-generated. Please look at the .xml version of this file and edit that one instead. GroboUtils - <xsl:value-of select="head/name/text()" /> Home
    GroboUtils

    About GroboUtils

    Sourceforge
    Project

    For Developers

    version

    Authors:Author:

    version:



    SourceForge Logo
    This space graciously provided by the SourceForge project
    Copyright &copy; 2002-2004 GroboUtils Project.
    All rights reserved.
    , http://ant.apache.org/manual/ []

    
    
            

    Table Of Contents

  • :
  • :
  • References

    []

    Description


    Examples


    Nested Elements



    Parameters

    Attribute Description Required

    Project Summary:

    Found project in summary ''.

    Section:&nbsp;&nbsp; ()

    Status:

    libgroboutils-java-5.orig/_shared/xdocs/xdocs.ant-inc.xml0000644000175000017500000000154407565014357023611 0ustar drazzibdrazzib libgroboutils-java-5.orig/_shared/xdocs/xdocs.ant-ent.xml0000644000175000017500000000034507521075241023613 0ustar drazzibdrazzib libgroboutils-java-5.orig/pmti/0000755000175000017500000000000011271425773016634 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/deployed.ant-inc.xml0000644000175000017500000000030007547162333022505 0ustar drazzibdrazzib libgroboutils-java-5.orig/pmti/build.xml0000644000175000017500000001157207737323756020475 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/pmti/TODO.txt0000644000175000017500000000131107737323756020150 0ustar drazzibdrazzibTODO for PMTI (in close-to priority order): 6. Look into moving from code-generated tracking numbers to XDoclet generated tracking numbers. This will pose a bigger problem with dependencies on the JUnit XML output format, but will allow for tracking number XML to be generated independent of running tests. 3. Complete the XML Parser for the AutoDoc generated XML files using the pmti.v1.itf.parser framework. 4. Complete the XML itf writer. 5. Integrate together the ITF and AutoDoc frameworks, to bond together the Parsers and Writers in the ITF framework with the AutoDoc framework. Should use the SPI stuff to reference the right writers. libgroboutils-java-5.orig/pmti/log4j.properties0000644000175000017500000000047507521071643021773 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.pmti=DEBUG libgroboutils-java-5.orig/pmti/sources/0000755000175000017500000000000010011472735020306 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ait/0000755000175000017500000000000011271425773021074 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ait/about.txt0000644000175000017500000000021007521071643022734 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/pmti/sources/dev/0000755000175000017500000000000011271425773021075 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/0000755000175000017500000000000010011472733021650 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/0000755000175000017500000000000010011472733024173 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472733026364 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/0000755000175000017500000000000010011472733027335 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/0000755000175000017500000000000011271425773027676 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IIssue.java0000644000175000017500000001330307622026412031732 0ustar drazzibdrazzib/* * @(#)IIssue.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Reflects an issue (or bug, or anomally report, or problem ticket) that * is generic enough to be used by most problem tracker system. All * IIssue instances are immutable, unless they also implement * IEditableIssue. *

    * An issue will only reflect the data associated with the issue at the time of * the polling of the issue from the tracker. Currently, the only way to * update the issue's data fields is to re-poll the issue from the * ProblemManager, or to call reload(). Individual * implemenations of the PMTI framework * may provide alternative means to real-time update the issue data, but that * is not the standard implementation. *

    * Containment patterns would require the creation methods for an editable form * of the issue to be in this interface. For security reasons, this method * is placed in the ProblemManager interface instead. *

    * NOTE: this interface may be too generic to be useful. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IIssue { /** * Returns the unique ID associated with this issue. * * @return the problem tracker's assigned ID for this issue, which can * never be null. */ public String getID(); /** * Returns the type of issue. For the SourceForge.net site, this may * be "bug", "feature request", and so forth. Some trackers may only * have one type of issue, so this field may not be as useful. For * those trackers that have different attribute data sets for different * types, this may aid programs in decoding the attributes and states. *

    * NOTE: this field may be deprecated in the future in favor of specific * IAttributeSet types. * * @return the issue's type, which may be null. * @see #getAttributes() */ public String getType(); /** * Retrieves the short description of the issue. This can also be * referred to as the issue title or summary. It should be a * human-readable short description, describing a general overview * of the issue. * * @return the issue's short description, which may be null. */ public String getShortDescription(); /** * Queries the "state" of the issue. In a very general way, this refers * to various progress states an issue can be in, such as "new", "assigned", * "investigating", "resolved", "verified", "closed", and so on. Additional * data may be associated with this state, such as who's working on the * issue, the resolution of the issue, who verified the resolution, and * so on. If the tracker does not support a state, then null * may be returned. *

    * Some trackers may have different state categories for different * issue types. * * @return the issue's state, which may be null. */ public IIssueState getState(); /** * Returns a list of all attributes associated with this issue. All * issues of a particular type should have the same set of issues. * * @return the set of tracker-specific and issue type-specific attributes * and values associated with this issue. Can never return * null. */ public IAttributeSet getAttributes(); /** * Returns a new issue instance, containing the most up-to-date tracker * information for this issue. Since the IIssue instances are * immutable, this will not change the invoked issue. If the current * instance is of type IEditableIssue, then an * IEditableIssue will be returned, but will contain none of the * non-committed changes performed on the owning issue. *

    * In theory, issues should never be removed. However, some systems allow * them to be deleted (say, if there was an accidental creation). In this * case, an IssueRemovedException will be thrown. * * @return an IIssue with the * @exception ProblemManagerException if there was an underlying tracker * error. */ public IIssue reload() throws ProblemManagerException; } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableListAttribute.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableListAttribute0000644000175000017500000000431707622026412034160 0ustar drazzibdrazzib/* * @(#)IEditableListAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * An editable list of values for a single attribute. *

    * The overloaded setValue( Object value ) will remove all elements * from the list, and add in the given value. If the given value is an * Array, then all its elements will be the new values in the list. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 7, 2002 */ public interface IEditableListAttribute extends IListAttribute, IEditableAttribute { /** * @exception IllegalArgumentException thrown if the value argument is * invalid. */ public void addValue( Object value ); /** * Does nothing if the value is not in the list of known values. */ public void removeValue( Object value ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/db/0000755000175000017500000000000011271425773030263 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/db/package.html0000644000175000017500000000013607521071643032540 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.db libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IIssueTypeInfo.java0000644000175000017500000000477607622026412033426 0ustar drazzibdrazzib/* * @(#)IIssueTypeInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Information about the owning problem manager. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 7, 2002 */ public interface IIssueTypeInfo { /** * Returns the type name. */ public String getName(); /** * Returns all states for the current issue type. */ public IIssueState[] getPossibleStates(); /** * Returns all attributes allowed for an issue of this type. */ public IAttributeInfo[] getSupportedAttributes(); /** * Returns the state that refer to the associated tests passing. Allows * for multiple states, for situations such as marked-as-fixed and * tests pass, or still-open but tests pass. */ public IIssueState[] getTestPassedStates(); /** * Returns the state that refer to the associated tests failing. Allows * for multiple states, for situations such as marked-as-fixed but * tests fail, or still-open but tests fail. */ public IIssueState[] getTestFailedStates(); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/0000755000175000017500000000000011271425773030460 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/package.html0000644000175000017500000000114307521071644032735 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.itf The Issue Traceability Framework. These classes and interfaces are an extention to the common PMTI to support tracing tests to an issue tracking system. The framework supports a set of interfaces which define how to record and load the traceability items, while the sub-packages define specific implementations of these interfaces.

    This is used by the net.sourceforge.groboutils.pmti.v1.autodoc package and sub-packages to interface the AutoDoc accumulated data with the PMTI framework proper. ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordCo0000644000175000017500000000356707622026417034075 0ustar drazzibdrazzib/* * @(#)IParserCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; /** * Logic to organize test-issue records into logically separated * sets of records. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public interface ITestIssueRecordCollator { /** * Returns the parsed test-issue records, divided into logically separated * collections. */ public ITestIssueRecordSet[] collate( ITestIssueRecord[] records ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestRecord.java0000644000175000017500000000363607622026417033517 0ustar drazzibdrazzib/* * @(#)ITestRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; /** * Encapsulates all the data associated with a testcase and its results. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public interface ITestRecord { public String getTestName(); public String getTestSuite(); public int getTestCount(); public long getRuntime(); public String[] getFailures(); public String[] getErrors(); public String getLog(); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/0000755000175000017500000000000011271425773031754 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/IParser.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/IParser.jav0000644000175000017500000000352707622026421034022 0ustar drazzibdrazzib/* * @(#)IParser.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; /** * Encapsulates all the data needed to reflect an issue reported by a testcase. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:01 $ * @since July 7, 2002 */ public interface IParser { /** * Parse up the internal data into test issue records. */ public ITestIssueRecord[] parse(); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/DefaultParserCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/DefaultPars0000644000175000017500000000756507622026421034116 0ustar drazzibdrazzib/* * @(#)DefaultParserCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSet; import net.sourceforge.groboutils.pmti.v1.itf.impl.DefaultTestIssueRecordSet; import java.util.Vector; import java.util.Enumeration; /** * Logic to extract parser parsed test-issue records into logically separated * sets of records. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:01 $ * @since July 7, 2002 */ public class DefaultParserCollator implements IParserCollator { private Vector parsers = new Vector(); private ITestIssueRecordSet parsed; /** * Adds a new parser to the internal collection. It is up to the * individual collator to lazily parse the records or parse the records * at the time of this invocation. *

    * It is illegal to invoke this method after a call to * getRecords(). * * @param p parser to add, which may be null (which should never * cause an error). * @exception IllegalStateException thrown if this is called after the * getRecords() method has been invoked. */ public void addParser( IParser p ) { if (this.parsers == null) { throw new IllegalStateException("already called getRecords()"); } if (p != null) { this.parsers.addElement( p ); } } /** * Returns the parsed test-issue records, divided into logically separated * collections. */ public synchronized ITestIssueRecordSet getRecords() { if (this.parsers == null) { return this.parsed; } Vector records = new Vector(); Enumeration enum = this.parsers.elements(); this.parsers = null; while (enum.hasMoreElements()) { ITestIssueRecord[] r = ((IParser)enum.nextElement()).parse(); if (r != null) { for (int i = 0; i < r.length; ++i) { if (r[i] != null) { records.addElement( r[i] ); } } } } ITestIssueRecord[] r = new ITestIssueRecord[ records.size() ]; records.copyInto( r ); this.parsed = new DefaultTestIssueRecordSet( r ); return this.parsed; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserGenerator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserGene0000644000175000017500000000352307622026421034036 0ustar drazzibdrazzib/* * @(#)IParserGenerator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; /** * Generates a collection of parsers which know how to parse small sets of data * into test records. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:01 $ * @since July 7, 2002 */ public interface IParserGenerator { /** * Generate a collection of parsers which know how to create test records. */ public IParser[] createParsers(); } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/AbstractParser.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/AbstractPar0000644000175000017500000000472007622026421034100 0ustar drazzibdrazzib/* * @(#)AbstractParser.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import java.util.Vector; /** * Encapsulates all the data needed to reflect an issue reported by a testcase. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:01 $ * @since July 7, 2002 */ public abstract class AbstractParser implements IParser { private Vector tirs; /** * Parse up the internal data into test issue records. */ public ITestIssueRecord[] parse() { this.tirs = new Vector(); findRecords(); ITestIssueRecord[] tir = new ITestIssueRecord[ this.tirs.size() ]; this.tirs.copyInto( tir ); return tir; } /** * Finds all the records, and registers each one with the * addRecord() method. */ protected abstract void findRecords(); protected void addRecord( ITestIssueRecord tir ) { if (tir != null) { this.tirs.addElement( tir ); } } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserColl0000644000175000017500000000465407622026421034057 0ustar drazzibdrazzib/* * @(#)IParserCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSet; /** * Logic to extract parser parsed test-issue records. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:01 $ * @since July 7, 2002 */ public interface IParserCollator { /** * Adds a new parser to the internal collection. It is up to the * individual collator to lazily parse the records or parse the records * at the time of this invocation. *

    * It is illegal to invoke this method after a call to * getRecords(). * * @param p parser to add, which may be null (which should never * cause an error). * @exception IllegalStateException thrown if this is called after the * getRecords() method has been invoked. */ public void addParser( IParser p ); /** * Returns the parsed test-issue records for all known parsers. */ public ITestIssueRecordSet getRecords(); } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordSet.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordSe0000644000175000017500000000341307622026417034071 0ustar drazzibdrazzib/* * @(#)ITestIssueRecordSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; /** * A collection of IIssueRecord instances. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public interface ITestIssueRecordSet { /** * Return all the records in this set. */ public ITestIssueRecord[] getTestIssueRecords(); } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITFReadProblemManager.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITFReadProblemMana0000644000175000017500000004263007622026417033741 0ustar drazzibdrazzib/* * @(#)ITFProblemManager.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.pmti.v1.IIssue; import net.sourceforge.groboutils.pmti.v1.IAttribute; import net.sourceforge.groboutils.pmti.v1.IIssueState; import net.sourceforge.groboutils.pmti.v1.IAttributeSet; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; import net.sourceforge.groboutils.pmti.v1.IIssueTypeInfo; import net.sourceforge.groboutils.pmti.v1.IEditableIssue; import net.sourceforge.groboutils.pmti.v1.IListAttribute; import net.sourceforge.groboutils.pmti.v1.IProblemManager; import net.sourceforge.groboutils.pmti.v1.IProblemManagerInfo; import net.sourceforge.groboutils.pmti.v1.ProblemManagerException; import net.sourceforge.groboutils.pmti.v1.defimpl.AbstractIssue; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultAttribute; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultAttributeSet; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultAttributeInfo; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultIssueState; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultIssueTypeInfo; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultListAttribute; import net.sourceforge.groboutils.pmti.v1.defimpl.DefaultProblemManagerInfo; import net.sourceforge.groboutils.pmti.v1.itf.parser.IParserGenerator; import net.sourceforge.groboutils.pmti.v1.itf.parser.IParserCollator; import net.sourceforge.groboutils.pmti.v1.itf.parser.IParser; import java.util.Hashtable; import java.util.Vector; import java.util.Enumeration; /** * A read-only ProblemManager for the ITF section of the PMTI framework. No * states are supported. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 12, 2002 */ public class ITFReadProblemManager implements IProblemManager { private Hashtable issueIdToIssue = new Hashtable(); private IIssueTypeInfo typeInfo; private IProblemManagerInfo pmInfo; private IAttributeInfo testAttribInfo; public ITFReadProblemManager( IParserGenerator generator ) { this( generator.createParsers() ); } public ITFReadProblemManager( IParser parsers ) { this( new IParser[] { parsers } ); } public ITFReadProblemManager( IParser[] parsers ) { if (parsers == null) { throw new IllegalArgumentException("no null arguments"); } for (int i = 0; i < parsers.length; ++i) { loadParser( parsers[i] ); } setupInfo(); } /** * Returns a list of all issue IDs known by the PMT. This may be an * extremely expensive operation, depending on the size of the underlying * system. This call must never return null. */ public String[] getIssueIDs() { // *Sigh* JDK 1.1 again... String ss[]; synchronized (this.issueIdToIssue) { ss = new String[ this.issueIdToIssue.size() ]; Enumeration enum = this.issueIdToIssue.keys(); for (int i = 0; enum.hasMoreElements(); ++i) { String s = (String)enum.nextElement(); ss[i] = s; } } return ss; } /** * Returns all issue IDs that match the given 'template'. A template is * an issue where all null values are considered 'wildcards', * so that a null state, for instance, would match for any * state object. May change the template in the future to a different * but similar type to allow for regular-expressions. */ public String[] getIssueIDsForTemplate( IIssue issue ) { if (issue == null) { return new String[0]; } if (issue.getType() != null) { // optimization: // there is only one type supported now, so if that type is // not the template type, then there is no match, otherwise // there is no change to the candidate list. if (!issue.getType().equals( typeInfo.getName() )) { return new String[0]; } } if (issue.getState() != null) { // optimization: // there is only one state supported now, which is null. // So since the template expects a specific state which is // not null, there can be no possible match. return new String[0]; } Enumeration currentCandidates; if (issue.getID() != null) { Vector v = new Vector(); v.addElement( getIssueByID( issue.getID() ) ); currentCandidates = v.elements(); } else { currentCandidates = issueIdToIssue.elements(); } if (issue.getShortDescription() != null) { String desc = issue.getShortDescription(); Vector matches = new Vector(); while (currentCandidates.hasMoreElements()) { IIssue check = (IIssue)currentCandidates.nextElement(); if (desc.equals( check.getShortDescription() )) { matches.addElement( check ); } } // update our valid match list currentCandidates = matches.elements(); } if (issue.getAttributes() != null) { // *sigh* there's the major work... IAttributeSet set = issue.getAttributes(); Vector matches = new Vector(); while (currentCandidates.hasMoreElements()) { IIssue check = (IIssue)currentCandidates.nextElement(); if (attributesMatch( set, check.getAttributes() )) { matches.addElement( check ); } } currentCandidates = matches.elements(); } Vector v = new Vector(); while (currentCandidates.hasMoreElements()) { v.addElement( ((IIssue)currentCandidates.nextElement()).getID() ); } String s[] = new String[ v.size() ]; v.copyInto( s ); return s; } /** * Returns the issue associated with the given unique issue ID. If no such * issue exists, then null is returned. Note that the returned * element is a non-editable version of the issue. */ public IIssue getIssueByID( String id ) { return (IIssue)this.issueIdToIssue.get( id ); } /** * Given the real issue, returns the editable version of the issue. */ public IEditableIssue editIssue( IIssue issue ) throws ProblemManagerException { throw new ProblemManagerException( "edit not allowed" ); } /** * Creates a new issue of the given type. If type is * null, then a new issue of the default issue type is * created and returned. */ public IEditableIssue createIssue( String type ) throws ProblemManagerException { throw new ProblemManagerException( "create not allowed" ); } /** * Returns all meta-data for this problem management tracker. */ public IProblemManagerInfo getProblemManagerInfo() { return this.pmInfo; } //------------------------------------------------------------------------- protected void loadParser( IParser p ) { ITestIssueRecord[] tir = p.parse(); if (tir != null) { for (int i = 0; i < tir.length; ++i) { addTestIssueRecord( tir[i] ); } } } protected void addTestIssueRecord( ITestIssueRecord tir ) { if (tir != null) { String id = tir.getIssueRecord().getID(); IIssue issue = (IIssue)this.issueIdToIssue.get( id ); // add the test record to the issue - null issues handled correctly issue = updateITFIssue( issue, tir ); this.issueIdToIssue.put( id, issue ); } } protected IIssue createNewITFIssue( ITestIssueRecord tir ) { String id = tir.getIssueRecord().getID(); String desc = tir.getIssueRecord().getDescription(); return createITFIssue( id, desc, new ITestRecord[] { tir.getTestRecord(), } ); } protected IIssue updateITFIssue( IIssue orig, ITestIssueRecord addTir ) { if (orig == null) { return createNewITFIssue( addTir ); } if (!orig.getID().equals( addTir.getIssueRecord().getID() )) { throw new IllegalArgumentException( "original issue id ("+orig.getID()+ ") not same as input ITestIssueRecord ("+ addTir.getIssueRecord().getID()+")" ); } IAttribute attrib = orig.getAttributes().getAttribute( this.testAttribInfo.getName() ); if (attrib == null) { throw new IllegalArgumentException( "invalid issue: does not contain an attribute with name "+ this.testAttribInfo.getName() ); } ITestRecord[] tr; if (attrib instanceof IListAttribute) { Vector v = new Vector(); Enumeration enum = ((IListAttribute)attrib).getValues(); while (enum.hasMoreElements()) { v.addElement( (ITestRecord)enum.nextElement() ); } v.addElement( addTir.getTestRecord() ); tr = new ITestRecord[ v.size() ]; v.copyInto( tr ); } else { tr = new ITestRecord[] { (ITestRecord)attrib.getValue(), addTir.getTestRecord() }; } String id = orig.getID(); String desc = orig.getShortDescription(); if (desc == null) { desc = addTir.getIssueRecord().getDescription(); } return createITFIssue( id, desc, tr ); } protected IIssue createITFIssue( String id, String desc, ITestRecord[] tr ) { IAttribute a1 = new DefaultListAttribute( tr, this.testAttribInfo ); IAttributeSet as = new DefaultAttributeSet( new IAttribute[] { a1, } ); IIssue issue = new ITFIssue( id, this.typeInfo.getName(), desc, null, as ); return issue; } protected void setupInfo() { if (typeInfo != null || pmInfo != null || testAttribInfo != null) { throw new IllegalStateException("already setup info."); } String defaultIssueName = "test issue"; this.testAttribInfo = new DefaultAttributeInfo( "test", "test that covers this issue", new Class[] { ITestRecord.class } ); this.typeInfo = new DefaultIssueTypeInfo( defaultIssueName, new IAttributeInfo[] { this.testAttribInfo }, null, null, null ); this.pmInfo = new DefaultProblemManagerInfo( defaultIssueName, new IIssueTypeInfo[] { this.typeInfo } ); } protected boolean attributesMatch( IAttributeSet check, IAttributeSet verify ) { IAttribute[] checkAA = check.getAttributes(); IAttribute[] verifyAA = verify.getAttributes(); // Note: for a match to be valid, all of the check attributes // must exist correctly in the verify attributes, but if there are // verify attributes which are not in check, then it's still a // match. for (int checkIndex = 0; checkIndex < checkAA.length; ++checkIndex) { IAttribute checkA = checkAA[ checkIndex ]; if (checkA == null) { // ignore this one - assume it's a match continue; } boolean notfound = true; for (int verifyIndex = 0; verifyIndex < verifyAA.length; ++verifyIndex) { IAttribute verifyA = verifyAA[ verifyIndex ]; if (verifyA == null) { // this attribute has already been matched, so skip to // the next one. continue; } if (attributeMatch( checkA, verifyA )) { // At this point, we have verified that both attributes do // indeed match each other. Mark it as so. notfound = false; verifyAA[ verifyIndex ] = null; break; } } if (notfound) { // did not find a match for the check attribute in any // of the verify attributes. return false; } } return true; } protected boolean attributeMatch( IAttribute checkA, IAttribute verifyA ) { // If checkA specifies an Info, then the infos must // match, otherwise, it will match any attribute. if (checkA.getInfo() != null) { if (!verifyA.getInfo().equals( checkA.getInfo() )) { // cannot possibly be a match return false; } } // If checkA specifies a value, then both values must match, // otherwise it will match any value. if (checkA.getValue() != null) { // if they're both list attributes, then check need to only // contain a sub-set of the verify elements. if (checkA instanceof IListAttribute) { if (!(verifyA instanceof IListAttribute)) { // cannot possibly be a match return false; } IListAttribute verifyLA = (IListAttribute)verifyA; Enumeration checkE = ((IListAttribute)checkA).getValues(); while (checkE.hasMoreElements()) { Object checkO = checkE.nextElement(); Enumeration verifyE = verifyLA.getValues(); boolean enumNotfound = true; while (verifyE.hasMoreElements()) { if (checkO.equals( verifyE.nextElement() )) { // matched this value. enumNotfound = false; break; } } if (enumNotfound) { // no match for the check's value. return false; } } } else { if (!checkA.getValue().equals( verifyA.getValue() )) { // values don't match. return false; } } } // We have verified that both attributes do indeed match each other. return true; } private static class ITFIssue extends AbstractIssue { public ITFIssue( String i, String t, String d, IIssueState s, IAttributeSet a ) { super( i, t, d, s, a ); } public IIssue reload() throws ProblemManagerException { // assumption is that this problem manager is read-only, so // it won't change underneath us. // Yes, that's not necessarily true, but it keeps the // implementation simple. return this; } } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordWriter.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordWr0000644000175000017500000000423607622026417034116 0ustar drazzibdrazzib/* * @(#)ITestIssueRecordWriter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import java.io.IOException; /** * Writes test-issues to some location. This may be an XML file, an external * Problem Tracker, or just output to the screen. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public interface ITestIssueRecordWriter { /** * Write the given record set to the output repository in the correct * format. * * @param set the set of records to write. * @param name a hint to specify a category to describe the set's output; * this may be used to generate a filename, among other things. */ public void write( ITestIssueRecordSet set, String name ) throws IOException; } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecord.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecord.j0000644000175000017500000000425307622026417034034 0ustar drazzibdrazzib/* * @(#)ITestIssueRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; /** * Encapsulates all the data that results from a issue record being * associated with a testcase. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public interface ITestIssueRecord { /** * Returns the issue this record is associated with. This cannot * be null. */ public IIssueRecord getIssueRecord(); /** * Returns the test this record is associated with. This cannot be * null. */ public ITestRecord getTestRecord(); /** * Returns any descriptive text the test associated itself with to the * issue. This may be null. */ public String getDescription(); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/IIssueRecord.java0000644000175000017500000000372307622026417033665 0ustar drazzibdrazzib/* * @(#)IIssueRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; /** * Encapsulates all the data needed to reflect an issue reported by a testcase. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public interface IIssueRecord { /** * Returns the unique ID for the issue. */ public String getID(); /** * Returns a human-readable brief description about the issue. If there * is no known description, null is an acceptable return value. */ public String getDescription(); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/0000755000175000017500000000000011271425773031421 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIssueRecordSet.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIs0000644000175000017500000000472707622026420034065 0ustar drazzibdrazzib/* * @(#)DefaultTestIssueRecordSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSet; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; /** * A simple immutable set of issue records. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class DefaultTestIssueRecordSet implements ITestIssueRecordSet { private ITestIssueRecord tir[]; public DefaultTestIssueRecordSet( ITestIssueRecord tir[] ) { if (tir == null) { this.tir = new ITestIssueRecord[0]; } else { this.tir = new ITestIssueRecord[ tir.length ]; System.arraycopy( tir, 0, this.tir, 0, tir.length ); } } /** * Return all the records in this set. */ public ITestIssueRecord[] getTestIssueRecords() { ITestIssueRecord[] ret = new ITestIssueRecord[ this.tir.length ]; System.arraycopy( this.tir, 0, ret, 0, this.tir.length ); return ret; } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestRecord.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestRe0000644000175000017500000000554107622026420034053 0ustar drazzibdrazzib/* * @(#)DefaultTestRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestRecord; /** * Simple changeable implementation of ITestRecord. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class DefaultTestRecord extends ImmutableTestRecord { private String name; private String suite; private int tCount; private long tRuntime; private String[] failures; private String[] errors; private String log; public DefaultTestRecord() { super(); } public DefaultTestRecord( ITestRecord tr ) { super( tr ); } public void setTestName( String name ) { super.setTestName( name ); } public void setTestSuite( String suite ) { super.setTestSuite( suite ); } public void setTestCount( int count ) { super.setTestCount( count ); } public void setRuntime( long time ) { super.setRuntime( time ); } public void setFailures( String[] f ) { super.setFailures( f ); } public void setErrors( String[] e ) { super.setErrors( e ); } public void setLog( String log ) { super.setLog( log ); } public ImmutableTestRecord createImmutable() { return new ImmutableTestRecord( this ); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/AbstractTestIssueRecordCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/AbstractTestI0000644000175000017500000000641507622026417034063 0ustar drazzibdrazzib/* * @(#)FactorParserCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSet; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordCollator; import java.util.Hashtable; import java.util.Vector; import java.util.Enumeration; /** * Collates the parsers' parsed records into record sets based on their * containment in some factor of the test issue record. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 7, 2002 */ public abstract class AbstractTestIssueRecordCollator implements ITestIssueRecordCollator { public ITestIssueRecordSet[] collate( ITestIssueRecord[] r ) { if (r == null || r.length <= 0) { return new ITestIssueRecordSet[0]; } Hashtable suites = new Hashtable(); for (int i = 0; i < r.length; ++i) { if (r[i] != null) { Object s = getFactor( r[i] ); Vector v = (Vector)suites.get( s ); if (v == null) { v = new Vector(); suites.put( s, v ); } v.addElement( r[i] ); } } ITestIssueRecordSet sets[] = new ITestIssueRecordSet[ suites.size() ]; Enumeration enum = suites.elements(); for (int i = 0; enum.hasMoreElements(); ++i) { Vector v = (Vector)enum.nextElement(); ITestIssueRecord[] rset = new ITestIssueRecord[ v.size() ]; v.copyInto( rset ); sets[i] = new DefaultTestIssueRecordSet( rset ); } return sets; } /** * Discovers the sorting factor from the given record. */ protected abstract Object getFactor( ITestIssueRecord r ); } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/ImmutableTestRecord.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/ImmutableTest0000644000175000017500000001126207622026420034114 0ustar drazzibdrazzib/* * @(#)ImmutableTestRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestRecord; /** * Simple immutable implementation of ITestRecord. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class ImmutableTestRecord implements ITestRecord { private String name; private String suite; private int tCount; private long tRuntime; private String[] failures; private String[] errors; private String log; public ImmutableTestRecord( String name, String suite, int tCount, long tRuntime, String[] failures, String[] errors, String log ) { setTestName( name ); setTestSuite( suite ); setTestCount( tCount ); setRuntime( tRuntime ); setFailures( failures ); setErrors( errors ); setLog( log ); } public ImmutableTestRecord( ITestRecord tr ) { if (tr == null) { throw new IllegalArgumentException("no null arguments"); } setTestName( tr.getTestName() ); setTestSuite( tr.getTestSuite() ); setTestCount( tr.getTestCount() ); setRuntime( tr.getRuntime() ); setFailures( tr.getFailures() ); setErrors( tr.getErrors() ); setLog( tr.getLog() ); } public String getTestName() { return this.name; } public String getTestSuite() { return this.suite; } public int getTestCount() { return this.tCount; } public long getRuntime() { return this.tRuntime; } public String[] getFailures() { String ret[] = new String[ this.failures.length ]; System.arraycopy( this.failures, 0, ret, 0, this.failures.length ); return ret; } public String[] getErrors() { String ret[] = new String[ this.errors.length ]; System.arraycopy( this.errors, 0, ret, 0, this.errors.length ); return ret; } public String getLog() { return this.log; } //------------------------------- // Package protected ImmutableTestRecord() { setErrors( null ); setFailures( null ); } void setTestName( String name ) { this.name = name; } void setTestSuite( String suite ) { this.suite = suite; } void setTestCount( int count ) { if (count < 0) { count = 0; } this.tCount = count; } void setRuntime( long time ) { if (time < 0L) { time = 0L; } this.tRuntime = time; } void setFailures( String[] f ) { if (f == null) { f = new String[0]; } this.failures = new String[ f.length ]; System.arraycopy( f, 0, this.failures, 0, f.length ); } void setErrors( String[] e ) { if (e == null) { e = new String[0]; } this.errors = new String[ e.length ]; System.arraycopy( e, 0, this.errors, 0, e.length ); } void setLog( String log ) { this.log = log; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/SuiteTestIssueRecordCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/SuiteTestIssu0000644000175000017500000000426007622026420034132 0ustar drazzibdrazzib/* * @(#)SuiteTestIssueRecordCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestRecord; import java.util.Hashtable; import java.util.Vector; import java.util.Enumeration; /** * Collates the parsers' parsed records into record sets based on their * containment in test suites. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class SuiteTestIssueRecordCollator extends AbstractTestIssueRecordCollator { protected Object getFactor( ITestIssueRecord r ) { String s = r.getTestRecord().getTestSuite(); if (s == null) { s = ""; } return s; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/IssueTestIssueRecordCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/IssueTestIssu0000644000175000017500000000415207622026420034131 0ustar drazzibdrazzib/* * @(#)IssueTestIssueRecordCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import java.util.Hashtable; import java.util.Vector; import java.util.Enumeration; /** * Collates the parsers' parsed records into record sets based on their * containment in issue ID. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class IssueTestIssueRecordCollator extends AbstractTestIssueRecordCollator { protected Object getFactor( ITestIssueRecord r ) { String s = r.getIssueRecord().getID(); if (s == null) { s = ""; } return s; } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIssueRecord.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIs0000644000175000017500000000536507622026420034064 0ustar drazzibdrazzib/* * @(#)DefaultTestIssueRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.IIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestRecord; /** * Simple immutable implementation of ITestIssueRecord. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class DefaultTestIssueRecord implements ITestIssueRecord { private IIssueRecord ir; private ITestRecord tr; private String desc; public DefaultTestIssueRecord( IIssueRecord ir, ITestRecord tr, String d ) { if (ir == null || tr == null) { throw new IllegalArgumentException("no null arguments"); } this.ir = ir; this.tr = tr; this.desc = d; } /** * Returns the issue this record is associated with. */ public IIssueRecord getIssueRecord() { return this.ir; } /** * Returns the test this record is associated with. */ public ITestRecord getTestRecord() { return this.tr; } /** * Returns any descriptive text the test associated itself with to the * issue. */ public String getDescription() { return this.desc; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/NameTestIssueRecordCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/NameTestIssue0000644000175000017500000000416007622026420034065 0ustar drazzibdrazzib/* * @(#)NameTestIssueRecordCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import java.util.Hashtable; import java.util.Vector; import java.util.Enumeration; /** * Collates the parsers' parsed records into record sets based on their * containment in test names. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class NameTestIssueRecordCollator extends AbstractTestIssueRecordCollator { protected Object getFactor( ITestIssueRecord r ) { String s = r.getTestRecord().getTestName(); if (s == null) { s = ""; } return s; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/XMLTestIssueRecordWriter.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/XMLTestIssueR0000644000175000017500000000504707622026420033774 0ustar drazzibdrazzib/* * @(#)XMLTestIssueRecordWriter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import java.io.Writer; import java.io.StringWriter; import java.io.PrintWriter; import java.io.IOException; import net.sourceforge.groboutils.pmti.v1.itf.IIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSet; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordWriter; /** * Parses the output of XMLFileServer. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:00 $ */ public class XMLTestIssueRecordWriter implements ITestIssueRecordWriter { /** * Write the given record set to the output repository in the correct * format. * * @param set the set of records to write. * @param name a hint to specify a category to describe the set's output; * this may be used to generate a filename, among other things. */ public void write( ITestIssueRecordSet set, String name ) throws IOException { // XXXXXXXXXXXXXXXXXX // throw new IllegalStateException("not implemented yet"); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultIssueRecord.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultIssueR0000644000175000017500000000434407622026420034057 0ustar drazzibdrazzib/* * @(#)DefaultIssueRecord.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.IIssueRecord; /** * Simple immutable implementation of IIssueRecord. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class DefaultIssueRecord implements IIssueRecord { private String id; private String desc; public DefaultIssueRecord( String id, String desc ) { if (id == null) { throw new IllegalArgumentException("no null arguments"); } this.id = id; this.desc = desc; } /** * Returns the unique ID for the issue. */ public String getID() { return this.id; } public String getDescription() { return this.desc; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/AllTestIssueRecordCollator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/itf/impl/AllTestIssueR0000644000175000017500000000437107622026420034043 0ustar drazzibdrazzib/* * @(#)AllTestIssueRecordCollator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSet; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordCollator; import java.util.Vector; import java.util.Enumeration; /** * Collates the parsers' parsed records into a single record set. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:00 $ * @since July 7, 2002 */ public class AllTestIssueRecordCollator implements ITestIssueRecordCollator { public ITestIssueRecordSet[] collate( ITestIssueRecord[] r ) { if (r == null || r.length <= 0) { return new ITestIssueRecordSet[0]; } // else return new ITestIssueRecordSet[] { new DefaultTestIssueRecordSet( r ) }; } } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/package.html0000644000175000017500000000013307521071643032150 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1 libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IAttributeInfo.java0000644000175000017500000000513207622026412033422 0ustar drazzibdrazzib/* * @(#)IAttributeInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Describes a particular attribute. Note that since attributes may be * shared among issue types, this cannot describe the particulars of the * real attribute's type. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 12, 2002 */ public interface IAttributeInfo { /** * Returns the identifying name of this attribute. This cannot be * null. */ public String getName(); /** * Returns a human-readable description of this attribute. This may * be null. */ public String getDescription(); /** * Returns a list of the acceptable types (baseclasses and * interfaces) for the values stored with this attribute. Implementations * should return a minimal but most descriptive set of classes * (that is, only returning java.lang.Object is not descriptive; * likewise if there are many known implementations of an inferface, * only the interface need to be returned). This is a convenience method, * and should not be relied upon to generate input values. */ public Class[] getValueTypes(); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/0000755000175000017500000000000011271425773031316 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditableAttributeSet.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditabl0000644000175000017500000000534707622026416034117 0ustar drazzibdrazzib/* * @(#)DefaultEditableAttributeSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IEditableAttributeSet; import net.sourceforge.groboutils.pmti.v1.IEditableAttribute; import net.sourceforge.groboutils.pmti.v1.IAttribute; /** * An editable form of an IAttributeSet. Note that the set of editable * attributes cannot be changed - just their contents. *

    * Note: as written, this class is not easily extendable, especially if the * corresponding super class is different. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultEditableAttributeSet extends DefaultAttributeSet implements IEditableAttributeSet { public DefaultEditableAttributeSet( IEditableAttribute a[] ) { super( a ); } /** * Synonymn for getAttributes() */ public IEditableAttribute[] getEditableAttributes() { return (IEditableAttribute[])getAttributes(); } /** * Synonymn for getAttribute( String ) */ public IEditableAttribute getEditableAttribute( String name ) { return (IEditableAttribute)getAttribute( name ); } protected IAttribute[] createAttributeArray( int size ) { return new IEditableAttribute[ size ]; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttributeSet.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribu0000644000175000017500000000752407622026416034164 0ustar drazzibdrazzib/* * @(#)DefaultAttributeSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IAttributeSet; import net.sourceforge.groboutils.pmti.v1.IAttribute; import java.util.Hashtable; import java.util.Enumeration; /** * Contains a queryable set of attribute name-value pairs associated with * issue types. Implementations may have direct accessors for these * attributes. Common attributes include: who reported the issue, a list * of comments written about this issue, and a history of the changes the * issue has gone through. All IAttributeSet implementations must be * immutable, unless they also implement IEditableAttributeSet. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultAttributeSet implements IAttributeSet { private Hashtable attribs; public DefaultAttributeSet( IAttribute[] a ) { if (a == null) { throw new IllegalArgumentException("no null arguments"); } this.attribs = new Hashtable(); for (int i = 0; i < a.length; ++i) { if (a[i] != null) { this.attribs.put( a[i].getInfo().getName(), a[i] ); } } } /** * Returns a list of all attributes. */ public IAttribute[] getAttributes() { IAttribute a[] = createAttributeArray( this.attribs.size() ); Enumeration enum = this.attribs.elements(); for (int i = 0; enum.hasMoreElements(); ++i) { a[i] = (IAttribute)enum.nextElement(); } return a; } /** * */ public String[] getAttributeNames() { String s[] = new String[ this.attribs.size() ]; Enumeration enum = this.attribs.keys(); for (int i = 0; enum.hasMoreElements(); ++i) { s[i] = (String)enum.nextElement(); } return s; } /** * Finds the attribute for the given name. * * @return the attribute for the name, or null if no such * attribute exists. */ public IAttribute getAttribute( String name ) { if (name == null) { return null; } return (IAttribute)this.attribs.get( name ); } protected IAttribute[] createAttributeArray( int size ) { return new IAttribute[ size ]; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribute.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribu0000644000175000017500000000476707622026416034172 0ustar drazzibdrazzib/* * @(#)DefaultAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IAttribute; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; /** * A simple name-value association for a specific kind of issue attribute. * All implementations of IAttribute are immutable, unless they also * implement IEditableAttribute. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultAttribute implements IAttribute { private Object value; private IAttributeInfo info; public DefaultAttribute( Object v, IAttributeInfo i ) { if (i == null) { throw new IllegalArgumentException("no null arguments"); } this.value = v; this.info = i; } /** * Returns the value for this attribute. */ public Object getValue() { return this.value; } /** * Returns the meta-information for this attribute. */ public IAttributeInfo getInfo() { return this.info; } } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/package.html0000644000175000017500000000014307521071644033572 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.defimpl ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditableIssueState.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditabl0000644000175000017500000000467407622026416034121 0ustar drazzibdrazzib/* * @(#)DefaultEditableIssueState.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IEditableIssueState; import net.sourceforge.groboutils.pmti.v1.IAttributeSet; import net.sourceforge.groboutils.pmti.v1.IEditableAttributeSet; /** * An editable form of an issue's state. Only the associated attributes * may be changed. Everything else is hard-coded by the owning PMT. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultEditableIssueState extends DefaultIssueState implements IEditableIssueState { public DefaultEditableIssueState( String n, String d, boolean o, IEditableAttributeSet s ) { super( n, d, o, s ); } /** * A synonymn for getAttributes(), but explicitly declares that * the returned attributes are editable, without the need for a cast. */ public IEditableAttributeSet getEditableAttributes() { return (IEditableAttributeSet)getAttributes(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditableListAttribute.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditab0000644000175000017500000001625607622026415034122 0ustar drazzibdrazzib/* * @(#)AbstractEditableListAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IEditableListAttribute; import net.sourceforge.groboutils.pmti.v1.IListAttribute; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; import java.util.Vector; import java.util.Enumeration; /** * A simple name-value association for a specific kind of issue attribute. * All implementations of IAttribute are immutable, unless they also * implement IEditableAttribute. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:57 $ * @since July 12, 2002 */ public abstract class AbstractEditableListAttribute implements IEditableListAttribute { private Vector vals; private IAttributeInfo info; private boolean changedVals = false; public AbstractEditableListAttribute( IListAttribute a ) { if (a == null) { throw new IllegalArgumentException("no null arguments"); } this.info = a.getInfo(); Enumeration enum = a.getValues(); this.vals = new Vector(); while (enum.hasMoreElements()) { this.vals.addElement( enum.nextElement() ); } } //------------------------------------------------------------------------- // IAttribute /** * Returns the enumeration for all values in this attribute. */ public Object getValue() { return getValues(); } /** * Returns the meta-information for this attribute. */ public IAttributeInfo getInfo() { return this.info; } //------------------------------------------------------------------------- // IListAttribute /** * A synonym for getValue(), but redefined here to explicitly * declare the returned type. */ public Enumeration getValues() { // clone the vector since this implementation is not immutable. return ((Vector)this.vals.clone()).elements(); } /** * */ public int getValueCount() { return this.vals.size(); } /** * */ public boolean containsValue( Object value ) { return this.vals.contains( value ); } //------------------------------------------------------------------------- // IEditableAttribute /** * This list version needs special handling for when the value is an * array. * * @exception IllegalArgumentException thrown if the value argument is * invalid. */ public void setValue( Object value ) { if (!isValidValue( value )) { throw new IllegalArgumentException("Value "+value+ " is not a valid value" ); } this.changedVals = true; this.vals.removeAllElements(); if (value instanceof Object[]) { Object[] o = (Object[])value; for (int i = 0; i < o.length; ++i) { this.vals.addElement( o[i] ); } } else { this.vals.addElement( value ); } } /** * @return true if the setValue( Object ) method has * been called on this instance and the actual value has changed * (via inspection with == and equals()), * otherwise false. */ public boolean hasValueChanged() { return this.changedVals; } /** * Specialization of the original purpose. Allows for the value to * be an array, in which case it checks each element. In the * case of an array, the array is invalid if any one element inside is * invalid. Do not override this method with an explicit array form - * the Java calling methodology is NOT dynamic, so if this class is * known as an IEditableAttribute, then this method will be invoked, not * the array form. */ public boolean isValidValue( Object value ) { if (value != null && value instanceof Object[]) { Object[] o = (Object[])value; for (int i = 0; i < o.length; ++i) { if (!innerIsValidValue( o[i] )) { // an element is invalid - the whole array is invalid. return false; } } // all elements are valid return true; } else return innerIsValidValue( value ); } /** * Simplified form of the value validation check. This method * should not perform array checking. */ protected abstract boolean innerIsValidValue( Object value ); //------------------------------------------------------------------------- // IEditableListAttribute /** * This method still performs array checking. * * @exception IllegalArgumentException thrown if the value argument is * invalid. */ public void addValue( Object value ) { if (!isValidValue( value )) { throw new IllegalArgumentException("value "+value+" is invalid"); } this.changedVals = true; if (value != null && value instanceof Object[]) { Object[] o = (Object[])value; for (int i = 0; i < o.length; ++i) { this.vals.addElement( o[i] ); } } else { this.vals.addElement( value ); } } /** * Does nothing if the value is not in the list of known values. */ public void removeValue( Object value ) { this.vals.removeElement( value ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultProblemManagerInfo.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultProblem0000644000175000017500000000710407622026417034145 0ustar drazzibdrazzib/* * @(#)DefaultProblemManagerInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IProblemManagerInfo; import net.sourceforge.groboutils.pmti.v1.IIssueTypeInfo; import java.util.Hashtable; import java.util.Enumeration; /** * Information about the owning problem manager. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 12, 2002 */ public class DefaultProblemManagerInfo implements IProblemManagerInfo { private String defaultType; private Hashtable types = new Hashtable(); /** * There must be at least one type info, and the passed-in default type * (dt) must be contained within the set. */ public DefaultProblemManagerInfo( String dt, IIssueTypeInfo[] t ) { if (dt == null || t == null) { throw new IllegalArgumentException("no null arguments"); } boolean foundDT = false; for (int i = 0; i < t.length; ++i) { if (t[i] != null) { String name = t[i].getName(); this.types.put( name, t[i] ); if (dt.equals( name )) { foundDT = true; } } } if (!foundDT) { throw new IllegalArgumentException("no such type "+dt); } this.defaultType = dt; } /** * Returns a list of all known types of issues, which can be used in * the creation of a new issue through createIssue( String ). */ public String[] getIssueTypes() { String s[] = new String[ this.types.size() ]; Enumeration enum = this.types.keys(); for (int i = 0; enum.hasMoreElements(); ++i) { s[i] = (String)enum.nextElement(); } return s; } /** * */ public String getDefaultType() { return this.defaultType; } /** * Returns all relevant meta-information about the issues of the given * type. */ public IIssueTypeInfo getTypeInfo( String type ) { return (IIssueTypeInfo)this.types.get( type ); } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractIssue.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractIssue.0000644000175000017500000001451607622026415034075 0ustar drazzibdrazzib/* * @(#)AbstractIssue.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IIssue; import net.sourceforge.groboutils.pmti.v1.IAttributeSet; import net.sourceforge.groboutils.pmti.v1.IIssueState; import net.sourceforge.groboutils.pmti.v1.ProblemManagerException; /** * Reflects an issue (or bug, or anomally report, or problem ticket) that * is generic enough to be used by most problem tracker system. All * IIssue instances are immutable, unless they also implement * IEditableIssue. *

    * An issue will only reflect the data associated with the issue at the time of * the polling of the issue from the tracker. Currently, the only way to * update the issue's data fields is to re-poll the issue from the * ProblemManager, or to call reload(). Individual * implemenations of the PMTI framework * may provide alternative means to real-time update the issue data, but that * is not the standard implementation. *

    * Containment patterns would require the creation methods for an editable form * of the issue to be in this interface. For security reasons, this method * is placed in the ProblemManager interface instead. *

    * NOTE: this interface may be too generic to be useful. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:57 $ * @since July 12, 2002 */ public abstract class AbstractIssue implements IIssue { private String id; private String type; private String desc; private IIssueState state; private IAttributeSet attribs; public AbstractIssue( String i, String t, String d, IIssueState s, IAttributeSet a ) { if (i == null || s == null) { throw new IllegalArgumentException("no null arguments"); } this.id = i; this.type = t; this.desc = d; this.state = s; this.attribs = a; } /** * Returns the unique ID associated with this issue. * * @return the problem tracker's assigned ID for this issue. */ public String getID() { return this.id; } /** * Returns the type of issue. For the SourceForge.net site, this may * be "bug", "feature request", and so forth. Some trackers may only * have one type of issue, so this field may not be as useful. For * those trackers that have different attribute data sets for different * types, this may aid programs in decoding the attributes and states. *

    * NOTE: this field may be deprecated in the future in favor of specific * IAttributeSet types. * * @see #getAttributes() */ public String getType() { return this.type; } /** * Retrieves the short description of the issue. This can also be * referred to as the issue title or summary. It should be a * human-readable short description, describing a general overview * of the issue. * * @return the issue's short description. */ public String getShortDescription() { return this.desc; } /** * Queries the "state" of the issue. In a very general way, this refers * to various progress states an issue can be in, such as "new", "assigned", * "investigating", "resolved", "verified", "closed", and so on. Additional * data may be associated with this state, such as who's working on the * issue, the resolution of the issue, who verified the resolution, and * so on. If the tracker does not support a state, then null * may be returned. *

    * Some trackers may have different state categories for different * issue types. * * @return the issue's state, which may be null. */ public IIssueState getState() { return this.state; } /** * Returns a list of all attributes associated with this issue. All * issues of a particular type should have the same set of issues. * * @return the set of tracker-specific and issue type-specific attributes * and values associated with this issue. Can never return * null. */ public IAttributeSet getAttributes() { return this.attribs; } /** * Reloads all the data in this issue so that it reflects the most current * tracker data possible. If this is called on an editable issue, then * all changes will be forgotten, and the issue will reflect the current * tracker state. *

    * In theory, issues should never be removed. However, some systems allow * them to be deleted (say, if there was an accidental creation). In this * case, an IssueRemovedException will be thrown. * * @exception ProblemManagerException if there was an underlying tracker * error. */ public abstract IIssue reload() throws ProblemManagerException; } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueTypeInfo.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueTy0000644000175000017500000001044207622026416034150 0ustar drazzibdrazzib/* * @(#)DefaultIssueTypeInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IIssueTypeInfo; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; import net.sourceforge.groboutils.pmti.v1.IIssueState; /** * Information about the owning problem manager. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultIssueTypeInfo implements IIssueTypeInfo { private String name; private IAttributeInfo[] attribs; private IIssueState[] allStates; private IIssueState[] passed; private IIssueState[] failed; public DefaultIssueTypeInfo( String n, IAttributeInfo[] at, IIssueState[] as, IIssueState[] ps, IIssueState[] fs ) { if (n == null || at == null) { throw new IllegalArgumentException("no null arguments"); } this.name = n; this.allStates = copyStates( as ); this.passed = copyStates( ps ); this.failed = copyStates( fs ); this.attribs = copyAttributeInfo( at ); } /** * Returns the type name. */ public String getName() { return this.name; } /** * Returns all states for the current issue type. */ public IIssueState[] getPossibleStates() { return copyStates( this.allStates ); } /** * Returns all attributes allowed for an issue of this type. */ public IAttributeInfo[] getSupportedAttributes() { return copyAttributeInfo( this.attribs ); } /** * Returns the state that refer to the associated tests passing. Allows * for multiple states, for situations such as marked-as-fixed and * tests pass, or still-open but tests pass. */ public IIssueState[] getTestPassedStates() { return copyStates( this.passed ); } /** * Returns the state that refer to the associated tests failing. Allows * for multiple states, for situations such as marked-as-fixed but * tests fail, or still-open but tests fail. */ public IIssueState[] getTestFailedStates() { return copyStates( this.failed ); } private IIssueState[] copyStates( IIssueState[] s ) { IIssueState[] ret; if (s == null) { ret = new IIssueState[0]; } else { ret = new IIssueState[ s.length ]; System.arraycopy( s, 0, ret, 0, s.length ); } return ret; } private IAttributeInfo[] copyAttributeInfo( IAttributeInfo[] a ) { if (a == null) { throw new IllegalArgumentException("no null arguments"); } IAttributeInfo[] ret = new IAttributeInfo[ a.length ]; System.arraycopy( a, 0, ret, 0, a.length ); return ret; } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueState.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueSt0000644000175000017500000001070607622026416034145 0ustar drazzibdrazzib/* * @(#)DefaultIssueState.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IIssueState; import net.sourceforge.groboutils.pmti.v1.IAttributeSet; /** * Describes the state of an Issue. Issue states may have additional * information associated with them, and as such uses the Attribute methodology * in the same way an Issue does. All implementations of IIssueState * must be immutable, unless they are also instances of * IEditableIssueState. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultIssueState implements IIssueState { private String name; private String desc; private boolean open; private IAttributeSet attribs; public DefaultIssueState( String n, String d, boolean o, IAttributeSet s ) { if (n == null || d == null || s == null) { throw new IllegalArgumentException("no null arguments"); } this.name = n; this.desc = d; this.open = o; this.attribs = s; } /** * Returns the short name of the state. * * @return the short readable name of the state. */ public String getName() { return this.name; } /** * Retrieves a long, human-readable, description of the state. * * @return the state's description. */ public String getDescription() { return this.desc; } /** * A broad category for the state - it means that the issue has not been * resolved yet, and the code is still open for changes based on this * issue. *

    * isOpen() must always return the opposite of * isClosed(); that is, the following code: *

         *      isOpen() == !isClosed()
         * 
    * must always evaluate to true. */ public boolean isOpen() { return this.open; } /** * A broad category for the state - it means that the issue has been * resolved, and the code is no longer open for changes based on this * issue. *

    * isClosed() must always return the opposite of * isOpen(); that is, the following code: *

         *      isOpen() == !isClosed()
         * 
    * must always evaluate to true. */ public boolean isClosed() { return !isOpen(); } /** * Returns a list of all attributes associated with this state. All * states of a particular type should have the same set of issues. If * the problem tracker does not have attributes associated with an issue * state, then this must still return a non-null, but the set * will be empty. * * @return the set of tracker-specific and issue type-specific attributes * and values associated with this issue. Can never return * null. */ public IAttributeSet getAttributes() { return this.attribs; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttributeInfo.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribu0000644000175000017500000000663307622026416034164 0ustar drazzibdrazzib/* * @(#)DefaultAttributeInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; /** * Describes a particular attribute. Note that since attributes may be * shared among issue types, this cannot describe the particulars of the * real attribute's type. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:58 $ * @since July 12, 2002 */ public class DefaultAttributeInfo implements IAttributeInfo { private String name; private String desc; private Class[] types; public DefaultAttributeInfo( String n, String d, Class[] t ) { if (n == null) { throw new IllegalArgumentException("no null arguments"); } this.types = copyClasses( t ); this.name = n; this.desc = d; } /** * Returns the identifying name of this attribute. */ public String getName() { return this.name; } /** * Returns a human-readable description of this attribute. */ public String getDescription() { return this.desc; } /** * Returns a list of the acceptable types (baseclasses and * interfaces) for the values stored with this attribute. Implementations * should return a minimal but most descriptive set of classes * (that is, only returning java.lang.Object is not descriptive; * likewise if there are many known implementations of an inferface, * only the interface need to be returned). This is a convenience method, * and should not be relied upon to generate input values. */ public Class[] getValueTypes() { return copyClasses( this.types ); } private Class[] copyClasses( Class[] c ) { if (c == null) { throw new IllegalArgumentException("no null arguments"); } Class[] ret = new Class[ c.length ]; System.arraycopy( c, 0, ret, 0, c.length ); return ret; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultListAttribute.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultListAtt0000644000175000017500000001061407622026417034131 0ustar drazzibdrazzib/* * @(#)DefaultListAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IListAttribute; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; import java.util.Enumeration; import java.util.NoSuchElementException; /** * A specialization of an attribute which contains a list of values. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:59 $ * @since July 12, 2002 */ public class DefaultListAttribute implements IListAttribute { // don't use a vector for memory and synchronization efficiency private Object[] obj; private IAttributeInfo info; public DefaultListAttribute( Object[] o, IAttributeInfo i ) { if (i == null) { throw new IllegalArgumentException("no null arguments"); } this.obj = copyObj( o ); this.info = i; } /** * Returns the enumeration for all values in this attribute. */ public Object getValue() { return getValues(); } /** * Returns the meta-information for this attribute. */ public IAttributeInfo getInfo() { return this.info; } /** * A synonym for getValue(), but redefined here to explicitly * declare the returned type. */ public Enumeration getValues() { // don't need to copy the object array - it's immutable! return new ArrayEnum( this.obj ); } /** * */ public int getValueCount() { return this.obj.length; } /** * */ public boolean containsValue( Object value ) { for (int i = 0; i < this.obj.length; ++i) { Object o = this.obj[i]; if (value == null) { if (o == null) { return true; } } else if (value.equals( o )) { return true; } } return false; } private Object[] copyObj( Object[] o ) { if (o == null) { throw new IllegalArgumentException("no null arguments"); } Object ret[] = new Object[ o.length ]; System.arraycopy( o, 0, ret, 0, o.length ); return ret; } private static class ArrayEnum implements Enumeration { private Object vals[]; private int index; public ArrayEnum( Object o[] ) { this.vals = o; this.index = 0; } public boolean hasMoreElements() { return (this.index < this.vals.length); } public Object nextElement() { if (this.index >= this.vals.length) { throw new NoSuchElementException(); } Object ret = this.vals[ this.index ]; ++this.index; return ret; } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditableAttribute.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditab0000644000175000017500000000754207622026415034120 0ustar drazzibdrazzib/* * @(#)AbstractEditableAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IEditableAttribute; import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; import net.sourceforge.groboutils.pmti.v1.IAttribute; /** * This uses delegation to allow for maximum flexibility in creating new * editable attributes based on this class through subclassing. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:57 $ * @since July 12, 2002 */ public abstract class AbstractEditableAttribute implements IEditableAttribute { private Object newvalue; private boolean valueChanged = false; private IAttribute baseAttrib; public AbstractEditableAttribute( IAttribute base ) { if (base == null) { throw new IllegalArgumentException("no null arguments"); } this.baseAttrib = base; } /** * Returns the current (possibly modified) value for this attribute. */ public Object getValue() { Object ret; if (this.valueChanged) { ret = this.newvalue; } else { ret = this.baseAttrib.getValue(); } return ret; } /** * Returns the meta-information for this attribute. */ public IAttributeInfo getInfo() { return this.baseAttrib.getInfo(); } /** * @exception IllegalArgumentException thrown if the value argument is * invalid. */ public void setValue( Object value ) { if (!isValidValue( value )) { throw new IllegalArgumentException( "invalid value "+value ); } Object orig = this.baseAttrib.getValue(); if ( value == orig || ( value != null && value.equals( orig ) ) ) { // no change from the original this.valueChanged = false; } else { this.valueChanged = true; this.newvalue = value; } } /** * @return true if the setValue( Object ) method has * been called on this instance and the actual value has changed * (via inspection with == and equals()), * otherwise false. */ public boolean hasValueChanged() { return this.valueChanged; } /** * */ public abstract boolean isValidValue( Object value ); } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditableIssue.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditab0000644000175000017500000002422307622026415034113 0ustar drazzibdrazzib/* * @(#)AbstractEditableIssue.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.IIssue; import net.sourceforge.groboutils.pmti.v1.IIssueState; import net.sourceforge.groboutils.pmti.v1.IAttributeSet; import net.sourceforge.groboutils.pmti.v1.IEditableIssue; import net.sourceforge.groboutils.pmti.v1.IEditableIssueState; import net.sourceforge.groboutils.pmti.v1.IEditableAttributeSet; import net.sourceforge.groboutils.pmti.v1.ProblemManagerException; /** * Allows for editing of an issue. The only parts that can't be edited are * the ID and type, since those uniquely identify the issue at hand. Editing * an issue has several constraints that should be known by the user: *
      *
    • * Just like with the IIssue instances, the issue being * edited will NOT be real-time updated to reflect the current * tracker state. Currently, the only way to update an issue is by * re-polling the ProblemManager. Individual implementations * may provide for alternative means to receive synchronized issues. *
    • *
    • * No changes to an editable issue will be committed to the problem * tracker is to call commit() on the issue. *
    • *
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:57 $ * @since July 12, 2002 */ public abstract class AbstractEditableIssue implements IEditableIssue { private IIssue baseIssue; private String newDesc; private boolean changedDesc; private IIssueState newState; private boolean changedState; private IEditableAttributeSet nextSet; public AbstractEditableIssue( IIssue base ) { if (base == null) { throw new IllegalArgumentException("no null arguments"); } this.baseIssue = base; } //------------------------------------------------------------------------- // IIssue public String getID() { return this.baseIssue.getID(); } public String getType() { return this.baseIssue.getType(); } public String getShortDescription() { if (this.changedDesc) { return this.newDesc; } else { return this.baseIssue.getShortDescription(); } } public IIssueState getState() { if (this.changedState) { return this.newState; } else { return this.baseIssue.getState(); } } public IAttributeSet getAttributes() { return getEditableAttributes(); } public abstract IIssue reload() throws ProblemManagerException; //------------------------------------------------------------------------- // IEditableIssue /** * */ public void setShortDescription( String desc ) { String orig = this.baseIssue.getShortDescription(); if ( desc == orig || ( desc != null && desc.equals( orig ) ) ) { // they're the same - ensure the state is correct this.changedDesc = false; } else { // changed this.changedDesc = true; this.newDesc = desc; } } /** * @return true if setShortDescription( String ) was * called with a different description string than the original * issue, otherwise false. */ public boolean hasShortDescriptionChanged() { return this.changedDesc; } /** * Returns the list of all states that this issue can move to next. * This is part of the workflow logic of the underlying PMT. The returned * states may be safely edited without any affect; the only effect will be * when the state is explicitly set. This will always return, in index 0, * a copy of the current state as editable. */ public IEditableIssueState[] getNextStates() { return createNextEditableIssueStates( getState() ); } /** * Sets the current state. Since there is no getEditableState() method, * use this method if any information in the current state needs to be * updated. You can retrieve the current state as an editable state * using getNextStates()[0], but note that any changes to that * editable version will not affect the tracker's state unless that * editable instance is explicitly set in this method. * * @exception ProblemManagerException if the input state is not a valid * next state. */ public void setState( IIssueState state ) throws ProblemManagerException { assertStateCanBeNext( state ); if (state instanceof IEditableIssueState) { state = createImmutableIssueState( (IEditableIssueState)state ); } this.newState = state; this.changedState = true; } /** * @return true if the setState( IIssueState ) method * has been invoked and did not throw an exception, otherwise * false. Note that even if the set state is an unchanged * version of the current issue's state, this will still return * true. */ public boolean hasStateChanged() { return this.changedState; } /** * This is a synonymn for getAttributes(), but this explicitly * sets the returned value as an editable set, without the need for an * extra cast. The returned attribute set may be safely edited, and * changes there will affect the issue that returned them. */ public IEditableAttributeSet getEditableAttributes() { if (this.nextSet == null) { // create the editable set IAttributeSet s = this.baseIssue.getAttributes(); this.nextSet = createEditableAttributeSet( s ); } return this.nextSet; } /** * Commits all changes from the issue to the tracker. *

    * In theory, issues should never be removed. However, some systems allow * them to be deleted (say, if there was an accidental creation). In this * case, an IssueRemovedException will be thrown. * * @exception ProblemManagerException if there was an underlying tracker * error. */ public abstract void commit() throws ProblemManagerException; //------------------------------------------------------------------------- // protected methods /** * Creates a set of editable issue states that can be set as 'next' for * is. Note that it is required that the input is * must be returned in index 0 of the returned array. */ protected abstract IEditableIssueState[] createNextEditableIssueStates( IIssueState is ); /** * Creates an editable set of attributes based on the immutable attribute * set. The new set of attributes should accurately reflect the input * attribute set's values. */ protected abstract IEditableAttributeSet createEditableAttributeSet( IAttributeSet as ); /** * Create a non-editable version of eis. */ protected abstract IIssueState createImmutableIssueState( IEditableIssueState eis ); protected void assertStateCanBeNext( IIssueState state ) throws ProblemManagerException { IEditableIssueState[] eis = getNextStates(); if (eis == null || eis.length < 1) { throw new IllegalStateException("Invalid set of next states."); } String name = null; if (state != null) { name = state.getName(); } for (int i = 0; i < eis.length; ++i) { if (eis[i] == null) { if (state == null) { // they are the same - null state supported. return; } } else // allow for a null name for the input state, // but the non-null state must have a non-null name. if (eis[i].getName().equals( name )) { // found the requested state in the next state list, // so the requested state is valid. return; } } // never found the requested state in the next state list. throw new ProblemManagerException( "State "+state+ " cannot be a next state for "+getState() ); } } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/0000755000175000017500000000000010011472733031321 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/0000755000175000017500000000000011271425773031662 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultTestDataFactory.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultTest0000644000175000017500000000456607622026414034036 0ustar drazzibdrazzib/* * @(#)DefaultTestDataFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactory; /** * A factory in charge of creating a specific TestData instance from * a TestInfo unique identifier. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public class DefaultTestDataFactory implements TestDataFactory { /** * Create the TestData for the specific info instance. * This should never return null. * * @param info the unique identifier for the test under inspection, which * should never be null. * @return the new data for the given info. */ public TestData createTestData( TestInfo info ) { return new ITFTestData( info ); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/package.htmllibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/package.htm0000644000175000017500000000102107521071643033755 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.autodoc.v1 The Issue Traceability Framework and AutoDoc v1 integration classes framework for PMTI.

    The Issue Traceability Framework supports the framework for tracing tests to an issue tracking system. The framework uses the net.sourceforge.groboutils.pmti.v1.itf classes to define how to record and load the traceability items, while the sub-packages define specific implementations of these interfaces.

    ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITFactoryImpl.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITFa0000644000175000017500000000511707622026413033644 0ustar drazzibdrazzib/* * @(#)AutoDocITFactoryImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDocIT; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocITFactory; import net.sourceforge.groboutils.autodoc.v1.testserver.MonitorFinder; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:55 $ * @since March 16, 2002 */ public class AutoDocITFactoryImpl implements AutoDocITFactory { private MonitorFinder finder; /** * Default constructor. */ public AutoDocITFactoryImpl() { // do nothing } /** * Creates the Issue Tracker entry point. */ public AutoDocIT createIT( Class owner ) { return new AutoDocITImpl( owner, getFinder() ); } public synchronized void setFinder( MonitorFinder finder ) { this.finder = finder; } public synchronized MonitorFinder getFinder() { if (this.finder == null) { setFinder( new ITFMonitorFinder() ); } return this.finder; } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFTestData.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFTestData0000644000175000017500000001162007622026414033653 0ustar drazzibdrazzib/* * @(#)ITFTestData.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactory; import net.sourceforge.groboutils.autodoc.v1.testserver.DefaultTestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import junit.framework.AssertionFailedError; import java.util.Vector; /** * An interface used to briefly describe a test and the gathered data associated * for the test in a particular framework. These should be created for * a framework through the {@link TestDataFactory} class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:56 $ * @since March 30, 2002 */ public class ITFTestData extends DefaultTestData { private Vector issueIDs = new Vector(); private Vector errors = new Vector(); private Vector failures = new Vector(); private int testCount = 0; private long startTime = -1; private long endTime = -1; public ITFTestData( TestInfo info ) { super( info ); } /** * This may be called multiple times. Each time will add a new issue for * the corresponding test info. If id is null, then it * will be ignored. Likewise, any duplicate IDs passed in will be ignored. * * @param id the issue id to associate with this test. */ public void addIssueID( String id ) { if (id != null && !this.issueIDs.contains( id )) { this.issueIDs.addElement( id ); } } /** * */ public void addError( Throwable error ) { if (error != null) { this.errors.addElement( error ); } } /** * */ public void addFailure( AssertionFailedError failure ) { if (failure != null) { this.failures.addElement( failure ); } } /** * */ public void addTest() { ++this.testCount; } /** * */ public void setStartTime( long startTime ) { this.startTime = startTime; } /** * */ public void setEndTime( long endTime ) { this.endTime = endTime; } /** * Retrieves all issue IDs for this TestInfo object. This will never return * null, but may return an empty array. */ public String[] getIssues() { String[] issues = new String[ this.issueIDs.size() ]; this.issueIDs.copyInto( issues ); return issues; } /** * */ public Throwable[] getErrors() { Throwable t[] = new Throwable[ this.errors.size() ]; this.errors.copyInto( t ); return t; } /** * */ public AssertionFailedError[] getFailures() { AssertionFailedError s[] = new AssertionFailedError[ this.failures.size() ]; this.failures.copyInto( s ); return s; } /** * */ public int getSuccessCount() { int c = this.testCount - this.errors.size() - this.failures.size(); if (c < 0) { c = 0; } return c; } /** * */ public int getTestCount() { return this.testCount; } /** * */ public long getRunTime() { if (this.startTime < 0 || this.endTime < 0) { return -1L; } return this.endTime - this.startTime; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitListener.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitLis0000644000175000017500000000670707622026414033655 0ustar drazzibdrazzib/* * @(#)ITFJUnitListener.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import junit.framework.Test; import junit.framework.AssertionFailedError; import net.sourceforge.groboutils.autodoc.v1.testserver.junit.JUnitTestListener; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import org.apache.log4j.Logger; /** * Listens to JUnit tests, and sends a report to the ITFServer via the * ITFBootstrap. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 4, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public class ITFJUnitListener extends JUnitTestListener { private static final Logger LOG = Logger.getLogger( ITFJUnitListener.class ); public ITFJUnitListener() { super( new ITFMonitorFinder() ); } /** * Called before the test starts, and after the test has been registered. */ protected void startTest( TestData data ) { if (data != null) { ITFTestData itd = (ITFTestData)data; itd.setStartTime( System.currentTimeMillis() ); itd.addTest(); } } /** * Called after the test ends. The implemented method must not send off * the data - that is done by the JUnitTestListener implementation. */ protected void endTest( TestData data ) { if (data != null) { ITFTestData itd = (ITFTestData)data; itd.setEndTime( System.currentTimeMillis() ); } } /** * Called when the test in the data has an unexpected exception thrown. */ protected void addError( TestData data, Throwable t ) { if (data != null && t != null) { ITFTestData itd = (ITFTestData)data; itd.addError( t ); } } /** * Called when the test in the data has an assertion error. */ protected void addFailure( TestData data, AssertionFailedError t ) { if (data != null && t != null) { ITFTestData itd = (ITFTestData)data; itd.addFailure( t ); } } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITImpl.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITIm0000644000175000017500000001310007622026414033653 0ustar drazzibdrazzib/* * @(#)AutoDocITImpl.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDocIT; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestCorrelate; import net.sourceforge.groboutils.autodoc.v1.testserver.MonitorFinder; import org.apache.log4j.Logger; /** * Issue Tracker entry point. Allows bugs and requriements to be tracked * directly to the test that ensures that part of the bug/requirement has been * fulfilled in the current code base. *

    * The alternate forms of the base {@link #testsIssue( String, String )} are * for convenience only. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:56 $ * @since March 30, 2002 */ public class AutoDocITImpl extends TestCorrelate implements AutoDocIT { private static final Logger LOG = Logger.getLogger( AutoDocITImpl.class ); /** * Default constructor, which requires an owning class. The monitor * finder will be the default ITFMonitorFinder. */ public AutoDocITImpl( Class owner ) { this( owner, new ITFMonitorFinder() ); } /** * Creates a new implementation of AutoDocIT, with the given owner and * monitor finder. */ public AutoDocITImpl( Class owner, MonitorFinder finder ) { super( owner, finder ); if (owner == null) { throw new IllegalArgumentException("no null args"); } } /** * Traces an issue from the owning class and declared method, to the * given ID. This is a long, as some systems may allow for * more than 2 billion issues. * * @param methodName the owning class's method to trace the issue back to. * @param issueID the id of the issue being tracked. */ public void testsIssue( String methodName, long issueID ) { testsIssue( methodName, Long.toString( issueID ) ); } /** * Traces an issue from the owning class and declared method, to the * given ID. * * @param methodName the owning class's method to trace the issue back to. * @param issueID the id of the issue being tracked. */ public void testsIssue( String methodName, String issueID ) { TestInfo ti = createTestInfo( methodName ); sendTestIssue( ti, issueID ); } /** * Traces an issue from the owning class to the given ID. * The method will still be given to the underlying tracker, but it will * be discovered through the stack trace. Hence, this is a volitile * method for tracking; it should only be called from the owning class * which is actually testing the bug. * * @param issueID the id of the issue being tracked. */ public void testsIssue( long issueID ) { testsIssue( Long.toString( issueID ) ); } /** * Traces an issue from the owning class to the given ID. * The method will still be given to the underlying tracker, but it will * be discovered through the stack trace. Hence, this is a volitile * method for tracking; it should only be called from the owning class * which is actually testing the bug. * * @param issueID the id of the issue being tracked. */ public void testsIssue( String issueID ) { TestInfo ti = createTestInfoFromStack(); sendTestIssue( ti, issueID ); } /** * Send the 'testsIssue' call to the monitor. */ protected void sendTestIssue( TestInfo ti, String issueID ) { TestData td = getTestData( ti ); if (td == null) { LOG.warn( "test data for "+ti+" never registered." ); return; } // assertion for security/robustness if (!(td instanceof ITFTestData)) { throw new IllegalStateException( "Expected the monitor to create "+ ITFTestData.class.getName()+", but it created a "+ td.getClass().getName()+" instead." ); } ((ITFTestData)td).addIssueID( issueID ); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitorFinder.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitorF0000644000175000017500000000537407622026414033710 0ustar drazzibdrazzib/* * @(#)ITFMonitorFinder.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.MonitorFinder; import net.sourceforge.groboutils.autodoc.v1.testserver.Monitor; import net.sourceforge.groboutils.util.classes.v1.SingletonStore; /** * Acts as a factory and singleton store for the ITFMonitor. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 30, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public class ITFMonitorFinder implements MonitorFinder { public static final String MONITOR_PROPERTY_NAME = ITFMonitor.class.getName() + ".implementation"; public static final Class DEFAULT_MONITOR = ITFMonitor.class; private static final SingletonStore s_monitorStore = new SingletonStore( Monitor.class, DEFAULT_MONITOR, MONITOR_PROPERTY_NAME ); /** * Retrieves the pseudo-singleton Monitor of the correct type. */ public Monitor getMonitor() { return (Monitor)getMonitorStore().getSingleton(); } //------------------------------------------------------------------------- // Static methods /** * Retrieve the Monitor singleton store for setting up the Monitor * to be used for all uninitialized or uncreated ITFMonitorFinder instances. */ public static SingletonStore getMonitorStore() { return s_monitorStore; } } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/0000755000175000017500000000000011271425773033170 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/LogFileServer.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/LogF0000644000175000017500000001004607622026414033735 0ustar drazzibdrazzib/* * @(#)LogFileServer.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; import java.io.File; import java.io.Writer; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.ITFTestData; /** * An interface which corresponds to a part of the framework that knows how * to deal with the framework's TestData. It may directly deal with * the data, or pass it off to a remote server. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public class LogFileServer extends AbstractAppendFileServer { public LogFileServer( File f ) { super( f ); } /** * Write the TestData with all the result's encountered BugTestLog * events. */ protected void writeTestData( TestData td, Writer w ) throws IOException { if (td == null || !(td instanceof ITFTestData)) { return; } String newline = System.getProperty( "line.separator" ); ITFTestData itd = (ITFTestData)td; TestInfo ti = td.getTestInfo(); StringBuffer sb = new StringBuffer( ti.getSuite() ); sb.append( '#' ). append( ti.getMethod() ). append( " test count=" ). append( itd.getTestCount() ). append( " runtime in ms=" ). append( itd.getRunTime() ). append( newline ). append( " Failures:" ); appendArray( sb, itd.getFailures(), newline ); sb.append( newline ). append( " Errors:" ); appendArray( sb, itd.getErrors(), newline ); sb.append( newline ). append( " Bugs: " ); String logs[] = itd.getIssues(); if (logs.length <= 0) { sb.append("none" ); } else { sb.append( logs[0] ); for (int i = 1; i < logs.length; ++i) { sb.append( ", " ). append( logs[i] ); } } sb.append( newline ); w.write( sb.toString() ); w.flush(); } void appendArray( StringBuffer sb, Object[] list, String newline ) { if (list == null || list.length <= 0) { sb.append( " none" ); } else { for (int i = 0; i < list.length; ++i) { sb.append( newline ). append( " " ). append( list[i] ); } } } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/package.htmllibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/pack0000644000175000017500000000035707521071643034032 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.autodoc.v1.server Collection of server classes for the AutoDoc integration of the PMTI package (called officially "Issue Traceability Framework"). ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/AbstractAppendFileServer.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/Abst0000644000175000017500000000527707622026414034011 0ustar drazzibdrazzib/* * @(#)AbstractAppendFileServer.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; import java.io.File; import java.io.IOException; import java.io.Writer; import java.io.FileWriter; import net.sourceforge.groboutils.autodoc.v1.testserver.AbstractWriterServer; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; /** * An interface which corresponds to a part of the framework that knows how * to deal with the framework's TestData. It may directly deal with * the data, or pass it off to a remote server. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:56 $ * @since March 30, 2002 */ public abstract class AbstractAppendFileServer extends AbstractWriterServer { private File file; public AbstractAppendFileServer( File f ) { if (f == null) { throw new IllegalArgumentException("no null arguments"); } this.file = f; } /** * Open a writer stream. This will be done once per result, so log-like * actions may need to append to the previous results. */ protected Writer openOutput( TestData td ) throws IOException { // append to the end of the last write FileWriter fw = new FileWriter( this.file.getAbsolutePath(), true ); return fw; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/AbstractNewFileServer.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/Abst0000644000175000017500000001126307622026414034001 0ustar drazzibdrazzib/* * @(#)AbstractNewFileServer.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; import java.io.File; import java.io.IOException; import java.io.Writer; import java.io.FileWriter; import net.sourceforge.groboutils.autodoc.v1.testserver.AbstractWriterServer; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import org.apache.log4j.Logger; /** * An interface which corresponds to a part of the framework that knows how * to deal with the framework's TestData. It may directly deal with * the data, or pass it off to a remote server. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public abstract class AbstractNewFileServer extends AbstractWriterServer { private static Logger LOG = Logger.getLogger( AbstractNewFileServer.class ); private String prefix; private String postfix; private boolean useTimestamp = true; /** * Creates a new file for every BugTestResult, in the format * prefix + BugTestResult.getSuiteName() + '-' + * BugTestResuilt.getTestMethodName() + '-' + * Long.toString( System.currentTimeMillis() ) + * postfix. prefix should include the directory. */ public AbstractNewFileServer( String prefix, String postfix ) { this( prefix, postfix, true ); } /** * Creates a new file for every BugTestResult, in the format * prefix + BugTestResult.getSuiteName() + '-' + * BugTestResuilt.getTestMethodName() + '-' + * Long.toString( System.currentTimeMillis() ) + * postfix. prefix should include the directory. */ public AbstractNewFileServer( String prefix, String postfix, boolean useTimestamp ) { if (prefix == null || postfix == null) { throw new IllegalArgumentException("no null arguments"); } this.prefix = prefix; this.postfix = postfix; this.useTimestamp = useTimestamp; } /** * Open a writer stream. This will be done once per result, so log-like * actions may need to append to the previous results. */ protected Writer openOutput( TestData td ) throws IOException { File f = new File( createFileName( td ) ); LOG.debug("Opening file "+f.getAbsolutePath()+" for output."); FileWriter fw = new FileWriter( f ); return fw; } /** * */ protected String createFileName( TestData td ) { TestInfo ti = td.getTestInfo(); String suite = "suite"; String method = "method"; if (ti != null) { if (ti.getSuite() != null) { suite = ti.getSuite(); } if (ti.getMethod() != null) { method = ti.getMethod(); } } StringBuffer sb = new StringBuffer( this.prefix ); sb.append( suite ). append( '-' ). append( method ); if (this.useTimestamp) { sb.append( '-' ). append( System.currentTimeMillis() ); } sb.append( this.postfix ); String name = sb.toString(); return name; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultITFFactory.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultITFF0000644000175000017500000000543307622026414033641 0ustar drazzibdrazzib/* * @(#)DefaultITFFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.Server; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactory; import net.sourceforge.groboutils.util.classes.v1.SingletonStore; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml.XMLFileServer; /** * Creates the basic requirements for an ITF framework. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 16, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public class DefaultITFFactory implements ITFFactory { private TestDataFactory tdf; private Server server; public DefaultITFFactory() { // do nothing } public Server getServer() { synchronized( this ) { if (this.server == null) { this.server = createServer(); } } return this.server; } public TestDataFactory getTestDataFactory() { synchronized( this ) { if (this.tdf == null) { this.tdf = createTestDataFactory(); } } return this.tdf; } public Server createServer() { return new XMLFileServer( "ISSUE-" ); } public TestDataFactory createTestDataFactory() { return new DefaultTestDataFactory(); } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFFactory.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFFactory.0000644000175000017500000000411107622026414033624 0ustar drazzibdrazzib/* * @(#)ITFFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.Server; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactory; /** * Creates the basic requirements for an ITF framework plugin for AutoDoc. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:56 $ * @since March 16, 2002 */ public interface ITFFactory { /** * Retrieve the server for this factory. * * @return the server */ public Server getServer(); /** * Retrieve the TestDataFactory for this factory. * * @return the factory */ public TestDataFactory getTestDataFactory(); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitor.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitor.0000644000175000017500000000741207622026414033653 0ustar drazzibdrazzib/* * @(#)ITFMonitor.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.Monitor; import net.sourceforge.groboutils.autodoc.v1.testserver.DefaultMonitor; import net.sourceforge.groboutils.autodoc.v1.testserver.Server; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactory; import net.sourceforge.groboutils.util.classes.v1.SingletonStore; /** * This implemenation of Monitor uses a Hashtable to store the * test data. *

    * This probably should be rewritten so that DefaultMonitor is a delegate-to * inner object, not a super class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:56 $ */ public class ITFMonitor extends DefaultMonitor // implements Monitor { public static final String FACTORY_PROPERTY_NAME = ITFFactory.class.getName() + ".implementation"; public static final Class DEFAULT_FACTORY = DefaultITFFactory.class; private static final SingletonStore s_factoryStore = new SingletonStore( ITFFactory.class, DEFAULT_FACTORY, FACTORY_PROPERTY_NAME ); /** * Default constructor. */ public ITFMonitor() { this( getFactory().getServer(), getFactory().getTestDataFactory() ); } /** * Constructor for a Monitor requiring a reference to the Server which will * receive the completed TestData structures, and a reference to * a factory for creating new TestData instances for the particular * framework this Monitor belongs to. * * @param s the server to receive completed TestData entities. * This cannot be null. * @param f the factory in charge of creating new TestData * entities. This cannot be null. * @exception IllegalArgumentException if s or f is * null. */ public ITFMonitor( Server s, TestDataFactory f ) { super( s, f ); } /** * Retrieves the pseudo-singleton factory of the correct type. */ public static ITFFactory getFactory() { return (ITFFactory)getFactoryStore().getSingleton(); } /** * Set the factory to whatever is in the system property. */ public static SingletonStore getFactoryStore() { return s_factoryStore; } } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/0000755000175000017500000000000011271425773032462 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileParser.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFile0000644000175000017500000000742007622026415033643 0ustar drazzibdrazzib/* * @(#)XMLFileParser.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml; import java.io.File; import java.io.Reader; import java.io.FileReader; import java.io.IOException; import java.net.URL; import net.sourceforge.groboutils.pmti.v1.itf.parser.AbstractParser; import net.sourceforge.groboutils.pmti.v1.itf.IIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.impl.DefaultIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.impl.ImmutableTestRecord; import net.sourceforge.groboutils.pmti.v1.itf.impl.DefaultTestIssueRecord; import java.util.Locale; import org.xml.sax.Locator; import org.xml.sax.InputSource; import org.xml.sax.HandlerBase; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.DocumentHandler; import org.xml.sax.AttributeList; import org.xml.sax.helpers.XMLReaderAdapter; import org.xml.sax.Parser; import org.apache.log4j.Logger; /** * Parses the output of XMLFileServer. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:57 $ */ public class XMLFileParser extends AbstractParser { private static final Class THIS_CLASS = XMLFileParser.class; private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger( THIS_CLASS ); private File file; private Parser parser; public XMLFileParser( File f, Parser p ) { if ( f == null || !f.exists() || !f.isFile() || !f.canRead() ) { throw new IllegalArgumentException("not valid file: "+f); } if ( p == null ) { throw new IllegalArgumentException("no null SAX parser"); } this.parser = p; this.file = f; } protected void findRecords() { try { FileReader fr = new FileReader( this.file ); try { InputSource source = new InputSource( fr ); source.setSystemId( (new URL( "file:" + this.file.getAbsolutePath() )).toString() ); } finally { fr.close(); } } catch (IOException ioe) { LOG.warn( "Error accessing file: "+this.file, ioe ); } } //protected class } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileServer.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFile0000644000175000017500000001300307622026415033635 0ustar drazzibdrazzib/* * @(#)XMLFileServer.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml; import java.io.Writer; import java.io.StringWriter; import java.io.PrintWriter; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.server.AbstractNewFileServer; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.ITFTestData; import junit.framework.AssertionFailedError; import net.sourceforge.groboutils.util.xml.v1.XMLUtil; /** * An interface which corresponds to a part of the framework that knows how * to deal with the framework's TestData. It may directly deal with * the data, or pass it off to a remote server. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:57 $ */ public class XMLFileServer extends AbstractNewFileServer { public XMLFileServer( String prefix ) { this( prefix, ".xml" ); } public XMLFileServer( String prefix, String postfix ) { super( prefix, postfix, false ); } /** * Write the BugTestResult with all the result's encountered BugTestLog * events. */ protected void writeTestData( TestData td, Writer w ) throws IOException { if (td == null || !(td instanceof ITFTestData)) { return; } ITFTestData itd = (ITFTestData)td; TestInfo ti = td.getTestInfo(); String newline = System.getProperty( "line.separator" ); if (newline == null) { newline = "\n"; } AssertionFailedError failures[] = itd.getFailures(); Throwable errors[] = itd.getErrors(); String logs[] = itd.getIssues(); StringBuffer sb = new StringBuffer( "" ); sb.append( newline ). append( "" ). append( newline ); if (failures != null) { for (int i = 0; i < failures.length; ++i) { sb.append( " " ).append( newline ); escapeString( sb, toString( failures[i] ) ); sb.append( " " ).append( newline ); } } if (errors != null) { for (int i = 0; i < errors.length; ++i) { sb.append( " " ).append( newline ); escapeString( sb, toString( errors[i] ) ); sb.append( " " ).append( newline ); } } for (int i = 0; i < logs.length; ++i) { sb.append( " " ). append( newline ); } sb.append( "" ). append( newline ); w.write( sb.toString() ); w.flush(); } protected void escapeString( StringBuffer sb, String raw ) { XMLUtil.getInstance().utf2xml( raw, sb ); } protected String toString( Throwable t ) { StringWriter sw = new StringWriter(); t.printStackTrace( new PrintWriter( sw ) ); return sw.toString(); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/package.htmllibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/package0000644000175000017500000000015207521071643033772 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.autodoc.v1.xml ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileParserGenerator.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFile0000644000175000017500000001734007622026415033645 0ustar drazzibdrazzib/* * @(#)XMLFileParserGenerator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml; import java.io.File; import java.io.Writer; import java.io.StringWriter; import java.io.PrintWriter; import java.io.IOException; import java.io.FilenameFilter; import java.util.Vector; import java.util.Enumeration; import net.sourceforge.groboutils.pmti.v1.itf.parser.IParserGenerator; import net.sourceforge.groboutils.pmti.v1.itf.parser.IParser; import net.sourceforge.groboutils.pmti.v1.itf.IIssueRecord; import net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecord; import org.xml.sax.Parser; /** * Parses the directory or directories containing the output of XMLFileServer * into individual IParsers, one for each file. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:51:57 $ */ public class XMLFileParserGenerator implements IParserGenerator { public static final String DEFAULT_PREFIX = "ISSUES-"; public static final String DEFAULT_POSTFIX = ".xml"; private Vector sourceDirs = new Vector(); private String filePrefix; private String filePostfix; private Parser parser; /** * Case-insensitive file filter. */ private static class PrefixPostfixFilter implements FilenameFilter { private String pre; private String post; public PrefixPostfixFilter( String pre, String post ) { this.pre = pre.toLowerCase(); this.post = post.toLowerCase(); } public boolean accept( File dir, String name ) { String n = name.toLowerCase(); return ( n.startsWith( this.pre ) && n.endsWith( this.post ) ); } } public XMLFileParserGenerator() { this( (File[])null, null, null ); } public XMLFileParserGenerator( File dir ) { this( new File[] { dir }, null, null ); } public XMLFileParserGenerator( File dir, String prefix, String postfix ) { this( new File[] { dir }, prefix, postfix ); } public XMLFileParserGenerator( File dirs[] ) { this( dirs, null, null ); } public XMLFileParserGenerator( File dirs[], String prefix, String postfix ) { addSourceDirs( dirs ); setFilePrefix( prefix ); setFilePostfix( postfix ); } /** * Sets the SAX 1.0 parser. */ public void setSAXParser( Parser p ) { if (p != null) { this.parser = p; } } /** * Set the text that all XML Issue file names must begin with. Unlike the * XMLFileServer, the prefix must not contain path information * due to the detection methods used. If a null is passed in, * then the default value ("ISSUE-") is used instead. The string will * be considered case-insensitive for searching purposes. * * @param prefix the new prefix value to use. */ public void setFilePrefix( String prefix ) { if (prefix == null) { prefix = DEFAULT_PREFIX; } this.filePrefix = prefix; } /** * Set the text that all XML Issue file names must end with. * If a null is passed in, * then the default value (".xml") is used instead. The string will * be considered case-insensitive for searching purposes. * * @param postfix the new postfix value to use. */ public void setFilePostfix( String postfix ) { if (postfix == null) { postfix = DEFAULT_POSTFIX; } this.filePostfix = postfix; } /** * Adds dir to the internal list of directories to check * for issue XML files. Subdirectories will not be inspected, unless they * are explicitly added. * * @param dir additional directory to search for issue files. * null values, non-directories, and non-existent files will * be ignored. * @see #addSourceDirs( File[] ) */ public void addSourceDir( File dir ) { addSourceDirs( new File[] { dir } ); } /** * Adds the given directories to the internal list of directories to check * for issue XML files. Subdirectories will not be inspected, unless they * are explicitly added. * * @param dirs additional directories to search for issue files. * null values, non-directories, and non-existent files will * be ignored. * @see #addSourceDir( File ) */ public void addSourceDirs( File dirs[] ) { if (dirs == null) { return; } // Get only the valid dirs for ( int i = 0; i < dirs.length; ++i ) { if ( dirs[i] != null && dirs[i].exists() && dirs[i].isDirectory() ) { this.sourceDirs.addElement( dirs[i] ); } } } /** * Generate a collection of parsers which know how to create test records. */ public IParser[] createParsers() { Vector parsers = new Vector(); Enumeration dirs = this.sourceDirs.elements(); while ( dirs.hasMoreElements() ) { File f[] = findIssueFiles( (File)dirs.nextElement() ); for ( int i = 0; i < f.length; ++i ) { IParser p = createParser( f[i] ); if ( p != null ) { parsers.addElement( p ); } } } IParser p[] = new IParser[ parsers.size() ]; parsers.copyInto( p ); return p; } protected File[] findIssueFiles( File dir ) { FilenameFilter filter = createFilter(); String found[] = dir.list( filter ); File ret[] = new File[ found.length ]; for ( int i = 0; i < found.length; ++i ) { ret[i] = new File( dir, found[i] ); } return ret; } protected IParser createParser( File issueFile ) { return new XMLFileParser( issueFile, this.parser ); } protected FilenameFilter createFilter() { return new PrefixPostfixFilter( this.filePrefix, this.filePostfix ); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitListenerFactory.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitLis0000644000175000017500000000373507622026414033653 0ustar drazzibdrazzib/* * @(#)ITFJUnitListenerFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import junit.framework.TestListener; import net.sourceforge.groboutils.autodoc.v1.spi.TestListenerFactory; /** * A factory which can create a specific type of TestListener. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:56 $ * @since March 17, 2002 */ public class ITFJUnitListenerFactory implements TestListenerFactory { /** * Creates the factory's specific type of TestListener. */ public TestListener createListener() { return new ITFJUnitListener(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IProblemManagerInfo.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IProblemManagerInfo.ja0000644000175000017500000000411407622026412034022 0ustar drazzibdrazzib/* * @(#)IProblemManagerInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Information about the owning problem manager. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 7, 2002 */ public interface IProblemManagerInfo { /** * Returns a list of all known types of issues, which can be used in * the creation of a new issue through createIssue( String ). */ public String[] getIssueTypes(); /** * */ public String getDefaultType(); /** * Returns all relevant meta-information about the issues of the given * type. */ public IIssueTypeInfo getTypeInfo( String type ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IAttributeSet.java0000644000175000017500000000463607622026412033272 0ustar drazzibdrazzib/* * @(#)IAttributeSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Contains a queryable set of attribute name-value pairs associated with * issue types. Implementations may have direct accessors for these * attributes. Common attributes include: who reported the issue, a list * of comments written about this issue, and a history of the changes the * issue has gone through. All IAttributeSet implementations must be * immutable, unless they also implement IEditableAttributeSet. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IAttributeSet { /** * Returns a list of all attributes. */ public IAttribute[] getAttributes(); /** * */ public String[] getAttributeNames(); /** * Finds the attribute for the given name. * * @return the attribute for the name, or null if no such * attribute exists. */ public IAttribute getAttribute( String name ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IProblemManager.java0000644000175000017500000000717207622026412033544 0ustar drazzibdrazzib/* * @(#)IProblemManager.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * The master class (generally a facade) responsible for interfacing the * programmer with the Problem Management Tracker, implementing not only the * query and change elements, but also enforcing the workflow logic associated * with the underlying tracker. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 7, 2002 */ public interface IProblemManager { /** * Returns a list of all issue IDs known by the PMT. This may be an * extremely expensive operation, depending on the size of the underlying * system. This call must never return null. This should never * return new issues that have not been comitted yet. */ public String[] getIssueIDs() throws ProblemManagerException; /** * Returns all issue IDs that match the given 'template'. A template is * an issue where all null values are considered 'wildcards', * so that a null state, for instance, would match for any * state object. May change the template in the future to a different * but similar type to allow for regular-expressions. */ public String[] getIssueIDsForTemplate( IIssue issue ) throws ProblemManagerException; /** * Returns the issue associated with the given unique issue ID. If no such * issue exists, then null is returned. Note that the returned * element is a non-editable version of the issue. */ public IIssue getIssueByID( String id ) throws ProblemManagerException; /** * Given the real issue, returns the editable version of the issue. */ public IEditableIssue editIssue( IIssue issue ) throws ProblemManagerException; /** * Creates a new issue of the given type. If type is * null, then a new issue of the default issue type is * created and returned. */ public IEditableIssue createIssue( String type ) throws ProblemManagerException; /** * Returns all meta-data for this problem management tracker. */ public IProblemManagerInfo getProblemManagerInfo(); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableAttributeSet.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableAttributeSet.0000644000175000017500000000377207622026412034062 0ustar drazzibdrazzib/* * @(#)IEditableAttributeSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * An editable form of an IAttributeSet. Note that the set of editable * attributes cannot be changed - just their contents. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IEditableAttributeSet extends IAttributeSet { /** * Synonymn for getAttributes() */ public IEditableAttribute[] getEditableAttributes(); /** * Synonymn for getAttribute( String ) */ public IEditableAttribute getEditableAttribute( String name ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableIssue.java0000644000175000017500000001177507622026412033377 0ustar drazzibdrazzib/* * @(#)IEditableIssue.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Allows for editing of an issue. The only parts that can't be edited are * the ID and type, since those uniquely identify the issue at hand. Editing * an issue has several constraints that should be known by the user: *

      *
    • * Just like with the IIssue instances, the issue being * edited will NOT be real-time updated to reflect the current * tracker state. Currently, the only way to update an issue is by * re-polling the ProblemManager. Individual implementations * may provide for alternative means to receive synchronized issues. *
    • *
    • * No changes to an editable issue will be committed to the problem * tracker is to call commit() on the issue. *
    • *
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IEditableIssue extends IIssue { /** * */ public void setShortDescription( String desc ); /** * @return true if setShortDescription( String ) was * called with a different description string than the original * issue, otherwise false. */ public boolean hasShortDescriptionChanged(); /** * Returns the list of all states that this issue can move to next. * This is part of the workflow logic of the underlying PMT. The returned * states may be safely edited without any affect; the only effect will be * when the state is explicitly set. This will always return, in index 0, * a copy of the current state as editable. */ public IEditableIssueState[] getNextStates(); /** * Sets the current state. Since there is no getEditableState() method, * use this method if any information in the current state needs to be * updated. You can retrieve the current state as an editable state * using getNextStates()[0], but note that any changes to that * editable version will not affect the tracker's state unless that * editable instance is explicitly set in this method. * * @exception ProblemManagerException if the input state is not a valid * next state. */ public void setState( IIssueState state ) throws ProblemManagerException; /** * @return true if the setState( IIssueState ) method * has been invoked and did not throw an exception, otherwise * false. Note that even if the set state is an unchanged * version of the current issue's state, this will still return * true. */ public boolean hasStateChanged(); /** * This is a synonymn for getAttributes(), but this explicitly * sets the returned value as an editable set, without the need for an * extra cast. The returned attribute set may be safely edited, and * changes there will affect the issue that returned them. */ public IEditableAttributeSet getEditableAttributes(); /** * Commits all changes from the issue to the tracker. *

    * In theory, issues should never be removed. However, some systems allow * them to be deleted (say, if there was an accidental creation). In this * case, an IssueRemovedException will be thrown. * * @exception ProblemManagerException if there was an underlying tracker * error. */ public void commit() throws ProblemManagerException; } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/website/0000755000175000017500000000000011271425773031340 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/website/package.html0000644000175000017500000000014307521071644033614 0ustar drazzibdrazzibnet.sourceforge.groboutils.pmti.v1.website ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableIssueState.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableIssueState.ja0000644000175000017500000000374707622026412034051 0ustar drazzibdrazzib/* * @(#)IEditableIssueState.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * An editable form of an issue's state. Only the associated attributes * may be changed. Everything else is hard-coded by the owning PMT. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 7, 2002 */ public interface IEditableIssueState extends IIssueState { /** * A synonymn for getAttributes(), but explicitly declares that * the returned attributes are editable, without the need for a cast. */ public IEditableAttributeSet getEditableAttributes(); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IListAttribute.java0000644000175000017500000000410307622026412033437 0ustar drazzibdrazzib/* * @(#)IListAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import java.util.Enumeration; /** * A specialization of an attribute which contains a list of values. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IListAttribute extends IAttribute { /** * A synonym for getValue(), but redefined here to explicitly * declare the returned type. */ public Enumeration getValues(); /** * @return the number of value elements in this list attribute. */ public int getValueCount(); /** * */ public boolean containsValue( Object value ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IIssueState.java0000644000175000017500000000724607622026412032744 0ustar drazzibdrazzib/* * @(#)IIssueState.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * Describes the state of an Issue. Issue states may have additional * information associated with them, and as such uses the Attribute methodology * in the same way an Issue does. All implementations of IIssueState * must be immutable, unless they are also instances of * IEditableIssueState. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 7, 2002 */ public interface IIssueState { /** * Returns the short name of the state. * * @return the short readable name of the state. */ public String getName(); /** * Retrieves a long, human-readable, description of the state. * * @return the state's description. */ public String getDescription(); /** * A broad category for the state - it means that the issue has not been * resolved yet, and the code is still open for changes based on this * issue. *

    * isOpen() must always return the opposite of * isClosed(); that is, the following code: *

         *      isOpen() == !isClosed()
         * 
    * must always evaluate to true. */ public boolean isOpen(); /** * A broad category for the state - it means that the issue has been * resolved, and the code is no longer open for changes based on this * issue. *

    * isClosed() must always return the opposite of * isOpen(); that is, the following code: *

         *      isOpen() == !isClosed()
         * 
    * must always evaluate to true. */ public boolean isClosed(); /** * Returns a list of all attributes associated with this state. All * states of a particular type should have the same set of issues. If * the problem tracker does not have attributes associated with an issue * state, then this must still return a non-null, but the set * will be empty. * * @return the set of tracker-specific and issue type-specific attributes * and values associated with this issue. Can never return * null. */ public IAttributeSet getAttributes(); } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableAttribute.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IEditableAttribute.jav0000644000175000017500000000467607622026412034113 0ustar drazzibdrazzib/* * @(#)IEditableAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * A simple name-value association for a specific kind of issue attribute. * All implementations of IAttribute are immutable, unless they also * implement IEditableAttribute. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IEditableAttribute extends IAttribute { /** * @exception IllegalArgumentException thrown if the value argument is * invalid. */ public void setValue( Object value ); /** * @return true if the setValue( Object ) method has * been called on this instance and the actual value has changed * (via inspection with == and equals()), * otherwise false. */ public boolean hasValueChanged(); /** * Checks if the given value is a valid input value for the * setValue( Object ) method. */ public boolean isValidValue( Object value ); } libgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IAttribute.java0000644000175000017500000000373507622026412032615 0ustar drazzibdrazzib/* * @(#)IAttribute.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * A simple name-value association for a specific kind of issue attribute. * All implementations of IAttribute are immutable, unless they also * implement IEditableAttribute. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 6, 2002 */ public interface IAttribute { /** * Returns the value for this attribute. */ public Object getValue(); /** * Returns the meta-information for this attribute. */ public IAttributeInfo getInfo(); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IssueRemovedException.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/IssueRemovedException.0000644000175000017500000000432207622026412034161 0ustar drazzibdrazzib/* * @(#)IssueRemovedException.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; /** * General exception thrown by the Problem Manager if an unexpected * circumstance occurs. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:54 $ * @since July 12, 2002 */ public class IssueRemovedException extends ProblemManagerException { public IssueRemovedException() { super(); } public IssueRemovedException( String message ) { super( message ); } public IssueRemovedException( Throwable cause ) { super( cause ); } public IssueRemovedException( Throwable cause, String message ) { super( cause, message ); } public IssueRemovedException( String message, Throwable cause ) { super( message, cause ); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/ProblemManagerException.javalibgroboutils-java-5.orig/pmti/sources/dev/net/sourceforge/groboutils/pmti/v1/ProblemManagerExceptio0000644000175000017500000001411607622026413034211 0ustar drazzibdrazzib/* * @(#)ProblemManagerException.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.util.throwable.v1.IChainableException; import net.sourceforge.groboutils.util.throwable.v1.ChainableExceptionHelper; import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; /** * General exception thrown by the Problem Manager if an unexpected * circumstance occurs. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:51:55 $ * @since July 7, 2002 */ public class ProblemManagerException extends IOException implements IChainableException { /** * @serial */ private ChainableExceptionHelper ceh; public ProblemManagerException() { super(); this.ceh = new ChainableExceptionHelper( this ); } public ProblemManagerException( String message ) { super( message ); this.ceh = new ChainableExceptionHelper( this ); } public ProblemManagerException( Throwable cause ) { super(); this.ceh = new ChainableExceptionHelper( this, cause ); } public ProblemManagerException( Throwable cause, String message ) { this( message, cause ); } public ProblemManagerException( String message, Throwable cause ) { super( message ); this.ceh = new ChainableExceptionHelper( this, cause ); } /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Returns the cause of this throwable or null if the cause is * nonexistent or unknown. (The cause is the throwable that caused this * throwable to get thrown.) *

    * This implementation returns the cause that was supplied via one of the * constructors requiring a Throwable, or that was set after * creation with the initCause( Throwable ) method. While it is * typically unnecessary to override this method, a subclass can override * it to return a cause set by some other means. This is appropriate for a * "legacy chained throwable" that predates the addition of chained * exceptions to Throwable. Note that it is not necessary to * override any of the PrintStackTrace methods, all of which * invoke the getCause method to determine the cause of a throwable. *

    * * @return the cause of this throwable or null if the cause is * nonexistent or unknown. */ public Throwable getCause() { return this.ceh.getCause(); } /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Initializes the cause of this throwable to the specified value. * (The cause is the throwable that caused this throwable to get thrown.) *

    * This method can be called at most once. It is generally called from * within the constructor, or immediately after creating the throwable. * If this throwable was created with Throwable(Throwable) or * Throwable(String,Throwable), this method cannot be called even once. *

    * * @param cause the cause (which is saved for later retrieval by the * getCause() method). (A null value is permitted, and indicates * that the cause is nonexistent or unknown.) * @return a reference to this Throwable instance. * @exception IllegalArgumentException if cause is this throwable. * (A throwable cannot be its own cause.) * @exception IllegalStateException if this throwable was created with * Throwable(Throwable) or Throwable(String,Throwable), or this * method has already been called on this throwable. */ public synchronized Throwable initCause( Throwable cause ) { return this.ceh.initCause( cause ); } /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintStream ps ) { this.ceh.printStackTrace( ps ); } /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintWriter pw ) { this.ceh.printStackTrace( pw ); } } libgroboutils-java-5.orig/pmti/sources/dev/META-INF/0000755000175000017500000000000010011472732022221 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/dev/META-INF/services/0000755000175000017500000000000011271425773024060 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.spi.AutoDocITFactorylibgroboutils-java-5.orig/pmti/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.s0000644000175000017500000000045407521071643033525 0ustar drazzibdrazzib# Service Provider Interface for AutoDocITFactory # # Author: Matt Albrecht groboclown@users.sourceforge.net # Version: $Date: 2002/07/28 22:43:47 $ # Since: July 6, 2002 net.sourceforge.groboutils.pmti.v1.autodoc.v1.AutoDocITFactoryImpl ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.spi.TestListenerFactorylibgroboutils-java-5.orig/pmti/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.s0000644000175000017500000000046307521071643033525 0ustar drazzibdrazzib# Service Provider Interface for TestListenerFactory # # Author: Matt Albrecht groboclown@users.sourceforge.net # Version: $Date: 2002/07/28 22:43:47 $ # Since: June 29, 2002 net.sourceforge.groboutils.pmti.v1.autodoc.v1.ITFJUnitListenerFactory libgroboutils-java-5.orig/pmti/sources/dev/about.txt0000644000175000017500000000015207521071643022742 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/pmti/sources/ut/0000755000175000017500000000000011271425773020747 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ut/net/0000755000175000017500000000000010011472735021524 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/0000755000175000017500000000000010011472736024050 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472736026241 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/0000755000175000017500000000000010011472736027212 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/0000755000175000017500000000000011271425773027550 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IAttributeSetUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IAttributeSetUTestI.jav0000644000175000017500000001307607622026421034077 0ustar drazzibdrazzib/* * @(#)IAttributeSetUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IAttributeSet interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IAttributeSetUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IAttributeSetUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IAttributeSetUTestI( String name, ImplFactory f ) { super( name, IAttributeSet.class, f ); } public IAttributeSet createIAttributeSet() { return (IAttributeSet)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetAttributes1() { IAttributeSet set = createIAttributeSet(); IAttribute[] att = set.getAttributes(); assertNotNull( "Null attribute array.", att ); for (int i = 0; i < att.length; ++i) { assertNotNull( "Attribute at index "+i+" is null.", att[i] ); } } public void testGetAttributeNames1() { IAttributeSet set = createIAttributeSet(); String[] names = set.getAttributeNames(); assertNotNull( "Null name array.", names ); for (int i = 0; i < names.length; ++i) { assertNotNull( "Name at index "+i+" is null.", names[i] ); } } public void testGetAttribute1() { IAttributeSet set = createIAttributeSet(); IAttribute[] att = set.getAttributes(); String[] names = set.getAttributeNames(); assertEquals( "Number of attributes does not equal number of attribute names.", att.length, names.length ); int foundCount = 0; for (int i = 0; i < names.length; ++i) { IAttribute found = set.getAttribute( names[i] ); assertNotNull( "Attribute named "+names[i]+" is null.", found ); assertEquals( "Attribute for name "+names[i]+" is not right name.", names[i], found.getInfo().getName() ); boolean foundIt = false; for ( int aIndex = 0; aIndex < att.length; ++aIndex ) { if (att[ aIndex ] != null && names[i].equals( att[ aIndex ].getInfo().getName() )) { foundIt = true; ++foundCount; att[ aIndex ] = null; break; } } assertTrue( "Did not find a getAttributes() version for attribute name "+ names[i], foundIt ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IIssueTypeInfoUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IIssueTypeInfoUTestI.ja0000644000175000017500000001260307622026421034033 0ustar drazzibdrazzib/* * @(#)IIssueTypeInfoUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IIssueTypeInfo interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IIssueTypeInfoUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IIssueTypeInfoUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IIssueTypeInfoUTestI( String name, ImplFactory f ) { super( name, IIssueTypeInfo.class, f ); } public IIssueTypeInfo createIIssueTypeInfo() { return (IIssueTypeInfo)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetName1() { IIssueTypeInfo iti = createIIssueTypeInfo(); String name = iti.getName(); assertNotNull( "Name must not be null.", name ); } public void testGetPossibleStates1() { IIssueTypeInfo iti = createIIssueTypeInfo(); IIssueState[] is = iti.getPossibleStates(); assertNotNull( "Possible state array must not be null.", is ); for (int i = 0; i < is.length; ++i) { assertNotNull( "Possible state index "+i+" is null.", is[i] ); } } public void testGetSupportedAttributes1() { IIssueTypeInfo iti = createIIssueTypeInfo(); IAttributeInfo[] ai = iti.getSupportedAttributes(); assertNotNull( "Supported attribute array must not be null.", ai ); for (int i = 0; i < ai.length; ++i) { assertNotNull( "Supported attribute index "+i+" is null.", ai[i] ); } } public void testGetTestPassedStates1() { IIssueTypeInfo iti = createIIssueTypeInfo(); IIssueState[] is = iti.getTestPassedStates(); assertNotNull( "Test passed state array must not be null.", is ); for (int i = 0; i < is.length; ++i) { assertNotNull( "Test passed state index "+i+" is null.", is[i] ); } } public void testGetTestFailedStates1() { IIssueTypeInfo iti = createIIssueTypeInfo(); IIssueState[] is = iti.getTestFailedStates(); assertNotNull( "Test failed state array must not be null.", is ); for (int i = 0; i < is.length; ++i) { assertNotNull( "Test failed state index "+i+" is null.", is[i] ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IProblemManagerInfoUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IProblemManagerInfoUTes0000644000175000017500000001163107622026421034106 0ustar drazzibdrazzib/* * @(#)IProblemManagerInfoUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IProblemManagerInfo interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IProblemManagerInfoUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IProblemManagerInfoUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IProblemManagerInfoUTestI( String name, ImplFactory f ) { super( name, IProblemManagerInfo.class, f ); } public IProblemManagerInfo createIProblemManagerInfo() { return (IProblemManagerInfo)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetIssueTypes1() { IProblemManagerInfo pmi = createIProblemManagerInfo(); String[] it = pmi.getIssueTypes(); assertNotNull( "Null issue types array.", it ); for (int i = 0; i < it.length; ++i) { assertNotNull( "Null issue type at index "+i+".", it[i] ); assertTrue( "Empty issue type at index "+i+".", it[i].trim().length() > 0 ); } } public void testGetDefaultType1() { IProblemManagerInfo pmi = createIProblemManagerInfo(); String dt = pmi.getDefaultType(); assertNotNull( "Null default type.", dt ); // final test for this method. String[] it = pmi.getIssueTypes(); for (int i = 0; i < it.length; ++i) { if (it[i].equals( dt )) { return; } } fail( "Issue type list did not contain default type." ); } public void testGetTypeInfo1() { IProblemManagerInfo pmi = createIProblemManagerInfo(); String[] it = pmi.getIssueTypes(); for (int i = 0; i < it.length; ++i) { IIssueTypeInfo iti = pmi.getTypeInfo( it[i] ); assertNotNull( "Null type info for type "+it[i]+".", iti ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IssueRemovedExceptionUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IssueRemovedExceptionUT0000644000175000017500000001131507665402436034241 0ustar drazzibdrazzib/* * @(#)IssueRemovedExceptionUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.util.throwable.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the IssueRemovedException class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:03:26 $ * @since July 14, 2002 */ public class IssueRemovedExceptionUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IssueRemovedExceptionUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IssueRemovedExceptionUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testAllTestsCoveredByInterfaceTests() { } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations private static class IREFactory implements IChainableExceptionUTestI.IChainableExceptionFactory { public IChainableException createException() { return new IssueRemovedException(); } public IChainableException createException( String message ) { return new IssueRemovedException( message ); } public IChainableException createException( Throwable cause ) { return new IssueRemovedException( cause ); } public IChainableException createException( String message, Throwable cause ) { return new IssueRemovedException( message, cause ); } public IChainableException createException( Throwable cause, String message ) { return new IssueRemovedException( cause, message ); } } public static Test suite() { InterfaceTestSuite suite = IChainableExceptionUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new IREFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableAttributeUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableAttributeUTest0000644000175000017500000000705007622026421034160 0ustar drazzibdrazzib/* * @(#)IEditableAttributeUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IEditableAttribute interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IEditableAttributeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IEditableAttributeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IEditableAttributeUTestI( String name, ImplFactory f ) { super( name, IEditableAttribute.class, f ); } public IEditableAttribute createIEditableAttribute() { return (IEditableAttribute)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IAttributeUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/0000755000175000017500000000000011271425773030332 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/IIssueRecordUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/IIssueRecordUTestI.0000644000175000017500000000741207622026425033771 0ustar drazzibdrazzib/* * @(#)IIssueRecordUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IIssueRecord interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class IIssueRecordUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IIssueRecordUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IIssueRecordUTestI( String name, ImplFactory f ) { super( name, IIssueRecord.class, f ); } public IIssueRecord createIIssueRecord() { return (IIssueRecord)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetID1() { IIssueRecord ir = createIIssueRecord(); assertNotNull( "Returned a null ID.", ir.getID() ); } public void testGetDescription1() { IIssueRecord ir = createIIssueRecord(); // description may be null ir.getDescription(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITFReadProblemManagerUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITFReadProblemManag0000644000175000017500000001024007665402655033763 0ustar drazzibdrazzib/* * @(#)ITFReadProblemManagerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.pmti.v1.itf.parser.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ITFReadProblemManager class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 14, 2002 */ public class ITFReadProblemManagerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFReadProblemManagerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITFReadProblemManagerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ITFReadProblemManager( (IParser[])null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IProblemManagerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IParser[] p = new IParser[0]; return new ITFReadProblemManager( p ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordWriterUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordWri0000644000175000017500000001001107622026426034125 0ustar drazzibdrazzib/* * @(#)ITestIssueRecordWriterUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITestIssueRecordWriter interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:06 $ */ public class ITestIssueRecordWriterUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITestIssueRecordWriterUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITestIssueRecordWriterUTestI( String name, ImplFactory f ) { super( name, ITestIssueRecordWriter.class, f ); } public ITestIssueRecordWriter createITestIssueRecordWriter() { return (ITestIssueRecordWriter)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testWrite1() throws Exception { ITestIssueRecordWriter tirw = createITestIssueRecordWriter(); try { tirw.write( null, null ); // not throwing an exception is acceptable. } catch (IllegalArgumentException iae) { // throwing an IllegalArgumentException is acceptable. } catch (NullPointerException npe) { // throwing an NullPointerException is acceptable. } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordUTe0000644000175000017500000001013707622026425034071 0ustar drazzibdrazzib/* * @(#)ITestIssueRecordUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITestIssueRecord interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class ITestIssueRecordUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITestIssueRecordUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITestIssueRecordUTestI( String name, ImplFactory f ) { super( name, ITestIssueRecord.class, f ); } public ITestIssueRecord createITestIssueRecord() { return (ITestIssueRecord)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetIssueRecord1() { ITestIssueRecord tir = createITestIssueRecord(); IIssueRecord ir = tir.getIssueRecord(); assertNotNull( "Returned null issue record.", ir ); } public void testGetTestRecord1() { ITestIssueRecord tir = createITestIssueRecord(); ITestRecord ir = tir.getTestRecord(); assertNotNull( "Returned null test record.", ir ); } public void testGetDescription1() { ITestIssueRecord tir = createITestIssueRecord(); String desc = tir.getDescription(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestRecordUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestRecordUTestI.j0000644000175000017500000001330307622026426033767 0ustar drazzibdrazzib/* * @(#)ITestRecordUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITestRecord interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:06 $ */ public class ITestRecordUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITestRecordUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITestRecordUTestI( String name, ImplFactory f ) { super( name, ITestRecord.class, f ); } public ITestRecord createITestRecord() { return (ITestRecord)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetTestName1() { ITestRecord tr = createITestRecord(); String name = tr.getTestName(); } public void testGetTestSuite1() { ITestRecord tr = createITestRecord(); String name = tr.getTestSuite(); } public void testGetLog1() { ITestRecord tr = createITestRecord(); String log = tr.getLog(); } public void testGetTestCount1() { ITestRecord tr = createITestRecord(); int count = tr.getTestCount(); assertTrue( "Not valid count "+count+".", count >= 0 ); } public void testGetRuntime1() { ITestRecord tr = createITestRecord(); long time = tr.getRuntime(); assertTrue( "Not valid runtime "+time+".", time >= 0L ); } public void testGetFailures1() { ITestRecord tr = createITestRecord(); String f[] = tr.getFailures(); assertNotNull( "Returned null failure list.", f ); for (int i = 0; i < f.length; ++i) { assertNotNull( "Returned null failure at index "+i+".", f[i] ); assertTrue( "Returned empty failure string at index "+i+".", f[i].length() > 0 ); } } public void testGetErrors1() { ITestRecord tr = createITestRecord(); String e[] = tr.getErrors(); assertNotNull( "Returned null failure list.", e ); for (int i = 0; i < e.length; ++i) { assertNotNull( "Returned null failure at index "+i+".", e[i] ); assertTrue( "Returned empty failure string at index "+i+".", e[i].length() > 0 ); } } public void testCombo1() { ITestRecord tr = createITestRecord(); int count = tr.getTestCount(); String e[] = tr.getErrors(); String f[] = tr.getFailures(); assertTrue( "Test Count ("+count+ ") is less than the number of errors ("+e.length+ ") and failures ("+f.length+").", count >= e.length + f.length ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/0000755000175000017500000000000011271425773031626 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserUTest0000644000175000017500000000745207622026432034105 0ustar drazzibdrazzib/* * @(#)IParserUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IParser interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:10 $ */ public class IParserUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IParserUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IParserUTestI( String name, ImplFactory f ) { super( name, IParser.class, f ); } public IParser createIParser() { return (IParser)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testParse1() { IParser p = createIParser(); ITestIssueRecord[] tir = p.parse(); assertNotNull( "Returned null array.", tir ); for (int i = 0; i < tir.length; ++i) { assertNotNull( "TsetIssueRecord index "+i+" is null.", tir[i] ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/DefaultParserCollatorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/DefaultParse0000644000175000017500000000754407665402657034152 0ustar drazzibdrazzib/* * @(#)DefaultParserCollatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultParserCollator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:51 $ * @since July 14, 2002 */ public class DefaultParserCollatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultParserCollatorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultParserCollatorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new DefaultParserCollator(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IParserCollatorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultParserCollator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/AbstractParserUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/AbstractPars0000644000175000017500000000701407622026427034142 0ustar drazzibdrazzib/* * @(#)AbstractParserUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractParser interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:07 $ */ public class AbstractParserUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractParserUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractParserUTestI( String name, ImplFactory f ) { super( name, AbstractParser.class, f ); } public AbstractParser createAbstractParser() { return (AbstractParser)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IParserUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserCollatorUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserColla0000644000175000017500000002224707622026431034071 0ustar drazzibdrazzib/* * @(#)IParserCollatorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.*; import net.sourceforge.groboutils.pmti.v1.itf.impl.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IParserCollator interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:09 $ */ public class IParserCollatorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IParserCollatorUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IParserCollatorUTestI( String name, ImplFactory f ) { super( name, IParserCollator.class, f ); } public IParserCollator createIParserCollator() { return (IParserCollator)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testAddParser1() { IParserCollator pc = createIParserCollator(); pc.addParser( null ); } public static class MyParser implements IParser { public ITestIssueRecord[] records; public MyParser() { this.records = new ITestIssueRecord[0]; } public MyParser( ITestIssueRecord[] r ) { this.records = r; } public ITestIssueRecord[] parse() { return this.records; } } public void testAddParser2() { IParserCollator pc = createIParserCollator(); pc.addParser( new MyParser() ); pc.addParser( new MyParser() ); } public void testAddParser3() { IParserCollator pc = createIParserCollator(); pc.addParser( new MyParser() ); pc.getRecords(); try { pc.addParser( new MyParser() ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ise) { // check exception?? } } public void testGetRecords1() { IParserCollator pc = createIParserCollator(); ITestIssueRecordSet set = pc.getRecords(); assertNotNull( "Returned null set.", set ); ITestIssueRecord[] records = set.getTestIssueRecords(); assertNotNull( "Returned null record array.", records ); assertEquals( "Returned a non-empty record set.", 0, records.length ); } public void testGetRecords2() { IParserCollator pc = createIParserCollator(); pc.addParser( new MyParser() ); pc.addParser( new MyParser() ); ITestIssueRecordSet set = pc.getRecords(); assertNotNull( "Returned null set.", set ); ITestIssueRecord[] records = set.getTestIssueRecords(); assertNotNull( "Returned null record array.", records ); assertEquals( "Returned a non-empty record set.", 0, records.length ); } public void testGetRecords3() { IParserCollator pc = createIParserCollator(); ITestIssueRecord[] real = { createRecord1(), }; pc.addParser( new MyParser( real ) ); ITestIssueRecordSet set = pc.getRecords(); assertNotNull( "Returned null set.", set ); assertContainsOnly( set, real ); } public void testGetRecords4() { IParserCollator pc = createIParserCollator(); ITestIssueRecord[] real = { createRecord1(), createRecord2(), createRecord2(), createRecord2(), createRecord3(), }; pc.addParser( new MyParser( real ) ); pc.addParser( new MyParser() ); ITestIssueRecordSet set = pc.getRecords(); assertNotNull( "Returned null set.", set ); assertContainsOnly( set, real ); } //------------------------------------------------------------------------- // Helpers /** * NOTE: changes records */ protected void assertContainsOnly( ITestIssueRecordSet set, ITestIssueRecord[] records ) { int foundCount = 0; ITestIssueRecord[] actualRecords = set.getTestIssueRecords(); assertNotNull( "test issue record set contains null record array.", actualRecords ); for (int arIndex = 0; arIndex < actualRecords.length; ++arIndex) { assertNotNull( "Returned a null test issue record in set.", actualRecords[ arIndex ] ); boolean foundRecord = false; for (int rIndex = 0; rIndex < records.length; ++rIndex) { if (records[ rIndex ] != null && actualRecords[ arIndex ] == records[ rIndex ]) { foundRecord = true; ++foundCount; records[ rIndex ] = null; break; } } assertTrue( "Found record "+actualRecords[ arIndex ]+ " in result set that was not passed into the collate method.", foundRecord ); } assertEquals( "Did not find all the input records to the collate method in its "+ "results.", records.length, foundCount ); } protected ITestIssueRecord createRecord1() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); return tir; } protected ITestIssueRecord createRecord2() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 2" ); return tir; } protected ITestIssueRecord createRecord3() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); tr.setTestName( "name" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 3" ); return tir; } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserGeneratorUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/parser/IParserGener0000644000175000017500000000761407622026431034100 0ustar drazzibdrazzib/* * @(#)IParserGeneratorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.parser; import net.sourceforge.groboutils.pmti.v1.itf.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IParserGenerator interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:09 $ */ public class IParserGeneratorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IParserGeneratorUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IParserGeneratorUTestI( String name, ImplFactory f ) { super( name, IParserGenerator.class, f ); } public IParserGenerator createIParserGenerator() { return (IParserGenerator)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateParsers1() { IParserGenerator pg = createIParserGenerator(); IParser[] p = pg.createParsers(); assertNotNull( "Returned null parser array.", p ); for (int i = 0; i < p.length; ++i) { assertNotNull( "Parser index "+i+" is null.", p[i] ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordSetUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordSet0000644000175000017500000000766407622026425034142 0ustar drazzibdrazzib/* * @(#)ITestIssueRecordSetUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITestIssueRecordSet interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class ITestIssueRecordSetUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITestIssueRecordSetUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITestIssueRecordSetUTestI( String name, ImplFactory f ) { super( name, ITestIssueRecordSet.class, f ); } public ITestIssueRecordSet createITestIssueRecordSet() { return (ITestIssueRecordSet)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetTestIssueRecords1() { ITestIssueRecordSet set = createITestIssueRecordSet(); ITestIssueRecord[] records = set.getTestIssueRecords(); assertNotNull( "Returned null array of records.", records ); for (int i = 0; i < records.length; ++i) { assertNotNull( "Returned null record at index "+i+".", records[i] ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/0000755000175000017500000000000011271425773031273 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestRecordUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestRec0000644000175000017500000001002707665402656034103 0ustar drazzibdrazzib/* * @(#)DefaultTestRecordUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultTestRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class DefaultTestRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultTestRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultTestRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultTestRecord( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestRecordUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultTestRecord(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/IssueTestIssueRecordCollatorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/IssueTestIssue0000644000175000017500000001046507665402656034174 0ustar drazzibdrazzib/* * @(#)IssueTestIssueRecordCollatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the IssueTestIssueRecordCollator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class IssueTestIssueRecordCollatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IssueTestIssueRecordCollatorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IssueTestIssueRecordCollatorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testGetFactor1() { IssueTestIssueRecordCollator itirc = new IssueTestIssueRecordCollator(); ITestIssueRecord tir = new DefaultTestIssueRecord( new DefaultIssueRecord( "1", null ), new DefaultTestRecord(), null ); assertEquals( "Did not return correct factor.", "1", itirc.getFactor( tir ) ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AbstractTestIssueRecordCollatorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new IssueTestIssueRecordCollator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/XMLTestIssueRecordWriterUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/XMLTestIssueRe0000644000175000017500000000766707665402657034046 0ustar drazzibdrazzib/* * @(#)XMLTestIssueRecordWriterUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the XMLTestIssueRecordWriter class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:51 $ * @since July 14, 2002 */ public class XMLTestIssueRecordWriterUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = XMLTestIssueRecordWriterUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public XMLTestIssueRecordWriterUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new XMLTestIssueRecordWriter(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestIssueRecordWriterUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new XMLTestIssueRecordWriter(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/SuiteTestIssueRecordCollatorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/SuiteTestIssue0000644000175000017500000001155307665402657034175 0ustar drazzibdrazzib/* * @(#)SuiteTestIssueRecordCollatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the SuiteTestIssueRecordCollator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:51 $ * @since July 14, 2002 */ public class SuiteTestIssueRecordCollatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = SuiteTestIssueRecordCollatorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public SuiteTestIssueRecordCollatorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testGetFactor1() { SuiteTestIssueRecordCollator atirc = new SuiteTestIssueRecordCollator(); IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); Object r = atirc.getFactor( tir ); assertEquals( "Not right default (null) factor", "", r ); } public void testGetFactor2() { SuiteTestIssueRecordCollator atirc = new SuiteTestIssueRecordCollator(); IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "1" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); Object r = atirc.getFactor( tir ); assertEquals( "Not right factor", "1", r ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AbstractTestIssueRecordCollatorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new SuiteTestIssueRecordCollator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIssueRecordUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIss0000644000175000017500000001261407665402656034134 0ustar drazzibdrazzib/* * @(#)DefaultTestIssueRecordUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultTestIssueRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class DefaultTestIssueRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultTestIssueRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultTestIssueRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultTestIssueRecord( null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception ??? } } public void testConstructor2() { try { new DefaultTestIssueRecord( new DefaultIssueRecord( "1", null ), null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception ??? } } public void testConstructor3() { try { new DefaultTestIssueRecord( null, new DefaultTestRecord(), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { // test exception ??? } } public void testConstructor4() { new DefaultTestIssueRecord( new DefaultIssueRecord( "1", null ), new DefaultTestRecord(), null ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestIssueRecordUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IIssueRecord ir = new DefaultIssueRecord( "a", "b" ); ITestRecord tr = new DefaultTestRecord(); return new DefaultTestIssueRecord( ir, tr, null ); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() { IIssueRecord ir = new DefaultIssueRecord( "a", "b" ); ITestRecord tr = new DefaultTestRecord(); return new DefaultTestIssueRecord( ir, tr, "c" ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/ImmutableTestRecordUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/ImmutableTestR0000644000175000017500000001004107665402656034122 0ustar drazzibdrazzib/* * @(#)ImmutableTestRecordUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ImmutableTestRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class ImmutableTestRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ImmutableTestRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ImmutableTestRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ImmutableTestRecord( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestRecordUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ImmutableTestRecord(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultIssueRecordUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultIssueRe0000644000175000017500000001203507665402656034112 0ustar drazzibdrazzib/* * @(#)DefaultIssueRecordUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultIssueRecord class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class DefaultIssueRecordUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultIssueRecordUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultIssueRecordUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultIssueRecord( null, null ); } catch (IllegalArgumentException e) { // check exception? } } public void testConstructor2() { try { new DefaultIssueRecord( null, "b" ); } catch (IllegalArgumentException e) { // check exception? } } public void testConstructor3() { DefaultIssueRecord dir = new DefaultIssueRecord( "a", null ); assertEquals( "not right id.", "a", dir.getID() ); assertNull( "not right description.", dir.getDescription() ); } public void testConstructor4() { DefaultIssueRecord dir = new DefaultIssueRecord( "a", "b" ); assertEquals( "not right id.", "a", dir.getID() ); assertEquals( "not right description.", "b", dir.getDescription() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IIssueRecordUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultIssueRecord( "a", null ); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() { return new DefaultIssueRecord( "a", "b" ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/AbstractTestIssueRecordCollatorUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/AbstractTestIs0000644000175000017500000001400707622026426034114 0ustar drazzibdrazzib/* * @(#)AbstractTestIssueRecordCollatorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractTestIssueRecordCollator interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:06 $ */ public class AbstractTestIssueRecordCollatorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractTestIssueRecordCollatorUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractTestIssueRecordCollatorUTestI( String name, ImplFactory f ) { super( name, AbstractTestIssueRecordCollator.class, f ); } public AbstractTestIssueRecordCollator createAbstractTestIssueRecordCollator() { return (AbstractTestIssueRecordCollator)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetFactor0() { AbstractTestIssueRecordCollator atirc = createAbstractTestIssueRecordCollator(); try { atirc.getFactor( null ); fail( "Did not throw an exception." ); } catch (RuntimeException e) { DOC.getLog().debug( "Threw exception", e ); } } public void testGetFactor1() { AbstractTestIssueRecordCollator atirc = createAbstractTestIssueRecordCollator(); Object r = atirc.getFactor( createRecord1() ); assertNotNull( "factor is null.", r ); } public void testGetFactor2() { AbstractTestIssueRecordCollator atirc = createAbstractTestIssueRecordCollator(); Object r = atirc.getFactor( createRecord2() ); assertNotNull( "factor is null.", r ); } public void testGetFactor3() { AbstractTestIssueRecordCollator atirc = createAbstractTestIssueRecordCollator(); Object r = atirc.getFactor( createRecord3() ); assertNotNull( "factor is null.", r ); } //------------------------------------------------------------------------- // Helpers protected ITestIssueRecord createRecord1() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); return tir; } protected ITestIssueRecord createRecord2() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 2" ); return tir; } protected ITestIssueRecord createRecord3() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); tr.setTestName( "name" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 3" ); return tir; } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( ITestIssueRecordCollatorUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/AllTestIssueRecordCollatorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/AllTestIssueRe0000644000175000017500000001315007665402656034075 0ustar drazzibdrazzib/* * @(#)AllTestIssueRecordCollatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the AllTestIssueRecordCollator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class AllTestIssueRecordCollatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AllTestIssueRecordCollatorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AllTestIssueRecordCollatorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testCollate1() { AllTestIssueRecordCollator atirc = new AllTestIssueRecordCollator(); ITestIssueRecord records[] = { createRecord1(), createRecord1(), }; ITestIssueRecordSet[] sets = atirc.collate( records ); ITestIssueRecord retRecords[] = sets[0].getTestIssueRecords(); assertEquals( "Must only return one set.", sets.length, 1 ); assertEquals( "Must return 2 records.", retRecords.length, 2 ); assertEquals( "Did not return the correct record for index 0.", retRecords[0], records[0] ); assertEquals( "Did not return the correct record for index 1.", retRecords[1], records[1] ); } //------------------------------------------------------------------------- // Helpers protected ITestIssueRecord createRecord1() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); return tir; } protected ITestIssueRecord createRecord2() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 2" ); return tir; } protected ITestIssueRecord createRecord3() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); tr.setTestName( "name" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 3" ); return tir; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestIssueRecordCollatorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new AllTestIssueRecordCollator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIssueRecordSetUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/DefaultTestIss0000644000175000017500000001120707665402656034131 0ustar drazzibdrazzib/* * @(#)DefaultTestIssueRecordSetUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultTestIssueRecordSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class DefaultTestIssueRecordSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultTestIssueRecordSetUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultTestIssueRecordSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new DefaultTestIssueRecordSet( null ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITestIssueRecordSetUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { ITestIssueRecord[] tir = null; return new DefaultTestIssueRecordSet( tir ); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() { ITestIssueRecord[] tir = new ITestIssueRecord[0]; return new DefaultTestIssueRecordSet( tir ); } } ); suite.addFactory( new CxFactory( "C" ) { public Object createImplObject() { ITestIssueRecord[] tir = { new DefaultTestIssueRecord( new DefaultIssueRecord( "1", null ), new DefaultTestRecord(), null ), }; return new DefaultTestIssueRecordSet( tir ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/NameTestIssueRecordCollatorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/impl/NameTestIssueR0000644000175000017500000001153207665402656034102 0ustar drazzibdrazzib/* * @(#)NameTestIssueRecordCollatorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf.impl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.pmti.v1.itf.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the NameTestIssueRecordCollator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:50 $ * @since July 14, 2002 */ public class NameTestIssueRecordCollatorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = NameTestIssueRecordCollatorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public NameTestIssueRecordCollatorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testGetFactor1() { NameTestIssueRecordCollator atirc = new NameTestIssueRecordCollator(); IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); Object r = atirc.getFactor( tir ); assertEquals( "Not right default (null) factor", "", r ); } public void testGetFactor2() { NameTestIssueRecordCollator atirc = new NameTestIssueRecordCollator(); IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestName( "1" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); Object r = atirc.getFactor( tir ); assertEquals( "Not right factor", "1", r ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AbstractTestIssueRecordCollatorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new NameTestIssueRecordCollator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordCollatorUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/itf/ITestIssueRecordCol0000644000175000017500000002167607622026425034123 0ustar drazzibdrazzib/* * @(#)ITestIssueRecordCollatorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.itf; import net.sourceforge.groboutils.pmti.v1.itf.impl.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITestIssueRecordCollator interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class ITestIssueRecordCollatorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITestIssueRecordCollatorUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITestIssueRecordCollatorUTestI( String name, ImplFactory f ) { super( name, ITestIssueRecordCollator.class, f ); } public ITestIssueRecordCollator createITestIssueRecordCollator() { return (ITestIssueRecordCollator)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCollate1() { ITestIssueRecordCollator tirc = createITestIssueRecordCollator(); ITestIssueRecordSet sets[] = tirc.collate( null ); assertNotNull( "result is null.", sets ); assertEquals( "has non-empty result.", 0, sets.length ); } public void testCollate2() { ITestIssueRecordCollator tirc = createITestIssueRecordCollator(); ITestIssueRecord[] records = new ITestIssueRecord[0]; ITestIssueRecordSet sets[] = tirc.collate( records ); assertNotNull( "result is null.", sets ); assertEquals( "has non-empty result.", 0, sets.length ); } public void testCollate3() { ITestIssueRecordCollator tirc = createITestIssueRecordCollator(); ITestIssueRecord[] records = { createRecord1(), }; ITestIssueRecordSet sets[] = tirc.collate( records ); assertNotNull( "result is null.", sets ); assertEquals( "Can only have one set.", 1, sets.length ); ITestIssueRecord retRecords[] = sets[0].getTestIssueRecords(); assertNotNull( "Must not have null record array returned.", retRecords ); assertEquals( "Must only have one record.", 1, retRecords.length ); assertEquals( "Did not return the input record.", records[0], retRecords[0] ); assertContainsOnly( sets, records ); } public void testCollate4() { ITestIssueRecordCollator tirc = createITestIssueRecordCollator(); ITestIssueRecord[] records = { createRecord1(), createRecord1(), }; ITestIssueRecordSet sets[] = tirc.collate( records ); assertNotNull( "result is null.", sets ); assertContainsOnly( sets, records ); } public void testCollate5() { ITestIssueRecordCollator tirc = createITestIssueRecordCollator(); ITestIssueRecord[] records = { createRecord1(), createRecord1(), createRecord2(), createRecord3(), createRecord3(), createRecord3(), }; ITestIssueRecordSet sets[] = tirc.collate( records ); assertNotNull( "result is null.", sets ); assertContainsOnly( sets, records ); } //------------------------------------------------------------------------- // Helpers /** * NOTE: changes records */ protected void assertContainsOnly( ITestIssueRecordSet sets[], ITestIssueRecord[] records ) { int foundCount = 0; for (int i = 0; i < sets.length; ++i) { ITestIssueRecordSet set = sets[i]; ITestIssueRecord[] actualRecords = set.getTestIssueRecords(); assertNotNull( "test issue record set "+i+" contains null record array.", actualRecords ); for (int arIndex = 0; arIndex < actualRecords.length; ++arIndex) { assertNotNull( "Returned a null test issue record in set "+i+".", actualRecords[ arIndex ] ); boolean foundRecord = false; for (int rIndex = 0; rIndex < records.length; ++rIndex) { if (records[ rIndex ] != null && actualRecords[ arIndex ] == records[ rIndex ]) { foundRecord = true; ++foundCount; records[ rIndex ] = null; break; } } assertTrue( "Found record "+actualRecords[ arIndex ]+ " in result set "+i+ " that was not passed into the collate method.", foundRecord ); } } assertEquals( "Did not find all the input records to the collate method in its "+ "results.", records.length, foundCount ); } protected ITestIssueRecord createRecord1() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); return tir; } protected ITestIssueRecord createRecord2() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 2" ); return tir; } protected ITestIssueRecord createRecord3() { IIssueRecord ir = new DefaultIssueRecord( "", null ); DefaultTestRecord tr = new DefaultTestRecord(); tr.setTestSuite( "suite" ); tr.setTestName( "name" ); ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 3" ); return tir; } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableIssueStateUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableIssueStateUTes0000644000175000017500000001016607622026421034124 0ustar drazzibdrazzib/* * @(#)IEditableIssueStateUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IEditableIssueState interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IEditableIssueStateUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IEditableIssueStateUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IEditableIssueStateUTestI( String name, ImplFactory f ) { super( name, IEditableIssueState.class, f ); } public IEditableIssueState createIEditableIssueState() { return (IEditableIssueState)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetEditableAttributes1() { IEditableIssueState eis = createIEditableIssueState(); IEditableAttributeSet eas = eis.getEditableAttributes(); assertNotNull( "Got null editable attribute set.", eas ); } public void testGetAttributes1() { IEditableIssueState eis = createIEditableIssueState(); IAttributeSet as = eis.getAttributes(); assertTrue( "getAttributes() did not return an editable set.", as instanceof IEditableAttributeSet ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IIssueStateUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableAttributeSetUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableAttributeSetUT0000644000175000017500000001233207622026421034117 0ustar drazzibdrazzib/* * @(#)IEditableAttributeSetUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IEditableAttributeSet interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IEditableAttributeSetUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IEditableAttributeSetUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IEditableAttributeSetUTestI( String name, ImplFactory f ) { super( name, IEditableAttributeSet.class, f ); } public IEditableAttributeSet createIEditableAttributeSet() { return (IEditableAttributeSet)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetEditableAttributes1() { IEditableAttributeSet set = createIEditableAttributeSet(); IEditableAttribute[] eatt = set.getEditableAttributes(); assertNotNull( "Attribute array is null.", eatt ); for (int i = 0; i < eatt.length; ++i) { assertNotNull( "Attribute index "+i+" is null.", eatt[i] ); } IAttribute[] att = set.getAttributes(); assertEquals( "Number of attributes does not equal number of editable "+ "attributes.", att.length, eatt.length ); } public void testGetAttributes1() { // ensure each attribute is in fact editable. IEditableAttributeSet set = createIEditableAttributeSet(); IAttribute[] att = set.getAttributes(); assertTrue( "getAttributes() did not return an Editable interface array.", att instanceof IEditableAttribute[] ); } public void testGetEditableAttribute1() { IEditableAttributeSet set = createIEditableAttributeSet(); String[] names = set.getAttributeNames(); for (int i = 0; i < names.length; ++i) { IEditableAttribute eatt = set.getEditableAttribute( names[i] ); assertNotNull( "Got null editable attribute for name "+names[i]+".", eatt ); assertEquals( "Attribute for name "+names[i]+" is not right name.", names[i], eatt.getInfo().getName() ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IAttributeSetUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableIssueUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableIssueUTestI.ja0000644000175000017500000000700007622026421034002 0ustar drazzibdrazzib/* * @(#)IEditableIssueUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IEditableIssue interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IEditableIssueUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IEditableIssueUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IEditableIssueUTestI( String name, ImplFactory f ) { super( name, IEditableIssue.class, f ); } public IEditableIssue createIEditableIssue() { return (IEditableIssue)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IIssueUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/0000755000175000017500000000000011271425773031170 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttributeInfoUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribut0000644000175000017500000001014407665402654034223 0ustar drazzibdrazzib/* * @(#)DefaultAttributeInfoUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultAttributeInfo class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:48 $ * @since July 20, 2002 */ public class DefaultAttributeInfoUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultAttributeInfoUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultAttributeInfoUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultAttributeInfo( null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAttributeInfoUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { Class c[] = {}; return new DefaultAttributeInfo( "a", null, c ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueStateUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueSta0000644000175000017500000001025407665402655034170 0ustar drazzibdrazzib/* * @(#)DefaultIssueStateUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultIssueState class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultIssueStateUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultIssueStateUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultIssueStateUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultIssueState( null, null, false, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IIssueStateUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IAttribute attrib[] = {}; IAttributeSet set = new DefaultAttributeSet( attrib ); return new DefaultIssueState( "a", "b", false, set ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttributeUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribut0000644000175000017500000001021007665402655034216 0ustar drazzibdrazzib/* * @(#)DefaultAttributeUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultAttribute class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultAttributeUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultAttributeUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultAttributeUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultAttribute( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAttributeUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { Class c[] = {}; IAttributeInfo ai = new DefaultAttributeInfo( "a", null, c ); return new DefaultAttribute( null, ai ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditableAttributeUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditabl0000644000175000017500000000744707622026424034152 0ustar drazzibdrazzib/* * @(#)AbstractEditableAttributeUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractEditableAttribute interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 20, 2002 * @version $Date: 2003/02/10 22:52:04 $ */ public class AbstractEditableAttributeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractEditableAttributeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractEditableAttributeUTestI( String name, ImplFactory f ) { super( name, AbstractEditableAttribute.class, f ); } public AbstractEditableAttribute createAbstractEditableAttribute() { return (AbstractEditableAttribute)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IEditableAttributeUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultProblemManagerInfoUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultProblemM0000644000175000017500000001453307665402655034151 0ustar drazzibdrazzib/* * @(#)DefaultProblemManagerInfoUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultProblemManagerInfo class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultProblemManagerInfoUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultProblemManagerInfoUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultProblemManagerInfoUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultProblemManagerInfo( null, null ); } catch (IllegalArgumentException iae) { // test exception ??? } } public void testConstructor2() { try { new DefaultProblemManagerInfo( "a", null ); } catch (IllegalArgumentException iae) { // test exception ??? } } public void testConstructor3() { IAttributeInfo[] at = {}; IIssueTypeInfo[] iti = { new DefaultIssueTypeInfo( "1", at, null, null, null ), }; try { new DefaultProblemManagerInfo( null, iti ); } catch (IllegalArgumentException iae) { // test exception ??? } } public void testConstructor4() { IAttributeInfo[] at = {}; IIssueTypeInfo[] iti = { new DefaultIssueTypeInfo( "1", at, null, null, null ), }; try { new DefaultProblemManagerInfo( "2", iti ); } catch (IllegalArgumentException iae) { // test exception ??? } } public void testConstructor5() { IAttributeInfo[] at = {}; IIssueTypeInfo[] iti = { new DefaultIssueTypeInfo( "1", at, null, null, null ), }; new DefaultProblemManagerInfo( "1", iti ); } public void testConstructor6() { IAttributeInfo[] at = {}; IIssueTypeInfo[] iti = { new DefaultIssueTypeInfo( "2", at, null, null, null ), new DefaultIssueTypeInfo( "3", at, null, null, null ), new DefaultIssueTypeInfo( "1", at, null, null, null ), }; new DefaultProblemManagerInfo( "1", iti ); } public void testConstructor7() { IAttributeInfo[] at = {}; IIssueTypeInfo[] iti = { new DefaultIssueTypeInfo( "2", at, null, null, null ), new DefaultIssueTypeInfo( "3", at, null, null, null ), new DefaultIssueTypeInfo( "1", at, null, null, null ), new DefaultIssueTypeInfo( "2", at, null, null, null ), }; new DefaultProblemManagerInfo( "1", iti ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IProblemManagerInfoUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IAttributeInfo[] at = {}; IIssueTypeInfo[] iti = { new DefaultIssueTypeInfo( "1", at, null, null, null ), }; return new DefaultProblemManagerInfo( "1", iti ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditableIssueUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditabl0000644000175000017500000000737707622026425034155 0ustar drazzibdrazzib/* * @(#)AbstractEditableIssueUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractEditableIssue interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 20, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class AbstractEditableIssueUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractEditableIssueUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractEditableIssueUTestI( String name, ImplFactory f ) { super( name, AbstractEditableIssue.class, f ); } public AbstractEditableIssue createAbstractEditableIssue() { return (AbstractEditableIssue)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IEditableIssueUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueTypeInfoUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultIssueTyp0000644000175000017500000001036607665402655034221 0ustar drazzibdrazzib/* * @(#)DefaultIssueTypeInfoUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultIssueTypeInfo class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultIssueTypeInfoUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultIssueTypeInfoUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultIssueTypeInfoUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultIssueTypeInfo( null, null, null, null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IIssueTypeInfoUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IAttributeInfo[] at = {}; IIssueState[] as = {}; IIssueState[] ps = {}; IIssueState[] fs = {}; return new DefaultIssueTypeInfo( "a", at, as, ps, fs ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditableListAttributeUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractEditabl0000644000175000017500000000751707622026425034151 0ustar drazzibdrazzib/* * @(#)AbstractEditableListAttributeUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractEditableListAttribute interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 20, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class AbstractEditableListAttributeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractEditableListAttributeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractEditableListAttributeUTestI( String name, ImplFactory f ) { super( name, AbstractEditableListAttribute.class, f ); } public AbstractEditableListAttribute createAbstractEditableListAttribute() { return (AbstractEditableListAttribute)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IEditableListAttributeUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditableAttributeSetUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditable0000644000175000017500000001022407665402655034136 0ustar drazzibdrazzib/* * @(#)DefaultEditableAttributeSetUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultEditableAttributeSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultEditableAttributeSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultEditableAttributeSetUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultEditableAttributeSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultEditableAttributeSet( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IEditableAttributeSetUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IEditableAttribute[] ea = {}; return new DefaultEditableAttributeSet( ea ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultListAttributeUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultListAttr0000644000175000017500000001032007665402655034170 0ustar drazzibdrazzib/* * @(#)DefaultListAttributeUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultListAttribute class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultListAttributeUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultListAttributeUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultListAttributeUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultListAttribute( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IListAttributeUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { Object vals[] = {}; Class c[] = {}; IAttributeInfo info = new DefaultAttributeInfo( "a", null, c ); return new DefaultListAttribute( vals, info ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditableIssueStateUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultEditable0000644000175000017500000001042607665402655034142 0ustar drazzibdrazzib/* * @(#)DefaultEditableIssueStateUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultEditableIssueState class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultEditableIssueStateUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultEditableIssueStateUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultEditableIssueStateUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultEditableIssueState( null, null, true, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IEditableIssueStateUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IEditableAttribute attrib[] = {}; IEditableAttributeSet set = new DefaultEditableAttributeSet( attrib ); return new DefaultEditableIssueState( "a", "b", true, set ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractIssueUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/AbstractIssueUT0000644000175000017500000000725707622026425034147 0ustar drazzibdrazzib/* * @(#)AbstractIssueUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractIssue interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 20, 2002 * @version $Date: 2003/02/10 22:52:05 $ */ public class AbstractIssueUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractIssueUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractIssueUTestI( String name, ImplFactory f ) { super( name, AbstractIssue.class, f ); } public AbstractIssue createAbstractIssue() { return (AbstractIssue)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IIssueUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttributeSetUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/defimpl/DefaultAttribut0000644000175000017500000001012607665402655034224 0ustar drazzibdrazzib/* * @(#)DefaultAttributeSetUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.defimpl; import net.sourceforge.groboutils.pmti.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultAttributeSet class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:49 $ * @since July 20, 2002 */ public class DefaultAttributeSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultAttributeSetUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultAttributeSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultAttributeSet( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IAttributeSetUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { IAttribute[] attribs = {}; return new DefaultAttributeSet( attribs ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IProblemManagerUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IProblemManagerUTestI.j0000644000175000017500000001116707622026421034023 0ustar drazzibdrazzib/* * @(#)IProblemManagerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IProblemManager interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IProblemManagerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IProblemManagerUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IProblemManagerUTestI( String name, ImplFactory f ) { super( name, IProblemManager.class, f ); } public IProblemManager createIProblemManager() { return (IProblemManager)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetIssueIDs1() throws ProblemManagerException { IProblemManager pm = createIProblemManager(); String[] ids = pm.getIssueIDs(); assertNotNull( "ID list is null.", ids ); for (int i = 0; i < ids.length; ++i) { assertNotNull( "ID index "+i+" is null.", ids[i] ); assertTrue( "ID index "+i+" is empty.", ids[i].trim().length() > 0 ); } } public void testGetIssueByID1() throws ProblemManagerException { IProblemManager pm = createIProblemManager(); String[] ids = pm.getIssueIDs(); for (int i = 0; i < ids.length; ++i) { IIssue issue = pm.getIssueByID( ids[i] ); assertNotNull( "Issue id "+ids[i]+" is null.", issue ); } } public void testGetProblemManagerInfo() { IProblemManager pm = createIProblemManager(); IProblemManagerInfo pmi = pm.getProblemManagerInfo(); assertNotNull( "Null info.", pmi ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IAttributeInfoUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IAttributeInfoUTestI.ja0000644000175000017500000001027607622026421034050 0ustar drazzibdrazzib/* * @(#)IAttributeInfoUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IAttributeInfo interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IAttributeInfoUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IAttributeInfoUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IAttributeInfoUTestI( String name, ImplFactory f ) { super( name, IAttributeInfo.class, f ); } public IAttributeInfo createIAttributeInfo() { return (IAttributeInfo)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetName1() { IAttributeInfo ai = createIAttributeInfo(); String name = ai.getName(); assertNotNull( "Returned null name.", name ); } public void testGetDescription1() { IAttributeInfo ai = createIAttributeInfo(); String desc = ai.getDescription(); } public void testGetValueTypes1() { IAttributeInfo ai = createIAttributeInfo(); Class[] c = ai.getValueTypes(); assertNotNull( "Returned null value types.", c ); for (int i = 0; i < c.length; ++i) { assertNotNull( "Value type index "+i+" is null.", c[i] ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/0000755000175000017500000000000010011472737031177 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/0000755000175000017500000000000011271425773031534 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitListenerJDK13UTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitList0000644000175000017500000001422507665402555033720 0ustar drazzibdrazzib/* * @(#)ITFJUnitListenerJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.junit.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitListenerUTestI; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ITFJUnitListener class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class ITFJUnitListenerJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFJUnitListenerJDK13UTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITFJUnitListenerJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup private MockControl testControl; private Test mockTest; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.testControl = EasyMock.controlFor( Test.class ); this.mockTest = (Test)this.testControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testAddFailure1() { DOC.getIT().testsIssue( 526454 ); createListener().addFailure( (TestData)null, null ); } public void testAddFailure1a() { DOC.getIT().testsIssue( 526454 ); createListener().addFailure( (Test)null, null ); } public void testAddFailure2() { DOC.getIT().testsIssue( 526454 ); createListener().addFailure( (TestData)null, new AssertionFailedError( "ignore error") ); } public void testAddFailure2a() { DOC.getIT().testsIssue( 526454 ); createListener().addFailure( (Test)null, new AssertionFailedError( "ignore error") ); } public void testAddFailure3() { this.testControl.activate(); createListener().addFailure( this.mockTest, new AssertionFailedError( "ignore error") ); this.testControl.verify(); } public void testAddError1() { DOC.getIT().testsIssue( 526454 ); createListener().addError( (TestData)null, null ); } public void testAddError1a() { DOC.getIT().testsIssue( 526454 ); createListener().addError( (Test)null, null ); } public void testAddError2() { DOC.getIT().testsIssue( 526454 ); createListener().addError( (TestData)null, new Throwable( "ignore error") ); } public void testAddError2a() { DOC.getIT().testsIssue( 526454 ); createListener().addError( (Test)null, new Throwable( "ignore error") ); } public void testAddError3() { this.testControl.activate(); createListener().addError( this.mockTest, new Throwable( "ignore error") ); this.testControl.verify(); } //------------------------------------------------------------------------- // Helpers protected ITFJUnitListener createListener() { return new ITFJUnitListener(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = JUnitTestListenerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ITFJUnitListener(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFFactoryUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFFactoryUT0000644000175000017500000001010007622026422033663 0ustar drazzibdrazzib/* * @(#)ITFFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import net.sourceforge.groboutils.junit.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ITFFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:02 $ */ public class ITFFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFFactoryUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ITFFactoryUTestI( String name, ImplFactory f ) { super( name, ITFFactory.class, f ); } public ITFFactory createITFFactory() { return (ITFFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { AssertConstructor.assertHasDefaultConstructor( createITFFactory() ); } public void testGetServer1() { ITFFactory f = createITFFactory(); Server s = f.getServer(); assertNotNull( "Returned null server.", s ); } public void testGetTestDataFactory1() { ITFFactory f = createITFFactory(); TestDataFactory tdf = f.getTestDataFactory(); assertNotNull( "Returned null test data factory.", tdf ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitorUT0000644000175000017500000000774007665402555033737 0ustar drazzibdrazzib/* * @(#)ITFMonitorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.testserver.MonitorUTestI; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ITFMonitor class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class ITFMonitorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFMonitorUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ITFMonitorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ITFMonitor( null, null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = MonitorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ITFMonitor(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFTestDataUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFTestDataU0000644000175000017500000003540407665402555033673 0ustar drazzibdrazzib/* * @(#)ITFTestDataUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.DefaultTestInfo; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataUTestI; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ITFTestData class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class ITFTestDataUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFTestDataUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ITFTestDataUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ITFTestData( null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } } public void testSetGetIssues1() { ITFTestData td = createTestData(); td.addIssueID( "a" ); String s[] = td.getIssues(); assertNotNull( "returned null string array", s ); assertEquals( "not right number of issues", s.length, 1 ); assertEquals( "not correct issue ID.", s[0], "a" ); td.addIssueID( "a" ); s = td.getIssues(); assertNotNull( "returned null string array", s ); assertEquals( "not right number of issues", s.length, 1 ); assertEquals( "not correct issue ID.", s[0], "a" ); td.addIssueID( "b" ); s = td.getIssues(); assertNotNull( "returned null string array", s ); assertEquals( "not right number of issues", s.length, 2 ); assertEquals( "not correct issue ID.", s[0], "a" ); assertEquals( "not correct issue ID.", s[1], "b" ); } public void testAddGetErrors1() { ITFTestData td = createTestData(); Throwable t1 = new Throwable("ignore"); td.addError( t1 ); Throwable t[] = td.getErrors(); assertNotNull( "returned null errors.", t ); assertEquals( "not right amount of errors.", t.length, 1 ); assertEquals( "not right error.", t[0], t1 ); td.addError( t1 ); t = td.getErrors(); assertNotNull( "returned null errors.", t ); assertEquals( "not right amount of errors.", t.length, 2 ); assertEquals( "not right error.", t[0], t1 ); assertEquals( "not right error.", t[1], t1 ); Throwable t2 = new Throwable("ignore again"); td.addError( t2 ); t = td.getErrors(); assertNotNull( "returned null errors.", t ); assertEquals( "not right amount of errors.", t.length, 3 ); assertEquals( "not right error.", t[0], t1 ); assertEquals( "not right error.", t[1], t1 ); assertEquals( "not right error.", t[2], t2 ); } public void testAddGetFailures1() { ITFTestData td = createTestData(); AssertionFailedError t1 = new AssertionFailedError("ignore"); td.addFailure( t1 ); AssertionFailedError t[] = td.getFailures(); assertNotNull( "returned null failure.", t ); assertEquals( "not right amount of failure.", t.length, 1 ); assertEquals( "not right failure.", t[0], t1 ); td.addFailure( t1 ); t = td.getFailures(); assertNotNull( "returned null failure.", t ); assertEquals( "not right amount of failure.", t.length, 2 ); assertEquals( "not right failure.", t[0], t1 ); assertEquals( "not right failure.", t[1], t1 ); AssertionFailedError t2 = new AssertionFailedError("ignore again"); td.addFailure( t2 ); t = td.getFailures(); assertNotNull( "returned null failure.", t ); assertEquals( "not right amount of failure.", t.length, 3 ); assertEquals( "not right failure.", t[0], t1 ); assertEquals( "not right failure.", t[1], t1 ); assertEquals( "not right failure.", t[2], t2 ); } public void testAddGetTests1() { ITFTestData td = createTestData(); assertEquals( "Not right number of initial TCs found.", td.getTestCount(), 0 ); td.addTest(); assertEquals( "Not right number of TCs found.", td.getTestCount(), 1 ); td.addTest(); td.addTest(); td.addTest(); assertEquals( "Not right number of TCs found.", td.getTestCount(), 4 ); } public void testTimes1() { ITFTestData td = createTestData(); assertEquals( "Initial runtime is incorrect.", td.getRunTime(), -1 ); } public void testTimes2() { ITFTestData td = createTestData(); td.setStartTime( 0L ); assertEquals( "Initial runtime is incorrect.", td.getRunTime(), -1 ); } public void testTimes3() { ITFTestData td = createTestData(); td.setEndTime( 0L ); assertEquals( "Initial runtime is incorrect.", td.getRunTime(), -1 ); } public void testTimes4() { ITFTestData td = createTestData(); td.setStartTime( 0L ); td.setEndTime( 0L ); assertEquals( "0 runtime is incorrect.", td.getRunTime(), 0 ); } public void testTimes5() { ITFTestData td = createTestData(); td.setStartTime( 0L ); td.setEndTime( 100L ); assertEquals( "runtime is incorrect.", td.getRunTime(), 100L ); } public void testGetSuccessCount1() { ITFTestData td = createTestData(); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 0 ); } public void testGetSuccessCount2() { ITFTestData td = createTestData(); td.addError( new Throwable() ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 0 ); } public void testGetSuccessCount3() { ITFTestData td = createTestData(); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 0 ); } public void testGetSuccessCount4() { ITFTestData td = createTestData(); td.addError( new Throwable() ); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 0 ); } public void testGetSuccessCount5() { ITFTestData td = createTestData(); td.addTest(); td.addError( new Throwable() ); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 0 ); } public void testGetSuccessCount6() { ITFTestData td = createTestData(); td.addTest(); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 1 ); } public void testGetSuccessCount6a() { ITFTestData td = createTestData(); td.addTest(); td.addTest(); td.addTest(); td.addTest(); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 4 ); } public void testGetSuccessCount7() { ITFTestData td = createTestData(); td.addTest(); td.addTest(); td.addTest(); td.addTest(); td.addError( new Throwable() ); td.addError( new Throwable() ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 2 ); } public void testGetSuccessCount8() { ITFTestData td = createTestData(); td.addTest(); td.addTest(); td.addTest(); td.addTest(); td.addFailure( new AssertionFailedError( "ignore" ) ); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 2 ); } public void testGetSuccessCount9() { ITFTestData td = createTestData(); td.addTest(); td.addTest(); td.addTest(); td.addTest(); td.addError( new Throwable() ); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 2 ); } public void testGetSuccessCount10() { ITFTestData td = createTestData(); td.addTest(); td.addTest(); td.addTest(); td.addTest(); td.addError( new Throwable() ); td.addError( new Throwable() ); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 1 ); } public void testGetSuccessCount11() { ITFTestData td = createTestData(); td.addTest(); td.addTest(); td.addTest(); td.addTest(); td.addError( new Throwable() ); td.addFailure( new AssertionFailedError( "ignore" ) ); td.addFailure( new AssertionFailedError( "ignore" ) ); assertEquals( "number of successful TCs incorrect.", td.getSuccessCount(), 1 ); } //------------------------------------------------------------------------- // Helpers protected ITFTestData createTestData() { ITFTestData td = new ITFTestData( new DefaultTestInfo( "a", "b" ) ); return td; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = TestDataUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ITFTestData( new DefaultTestInfo( "a", "b" ) ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitorFinderUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFMonitorFi0000644000175000017500000001001607665402555033733 0ustar drazzibdrazzib/* * @(#)ITFMonitorFinderUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import java.util.Vector; import java.util.Hashtable; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.testserver.MonitorFinderUTestI; import net.sourceforge.groboutils.autodoc.v1.testserver.Monitor; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ITFMonitorFinder class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class ITFMonitorFinderUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFMonitorFinderUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ITFMonitorFinderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testGetMonitor1() { ITFMonitorFinder mf = new ITFMonitorFinder(); Monitor m = mf.getMonitor(); assertNotNull( "getMonitor() returned null.", m ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = MonitorFinderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ITFMonitorFinder(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITImplUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITImp0000644000175000017500000001372607665402555033736 0ustar drazzibdrazzib/* * @(#)AutoDocITImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import java.util.Vector; import java.util.Hashtable; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDocITUTestI; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the AutoDocITImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class AutoDocITImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocITImplUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocITImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public class MyMonitor implements Monitor { public Vector addedTests = new Vector(); public Hashtable testData = new Hashtable(); public Vector sentTests = new Vector(); public void addTestData( TestInfo info ) { addedTests.addElement( info ); } public TestData getTestData( TestInfo info ) { return (TestData)testData.get( info ); } public void sendTestData( TestInfo info ) { sentTests.addElement( info ); } } public class MyMonitorFinder implements MonitorFinder { private Monitor m; public MyMonitorFinder( Monitor m ) { this.m = m; } public Monitor getMonitor() { return m; } } public void testSendTestIssue1() { MyMonitor mon = new MyMonitor(); MyMonitorFinder mf = new MyMonitorFinder( mon ); DefaultTestInfo ti = new DefaultTestInfo( "a", "b" ); DefaultTestData td = new DefaultTestData( ti ); mon.testData.put( ti, td ); AutoDocITImpl it = new AutoDocITImpl( THIS_CLASS, mf ); try { it.sendTestIssue( ti, "" ); fail("did not throw IllegalStateException"); } catch (IllegalStateException iae) { // test exception? } } public void testSendTestIssue2() { MyMonitor mon = new MyMonitor(); MyMonitorFinder mf = new MyMonitorFinder( mon ); DefaultTestInfo ti = new DefaultTestInfo( "a", "b" ); ITFTestData td = new ITFTestData( ti ); mon.testData.put( ti, td ); AutoDocITImpl it = new AutoDocITImpl( THIS_CLASS, mf ); it.sendTestIssue( ti, "a" ); String[] issues = td.getIssues(); assertNotNull( "null issue set", issues ); assertEquals( "incorrect number of issues registered.", issues.length, 1 ); assertEquals( "incorrect registration of issue.", issues[0], "a" ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocITUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new AutoDocITImpl( THIS_CLASS ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/0000755000175000017500000000000011271425773033042 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/AbstractNewFileServerUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/Abstr0000644000175000017500000001104607622026423034034 0ustar drazzibdrazzib/* * @(#)AbstractNewFileServerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; import net.sourceforge.groboutils.pmti.v1.itf.*; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import java.io.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractNewFileServer interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:03 $ */ public class AbstractNewFileServerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractNewFileServerUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractNewFileServerUTestI( String name, ImplFactory f ) { super( name, AbstractNewFileServer.class, f ); } public AbstractNewFileServer createAbstractNewFileServer() { return (AbstractNewFileServer)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testOpenOutput() throws Exception { AbstractNewFileServer anfs = createAbstractNewFileServer(); TestInfo ti = new DefaultTestInfo( "a", "b" ); TestData td = new DefaultTestData( ti ); Writer w = anfs.openOutput( td ); try { assertNotNull( "Must never return a null writer.", w ); } finally { w.close(); } } public void testCreateFileName() { AbstractNewFileServer anfs = createAbstractNewFileServer(); TestInfo ti = new DefaultTestInfo( "a", "b" ); TestData td = new DefaultTestData( ti ); String name = anfs.createFileName( td ); assertNotNull( "Name is null.", name ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( AbstractWriterServerUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/AbstractAppendFileServerUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/Abstr0000644000175000017500000001033407622026423034033 0ustar drazzibdrazzib/* * @(#)AbstractAppendFileServerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; import net.sourceforge.groboutils.pmti.v1.itf.*; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import java.io.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AbstractAppendFileServer interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:03 $ */ public class AbstractAppendFileServerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractAppendFileServerUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AbstractAppendFileServerUTestI( String name, ImplFactory f ) { super( name, AbstractAppendFileServer.class, f ); } public AbstractAppendFileServer createAbstractAppendFileServer() { return (AbstractAppendFileServer)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testOpenOutput() throws Exception { AbstractAppendFileServer aafs = createAbstractAppendFileServer(); TestInfo ti = new DefaultTestInfo( "a", "b" ); TestData td = new DefaultTestData( ti ); Writer w = aafs.openOutput( td ); try { assertNotNull( "Must never return a null writer.", w ); } finally { w.close(); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( AbstractWriterServerUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/LogFileServerUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/server/LogFi0000644000175000017500000001124107655644604033773 0ustar drazzibdrazzib/* * @(#)LogFileServerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.server; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; import java.io.*; /** * Tests the LogFileServer class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:00 $ * @since July 14, 2002 */ public class LogFileServerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = LogFileServerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public LogFileServerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testWriteTestData1() throws Exception { StringWriter sw = new StringWriter(); File f = new File( "logtest-"+System.currentTimeMillis()+".tmp" ); try { TestInfo ti = new DefaultTestInfo( "a", "b" ); ITFTestData td = new ITFTestData( ti ); LogFileServer lfs = new LogFileServer( f ); lfs.writeTestData( td, sw ); } finally { f.delete(); } String output = sw.toString(); DOC.getLog().debug(new String[] { "Log Server output='",output,"'" }); assertTrue( "Does not contain test suite and test name.", output.indexOf( "a#b" ) >= 0 ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AbstractAppendFileServerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { File f = new File( "testlog-"+System.currentTimeMillis()+ ".log" ); return new LogFileServer( f ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/0000755000175000017500000000000011271425773032334 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileParserUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileP0000644000175000017500000001522507665402653033650 0ustar drazzibdrazzib/* * @(#)XMLFileParserUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml; import net.sourceforge.groboutils.pmti.v1.itf.parser.*; import java.io.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Parser; /** * Tests the XMLFileParser class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:47 $ * @since July 14, 2002 */ public class XMLFileParserUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = XMLFileParserUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public XMLFileParserUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new XMLFileParser( null, null ); } catch (IllegalArgumentException e) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers protected static File createSample1() { File f = new File( "test-" + System.currentTimeMillis() + ".xml" ); PrintWriter pw = null; try { FileWriter fw = new FileWriter( f ); pw = new PrintWriter( fw ); pw.println( "" ); pw.println( "" ); pw.println( "" ); } catch (IOException e) { e.printStackTrace(); if (f.exists()) { f.delete(); } throw new IllegalStateException("unexpected exception: "+ e.getMessage() ); } finally { if (pw != null) { pw.close(); } } return f; } protected static File createSample2() { File f = new File( "test-" + System.currentTimeMillis() + ".xml" ); PrintWriter pw = null; try { FileWriter fw = new FileWriter( f ); pw = new PrintWriter( fw ); pw.println( "" ); pw.println( "" ); pw.println( "" ); } catch (IOException e) { e.printStackTrace(); if (f.exists()) { f.delete(); } throw new IllegalStateException("unexpected exception: "+ e.getMessage() ); } finally { if (pw != null) { pw.close(); } } return f; } protected static Parser createParser() { try { return SAXParserFactory.newInstance().newSAXParser().getParser(); } catch (Exception e) { DOC.getLog().debug( "Creating SAX parser caused exception.", e ); throw new IllegalStateException("Could not create a SAX parser: "+ e.getMessage() ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IParserUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new XMLFileParser( createSample1(), createParser() ); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() { return new XMLFileParser( createSample2(), createParser() ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileParserGeneratorUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileP0000644000175000017500000000760107665402652033646 0ustar drazzibdrazzib/* * @(#)XMLFileParserGeneratorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml; import net.sourceforge.groboutils.pmti.v1.itf.parser.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the XMLFileParserGenerator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:46 $ * @since July 14, 2002 */ public class XMLFileParserGeneratorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = XMLFileParserGeneratorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public XMLFileParserGeneratorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new XMLFileParserGenerator(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IParserGeneratorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new XMLFileParserGenerator(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileServerUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/xml/XMLFileS0000644000175000017500000001013607665402653033647 0ustar drazzibdrazzib/* * @(#)XMLFileServerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1.xml; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.*; import net.sourceforge.groboutils.pmti.v1.autodoc.v1.server.*; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the XMLFileServer class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:47 $ * @since July 14, 2002 */ public class XMLFileServerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = XMLFileServerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public XMLFileServerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new XMLFileServer( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test exception ??? } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AbstractNewFileServerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new XMLFileServer( "utest-" ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultITFFactoryUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultITFFa0000644000175000017500000001027707665402555033671 0ustar drazzibdrazzib/* * @(#)DefaultITFFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultITFFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class DefaultITFFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultITFFactoryUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public DefaultITFFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testCreateServer1() { DefaultITFFactory factory = new DefaultITFFactory(); assertNotNull( "Null server on create.", factory.createServer() ); } public void testCreateTestDataFactory1() { DefaultITFFactory factory = new DefaultITFFactory(); assertNotNull( "Null test data factory on create.", factory.createTestDataFactory() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = ITFFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultITFFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITFactoryImplUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/AutoDocITFac0000644000175000017500000000760307665402555033677 0ustar drazzibdrazzib/* * @(#)AutoDocITFactoryImplUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocITFactoryUTestI; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the AutoDocITFactoryImpl class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class AutoDocITFactoryImplUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocITFactoryImplUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocITFactoryImplUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testCreate() { } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocITFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new AutoDocITFactoryImpl(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultTestDataFactoryUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/DefaultTestD0000644000175000017500000001016507665402555034017 0ustar drazzibdrazzib/* * @(#)DefaultTestDataFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.testserver.DefaultTestInfo; import net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactoryUTestI; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the DefaultTestDataFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since March 5, 2002 */ public class DefaultTestDataFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultTestDataFactoryUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public DefaultTestDataFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testCreate1() { DefaultTestDataFactory f = new DefaultTestDataFactory(); assertTrue( "not correct type.", f.createTestData( new DefaultTestInfo( "", "" ) ) instanceof ITFTestData ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = TestDataFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultTestDataFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitListenerFactoryUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/autodoc/v1/ITFJUnitList0000644000175000017500000001006307665402555033714 0ustar drazzibdrazzib/* * @(#)ITFJUnitListenerFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.spi.TestListenerFactoryUTestI; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ITFJUnitListenerFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:04:45 $ * @since April 29, 2002 */ public class ITFJUnitListenerFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ITFJUnitListenerFactoryUTest.class; //private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ITFJUnitListenerFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testCreateListener1() { ITFJUnitListenerFactory lf = new ITFJUnitListenerFactory(); assertTrue( "Not right kind of subclass.", lf.createListener() instanceof ITFJUnitListener ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = TestListenerFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new ITFJUnitListenerFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IAttributeUTestI.java0000644000175000017500000000735407622026421033566 0ustar drazzibdrazzib/* * @(#)IAttributeUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IAttribute interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IAttributeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IAttributeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IAttributeUTestI( String name, ImplFactory f ) { super( name, IAttribute.class, f ); } public IAttribute createIAttribute() { return (IAttribute)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetValue1() { IAttribute att = createIAttribute(); Object v = att.getValue(); } public void testGetInfo1() { IAttribute att = createIAttribute(); IAttributeInfo ai = att.getInfo(); assertNotNull( "Null attribute info.", ai ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableListAttributeUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IEditableListAttributeU0000644000175000017500000000711007622026421034151 0ustar drazzibdrazzib/* * @(#)IEditableListAttributeUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IEditableListAttribute interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IEditableListAttributeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IEditableListAttributeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IEditableListAttributeUTestI( String name, ImplFactory f ) { super( name, IListAttribute.class, f ); } public IEditableListAttribute createIEditableListAttribute() { return (IEditableListAttribute)createImplObject(); } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IListAttributeUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IListAttributeUTestI.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IListAttributeUTestI.ja0000644000175000017500000001166707622026421034075 0ustar drazzibdrazzib/* * @(#)IListAttributeUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import java.util.Enumeration; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IListAttribute interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IListAttributeUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IListAttributeUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IListAttributeUTestI( String name, ImplFactory f ) { super( name, IListAttribute.class, f ); } public IListAttribute createIListAttribute() { return (IListAttribute)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetValues1() { IListAttribute la = createIListAttribute(); Enumeration enum = la.getValues(); assertNotNull( "Null enum.", enum ); } public void testGetValues2() { IListAttribute la = createIListAttribute(); Enumeration enum = la.getValues(); int found = 0; for (; enum.hasMoreElements(); ++found) { Object o = enum.nextElement(); /* can contain nulls! assertNotNull( "Element at index "+found+" is null.", o ); */ } assertEquals( "Number of returned elements does not match count.", found, la.getValueCount() ); } public void testGetValueCount1() { IListAttribute la = createIListAttribute(); int count = la.getValueCount(); assertTrue( "Invalid value count ("+count+").", count >= 0 ); } public void testContainsValue1() { IListAttribute la = createIListAttribute(); Enumeration enum = la.getValues(); while (enum.hasMoreElements()) { Object o = enum.nextElement(); assertTrue( "Does not contain value it returned in enumeration ("+o+").", la.containsValue( o ) ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( IAttributeUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/ProblemManagerExceptionUTest.javalibgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/ProblemManagerException0000644000175000017500000001132707665402436034254 0ustar drazzibdrazzib/* * @(#)ProblemManagerExceptionUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.util.throwable.v1.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the ProblemManagerException class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:03:26 $ * @since July 14, 2002 */ public class ProblemManagerExceptionUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ProblemManagerExceptionUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ProblemManagerExceptionUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testAllTestsCoveredByInterfaceTests() { } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations private static class PMEFactory implements IChainableExceptionUTestI.IChainableExceptionFactory { public IChainableException createException() { return new ProblemManagerException(); } public IChainableException createException( String message ) { return new ProblemManagerException( message ); } public IChainableException createException( Throwable cause ) { return new ProblemManagerException( cause ); } public IChainableException createException( String message, Throwable cause ) { return new ProblemManagerException( message, cause ); } public IChainableException createException( Throwable cause, String message ) { return new ProblemManagerException( cause, message ); } } public static Test suite() { InterfaceTestSuite suite = IChainableExceptionUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new PMEFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IIssueStateUTestI.java0000644000175000017500000001032307622026421033702 0ustar drazzibdrazzib/* * @(#)IIssueStateUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IIssueState interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IIssueStateUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IIssueStateUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IIssueStateUTestI( String name, ImplFactory f ) { super( name, IIssueState.class, f ); } public IIssueState createIIssueState() { return (IIssueState)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetName1() { IIssueState is = createIIssueState(); String name = is.getName(); assertNotNull( "Got null issue state name.", name ); } public void testGetDescription1() { IIssueState is = createIIssueState(); String desc = is.getDescription(); } public void testOpenClosed1() { IIssueState is = createIIssueState(); assertEquals( "Open must be opposite of closed.", !is.isOpen(), is.isClosed() ); } public void testGetAttributes1() { IIssueState is = createIIssueState(); IAttributeSet set = is.getAttributes(); assertNotNull( "Got null attribute set.", set ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/net/sourceforge/groboutils/pmti/v1/IIssueUTestI.java0000644000175000017500000001150507622026421032704 0ustar drazzibdrazzib/* * @(#)IIssueUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.pmti.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the IIssue interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since July 14, 2002 * @version $Date: 2003/02/10 22:52:01 $ */ public class IIssueUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IIssueUTestI.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public IIssueUTestI( String name, ImplFactory f ) { super( name, IIssue.class, f ); } public IIssue createIIssue() { return (IIssue)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetID1() { IIssue issue = createIIssue(); assertNotNull( issue.getID() ); } public void testGetType1() { IIssue issue = createIIssue(); assertNotNull( issue.getType() ); } public void testGetShortDescription1() { IIssue issue = createIIssue(); // may be null issue.getShortDescription(); } public void testGetState1() { IIssue issue = createIIssue(); IIssueState state = issue.getState(); if (state != null) { // simple tests assertNotNull( state.getName() ); } } public void testGetAttributes1() { IIssue issue = createIIssue(); assertNotNull( issue.getAttributes() ); } public void testReload1() { IIssue issue = createIIssue(); try { IIssue reloaded = issue.reload(); assertNotNull( "Null reloaded issue", reloaded ); assertEquals( reloaded.getID(), issue.getID() ); assertEquals( reloaded.getType(), issue.getType() ); } catch (ProblemManagerException pme) { assertNotNull( "Raised exception "+pme+" has null message.", pme.getMessage() ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/pmti/sources/ut/about.txt0000644000175000017500000000012207521071644022612 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/pmti/sources/iut/0000755000175000017500000000000011271425773021120 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/iut/about.txt0000644000175000017500000000021107521071644022762 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/pmti/sources/eut/0000755000175000017500000000000011271425773021114 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/sources/eut/about.txt0000644000175000017500000000015307521071644022763 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/pmti/CHANGES.TXT0000644000175000017500000000447407737323756020330 0ustar drazzibdrazzib v1.0.0alpha3 * Changed build to reflect new version. * Updated documentation to reflect current thoughts on this package. This will be, probably, the last version in its current state. v1.0.0alpha2 * Moved the license from LGPL to MIT. v1.0.0alpha1 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Isolated the 'pmti' hierarchy. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/pmti/xdocs/0000755000175000017500000000000011271425773017754 5ustar drazzibdrazziblibgroboutils-java-5.orig/pmti/xdocs/summary.xml0000644000175000017500000000202607737323757022206 0ustar drazzibdrazzib pmti net.sourceforge.groboutils.pmti.v1 The Problem Management Tracker Interface. A framework for interfacing with Problem Management Trackers (a.k.a. bug trackers). Includes SPI connectors for the AutoDoc framework. 04-Oct-2003: Looking at moving the location of the tracking numbers from code to XDoclet. If so, this will be a major change and break backwards-compatibility.
    Still need example implementations for Sourceforge (web-based) and Bugzilla (database-based).
    Complete the documentation. As the system is in flux, this is an on-going task.
    libgroboutils-java-5.orig/pmti/xdocs/ant.xml0000644000175000017500000001023107655132714021256 0ustar drazzibdrazzib Using Matt Albrecht $Date: 2003/05/04 06:40:12 $
    Ant Tasks

    The following is a listing of all ant tasks contained in this package.

    libgroboutils-java-5.orig/pmti/xdocs/about.xml0000644000175000017500000000062007655132714021607 0ustar drazzibdrazzib About PMTI $Date: 2003/05/04 06:40:12 $ Matt Albrecht The Problem Management Tracker Interface is a framework for interfacing with Problem Management Trackers (a.k.a. bug trackers). Includes SPI connectors for the AutoDoc framework. libgroboutils-java-5.orig/pmti/xdocs/requirements.xml0000644000175000017500000000045307662237146023227 0ustar drazzibdrazzib Requirements for PMTI $Date: 2003/05/19 20:28:22 $

    Still in progress. You'd think that requirements would come before code, wouldn't you?

    libgroboutils-java-5.orig/pmti/xdocs/design.xml0000644000175000017500000000037407662237145021756 0ustar drazzibdrazzib Design of PMTI $Date: 2003/05/19 20:28:21 $

    Still retrofiting the design to match the code.

    libgroboutils-java-5.orig/pmti/xdocs/index.xml0000644000175000017500000000120307655132714021602 0ustar drazzibdrazzib Welcome $Date: 2003/05/04 06:40:12 $
  • About PMTI
  • Requirements
  • Design
  • Using
  • See AutoDoc for more about issue traceability
  • libgroboutils-java-5.orig/pmti/xdocs/using.xml0000644000175000017500000000102507662237146021625 0ustar drazzibdrazzib Using PMTI $Date: 2003/05/19 20:28:22 $ Matt Albrecht
    Integration with AutoDoc

    To integrate PMTI with AutoDoc, you only need to add the PMTI Jar file to the classpath. The AutoDoc framework will automatically detect the PMTI SPI settings.

    Integration with Bug Trackers

    This section is still being developed.

    libgroboutils-java-5.orig/uicapture/0000755000175000017500000000000011271425773017664 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/deployed.ant-inc.xml0000644000175000017500000000031707547162334023546 0ustar drazzibdrazzib libgroboutils-java-5.orig/uicapture/build.xml0000644000175000017500000001103307561622145021502 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/uicapture/TODO.txt0000644000175000017500000000062107737567307021205 0ustar drazzibdrazzibItems to do for UICapture (in relative order of importance): 1. Allow for a "multi-action" feature: the user can queue up several actions to be executed in a single request (that is, the in-between steps won't pause with the glass pane). This should be a hack to work-around the drop-down menu bug. 2. Create a default UI that has meta-codes for various actions. libgroboutils-java-5.orig/uicapture/log4j.properties0000644000175000017500000000050207521071666023017 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.uicapture=DEBUG libgroboutils-java-5.orig/uicapture/sources/0000755000175000017500000000000010011472765021341 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/0000755000175000017500000000000011271425773022124 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/net/0000755000175000017500000000000010011472763022702 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/net/sourceforge/0000755000175000017500000000000010011472763025225 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/net/sourceforge/groboutils/0000755000175000017500000000000010011472763027416 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/net/sourceforge/groboutils/uicapture/0000755000175000017500000000000010011472763031417 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/net/sourceforge/groboutils/uicapture/v1/0000755000175000017500000000000011271425773031755 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ait/about.txt0000644000175000017500000000021007521071666023771 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/uicapture/sources/dev/0000755000175000017500000000000011271425773022125 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/dev/net/0000755000175000017500000000000010011472763022703 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/0000755000175000017500000000000010011472763025226 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472763027417 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/0000755000175000017500000000000010011472763031420 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/0000755000175000017500000000000011271425773031756 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/DefaultFocusedWindowFinder.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/DefaultFocus0000644000175000017500000000452207622026456034270 0ustar drazzibdrazzib/* * @(#)DefaultFocusedWindowFinder.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Rectangle; import java.awt.Toolkit; /** * Default implementation, which always returns null. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 7, 2002 */ public class DefaultFocusedWindowFinder implements IFocusedWindowFinder { /** * Default constructor. */ public DefaultFocusedWindowFinder() { // do nothing } //------------------------------------------------------------------------- // Public methods /** * Find the current native UI focused window's bounds. * If the class cannot determine * the focused window, or there isn't a focused window, then the class * should return null, in which case the framework should default * to the screen size. * * @return the focused window's bounds, or null if it cannot be * found. */ public Rectangle getFocusedWindowBounds() { return null; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/IScreenScraper.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/IScreenScrap0000644000175000017500000000474607622026457034236 0ustar drazzibdrazzib/* * @(#)IScreenScraper.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; /** * This interface defines a class which can save an Image to a file. The * writing may be compressed, lossy, or whatever, just as long as a proper * file Diff of the same Image (but different files) will result in no * differences. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 7, 2002 */ public interface IScreenScraper { //------------------------------------------------------------------------- // Public methods /** * Write the given image to the given file. * * @param image The screen image to write to disk. * @param file The File to save the image as. * @exception IOException thrown if there was a problem saving the image to * the file. */ public void writeImageToFile( BufferedImage image, File file ) throws IOException; /** * Discover the file extention for images created by this scraper. * This does not include a '.'. * * @return the extention for files this scraper writes. */ public String getFileExtention(); } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/IScriptMaker.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/IScriptMaker0000644000175000017500000001324707622026457034246 0ustar drazzibdrazzib/* * @(#)IScriptMaker.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.io.File; /** * Implementors of this interface accept a collection of UI captured * events as they relate to creating a play-back script. This interface * dictates that the contract for all IScriptMaker instances, the * {@link #start()} method * must be called before any other method, and no other method, besides * toString(), may be called after invoking the {@link #end()} method. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:31 $ * @since Jan 7, 2002 */ public interface IScriptMaker { //------------------------------------------------------------------------- // Public methods /** * Starts the script generation. * * @exception IllegalStateException if start() has already been * called. */ public void start(); /** * Terminates the script generation. * * @exception IllegalStateException if start() has not been called, * or if end() has already been called. */ public void end(); /** * Cause the script to delay for the given number of milliseconds. * * @param milliseconds the number of milliseconds in the delay. * @exception IllegalStateException if start() has not been called, * or if end() has already been called. */ public void generateDelay( long milliseconds ); /** * Cause the script to rotate the mouse wheel. * * @param rotate the number of rotations the mouse wheel generated. * @exception IllegalStateException if start() has not been called, * or if end() has already been called. * @see java.awt.event.MouseWheelEvent */ public void generateMoveMouseWheel( int rotate ); /** * Cause the script to move the mouse. * * @param x the x-coordinate that the mouse moved to * @param y the y-coordinate that the mouse moved to * @exception IllegalStateException if start() has not been called, * or if end() has already been called. */ public void generateMoveMouse( int x, int y ); /** * Cause the script to press a mouse button. * * @param modifier the modifier code for the mouse button pressed. * @exception IllegalStateException if start() has not been called, * or if end() has already been called. * @see java.awt.event.MouseEvent */ public void generatePressMouse( int modifer ); /** * Cause the script to release a mouse button. * * @param modifier the modifier code for the mouse button released. * @exception IllegalStateException if start() has not been called, * or if end() has already been called. * @see java.awt.event.MouseEvent */ public void generateReleaseMouse( int modifier ); /** * Cause the script to press a key. * * @param keyCode code for the pressed key. * @exception IllegalStateException if start() has not been called, * or if end() has already been called. * @see java.awt.event.KeyEvent */ public void generatePressKey( int keyCode ); /** * Cause the script to release a key. * * @param keyCode code for the released key. * @exception IllegalStateException if start() has not been called, * or if end() has already been called. * @see java.awt.event.KeyEvent */ public void generateReleaseKey( int keyCode ); /** * Cause the script to capture a screen shot. Probably, it should compare * the captured image against the original saved image. * * @param originalImage file containing the original image for the screen * capture that the generated script will compare against when the * test is run. * @param x screen image bounds. * @param y screen image bounds. * @param width screen image bounds. * @param height screen image bounds. * * @exception IllegalStateException if start() has not been called, * or if end() has already been called. */ public void generateScreenCapture( File originalImage, int x, int y, int width, int height ); } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/package.htmllibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/package.html0000644000175000017500000000036407521071666034243 0ustar drazzibdrazzibnet.sourceforge.groboutils.uicapture.v1 A testing framework used for capturing a user's UI interaction, and for generating scripts which can automatically play back a captured interaction. libgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/0000755000175000017500000000000011271425773033077 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/CaptureAdapter.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/Captur0000644000175000017500000000507207622026460034257 0ustar drazzibdrazzib/* * @(#)CaptureAdapter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; /** * Default implementation of an ICaptureListener. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class CaptureAdapter implements ICaptureListener { /** * @param ce the captured event. * @see java.awt.event.MouseWheelListener */ public void mouseWheelMoved( MouseWheelCaptureEvent ce ) { } /** * @param ce the captured event. * @see java.awt.event.MouseMotionListener */ public void mouseMoved( MouseMovedCaptureEvent ce ) { } /** * @param ce the captured event. * @see java.awt.event.MouseListener */ public void mousePressed( MousePressedCaptureEvent ce ) { } /** * @param ce the captured event. * @see java.awt.event.MouseListener */ public void mouseReleased( MouseReleasedCaptureEvent ce ) { } /** * @param ce the captured event. * @see java.awt.event.KeyListener */ public void keyPressed( KeyPressedCaptureEvent ce ) { } /** * @param ce the captured event. * @see java.awt.event.KeyListener */ public void keyReleased( KeyReleasedCaptureEvent ce ) { } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/KeyReleasedCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/KeyRel0000644000175000017500000000375507622026460034222 0ustar drazzibdrazzib/* * @(#)KeyReleasedCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class KeyReleasedCaptureEvent extends KeyCaptureEvent { public KeyReleasedCaptureEvent( KeyEvent event ) { super( CE_KEY_RELEASED, event ); } public KeyReleasedCaptureEvent( int keyCode ) { super( CE_KEY_RELEASED, keyCode ); } public void performEvent( Robot r ) { super.performEvent( r ); r.keyRelease( getKeyCode() ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseC0000644000175000017500000000447107622026460034216 0ustar drazzibdrazzib/* * @(#)MousePressedCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public abstract class MouseCaptureEvent extends CaptureEvent { protected static final int BUTTON_MASK = InputEvent.BUTTON1_MASK | InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK; public MouseCaptureEvent( int type, MouseEvent event ) { super( type, (InputEvent)event ); } public MouseCaptureEvent( int type ) { super( type ); } public MouseEvent getMouseEvent() { return (MouseEvent)getInputEvent(); } /** * Ensure the Robot is not null. */ public void performEvent( Robot r ) { if (r == null) { throw new IllegalArgumentException( "no null args" ); } } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseButtonCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseB0000644000175000017500000000420607622026460034211 0ustar drazzibdrazzib/* * @(#)MouseButtonCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public abstract class MouseButtonCaptureEvent extends MouseCaptureEvent { /** * @serial */ private int modifiers = -1; public MouseButtonCaptureEvent( int type, MouseEvent event ) { super( type, event ); this.modifiers = event.getModifiers() & BUTTON_MASK; } public MouseButtonCaptureEvent( int type, int modifiers ) { super( type ); this.modifiers = modifiers & BUTTON_MASK; } public int getModifiers() { return this.modifiers; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/ICaptureListener.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/ICaptu0000644000175000017500000000446407622026460034212 0ustar drazzibdrazzib/* * @(#)ICaptureListener.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; /** * A listener which becomes aware of all low-level user interaction, and * when they occured. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public interface ICaptureListener { /** * @see java.awt.event.MouseWheelListener */ public void mouseWheelMoved( MouseWheelCaptureEvent ce ); /** * @see java.awt.event.MouseMotionListener */ public void mouseMoved( MouseMovedCaptureEvent ce ); /** * @see java.awt.event.MouseListener */ public void mousePressed( MousePressedCaptureEvent ce ); /** * @see java.awt.event.MouseListener */ public void mouseReleased( MouseReleasedCaptureEvent ce ); /** * @see java.awt.event.KeyListener */ public void keyPressed( KeyPressedCaptureEvent ce ); /** * @see java.awt.event.KeyListener */ public void keyReleased( KeyReleasedCaptureEvent ce ); } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MousePressedCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseP0000644000175000017500000000415307622026460034230 0ustar drazzibdrazzib/* * @(#)MousePressedCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class MousePressedCaptureEvent extends MouseButtonCaptureEvent { public MousePressedCaptureEvent( MouseEvent event ) { super( CE_MOUSE_PRESSED, event ); } public MousePressedCaptureEvent( int modifiers ) { super( CE_MOUSE_PRESSED, modifiers ); } /** * Reenacts the event that this CaptureEvent represents underneath it * all. */ public void performEvent( Robot r ) { super.performEvent( r ); r.mousePress( getModifiers() ); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseReleasedCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseR0000644000175000017500000000416307622026460034233 0ustar drazzibdrazzib/* * @(#)MouseReleasedCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class MouseReleasedCaptureEvent extends MouseButtonCaptureEvent { public MouseReleasedCaptureEvent( MouseEvent event ) { super( CE_MOUSE_RELEASED, event ); } public MouseReleasedCaptureEvent( int modifiers ) { super( CE_MOUSE_RELEASED, modifiers ); } /** * Reenacts the event that this CaptureEvent represents underneath it * all. */ public void performEvent( Robot r ) { super.performEvent( r ); r.mouseRelease( getModifiers() ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseWheelCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseW0000644000175000017500000000464307622026460034243 0ustar drazzibdrazzib/* * @(#)MouseWheelCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; /** * An event object which stores a capture event. *

    * Requires JDK 1.4+ * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class MouseWheelCaptureEvent extends MouseCaptureEvent { /** * @serial */ private int rotation = 0; public MouseWheelCaptureEvent( MouseWheelEvent event ) { super( CE_MOUSE_WHEEL, (MouseEvent)event ); this.rotation = event.getWheelRotation(); } public MouseWheelCaptureEvent( int rotation ) { super( CE_MOUSE_WHEEL ); this.rotation = rotation; } public int getWheelRotation() { return this.rotation; } /** * Reenacts the event that this CaptureEvent represents underneath it * all. */ public void performEvent( Robot r ) { super.performEvent( r ); r.mouseWheel( getWheelRotation() ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/AllowCapturePassThroughAdapter.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/AllowC0000644000175000017500000000627507622026460034210 0ustar drazzibdrazzib/* * @(#)AllowCapturePassThroughAdapter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; /** * An adapter for IAllowCapturePassThroughListener. All instances must * also be of type ICaptureListener. By default, all these events * allow passthrough. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class AllowCapturePassThroughAdapter extends CaptureAdapter implements IAllowCapturePassThroughListener { /** * @see java.awt.event.MouseWheelListener * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowMouseWheelMoved( MouseWheelCaptureEvent ce ) { return true; } /** * @see java.awt.event.MouseListener * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowMousePressed( MousePressedCaptureEvent ce ) { return true; } /** * @see java.awt.event.MouseListener * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowMouseReleased( MouseReleasedCaptureEvent ce ) { return true; } /** * @see java.awt.event.KeyListener * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowKeyPressed( KeyPressedCaptureEvent ce ) { return true; } /** * @see java.awt.event.KeyListener * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowKeyReleased( KeyReleasedCaptureEvent ce ) { return true; } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/KeyCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/KeyCap0000644000175000017500000000466407622026460034203 0ustar drazzibdrazzib/* * @(#)KeyCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public abstract class KeyCaptureEvent extends CaptureEvent { /** * @serial */ private int keyCode = -1; public KeyCaptureEvent( int type, KeyEvent event ) { super( type, (InputEvent)event ); if (event != null) { this.keyCode = event.getKeyCode(); } } public KeyCaptureEvent( int type, int keyCode ) { super( type ); this.keyCode = keyCode; } public KeyEvent getKeyEvent() { return (KeyEvent)getInputEvent(); } public int getKeyCode() { return this.keyCode; } /** * Ensures that the robot is not null. */ public void performEvent( Robot r ) { if (r == null) { throw new IllegalArgumentException( "no null args" ); } } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseMovedCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/MouseM0000644000175000017500000000470207622026460034225 0ustar drazzibdrazzib/* * @(#)MouseMovedCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class MouseMovedCaptureEvent extends MouseCaptureEvent { /** * @serial */ private int x = -1; /** * @serial */ private int y = -1; public MouseMovedCaptureEvent( MouseEvent event ) { super( CE_MOUSE_MOVED, event ); this.x = event.getX(); this.y = event.getY(); } public MouseMovedCaptureEvent( int x, int y ) { super( CE_MOUSE_MOVED ); this.x = x; this.y = y; } public int getX() { return this.x; } public int getY() { return this.y; } /** * Reenacts the event that this CaptureEvent represents underneath it * all. */ public void performEvent( Robot r ) { super.performEvent( r ); r.mouseMove( getX(), getY() ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/KeyPressedCaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/KeyPre0000644000175000017500000000374507622026460034225 0ustar drazzibdrazzib/* * @(#)KeyPressedCaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class KeyPressedCaptureEvent extends KeyCaptureEvent { public KeyPressedCaptureEvent( KeyEvent event ) { super( CE_KEY_PRESSED, event ); } public KeyPressedCaptureEvent( int keyCode ) { super( CE_KEY_PRESSED, keyCode ); } public void performEvent( Robot r ) { super.performEvent( r ); r.keyPress( getKeyCode() ); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/CaptureEvent.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/Captur0000644000175000017500000000603607622026460034260 0ustar drazzibdrazzib/* * @(#)CaptureEvent.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; /** * An event object which stores a capture event. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public abstract class CaptureEvent implements java.io.Serializable { public static final int CE_MOUSE_MOVED = 1; public static final int CE_MOUSE_PRESSED = 2; public static final int CE_MOUSE_RELEASED = 3; public static final int CE_KEY_PRESSED = 4; public static final int CE_KEY_RELEASED = 5; public static final int CE_MOUSE_WHEEL = 6; /** * @serial */ private int eventType = -1; /** * @serial */ private InputEvent event = null; /** * @serial */ private long timeOfEvent = -1; /** * Create a CaptureEvent with an AWT InputEvent. */ public CaptureEvent( int eventType, InputEvent event ) { this.eventType = eventType; this.event = event; if (event != null) { this.timeOfEvent = event.getWhen(); } } /** * Create a CaptureEvent without an AWT InputEvent. */ public CaptureEvent( int eventType ) { this.eventType = eventType; this.event = null; this.timeOfEvent = -1; } public int getEventType() { return this.eventType; } public InputEvent getInputEvent() { return this.event; } public long getTimeOfEvent() { return this.timeOfEvent; } /** * Reenacts the event that this CaptureEvent represents underneath it * all. */ public abstract void performEvent( Robot r ); } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/IAllowCapturePassThroughListener.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/event/IAllow0000644000175000017500000000567307622026460034217 0ustar drazzibdrazzib/* * @(#)IAllowCapturePassThroughListener.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; /** * A listener which becomes aware of all low-level user interaction, and * when they occured. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public interface IAllowCapturePassThroughListener { /** * @see java.awt.event.MouseWheelListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowMouseWheelMoved( MouseWheelCaptureEvent ce ); /** * @see java.awt.event.MouseListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowMousePressed( MousePressedCaptureEvent ce ); /** * @see java.awt.event.MouseListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowMouseReleased( MouseReleasedCaptureEvent ce ); /** * @see java.awt.event.KeyListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowKeyPressed( KeyPressedCaptureEvent ce ); /** * @see java.awt.event.KeyListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public boolean allowKeyReleased( KeyReleasedCaptureEvent ce ); } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/ScriptGenerator.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/ScriptGenera0000644000175000017500000004136707622026457034303 0ustar drazzibdrazzib/* * @(#)ScriptGenerator.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Rectangle; import java.io.File; import java.io.IOException; import net.sourceforge.groboutils.uicapture.v1.event.ICaptureListener; import net.sourceforge.groboutils.uicapture.v1.event.CaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseWheelCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseMovedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseButtonCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MousePressedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseReleasedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyPressedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyReleasedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.IAllowCapturePassThroughListener; /** * Listens to CaptureEvents, and converts these into script commands to the * IScriptMaker. It allows for easy subclassing through having a "Meta-Mode". * All events will be swallowed (not passed to the UI or IScriptMaker) * while in this meta-mode. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 7, 2002 */ public class ScriptGenerator implements ICaptureListener, IAllowCapturePassThroughListener { private IScriptMaker maker = null; private boolean metaMode = false; private long lastEventTime = -1; private VirtualWindow window = null; private IScreenScraper ss = null; private IFocusedWindowFinder fwf = null; private String baseImageName = null; private int filenameIndex = 0; private boolean isRunning = false; //------------------------------------------------------------------------- // Constructors /** * Uses the Default version for the IScreenScraper and IFocusedWindowFinder. */ public ScriptGenerator( IScriptMaker maker, String baseImageName ) { this( new DefaultScreenScraper(), new DefaultFocusedWindowFinder(), maker, baseImageName ); } /** * Create using the given arguments to build the framework. */ public ScriptGenerator( IScreenScraper ss, IFocusedWindowFinder fwf, IScriptMaker maker, String baseImageName ) { this.ss = ss; this.fwf = fwf; this.maker = maker; this.baseImageName = baseImageName; } //------------------------------------------------------------------------- // Public Methods /* * Should this be here ???? public VirtualWindow getVirtualWindow() { return this.window; } */ /** * * @exception java.awt.AWTException Robot isn't supported. */ public void begin() throws java.awt.AWTException { this.window = new VirtualWindow( null, true ); this.window.addCaptureListener( this ); this.maker.start(); this.isRunning = true; } public void end() { this.isRunning = false; fireStop(); } public boolean isRunning() { return this.isRunning; } //------------------------------------------------------------------------- // Meta Methods /** * */ public boolean isInMetaMode() { return this.metaMode; } /** * */ public void setInMetaMode( boolean set ) { this.metaMode = set; } /** * Performs a meta-mode action when this event is caught and the * generator is in meta-mode. Default action does nothing. */ protected void metaMouseWheelMoved( MouseWheelCaptureEvent ce ) { // do nothing } /** * Performs a meta-mode action when this event is caught and the * generator is in meta-mode. Default action does nothing. */ protected void metaMousePressed( MousePressedCaptureEvent ce ) { // do nothing } /** * Performs a meta-mode action when this event is caught and the * generator is in meta-mode. Default action does nothing. */ protected void metaMouseReleased( MouseReleasedCaptureEvent ce ) { // do nothing } /** * Performs a meta-mode action when this event is caught and the * generator is in meta-mode. Default action does nothing. */ protected void metaKeyPressed( KeyPressedCaptureEvent ce ) { // do nothing } /** * Performs a meta-mode action when this event is caught and the * generator is in meta-mode. Default action does nothing. */ protected void metaKeyReleased( KeyReleasedCaptureEvent ce ) { // do nothing } /** * Performs a meta-mode action when this event is caught and the * generator is in meta-mode. Default action does nothing. */ protected void metaMouseMoved( MouseMovedCaptureEvent ce ) { // do nothing } //------------------------------------------------------------------------- // Fire ScriptMaker Event Methods /** * */ protected synchronized void fireStop() { if (this.window != null) { this.window.removeCaptureListener( this ); if (isRunning()) { this.maker.end(); } this.window.dispose(); this.window = null; } } /** * Saves the entire screen to a file. * * @param filename the file to save the image as. */ protected synchronized void fireSaveScreen() { if (isRunning()) { fireSaveScreenImage( new Rectangle( this.window.getWindow().getCoveredScreen() ) ); } } /** * Saves a picture of the underlying UI's focused window to a file. * * @param filename the file to save the image as. */ protected synchronized void fireSaveFocusedWindow() { if (isRunning()) { Rectangle bounds = this.fwf.getFocusedWindowBounds(); if (bounds == null) { // save the entire screen fireSaveScreen(); } else { fireSaveScreenImage( bounds ); } } } /** * Saves the selected screen part to a file. * * @param filename the file to save the image as. * @param x the x position of the part of the screen to grab. * @param y the y position of the part of the screen to grab. * @param w the width of the part of the screen to grab. * @param h the height of the part of the screen to grab. */ protected synchronized void fireSaveScreenImage( int x, int y, int w,int h ) { if (isRunning()) { fireSaveScreenImage( new Rectangle( x, y, w, h ) ); } } /** * Saves the selected screen part to a file. * * @param filename the file to save the image as. * @param bounds the part of the screen to grab. */ protected synchronized void fireSaveScreenImage( Rectangle bounds ) { if (isRunning()) { File f = createFile(); try { this.ss.writeImageToFile( this.window.createScreenScrape(bounds ), f ); this.maker.generateScreenCapture( f, bounds.x, bounds.y, bounds.width, bounds.height ); } catch (IOException ioe) { encounteredError( ioe ); } } } /** * */ protected synchronized void fireMouseWheelMoved( MouseWheelCaptureEvent ce ) { if (isRunning()) { generateDelay( ce ); this.maker.generateMoveMouseWheel( ce.getWheelRotation() ); } } /** * */ protected synchronized void fireMouseMoved( MouseMovedCaptureEvent ce ) { if (isRunning()) { generateDelay( ce ); this.maker.generateMoveMouse( ce.getX(), ce.getY() ); } } /** * */ protected synchronized void fireMousePressed( MouseButtonCaptureEvent ce ) { if (isRunning()) { generateDelay( ce ); this.maker.generatePressMouse( ce.getModifiers() ); } } /** * */ protected synchronized void fireMouseReleased( MouseButtonCaptureEvent ce ) { if (isRunning()) { generateDelay( ce ); this.maker.generateReleaseMouse( ce.getModifiers() ); } } /** * */ protected synchronized void fireKeyPressed( KeyCaptureEvent ce ) { if (isRunning()) { generateDelay( ce ); this.maker.generatePressKey( ce.getKeyCode() ); } } /** * */ protected synchronized void fireKeyReleased( KeyCaptureEvent ce ) { if (isRunning()) { generateDelay( ce ); this.maker.generateReleaseKey( ce.getKeyCode() ); } } //------------------------------------------------------------------------- // Event Methods /** * If a subclass overrides this method, it must first check * if meta-mode is enabled, and invoke * the super's version of this method at the very end (right before * leaving the method). */ public void mouseWheelMoved( MouseWheelCaptureEvent ce ) { if (allowMouseWheelMoved( ce )) { fireMouseWheelMoved( ce ); } else { metaMouseWheelMoved( ce ); } } /** * If a subclass overrides this method, it must first check * if meta-mode is enabled, and invoke * the super's version of this method at the very end (right before * leaving the method). */ public void mouseMoved( MouseMovedCaptureEvent ce ) { if (allowMouseMoved( ce )) { fireMouseMoved( ce ); } else { metaMouseMoved( ce ); } } /** * If a subclass overrides this method, it must first check * if meta-mode is enabled, and invoke * the super's version of this method at the very end (right before * leaving the method). */ public void mousePressed( MousePressedCaptureEvent ce ) { if (allowMousePressed( ce )) { fireMousePressed( ce ); } else { metaMousePressed( ce ); } } /** * If a subclass overrides this method, it must first check * if meta-mode is enabled, and invoke * the super's version of this method at the very end (right before * leaving the method). */ public void mouseReleased( MouseReleasedCaptureEvent ce ) { if (allowMouseReleased( ce )) { fireMouseReleased( ce ); } else { metaMouseReleased( ce ); } } /** * If a subclass overrides this method, it must first check * if meta-mode is enabled, and invoke * the super's version of this method at the very end (right before * leaving the method). */ public void keyPressed( KeyPressedCaptureEvent ce ) { if (allowKeyPressed( ce )) { fireKeyPressed( ce ); } else { metaKeyPressed( ce ); } } /** * If a subclass overrides this method, it must first check * if meta-mode is enabled, and invoke * the super's version of this method at the very end (right before * leaving the method). */ public void keyReleased( KeyReleasedCaptureEvent ce ) { if (allowKeyReleased( ce )) { fireKeyReleased( ce ); } else { metaKeyReleased( ce ); } } //------------- /** * @see java.awt.event.MouseWheelListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public final boolean allowMouseWheelMoved( MouseWheelCaptureEvent ce ) { return !isInMetaMode(); } /** * @see java.awt.event.MouseListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public final boolean allowMousePressed( MousePressedCaptureEvent ce ) { return !isInMetaMode(); } /** * @see java.awt.event.MouseListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public final boolean allowMouseReleased( MouseReleasedCaptureEvent ce ) { return !isInMetaMode(); } /** * @see java.awt.event.KeyListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public final boolean allowKeyPressed( KeyPressedCaptureEvent ce ) { return !isInMetaMode(); } /** * @see java.awt.event.KeyListener * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public final boolean allowKeyReleased( KeyReleasedCaptureEvent ce ) { return !isInMetaMode(); } /** * Not part of the allow interface. * * @return true to allow the event to passed to the underlying * UI, or false to 'swallow' the event. */ public final boolean allowMouseMoved( MouseMovedCaptureEvent ce ) { return !isInMetaMode(); } //------------------------------------------------------------------------- // Misc Protected Methods /** * Create a delay event in the script maker. */ protected void generateDelay( CaptureEvent ce ) { long delay = getDelayTime( ce ); if (delay > 0) { this.maker.generateDelay( delay ); } } /** * Calculate the amount of time between the last event and the given * event. * * @return the delay time in milliseconds. */ protected synchronized long getDelayTime( CaptureEvent ce ) { long waitTime = ce.getTimeOfEvent(); if (this.lastEventTime < 0) { this.lastEventTime = waitTime; return 0; } if (waitTime < 0 || waitTime < this.lastEventTime) { return 0; } long diff = waitTime - this.lastEventTime; this.lastEventTime = waitTime; return diff; } /** * */ protected synchronized File createFile() { File f = new File( this.baseImageName + this.filenameIndex + '.' + this.ss.getFileExtention() ); ++this.filenameIndex; return f; } /** * */ protected void encounteredError( Throwable t ) { t.printStackTrace(); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/VirtualWindowUI.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/VirtualWindo0000644000175000017500000002246307622026457034340 0ustar drazzibdrazzib/* * @(#)VirtualWindowUI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Color; import java.awt.Point; import java.awt.Window; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.Image; import java.awt.event.FocusListener; import java.awt.event.FocusEvent; /** * This UI part of the VirtualWindow framework is in charge of intercepting * all Window events related to drawing, in order to keep the invisible * facade. *

    * There is a problem with the transparency right now. I'm investigating * a solution. The final (and unwanted) solution is to capture the background * behind the Window, and display that on {@link #paint( Graphics )} calls. *

    * WARNING: if the screen size is to resize, then this will not work correctly. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 4, 2002 * @version Mar 13, 2002 */ public class VirtualWindowUI extends Window implements Runnable, FocusListener { //------------------------------------------------------------------------- // Private fields /** * @serial */ private boolean enableGlass = false; // Thread-based variables // Synchronization must be used with care! private transient Thread runner = null; private transient Object syncObj = new Object(); private transient boolean doRun = true; private transient Image background = null; private static final Color INVISIBLE = new Color( 0, 0, 0, 0 ); private static final int SLEEP_LENGTH = 100; //------------------------------------------------------------------------- // Constructors /** * Creates a disabled window with no parent. */ public VirtualWindowUI( Window owner ) { super( owner ); // setup Window variables // setFocusableWindow( true ); setBackground( INVISIBLE ); setForeground( INVISIBLE ); // start the stay-focused thread /* this.runner = new Thread( this, "UI Capture always-focused thread" ); this.runner.setDaemon( true ); this.runner.setPriority( (Thread.NORM_PRIORITY - Thread.MIN_PRIORITY) / 2 ); this.runner.start(); */ // get the window registered in the UI. setSize( 0, 0 ); super.show(); setGlassEnabled( false ); } //------------------------------------------------------------------------- // Public methods /** * Sets the inner state for displaying the glass pane. If the pane is * enabled, then the glass pane will attempt to maximize itself and * keep itself on the foreground at all costs. *

    * This should be the only method where the inner enableGlass * field is manipulated. Any inner testing against this variable * needs to be synchronized. * * @param on true if the glass pane is enabled (active and * intercepting events), or false if is disabled. */ public void setGlassEnabled( boolean on ) { synchronized( this.syncObj ) { this.enableGlass = on; if (on) { this.syncObj.notifyAll(); maximize(); } } } /** * Retrieves the current glass enabled state. * * @return true if the glass pane is enabled (active and * intercepting events), or false if is disabled. */ public boolean isGlassEnabled() { return this.enableGlass; } /** * Enlarge the window to the size of the screen. */ public void maximize() { synchronized( this.syncObj ) { if (this.enableGlass) { Rectangle rect = getCoveredScreen(); setLocation( rect.getLocation() ); setSize( rect.getSize() ); } } } /** * Retrieve the size of the covered window. */ public Rectangle getCoveredScreen() { return new Rectangle( new Point( 0, 0 ), getToolkit().getScreenSize() ); } /** * Update the background image. This may set the background to * null. */ public void setBackground( Image img ) { synchronized( this.syncObj ) { this.background = img; } } //------------------------------------------------------------------------- // Inherited methods /** * */ public void show() { setGlassEnabled( true ); super.show(); toFront(); } /** * */ public void hide() { setGlassEnabled( false ); toBack(); super.hide(); } /** * */ public void dispose() { if (this.runner != null) { this.doRun = false; synchronized( this.syncObj ) { setGlassEnabled( false ); this.syncObj.notifyAll(); } // wait for thread to die. try { this.runner.join( 1000 ); this.runner = null; } catch (InterruptedException ie) { // !!! // ignore for now. } this.background = null; } super.dispose(); } /** * */ public void update( Graphics g ) { // do nothing } /** * */ public void paint( Graphics g ) { // Fill the background with the transparent color. synchronized( this.syncObj ) { if (this.background == null) { // g.setColor( INVISIBLE ); g.fillRect( 0, 0, getWidth(), getHeight() ); } else { g.drawImage( this.background, 0, 0, this ); } } } /** * public void repaint() { // do nothing } */ //------------------------------------------------------------------------- // Event methods /** * Thread runner to keep the window in the front. */ public void run() { while (this.doRun) { boolean doToFront = false; try { synchronized( this.syncObj ) { if (this.enableGlass == false) { // pause this.syncObj.wait(); } else { doToFront = true; } } if (doToFront) { // send to the foreground toFront(); // sleep for a bit Thread.sleep( SLEEP_LENGTH ); } } catch (InterruptedException ie) { // *must* be something important! break; } } } /** * */ public void focusGained( FocusEvent fe ) { // do nothing } /** * */ public void focusLost( FocusEvent fe ) { // bring us back to the front. synchronized( this.syncObj ) { if (this.enableGlass) { toFront(); } } } //------------------------------------------------------------------------- // Protected methods /** * @exception Throwable thrown if the super throws anything. */ protected void finalize() throws Throwable { if (this.runner != null) { dispose(); } super.finalize(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/DefaultScreenScraper.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/DefaultScree0000644000175000017500000001154507622026457034256 0ustar drazzibdrazzib/* * @(#)DefaultScreenScraper.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Iterator; import javax.imageio.ImageIO; import org.apache.log4j.Logger; /** * Writes images to files using the javax.imageio package. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 7, 2002 */ public class DefaultScreenScraper implements IScreenScraper { private static final Logger LOG = Logger.getLogger( DefaultScreenScraper.class ); private String writerFormatName = null; private static final boolean DEBUG = true; //------------------------------------------------------------------------- // Constructors /** * Find the first writer format name we come across. * * @exception IllegalArgumentException thrown if there are no formats * supported. */ public DefaultScreenScraper() { String[] names = ImageIO.getWriterFormatNames(); if (names == null || names.length <= 0) { throw new IllegalArgumentException( "No writer format names supported." ); } this.writerFormatName = names[0]; for (int i = 0; i < names.length; ++i) { LOG.debug( "Writer format found: "+names[i] ); } assertFormatName(); } /** * Use the given writerFormatName to write images to disk. * * @exception IllegalArgumentException thrown if the given name is not * supported. */ public DefaultScreenScraper( String writerFormatName ) { this.writerFormatName = writerFormatName; assertFormatName(); } //------------------------------------------------------------------------- // Public methods /** * Write the given image to the given file. * * @param image The screen image to write to disk. * @param file The File to save the image as. * @exception IOException thrown if there was a problem saving the image to * the file. * @exception IllegalArgumentException if any parameter is null. * @exception IllegalStateException if no appropriate writer could be found. */ public void writeImageToFile( BufferedImage image, File file ) throws IOException { boolean result = ImageIO.write( image, this.writerFormatName, file ); if (!result) { throw new IllegalStateException( "No appropriate writer was found." ); } } /** * Discover the file extention for images created by this scraper. * This does not include a '.'. * * @return the extention for files this scraper writes. */ public String getFileExtention() { return this.writerFormatName; } //------------------------------------------------------------------------- // Protected methods /** * Discover if the current format name is supported. * * @exception IllegalArgumentException thrown if the current name is not * supported. */ protected void assertFormatName() { Iterator iter = ImageIO.getImageWritersByFormatName( this.writerFormatName ); if (iter == null || !iter.hasNext()) { throw new IllegalArgumentException( "Image Format " + this.writerFormatName + " is not supported in the current runtime system." ); } } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/VirtualWindow.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/VirtualWindo0000644000175000017500000003764207622026457034345 0ustar drazzibdrazzib/* * @(#)VirtualWindow.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Robot; import java.awt.Frame; import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.awt.event.KeyListener; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelListener; import java.awt.event.MouseEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseWheelEvent; import java.util.LinkedList; import java.util.Iterator; import net.sourceforge.groboutils.uicapture.v1.event.ICaptureListener; import net.sourceforge.groboutils.uicapture.v1.event.CaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyPressedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyReleasedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MousePressedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseReleasedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseMovedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseWheelCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.IAllowCapturePassThroughListener; /** * A window which covers the whole screen, and does not paint in the background. * It captures keyboard and mouse events, and sends them to both all registered * listeners, and to the underlying GUI as well. This transparent window is * similar to the "glass pane" concept in Swing JFrames. *

    * For the moment, there is no way for listeners to prevent an event from * being passed to the underlying UI. This needs to be changed. *

    * WARNING: if the screen size is to resize, then this will not work correctly. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 4, 2002 * @version Mar 13, 2002 */ public class VirtualWindow implements KeyListener, MouseListener, MouseMotionListener, MouseWheelListener { //------------------------------------------------------------------------- // Private fields private LinkedList captureListeners = new LinkedList(); private Robot robot = null; private VirtualWindowUI window = null; private boolean enableGlass = true; private Frame owningFrame = null; private static final String DEFAULT_TITLE = "UI Capture"; //------------------------------------------------------------------------- // Constructors /** * Create a new VirtualWindow, with the glass enabled. * * @exception java.awt.AWTException thrown if a Robot is not supported * in the current JDK implementation. */ public VirtualWindow() throws java.awt.AWTException { this( null, true ); } /** * Specify the initial enabled state of the window. * * @param enable set to the initial glass pane state. * @exception java.awt.AWTException thrown if a Robot is not supported * in the current JDK implementation. */ public VirtualWindow( String title, boolean enable ) throws java.awt.AWTException { if (title == null) { title = DEFAULT_TITLE; } this.owningFrame = new Frame( title ); this.owningFrame.setSize( 0, 0 ); // this.owningFrame.show(); // this.owningFrame.hide(); this.window = new VirtualWindowUI( this.owningFrame ); this.robot = new Robot(); this.window.addKeyListener( this ); this.window.addMouseListener( this ); this.window.addMouseMotionListener( this ); this.window.addMouseWheelListener( this ); update(); setGlassEnabled( enable ); } //------------------------------------------------------------------------- // Public methods /** * Close out all inner instances and shut down the UI */ public void dispose() { this.window.removeKeyListener( this ); this.window.removeMouseListener( this ); this.window.removeMouseMotionListener( this ); this.window.removeMouseWheelListener( this ); this.window.dispose(); this.owningFrame.dispose(); this.captureListeners.clear(); this.robot = null; this.window = null; } /** * * @return the inner Window reference. */ public VirtualWindowUI getWindow() { return this.window; } /** * Sets the inner state for displaying the glass pane. If the pane is * enabled, then the glass pane will attempt to maximize itself and * keep itself on the foreground at all costs. * * @param on true if the glass pane is enabled (active and * intercepting events), or false if is disabled. */ public synchronized void setGlassEnabled( boolean on ) { this.enableGlass = on; this.window.setGlassEnabled( on ); } /** * Retrieves the current glass enabled state. * * @return true if the glass pane is enabled (active and * intercepting events), or false if is disabled. */ public boolean isGlassEnabled() { return this.enableGlass; } /** * Simulates the given captured event. This minimizes the glass window, * performs the event with the Robot, and restores the glass window if * the glass pane is enabled. * * @param ce the event to simulate. */ public synchronized void simulateEvent( CaptureEvent ce ) { hide(); // ensure that the window is restored, no matter the exception. try { ce.performEvent( this.robot ); } finally { show(); } } /** * Sleeps for the specified number of milliseconds. This is passed * directly through to the underlying Robot. * * @param ms Time to sleep in milliseconds. * @exception IllegalArgumentException thrown by Robot if ms is * not between 0 and 60,000, inclusive. */ public void delay( int ms ) { this.robot.delay( ms ); } /** * Waits until all events currently on the event queue have been processed. * This is passed directly through to the underlying Robot. */ public void waitForIdle() { this.robot.waitForIdle(); } /** * Scrapes the current screen into a BufferedImage the same size as the * window. * * @return the captured screen image. */ public BufferedImage createScreenScrape() { return createScreenScrape( this.window.getCoveredScreen() ); } /** * Scrapes the current screen into a BufferedImage from the given area * on the screen. This is passed directly to the underlying Robot. * * @return the captured screen image. */ public BufferedImage createScreenScrape( Rectangle bounds ) { // check bounds against the window's bounds if (bounds == null || !this.window.getCoveredScreen().contains( bounds )) { throw new IllegalArgumentException("Bounds "+bounds+ " is not within the screen dimension."); } // ensure the window is hidden, to get the current screen image, // then restore the window, no matter the thrown exceptions. hide(); try { return this.robot.createScreenCapture( bounds ); } finally { show(); } } /** * Adds an ICaptureListener to the list of recipients of input * events. If the given listener is null, then the request is * ignored. * * @param cl the listener to add. */ public void addCaptureListener( ICaptureListener cl ) { if (cl != null) { this.captureListeners.add( cl ); } } /** * Removes the given ICaptureListener from the inner list of * input events recipients. If the given listener is null or * not registered, then the request is ignored. * * @param cl the listener to remove. */ public void removeCaptureListener( ICaptureListener cl ) { if (cl != null) { this.captureListeners.remove( cl ); } } /** * Hides the glass pane, and stops all input event capturing. This is * only executed if the glass is enabled, and has no effect on the * enabled state of the glass. */ public void hide() { if (this.enableGlass) { this.window.hide(); } } /** * Shows the glass pane, and continues all input event capturing. This is * only executed if the glass is enabled, and has no effect on the * enabled state of the glass. */ public void show() { if (this.enableGlass) { this.window.show(); } } /** * Updates the background image. */ public void update() { this.window.setBackground( createScreenScrape() ); } //------------------------------------------------------------------------- // Event methods /** * @see java.awt.event.MouseWheelListener */ public void mouseWheelMoved( MouseWheelEvent me ) { MouseWheelCaptureEvent ce = new MouseWheelCaptureEvent( me ); Iterator iter = getCaptureListeners(); boolean allow = true; while (iter.hasNext()) { ICaptureListener icl = (ICaptureListener)iter.next(); if (icl instanceof IAllowCapturePassThroughListener) { if (!((IAllowCapturePassThroughListener)icl). allowMouseWheelMoved( ce )) { allow = false; } } icl.mouseWheelMoved( ce ); } if (allow) { simulateEvent( ce ); } } /** * @see java.awt.event.MouseMotionListener */ public void mouseDragged( MouseEvent me ) { // ignore this method } /** * @see java.awt.event.MouseMotionListener */ public void mouseMoved( MouseEvent me ) { MouseMovedCaptureEvent ce = new MouseMovedCaptureEvent( me ); // do not need to simulate event: the mouse already moved. // simulateEvent( ce ); Iterator iter = getCaptureListeners(); while (iter.hasNext()) { ((ICaptureListener)iter.next()).mouseMoved( ce ); } } /** * @see java.awt.event.MouseListener */ public void mousePressed( MouseEvent me ) { MousePressedCaptureEvent ce = new MousePressedCaptureEvent( me ); Iterator iter = getCaptureListeners(); boolean allow = true; while (iter.hasNext()) { ICaptureListener icl = (ICaptureListener)iter.next(); if (icl instanceof IAllowCapturePassThroughListener) { if (!((IAllowCapturePassThroughListener)icl). allowMousePressed( ce )) { allow = false; } } icl.mousePressed( ce ); } if (allow) { simulateEvent( ce ); } } /** * @see java.awt.event.MouseListener */ public void mouseReleased( MouseEvent me ) { MouseReleasedCaptureEvent ce = new MouseReleasedCaptureEvent( me ); Iterator iter = getCaptureListeners(); boolean allow = true; while (iter.hasNext()) { ICaptureListener icl = (ICaptureListener)iter.next(); if (icl instanceof IAllowCapturePassThroughListener) { if (!((IAllowCapturePassThroughListener)icl). allowMouseReleased( ce )) { allow = false; } } icl.mouseReleased( ce ); } if (allow) { simulateEvent( ce ); } } /** * @see java.awt.event.MouseListener */ public void mouseClicked( MouseEvent me ) { // ignore this method } /** * @see java.awt.event.MouseListener */ public void mouseEntered( MouseEvent me ) { // ignore this method } /** * @see java.awt.event.MouseListener */ public void mouseExited( MouseEvent me ) { // ignore this method } /** * @see java.awt.event.KeyListener */ public void keyTyped( KeyEvent me ) { // ignore this method } /** * @see java.awt.event.KeyListener */ public void keyPressed( KeyEvent ke ) { KeyPressedCaptureEvent ce = new KeyPressedCaptureEvent( ke ); Iterator iter = getCaptureListeners(); boolean allow = true; while (iter.hasNext()) { ICaptureListener icl = (ICaptureListener)iter.next(); if (icl instanceof IAllowCapturePassThroughListener) { if (!((IAllowCapturePassThroughListener)icl). allowKeyPressed( ce )) { allow = false; } } icl.keyPressed( ce ); } if (allow) { simulateEvent( ce ); } } /** * @see java.awt.event.KeyListener */ public void keyReleased( KeyEvent ke ) { KeyReleasedCaptureEvent ce = new KeyReleasedCaptureEvent( ke ); Iterator iter = getCaptureListeners(); boolean allow = true; while (iter.hasNext()) { ICaptureListener icl = (ICaptureListener)iter.next(); if (icl instanceof IAllowCapturePassThroughListener) { if (!((IAllowCapturePassThroughListener)icl). allowKeyReleased( ce )) { allow = false; } } icl.keyReleased( ce ); } if (allow) { simulateEvent( ce ); } } //------------------------------------------------------------------------- // Protected methods /** * Returns a list of all the current ICaptureListeners. * * @return an iterator of the listeners. */ protected Iterator getCaptureListeners() { return this.captureListeners.iterator(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/VirtualWindowController.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/VirtualWindo0000644000175000017500000002426007622026457034335 0ustar drazzibdrazzib/* * @(#)VirtualWindowController.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Robot; import java.awt.Window; import java.awt.Dimension; import java.awt.Rectangle; import net.sourceforge.groboutils.uicapture.v1.event.MouseMovedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MousePressedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseReleasedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.MouseWheelCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyPressedCaptureEvent; import net.sourceforge.groboutils.uicapture.v1.event.KeyReleasedCaptureEvent; import java.io.File; import java.io.IOException; /** * A window which covers the whole screen, and does not paint in the background. * It captures keyboard and mouse events, and sends them to both all registered * listeners, and to the underlying GUI as well. * * WARNING: if the screen size is to resize, then this will not work correctly. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 4, 2002 */ public class VirtualWindowController { //------------------------------------------------------------------------- // Private fields private VirtualWindow window = null; private IScreenScraper ss = null; private IFocusedWindowFinder fwf = null; private static final long MAX_ROBOT_DELAY = 60000L; //------------------------------------------------------------------------- // Constructors /** * Uses the Default version for the IScreenScraper and IFocusedWindowFinder. */ public VirtualWindowController() { this( new DefaultScreenScraper(), new DefaultFocusedWindowFinder() ); } /** * Create using the given arguments to build the framework. */ public VirtualWindowController( IScreenScraper ss, IFocusedWindowFinder fwf ) { this.ss = ss; this.fwf = fwf; } //------------------------------------------------------------------------- // Public methods /** * Begin the reinactment process. * * @exception java.awt.AWTException thrown if a Robot is not supported * in the current JDK implementation. */ public void begin() throws java.awt.AWTException { assertInactive(); this.window = new VirtualWindow( null, false ); } /** * Complete the reinactment process. */ public void end() { assertActive(); this.window.dispose(); this.window = null; } /** * Pause for a period of milliseconds. Since Robot can only delay for * 60 seconds at a time, this will first sleep using the Robot, then * will use Thread for the remainder of the time. * * @param milliseconds Time in milliseconds to sleep. */ public void sleep( long milliseconds ) { assertActive(); int ms = (milliseconds > MAX_ROBOT_DELAY ? (int)MAX_ROBOT_DELAY : (int)milliseconds); long remainder = milliseconds - ms; this.window.delay( ms ); if (remainder > 0) { try { Thread.sleep( remainder ); } catch (InterruptedException ie) { // ignore } } } /** * Waits until all events currently on the event queue have been processed. */ public void waitForIdle() { assertActive(); this.window.waitForIdle(); } /** * Retrieves the size and position of the capture area of the screen. * * @return the screen size. */ public Rectangle getBounds() { assertActive(); return this.window.getWindow().getCoveredScreen(); } /** * Compares the two files for identity. * * @return true if the files are identical, else false. */ public boolean compareFiles( File one, File two ) throws IOException { throw new IllegalStateException( "Not implemented yet." ); } public String getImageExtension() { return this.ss.getFileExtention(); } /** * Saves the entire screen to a file. * * @param filename the file to save the image as. * @exception IOException thrown if there was a problem writing the file. */ public void saveScreen( String filename ) throws IOException { assertActive(); saveScreenImage( filename, new Rectangle( getBounds() ) ); } /** * Saves a picture of the underlying UI's focused window to a file. * * @param filename the file to save the image as. * @exception IOException thrown if there was a problem writing the file. */ public void saveFocusedWindow( String filename ) throws IOException { assertActive(); Rectangle bounds = this.fwf.getFocusedWindowBounds(); if (bounds == null) { // save the entire screen saveScreen( filename ); } else { saveScreenImage( filename, bounds ); } } /** * Saves the selected screen part to a file. * * @param filename the file to save the image as. * @param x the x position of the part of the screen to grab. * @param y the y position of the part of the screen to grab. * @param w the width of the part of the screen to grab. * @param h the height of the part of the screen to grab. * @exception IOException thrown if there was a problem writing the file. */ public void saveScreenImage( String filename, int x, int y, int w, int h ) throws IOException { saveScreenImage( filename, new Rectangle( x, y, w, h ) ); } /** * Saves the selected screen part to a file. * * @param filename the file to save the image as. * @param bounds the part of the screen to grab. * @exception IOException thrown if there was a problem writing the file. */ public void saveScreenImage( String filename, Rectangle bounds ) throws IOException { assertActive(); this.ss.writeImageToFile( this.window.createScreenScrape( bounds ), new File( filename ) ); } //------------------------------------------------------------------------- // Event methods /** * Simulate a mouse movement. * * @param x the x position (aboslute) to move the mouse to. * @param y the y position (aboslute) to move the mouse to. */ public void moveMouse( int x, int y ) { assertActive(); MouseMovedCaptureEvent ce = new MouseMovedCaptureEvent( x, y ); this.window.simulateEvent( ce ); } /** * Simulate a mouse button press. * * @param modifiers the mouse button modifiers. */ public void pressMouse( int modifiers ) { assertActive(); MousePressedCaptureEvent ce = new MousePressedCaptureEvent( modifiers ); this.window.simulateEvent( ce ); } /** * Simulate a mouse button release. * * @param modifiers the mouse button modifiers. */ public void releaseMouse( int modifiers ) { assertActive(); MouseReleasedCaptureEvent ce = new MouseReleasedCaptureEvent( modifiers ); this.window.simulateEvent( ce ); } /** * Simulate a mouse wheel rotation. * * @param rotation the number of 'clicks' to rotate the mouse wheel. */ public void rotateMouseWheel( int rotation ) { assertActive(); MouseWheelCaptureEvent ce = new MouseWheelCaptureEvent( rotation ); this.window.simulateEvent( ce ); } /** * Simulate a key press. * * @param keyCode the key code of the key. */ public void pressKey( int keyCode ) { assertActive(); KeyPressedCaptureEvent ce = new KeyPressedCaptureEvent( keyCode ); this.window.simulateEvent( ce ); } /** * Simulate a key release. * * @param keyCode the key code of the key. */ public void releaseKey( int keyCode ) { assertActive(); KeyReleasedCaptureEvent ce = new KeyReleasedCaptureEvent( keyCode ); this.window.simulateEvent( ce ); } //------------------------------------------------------------------------- // Protected methods protected void assertActive() { if (this.window == null) { throw new IllegalStateException("Window is not active."); } } protected void assertInactive() { if (this.window != null) { throw new IllegalStateException("Window is active."); } } } libgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/javamaker/0000755000175000017500000000000011271425773033717 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/javamaker/JavaMaker.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/javamaker/Ja0000644000175000017500000002237307622026460034176 0ustar drazzibdrazzib/* * @(#)JavaScriptMaker.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.javamaker; import net.sourceforge.groboutils.uicapture.v1.VirtualWindowController; import net.sourceforge.groboutils.uicapture.v1.IScriptMaker; import java.io.Writer; import java.io.FileWriter; import java.io.PrintWriter; import java.io.IOException; import java.io.File; /** * Creates a Java playback sourcefile. The Java file will quit with an error * code of 1 if the playback did not go perfectly. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 7, 2002 */ public class JavaMaker implements IScriptMaker { private Writer outF = null; private PrintWriter out = null; private String packageName = null; private String className = null; private int step = 0; public JavaMaker( File outFile, String packageName, String className ) throws IOException { if (outFile == null || packageName == null || className == null) { throw new IllegalArgumentException( "no null args" ); } this.outF = new FileWriter( outFile ); this.out = new PrintWriter( outF ); this.packageName = packageName; this.className = className; } public JavaMaker( Writer w, String packageName, String className ) { if (w == null || packageName == null || className == null) { throw new IllegalArgumentException( "no null args" ); } this.outF = w; this.out = new PrintWriter( w ); this.packageName = packageName; this.className = className; } //------------------------------------------------------------------------- // Public methods /** * Starts the script generation. */ public void start() { if (this.step > 0) { throw new IllegalStateException("Already started generation."); } wrln( "/"+"*" ); wrln( " * Pregenerated script file." ); wrln( " * Created "+(new java.util.Date()).toString() ); wrln( " *"+"/" ); wrln(); wrln( "package "+this.packageName+";" ); wrln(); wrln( "import "+VirtualWindowController.class.getName()+";" ); wrln( "import "+File.class.getName()+";" ); wrln(); wrln( "public class "+this.className ); wrln( "{" ); wrln( " public static void main( String[] args )" ); wrln( " throws Exception" ); wrln( " {" ); step( "Setup." ); wrln( " VirtualWindowController vwc = new " ); wrln( " VirtualWindowController();" ); wrln( " vwc.begin();" ); wrln( " try {" ); wrln( " vwc.sleep( 2000 );" ); // bug 618295 this.step = 1; } /** * Terminates the script generation. */ public void end() { assertActive(); wrln( " /"+"/ end of script" ); wrln( " System.out.println( \"No errors found in playback.\" ):"); wrln( " System.exit( 0 );" ); wrln( " } finally {" ); wrln( " vwc.end();" ); wrln( " vwc = null;" ); wrln( " }" ); wrln( " }" ); wrln( "}" ); // bug 618295 this.step = 2; try { this.out.close(); this.outF.close(); } catch (IOException ioe) { handleException( ioe ); } finally { this.out = null; this.outF = null; } } /** * Cause the script to delay for the given number of milliseconds. */ public void generateDelay( long milliseconds ) { assertActive(); step( "sleep for "+milliseconds+" milliseconds." ); wrln( " vwc.sleep( "+milliseconds+" );" ); } /** * Cause the script to rotate the mouse wheel. */ public void generateMoveMouseWheel( int rotate ) { assertActive(); step( "rotate mouse wheel "+rotate+" clicks." ); wrln( " vwc.moveMouseWheel( "+rotate+" );" ); } /** * Cause the script to move the mouse. */ public void generateMoveMouse( int x, int y ) { assertActive(); step( "move mouse to ("+x+", "+y+")." ); wrln( " vwc.moveMouse( "+x+", "+y+" );" ); } /** * Cause the script to press a mouse button. */ public void generatePressMouse( int modifier ) { assertActive(); step( "press mouse with "+modifier+"." ); wrln( " vwc.pressMouse( "+modifier+" );" ); } /** * Cause the script to release a mouse button. */ public void generateReleaseMouse( int modifier ) { assertActive(); step( "release mouse with "+modifier+"." ); wrln( " vwc.releaseMouse( "+modifier+" );" ); } /** * Cause the script to press a key. */ public void generatePressKey( int keyCode ) { assertActive(); step( "press key with "+keyCode+"." ); wrln( " vwc.pressKey( "+keyCode+" );" ); } /** * Cause the script to release a key. */ public void generateReleaseKey( int keyCode ) { assertActive(); step( "release key with "+keyCode+"." ); wrln( " vwc.releaseKey( "+keyCode+" );" ); } /** * Cause the script to capture a screen shot. Probably, it should compare * the captured image against the original saved image. * * @param x screen image bounds. * @param y screen image bounds. * @param width screen image bounds. * @param height screen image bounds. */ public void generateScreenCapture( File originalImage, int x, int y, int width, int height ) { assertActive(); step( "capture and compare screen in ("+x+", "+y+", "+width+", "+ height+" ) against "+originalImage+"." ); wrln( " File f"+this.step+" = new File( \""+ className + "-" + this.step + ".\" + vwc.getImageExtension() );" ); wrln( " vwc.saveScreenImage( f"+this.step+".toString(), "+x+ ", "+y+", "+width+", "+height+" );" ); wrln( " if (!vwc.compareFiles( f"+step+", new File( \"" + originalImage + "\" ))" ); wrln( " {" ); wrln( " System.out.println( \"Images did not match on step "+ this.step+".\" );" ); wrln( " System.out.println( \"Test Failed.\" );" ); wrln( " vwc.end();" ); wrln( " vwc = null;" ); wrln( " Thread.sleep( 1000 );" ); wrln( " System.exit(1);" ); wrln( " }" ); wrln( " System.out.println( \"** Images match!\" );"); } //------------------------------------------------------------------------- protected void handleException( Throwable t ) { t.printStackTrace(); this.out = null; this.outF = null; throw new IllegalStateException("Encountered exception "+t); } protected void assertActive() { if (this.out == null) { throw new IllegalStateException("Not open for writing."); } if (this.step <= 0) { throw new IllegalStateException("Never started writing."); } } protected void wr( String text ) { this.out.print( text ); } protected void wrln( String text ) { this.out.println( text ); } protected void wrln() { this.out.println( "" ); } protected void step( String msg ) { ++this.step; wrln( " System.out.println( \"Step "+this.step+": "+ msg +"\" );" ); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/javamaker/package.htmllibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/javamaker/pa0000644000175000017500000000024207521071667034242 0ustar drazzibdrazzibnet.sourceforge.groboutils.uicapture.v1.javamaker Generates Java source files for a captured UI play back. ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/IFocusedWindowFinder.javalibgroboutils-java-5.orig/uicapture/sources/dev/net/sourceforge/groboutils/uicapture/v1/IFocusedWind0000644000175000017500000000463207622026457034232 0ustar drazzibdrazzib/* * @(#)IFocusedWindowFinder.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Rectangle; /** * This interface defines a class which can discover the screen * position for the native UI's currently focused window. This will, in * general, need to be a native function. If the class cannot determine * the focused window, or there isn't a focused window, then the class should * return null, in which case the framework should default to the * screen size. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 7, 2002 */ public interface IFocusedWindowFinder { //------------------------------------------------------------------------- // Public methods /** * Find the current native UI focused window's bounds. * If the class cannot determine * the focused window, or there isn't a focused window, then the class * should return null, in which case the framework should default * to the screen size. * * @return the focused window's bounds, or null if it cannot be * found. */ public Rectangle getFocusedWindowBounds(); } libgroboutils-java-5.orig/uicapture/sources/dev/about.txt0000644000175000017500000000015207521071666023777 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/uicapture/sources/ut/0000755000175000017500000000000011271425773021777 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ut/net/0000755000175000017500000000000010011472765022557 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/0000755000175000017500000000000010011472766025103 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472766027274 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/0000755000175000017500000000000010011472766031275 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/0000755000175000017500000000000011271425773031630 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/ScriptGeneratorUTest.javalibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/ScriptGenerat0000644000175000017500000001073307622026462034326 0ustar drazzibdrazzib/* * @(#)ScriptGeneratorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Robot; import java.awt.Frame; import java.awt.Rectangle; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import net.sourceforge.groboutils.uicapture.v1.event.*; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.easymock.EasyMock; import org.easymock.MockControl; /** * Tests the ScriptGenerator class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:34 $ * @since Oct 3, 2002 */ public class ScriptGeneratorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ScriptGeneratorUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ScriptGeneratorUTest( String name ) { super( name ); } private MockControl scriptmakerControl; private IScriptMaker mockScriptmaker; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.scriptmakerControl = EasyMock.controlFor( IScriptMaker.class ); this.mockScriptmaker = (IScriptMaker)this.scriptmakerControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testInstantiation() { new ScriptGenerator( null, null, null, null ); } public void testMouseWheelMovedNotStarted() { DOC.getIT().testsIssue( 618314 ); // no method should be called in the scriptmaker. //this.mockScriptmaker.removeText("Text"); //this.scriptmakerControl.setVoidCallable(); this.scriptmakerControl.activate(); ScriptGenerator sg = new ScriptGenerator( null, null, this.mockScriptmaker, "base" ); MouseWheelCaptureEvent mwce = new MouseWheelCaptureEvent( 10 ); sg.mouseWheelMoved( mwce ); this.scriptmakerControl.verify(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/VirtualWindowUTest.javalibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/VirtualWindow0000644000175000017500000002556507622026462034403 0ustar drazzibdrazzib/* * @(#)VirtualWindowUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Robot; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.uicapture.v1.event.*; import java.awt.*; import java.awt.event.*; import java.util.*; /** * Tests the VirtualWindow class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:34 $ * @since Jan 6, 2002 */ public class VirtualWindowUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = VirtualWindowUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public VirtualWindowUTest( String name ) { super( name ); } private VirtualWindow vw; public class MyCaptureListener implements ICaptureListener { ArrayList mwm = new ArrayList(); ArrayList mm = new ArrayList(); ArrayList mp = new ArrayList(); ArrayList mr = new ArrayList(); ArrayList kp = new ArrayList(); ArrayList kr = new ArrayList(); public void mouseWheelMoved( MouseWheelCaptureEvent ce ) { mwm.add( ce ); } public void mouseMoved( MouseMovedCaptureEvent ce ) { mm.add( ce ); } public void mousePressed( MousePressedCaptureEvent ce ) { mp.add( ce ); } public void mouseReleased( MouseReleasedCaptureEvent ce ) { mr.add( ce ); } public void keyPressed( KeyPressedCaptureEvent ce ) { kp.add( ce ); } public void keyReleased( KeyReleasedCaptureEvent ce ) { kr.add( ce ); } } //------------------------------------------------------------------------- // Tests public void testInstantiation1() { this.vw = createVirtualWindow(); assertTrue( "Default glass pane state is true.", this.vw.isGlassEnabled() ); } public void testInstantiation2() { this.vw = createVirtualWindow( null, true ); assertTrue( "Manually set glass pane state to true.", this.vw.isGlassEnabled() ); } public void testInstantiation3() { this.vw = createVirtualWindow( null, false ); assertTrue( "Manually set glass pane state to false.", !this.vw.isGlassEnabled() ); } public void testMouseWheelMoved1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); MouseWheelEvent mwe = new MouseWheelEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, 0, 0, 2, false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, 1 ); this.vw.mouseWheelMoved( mwe ); assertEquals( "Did not fire a wheel event to listener 1.", 1, mcl1.mwm.size() ); assertEquals( "Did not fire a wheel event to listener 2.", 1, mcl2.mwm.size() ); } public void testMouseDragged1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); MouseEvent me = new MouseEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, 0, 0, 0, // click count false, 0 ); this.vw.mouseDragged( me ); } public void testMouseMoved1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); MouseEvent me = new MouseEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, 0, 0, 0, // click count false, 0 ); this.vw.mouseMoved( me ); assertEquals( "Did not fire a move event to listener 1.", 1, mcl1.mm.size() ); assertEquals( "Did not fire a move event to listener 2.", 1, mcl2.mm.size() ); } public void testMousePressed1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); MouseEvent me = new MouseEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, 0, 0, 1, // click count false, 0 ); this.vw.mousePressed( me ); assertEquals( "Did not fire a mouse press event to listener 1.", 1, mcl1.mp.size() ); assertEquals( "Did not fire a mouse press event to listener 2.", 1, mcl2.mp.size() ); } public void testMouseReleased1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); MouseEvent me = new MouseEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, 0, 0, 0, // click count false, 0 ); this.vw.mouseReleased( me ); assertEquals( "Did not fire a mouse release event to listener 1.", 1, mcl1.mr.size() ); assertEquals( "Did not fire a mouse release event to listener 2.", 1, mcl2.mr.size() ); } public void testKeyPressed1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); KeyEvent ke = new KeyEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, KeyEvent.VK_A, 'a', 0 ); this.vw.keyPressed( ke ); assertEquals( "Did not fire a key press event to listener 1.", 1, mcl1.kp.size() ); assertEquals( "Did not fire a key press event to listener 2.", 1, mcl2.kp.size() ); } public void testKeyReleased1() { this.vw = createVirtualWindow(); MyCaptureListener mcl1 = createCaptureListener(); MyCaptureListener mcl2 = createCaptureListener(); this.vw.addCaptureListener( mcl1 ); this.vw.addCaptureListener( mcl2 ); KeyEvent ke = new KeyEvent( getUIComponent(), 1, System.currentTimeMillis(), 0, KeyEvent.VK_A, 'a', 0 ); this.vw.keyReleased( ke ); assertEquals( "Did not fire a key release event to listener 1.", 1, mcl1.kr.size() ); assertEquals( "Did not fire a key release event to listener 2.", 1, mcl2.kr.size() ); } //------------------------------------------------------------------------- protected VirtualWindow createVirtualWindow() { try { return new VirtualWindow(); } catch (java.awt.AWTException ae) { fail( "JDK implementation does not support low-level Robot "+ "actions: "+ae ); // unreachable return null; } } protected VirtualWindow createVirtualWindow( String title, boolean enable ) { try { return new VirtualWindow( title, enable ); } catch (java.awt.AWTException ae) { fail( "JDK implementation does not support low-level Robot "+ "actions: "+ae ); // unreachable return null; } } protected Component getUIComponent() { return this.vw.getWindow(); } protected MyCaptureListener createCaptureListener() { return new MyCaptureListener(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected synchronized void tearDown() throws Exception { // tear ourself down if (this.vw != null) { this.vw.dispose(); this.vw = null; } super.tearDown(); } } libgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/javamaker/0000755000175000017500000000000011271425773033571 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/javamaker/JavaMakerUTest.javalibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/javamaker/Jav0000644000175000017500000001204207665402664034241 0ustar drazzibdrazzib/* * @(#)JavaMakerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.javamaker; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.*; import net.sourceforge.groboutils.uicapture.v1.*; /** * Tests the JavaMaker class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:56 $ * @since Oct 3, 2002 */ public class JavaMakerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JavaMakerUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public JavaMakerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testInstantiation1() throws IOException { try { new JavaMaker( (File)null, null, null ); } catch (IllegalArgumentException e) { // test exception? } } public void testInstantiation2() { try { new JavaMaker( (Writer)null, null, null ); } catch (IllegalArgumentException e) { // test exception? } } public void testInstantiation3() { JavaMaker jm = new JavaMaker( new StringWriter(), "a", "b" ); } public void testInstantiation4() throws IOException { File f = File.createTempFile( "JavaMakerUTest", ".tmp" ); JavaMaker jm = new JavaMaker( f, "a", "b" ); } public void testStartEnd1() { DOC.getIT().testsIssue( 618295 ); StringWriter sw = new StringWriter(); JavaMaker jm = new JavaMaker( sw, "a", "b" ); jm.start(); jm.end(); assertTrue( "Did not create Java package header correctly.", sw.toString().indexOf( "package a;" ) >= 0 ); assertTrue( "Did not create Java class definition header correctly.", sw.toString().indexOf( "public class b" ) >= 0 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = IScriptMakerUTestI.suite(); // all tests are covered by the interface tests, so don't need this // line. But will add it for insurance in case tests are needed later. suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new JavaMaker( new StringWriter(), "my.package", "MyClass" ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected synchronized void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/IScriptMakerUTestI.javalibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/IScriptMakerU0000644000175000017500000001471207622026462034237 0ustar drazzibdrazzib/* * @(#)IScriptMakerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.junit.v1.iftc.*; import java.io.*; /** * Tests the IScriptMaker interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:34 $ * @since Oct 3, 2002 */ public class IScriptMakerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IScriptMakerUTestI.class; public IScriptMakerUTestI( String name, ImplFactory f ) { super( name, IScriptMaker.class, f ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } private IScriptMaker createIScriptMaker() { return (IScriptMaker)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testStart1() { IScriptMaker ism = createIScriptMaker(); ism.start(); } public void testStart2() { IScriptMaker ism = createIScriptMaker(); ism.start(); try { ism.start(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception? } } public void testStart3() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.end(); try { ism.start(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception? } } public void testEnd1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.end(); } public void testEnd2() { IScriptMaker ism = createIScriptMaker(); try { ism.end(); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException e) { // test exception? } } public void testGenerateDelay1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generateDelay( 100 ); } public void testGenerateMoveMouseWheel1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generateMoveMouseWheel( 10 ); } public void testGenerateMoveMouse1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generateMoveMouse( 10, 20 ); } public void testGeneratePressMouse1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generatePressMouse( 0 ); } public void testGenerateReleaseMouse1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generateReleaseMouse( 0 ); } public void testGeneratePressKey1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generatePressKey( 1 ); } public void testGenerateReleaseKey1() { IScriptMaker ism = createIScriptMaker(); ism.start(); ism.generateReleaseKey( 1 ); } public void testGenerateScreenCapture1() throws IOException { IScriptMaker ism = createIScriptMaker(); ism.start(); File f = new File( "blah" ); FileWriter fw = new FileWriter( f ); try { fw.write( "blah blah" ); fw.flush(); fw.close(); ism.generateScreenCapture( f, 1, 100, 30, 30 ); } finally { f.delete(); } } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/VirtualWindowUIUTest.javalibgroboutils-java-5.orig/uicapture/sources/ut/net/sourceforge/groboutils/uicapture/v1/VirtualWindow0000644000175000017500000001611607622026462034373 0ustar drazzibdrazzib/* * @(#)VirtualWindowUIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Robot; import java.awt.Frame; import java.awt.Rectangle; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the VirtualWindowUI class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:34 $ * @since Jan 6, 2002 */ public class VirtualWindowUIUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = VirtualWindowUIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public VirtualWindowUIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testInstantiation() { VirtualWindowUI vwui = createVWUI(); assertTrue( "Default glass pane state is false.", !vwui.isGlassEnabled() ); } public void testCoveredScreen() { VirtualWindowUI vwui = createVWUI(); Rectangle r = vwui.getCoveredScreen(); assertNotNull( "Covered screen should never be null.", r ); assertEquals( "X is not 0", 0, (int)r.getX() ); assertEquals( "Y is not 0", 0, (int)r.getY() ); } public void testGlass1() { VirtualWindowUI vwui = createVWUI(); assertTrue( "Default glass pane state is false.", !vwui.isGlassEnabled() ); vwui.show(); assertTrue( "Showing UI should set glass pane state to true.", vwui.isGlassEnabled() ); vwui.hide(); assertTrue( "Hiding UI should set glass pane state to false.", !vwui.isGlassEnabled() ); } public void testGlass2() { VirtualWindowUI vwui = createVWUI(); assertTrue( "Default glass pane state is false.", !vwui.isGlassEnabled() ); vwui.hide(); assertTrue( "Hiding UI should set glass pane state to false.", !vwui.isGlassEnabled() ); vwui.show(); assertTrue( "Showing UI should set glass pane state to true.", vwui.isGlassEnabled() ); vwui.show(); assertTrue( "Showing UI should set glass pane state to true.", vwui.isGlassEnabled() ); vwui.hide(); assertTrue( "Hiding UI should set glass pane state to false.", !vwui.isGlassEnabled() ); vwui.hide(); assertTrue( "Hiding UI should set glass pane state to false.", !vwui.isGlassEnabled() ); } /* this test has never worked right. If a screen-saver is running, or the moon is full, then the test will fail. public void testDraw1() throws Exception { Robot r = new Robot(); Color p1 = r.getPixelColor( 0, 0 ); // set the new UI's background to a color that is opposite of // the current color. Color inverse = new Color( 255 - p1.getRed(), 255 - p1.getGreen(), 255 - p1.getBlue() ); BufferedImage img = new BufferedImage( 2, 2, BufferedImage.TYPE_3BYTE_BGR ); Graphics2D g = img.createGraphics(); g.setColor( inverse ); g.drawLine( 0, 0, 1, 0 ); VirtualWindowUI vwui = createVWUI(); vwui.setBackground( img ); vwui.show(); Color p2 = r.getPixelColor( 0, 0 ); assertEquals( "Displayed image was not the same.", inverse, p2 ); } */ //------------------------------------------------------------------------- // Helpers private Frame f; private VirtualWindowUI innervwui; protected VirtualWindowUI createVWUI() { if (this.f == null) { this.f = new Frame( "Test" ); // f.show(); } VirtualWindowUI vwui = new VirtualWindowUI( f ); this.innervwui = vwui; return vwui; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down if (this.f != null) { this.f.dispose(); this.f = null; } if (this.innervwui != null) { try { this.innervwui.dispose(); } catch (Exception e) { DOC.getLog().info( "VWUI threw an exception during disposal.", e ); } this.innervwui = null; } super.tearDown(); } } libgroboutils-java-5.orig/uicapture/sources/ut/about.txt0000644000175000017500000000012207521071672023643 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/uicapture/sources/iut/0000755000175000017500000000000011271425773022150 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/iut/net/0000755000175000017500000000000010011472764022727 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/0000755000175000017500000000000010011472764025252 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/0000755000175000017500000000000010011472764027443 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/0000755000175000017500000000000010011472764031444 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/0000755000175000017500000000000011271425773032001 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/0000755000175000017500000000000011271425773033122 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/AllowCapturePassThroughAdapterIUTest.javalibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/AllowC0000644000175000017500000001104207622026461034220 0ustar drazzibdrazzib/* * @(#)AllowCapturePassThroughAdapterIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AllowCapturePassThroughAdapter class. Since the adapter is * an extention to CaptureAdapter, * we'll extend that tester to allow testing of its features, too. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 6, 2002 * @version $Date: 2003/02/10 22:52:33 $ */ public class AllowCapturePassThroughAdapterIUTest extends CaptureAdapterIUTest { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AllowCapturePassThroughAdapterIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public AllowCapturePassThroughAdapterIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testInstantiation() { // make sure the casting and hierarchy is correct IAllowCapturePassThroughListener ica = createAllowCapturePassThroughAdapter(); } public void testBasics2() { AllowCapturePassThroughAdapter acpta = createAllowCapturePassThroughAdapter(); assertTrue( "allowMousePressed did not return true.", acpta.allowMousePressed( null ) ); assertTrue( "allowMouseReleased did not return true.", acpta.allowMouseReleased( null ) ); assertTrue( "allowKeyPressed did not return true.", acpta.allowKeyPressed( null ) ); assertTrue( "allowKeyReleased did not return true.", acpta.allowKeyReleased( null ) ); } /** * Override super's implementation. */ protected CaptureAdapter createCaptureAdapter() { return new AllowCapturePassThroughAdapter(); } protected AllowCapturePassThroughAdapter createAllowCapturePassThroughAdapter() { return new AllowCapturePassThroughAdapter(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/KeyCaptureEventIUTest.javalibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/KeyCap0000644000175000017500000001225707622026462034225 0ustar drazzibdrazzib/* * @(#)KeyCaptureEventIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the CaptureEvent class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 6, 2002 * @version $Date: 2003/02/10 22:52:34 $ */ public class KeyCaptureEventIUTest extends CaptureEventIUTest { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = KeyCaptureEventIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public KeyCaptureEventIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testNoEventConstructorKey() { KeyCaptureEvent ce = createKeyCaptureEvent(); assertEquals( "Null event at constructor must return a null event.", ce.getKeyEvent(), null ); assertEquals( "Event creation must return the same keyCode", ce.getKeyCode(), this.keyCodeMan ); } public void testEventConstructorKey() { KeyEvent ie = createKeyEvent(); KeyCaptureEvent ce = createKeyCaptureEvent( ie ); assertTrue( "Event passed in creation must be the same event returned.", ce.getKeyEvent() == ie ); assertEquals( "Event passed in creation must be the same event returned.", ce.getKeyCode(), this.keyCodeImplicit ); } protected int eventType = -3; protected int keyCodeMan = KeyEvent.VK_T; protected int keyCodeImplicit = KeyEvent.VK_S; protected CaptureEvent createCaptureEvent( InputEvent ie ) { return createKeyCaptureEvent( (KeyEvent)ie ); } protected CaptureEvent createCaptureEvent() { return createKeyCaptureEvent(); } protected InputEvent createInputEvent() { return createKeyEvent(); } protected KeyCaptureEvent createKeyCaptureEvent( KeyEvent ie ) { return new KeyCaptureEvent( this.eventType, ie ) { public void performEvent( Robot r ) { // do nothing } }; } protected KeyCaptureEvent createKeyCaptureEvent() { return new KeyCaptureEvent( this.eventType, this.keyCodeMan ) { public void performEvent( Robot r ) { // do nothing } }; } protected KeyEvent createKeyEvent() { return new KeyEvent( createComponent(), 1, 2L, 0, this.keyCodeImplicit ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/CaptureAdapterIUTest.javalibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/Captur0000644000175000017500000000732107622026461034302 0ustar drazzibdrazzib/* * @(#)CaptureAdapterIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the CaptureAdapter class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 6, 2002 * @version $Date: 2003/02/10 22:52:33 $ */ public class CaptureAdapterIUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CaptureAdapterIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public CaptureAdapterIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testInstantiation() { // make sure the casting and hierarchy is correct ICaptureListener ica = createCaptureAdapter(); } public void testBasics() { CaptureAdapter ca = createCaptureAdapter(); ca.mouseWheelMoved( null ); ca.mouseMoved( null ); ca.mousePressed( null ); ca.mouseReleased( null ); ca.keyPressed( null ); ca.keyReleased( null ); } protected CaptureAdapter createCaptureAdapter() { return new CaptureAdapter(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/CaptureEventIUTest.javalibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/event/Captur0000644000175000017500000001314607622026461034304 0ustar drazzibdrazzib/* * @(#)CaptureEventIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.event; import java.awt.Robot; import java.awt.Component; import java.awt.Button; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the CaptureEvent class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 6, 2002 * @version $Date: 2003/02/10 22:52:33 $ */ public class CaptureEventIUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = CaptureEventIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public CaptureEventIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testNoEventConstructor() { CaptureEvent ce = createCaptureEvent(); assertEquals( "Null event in creation must have null event returned.", ce.getInputEvent(), null ); assertEquals( "Must return the passed-in event type.", ce.getEventType(), this.eventType ); assertEquals( "Must not have a valid time of event.", ce.getTimeOfEvent(), -1 ); } public void testNullEventConstructor() { InputEvent ie = null; CaptureEvent ce = createCaptureEvent( ie ); assertEquals( "Event passed in creation must be the same event returned.", ce.getInputEvent(), ie ); assertEquals( "Must return the passed-in event type.", ce.getEventType(), this.eventType ); assertEquals( "Must not have a valid time of event.", ce.getTimeOfEvent(), -1 ); } public void testEventConstructor() { InputEvent ie = createInputEvent(); CaptureEvent ce = createCaptureEvent( ie ); assertEquals( "Event passed in creation must be the same event returned.", ce.getInputEvent(), ie ); assertEquals( "Must return the passed-in event type.", ce.getEventType(), this.eventType ); assertEquals( "Must not have a valid time of event.", ce.getTimeOfEvent(), ie.getWhen() ); } protected int eventType = -3; protected CaptureEvent createCaptureEvent( InputEvent ie ) { return new CaptureEvent( this.eventType, ie ) { public void performEvent( Robot r ) { // do nothing } }; } protected CaptureEvent createCaptureEvent() { return new CaptureEvent( this.eventType ) { public void performEvent( Robot r ) { // do nothing } }; } protected InputEvent createInputEvent() { return new KeyEvent( createComponent(), 1, 2L, 0, KeyEvent.VK_S ); } protected Component createComponent() { return new Button(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/javamaker/0000755000175000017500000000000011271425773033742 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/javamaker/JavaMakerIUTest.javalibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/javamaker/Ja0000644000175000017500000002260407622026462034220 0ustar drazzibdrazzib/* * @(#)JavaMakerIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1.javamaker; import java.io.File; import java.io.Writer; import java.io.StringWriter; import java.io.IOException; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the JavaMaker class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 6, 2002 * @version $Date: 2003/02/10 22:52:34 $ */ public class JavaMakerIUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JavaMakerIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public JavaMakerIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testInstantiation() throws IOException { try { new JavaMaker( (File)null, null, null ); fail( "Should throw IAE" ); } catch (IllegalArgumentException iae) { // do nothing } try { new JavaMaker( (Writer)null, null, null ); fail( "Should throw IAE" ); } catch (IllegalArgumentException iae) { // do nothing } File f = new File("a"); try { new JavaMaker( f, "b", "c" ); } finally { if (f.exists()) { f.delete(); } } } public void testCreatesFile() throws IOException { File f = File.createTempFile( "Script", ".java" ); try { if (f.exists()) { f.delete(); } assertTrue( "Generated a temporary file. It should not already exist.", !f.exists() ); JavaMaker jsm = new JavaMaker( f, "a", "b" ); jsm.start(); jsm.end(); assertTrue( "ScriptMaker should have created temp file.", f.exists() ); } finally { if (f.exists()) { f.delete(); } } } public void testCreatesString() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); jsm.start(); jsm.end(); String output = sw.toString(); assertTrue( "ScriptMaker should have created a non-empty string.", output.length() > 0 ); } public void testIllegalOrderEnd() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.end(); fail( "end should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderDelay() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generateDelay( 10 ); fail( "generateDelay should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderWheel() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generateMoveMouseWheel( 10 ); fail( "generateMoveMouseWheel should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderMove() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generateMoveMouse( 10, 10 ); fail( "generateMoveMouse should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderMPress() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generatePressMouse( 10 ); fail( "generatePressMouse should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderMRelease() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generateReleaseMouse( 10 ); fail( "generateReleaseMouse should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderKPress() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generatePressKey( 10 ); fail( "generatePressKey should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderKRelease() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generateReleaseKey( 10 ); fail( "generateReleaseKey should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderScreen() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); try { jsm.generateScreenCapture( null, 10, 10, 10, 10 ); fail( "generateScreenCapture should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } } public void testIllegalOrderStart() { StringWriter sw = new StringWriter(); JavaMaker jsm = new JavaMaker( sw, "a", "b" ); jsm.start(); try { jsm.start(); fail( "start should have thrown an IllegalStateException." ); } catch (IllegalStateException e) { // should have generated this exception } finally { jsm.end(); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/VirtualWindowControllerIUTest.javalibgroboutils-java-5.orig/uicapture/sources/iut/net/sourceforge/groboutils/uicapture/v1/VirtualWindo0000644000175000017500000000737207622026461034360 0ustar drazzibdrazzib/* * @(#)VirtualWindowControllerIUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.uicapture.v1; import java.awt.Robot; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the VirtualWindowController class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Jan 6, 2002 * @version $Date: 2003/02/10 22:52:33 $ */ public class VirtualWindowControllerIUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = VirtualWindowControllerIUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public VirtualWindowControllerIUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testInstantiation() { VirtualWindowController vwc = new VirtualWindowController(); } /** * * @exception java.awt.AWTException thrown if JDK does not support Robot. * @exception InterruptedException thrown if interrupt called during sleep. */ public void testSimpleRun() throws java.awt.AWTException, InterruptedException { VirtualWindowController vwc = new VirtualWindowController(); vwc.begin(); Thread.sleep( 1000 ); vwc.end(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/uicapture/sources/iut/about.txt0000644000175000017500000000021107521071667024017 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/uicapture/sources/eut/0000755000175000017500000000000011271425773022144 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/sources/eut/about.txt0000644000175000017500000000015307521071667024020 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/uicapture/CHANGES.TXT0000644000175000017500000000430207737570036021341 0ustar drazzibdrazzib v1.0.0alpha1 & alpha2: * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Moved the UICapture hierarchy back here, but kept it in its own project. * Fixed bug #618314. * Fixed bug #618295. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/uicapture/xdocs/0000755000175000017500000000000011271425773021004 5ustar drazzibdrazziblibgroboutils-java-5.orig/uicapture/xdocs/summary.xml0000644000175000017500000000152207655132716023226 0ustar drazzibdrazzib uicapture net.sourceforge.groboutils.uicapture.v1 A UI capture program for Java. Allows for capture and playback ability in any graphical application running on the local system. 08-Oct-2002: Able to capture and play-back UI interactions, but capturing has issues with the underlying UIs being interacted with: due to the glass pane manipulation and click pass-through implementation, UI components such as menus disappear. libgroboutils-java-5.orig/uicapture/xdocs/about.xml0000644000175000017500000000050107662237462022641 0ustar drazzibdrazzib About UI Capture $Date: 2003/05/19 20:31:46 $ A UI capture program for Java. Allows for capture and playback ability in any graphical application running on the local system. libgroboutils-java-5.orig/uicapture/xdocs/requirements.xml0000644000175000017500000000031207662237462024252 0ustar drazzibdrazzib Requirements of UI Capture $Date: 2003/05/19 20:31:46 $ libgroboutils-java-5.orig/uicapture/xdocs/design.xml0000644000175000017500000000030407662237462023001 0ustar drazzibdrazzib Design of UI Capture $Date: 2003/05/19 20:31:46 $ libgroboutils-java-5.orig/uicapture/xdocs/index.xml0000644000175000017500000000070207662237462022641 0ustar drazzibdrazzib UI Capture $Date: 2003/05/19 20:31:46 $

  • About UICapture
  • Requirements
  • Design
  • Using
  • libgroboutils-java-5.orig/uicapture/xdocs/using.xml0000644000175000017500000000030007662237462022651 0ustar drazzibdrazzib Using UI Capture $Date: 2003/05/19 20:31:46 $ libgroboutils-java-5.orig/checkClass.sh0000644000175000017500000000102610037142271020245 0ustar drazzibdrazzib#!/bin/bash pushd $(dirname $0) > /dev/null HERE=$(pwd) popd if [ -z $1 ]; then echo "Argument 1 is the classname to analyze." exit fi CLASSNAME="$1" SRCDIR=$HERE/codecoverage/sources/dev if [ ! -z $2 ]; then SRCDIR="$2" fi WORKDIR=$HERE/codecoverage/work if [ ! -z $3 ]; then WORKDIR="$3" fi ./pmake.sh codecoverage test-ait-2 -Dconfig.classname=$CLASSNAME -Dconfig.datadir=$WORKDIR/coverage/data -Dconfig.srcdir=$SRCDIR -Dconfig.origclassdir=$WORKDIR/classes/dev -Dconfig.covclassdir=$WORKDIR/coverage/classes libgroboutils-java-5.orig/util-io/0000755000175000017500000000000011271425773017245 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/deployed.ant-inc.xml0000644000175000017500000000031007550512633023113 0ustar drazzibdrazzib libgroboutils-java-5.orig/util-io/build.xml0000644000175000017500000001405107561622146021067 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/util-io/log4j.properties0000644000175000017500000000050007521071676022377 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.util.io=DEBUG libgroboutils-java-5.orig/util-io/sources/0000755000175000017500000000000010011472777020725 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ait/0000755000175000017500000000000011271425773021505 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ait/about.txt0000644000175000017500000000021007521071676023353 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/util-io/sources/dev/0000755000175000017500000000000011271425773021506 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/dev/net/0000755000175000017500000000000010011472776022270 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/0000755000175000017500000000000010011472776024613 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472776027004 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/0000755000175000017500000000000010011472776027761 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/0000755000175000017500000000000010011472776030370 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/0000755000175000017500000000000011271425773030722 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/AllFileFilter.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/AllFileFilter.ja0000644000175000017500000000411407622026475033715 0ustar drazzibdrazzib/* * AllFileFilter.java - 0.9.0 01/07/2001 - 12:30:24 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.IOException; import java.io.File; import java.io.FileFilter; import java.io.FilenameFilter; /** * Allows all files to be accepted. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since January 7, 2001 * @version $Date: 2003/02/10 22:52:45 $ */ public class AllFileFilter extends AllFilenameFilter implements FileFilter { /** * Default constructor. */ public AllFileFilter() { // do nothing } /** * Accepts all files. */ public boolean accept( File pathname ) { return true; } /** * Accepts all files. */ public boolean accept( File dir, String name ) { return true; } } libgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/package.html0000644000175000017500000000030707521071677033206 0ustar drazzibdrazzibnet.sourceforge.groboutils.util.io.v1 Utilities and Java I/O extentions to speed up development time of file and stream processing in your app. ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/FileInputStreamGenerator.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/FileInputStreamG0000644000175000017500000000744007622026475034035 0ustar drazzibdrazzib/* * @(#)FileInputStreamGenerator.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.InputStream; import java.io.IOException; import java.io.File; import java.io.FileInputStream; /** * A type of class which can generate a new InputStream based on just a * partial name. Useful if a resource is loaded from a specific location * (classpath resource, file system, URL, etc), and it references other * resources which must be loaded relative to it. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class FileInputStreamGenerator implements IInputStreamGenerator { private String root; private String orig; /** * Accepts the name of the 1st file loaded. All files generated from * this generator will be relative to its location. If the name is * a directory, then all relative names will be in this directory. */ public FileInputStreamGenerator( String originalName ) throws IOException { this.orig = originalName; File f = new File( originalName ); if (!f.isDirectory()) { originalName = f.getParent(); if (originalName == null) { originalName = ""; } } if (originalName.endsWith( File.separator )) { originalName = originalName.substring( 0, originalName.length() - File.separator.length() ); } this.root = originalName; if (this.root.length() <= 0) { this.root = "."; } } public File getFile( String relativeName ) { if (!this.orig.equals( relativeName )) { if (!relativeName.startsWith( "/" ) && !relativeName.startsWith( File.separator )) { // only adjust the relative name if it is relative. relativeName = this.root + File.separator + relativeName; } } return new File( relativeName ); } public String getFullName( String relativeName ) { File f = getFile( relativeName ); try { return f.getCanonicalPath(); } catch (IOException ioe) { return f.getAbsolutePath(); } } public InputStream createInputStream( String relativeName ) throws IOException { return new FileInputStream( getFile( relativeName ) ); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ExtensionFileFilter.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ExtensionFileFil0000644000175000017500000000745607622026475034071 0ustar drazzibdrazzib/* * ExtensionFileFilter.java - 0.9.0 01/07/2001 - 12:35:59 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.IOException; import java.io.File; import java.io.FilenameFilter; import java.io.FileFilter; /** * Allows files with the given extention(s) to be accepted. You can also * specify whether directories are allowed or not. This filter is * case insensitive or sensitive, depending on the settings. *

    * The extension strings passed in are the end-of-name Strings, meaning * that each file must match at least one given string at the end. So, * if you want to match all "DOC" files, pass in ".doc" to match. *

    * By default, directories are allowed, independent of their names. If * directories are not allowed, then the directory names must match the * extension list. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since January 7, 2001 * @version $Date: 2003/02/10 22:52:45 $ */ public class ExtensionFileFilter extends ExtensionFilenameFilter implements FileFilter { //-------------------------------------------------------------- // Private fields //-------------------------------------------------------------- // Constructors /** * Default Constructor. */ public ExtensionFileFilter() { super(); } /** * Specify a single "end string" to match. */ public ExtensionFileFilter( String extension ) { super( extension ); } /** *

    * Slow, but it works. */ public ExtensionFileFilter( String exts[] ) { super( exts ); } /** * */ public ExtensionFileFilter( boolean caseInsensitive ) { super( caseInsensitive ); } /** * */ public ExtensionFileFilter( String extension, boolean caseInsensitive ) { super( extension, caseInsensitive ); } /** * */ public ExtensionFileFilter( String exts[], boolean caseInsensitive ) { super( exts, caseInsensitive ); } //-------------------------------------------------------------- // Public methods /** * Accepts some files. */ public boolean accept( File pathname ) { if (pathname == null) { throw new IllegalArgumentException( "no null args" ); } return matches( pathname.getName(), pathname ); } //-------------------------------------------------------------- // Protected methods } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ReadStringStream.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ReadStringStream0000644000175000017500000001360007622026475034064 0ustar drazzibdrazzib/* * @(#)ReadStringStream.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.File; import java.io.IOException; import java.io.StringWriter; import java.io.Reader; /** * Reads a byte array from a stream until the stream is finished. * You can specify a maximum size to read, and the block read size. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since Alpha 0.9.1d (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class ReadStringStream { //---------------------------- // Public data /** * Read in an unlimited number of bytes. This can be very * dangerous. */ public static final int READ_TO_END_OF_STREAM = Integer.MAX_VALUE; /** * Default block read size. */ public static final int DEFAULT_BLOCK_READ_SIZE = 4096; //---------------------------- // Private data private Reader m_is; private int m_maxSize; private int m_bufferSize; //---------------------------- // constructors /** * Create a new stream using the default parameters and the given * reader. * * @param input reader to pull from. */ public ReadStringStream( Reader input ) { this( input, READ_TO_END_OF_STREAM, DEFAULT_BLOCK_READ_SIZE ); } /** * * @param input reader to pull from. */ public ReadStringStream( Reader input, int maxReadSize, int blockReadSize ) { setReader( input ); setSizes( maxReadSize, blockReadSize ); } //---------------------------- // Public methods /** * Sets the internal input stream. * * @param input reader to pull from. */ public void setReader( Reader input ) { if (input == null) { throw new IllegalArgumentException( "Reader is null" ); } this.m_is = input; } /** * Sets the internal sizes. */ public void setSizes( int maxReadSize, int blockReadSize ) { if (blockReadSize <= 0) { blockReadSize = DEFAULT_BLOCK_READ_SIZE; } if (maxReadSize <= 0 || maxReadSize > READ_TO_END_OF_STREAM) { maxReadSize = READ_TO_END_OF_STREAM; } if (maxReadSize < blockReadSize) { blockReadSize = maxReadSize; } this.m_maxSize = maxReadSize; this.m_bufferSize = blockReadSize; } /** * Read in the byte stream, using the current settings. * * @return the read-in string */ public String readStringStream() throws IOException { return readStringStream( this.m_is, this.m_maxSize, this.m_bufferSize ); } /** * Read in the byte stream. Does not close the stream after it has * finished reading. Uses the default sizes. * * @param input reader to pull from. * @return the read-in string * @see #readStringStream( Reader, int, int ) */ public static String readStringStream( Reader input ) throws IOException { return readStringStream( input, READ_TO_END_OF_STREAM, DEFAULT_BLOCK_READ_SIZE ); } /** * Read in the stream to a String. Does not close the stream after it has * finished reading. *

    * Note that there is no variable checking, for performance reasons. * The user needs to verify that: * @param input the reader, which cannot be null. * @param maxReadSize the maximum number of bytes to read, which * must be positive, and must be modulo 0 of blockReadSize. * This is an "estimation", and may actually read in more than this * many bytes if it is not modulo 0 of blockReadSize, but * will always return all the bytes read. * @param blockReadSize the number of bytes to read in per read command, * which cannot be more than maxReadSize, and cannot be * less than or equal to zero. */ public static String readStringStream( Reader input, int maxReadSize, int blockReadSize ) throws IOException { StringWriter sw = new StringWriter(); char buffer[] = new char[ blockReadSize ]; int size = input.read( buffer, 0, blockReadSize ); int totSize = size; while (size > 0 && totSize < maxReadSize) { sw.write( buffer, 0, size ); size = input.read( buffer, 0, blockReadSize ); totSize += size; } sw.close(); return sw.toString(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/URLInputStreamGenerator.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/URLInputStreamGe0000644000175000017500000000650207622026475033763 0ustar drazzibdrazzib/* * @(#)URLInputStreamGenerator.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.InputStream; import java.io.IOException; import java.net.URL; /** * A type of class which can generate a new InputStream based on just a * partial name. Useful if a resource is loaded from a specific location * (classpath resource, file system, URL, etc), and it references other * resources which must be loaded relative to it. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class URLInputStreamGenerator implements IInputStreamGenerator { private URL root; private String orig; /** * Accepts the name of the 1st file loaded. All files generated from * this generator will be relative to its location. */ public URLInputStreamGenerator( String originalName ) throws IOException { this.orig = originalName; URL url = new URL( originalName ); // JDK 1.3 allows for getPath()... String path = url.getFile(); int lastPos = path.lastIndexOf( '/' ); if (lastPos >= 0) { path = path.substring( 0, lastPos+1 ); } this.root = new URL( url.getProtocol(), url.getHost(), url.getPort(), path ); } public URL getURL( String relativeName ) throws IOException { URL url; if (this.orig.equals( relativeName )) { url = new URL( relativeName ); } else { url = new URL( this.root, relativeName ); } return url; } public String getFullName( String relativeName ) { try { return getURL( relativeName ).toString(); } catch (IOException e) { return e.toString(); } } public InputStream createInputStream( String relativeName ) throws IOException { return getURL( relativeName ).openStream(); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/MimeOutputStream.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/MimeOutputStream0000644000175000017500000000756107622026475034143 0ustar drazzibdrazzib/* * MimeOutputStream.java - A Filter stream for MIME encoding * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.util.io.v1; import java.io.FilterOutputStream; import java.io.OutputStream; import java.io.IOException; import java.awt.TextComponent; /** * java.io.FilterOutputStream implementation for Mime base 64. Not incredibly * efficient, but it works and is small. *

    * All we need to implement are: *

      *
    • write(int)
    • *
    • flush()
    • *
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.0 Alpha (early 2000) * @version $Date: 2003/02/10 22:52:45 $ */ public class MimeOutputStream extends FilterOutputStream { private int bits = 0, spare = 0; /** * Mime character set translation */ private static final int[] charset = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R', 'S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j', 'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1', '2','3','4','5','6','7','8','9','+','/' }; private static final int pad = '='; /** Constructor! */ public MimeOutputStream( OutputStream o ) { super(o); } /** * Write the specified byte, performing mime encoding. * *

    Override this method, since all other write methods call it. * * @exception IOException If an I/O error occurs */ public void write(int c) throws IOException { int s, t; switch (bits) { case 0: bits++; s = (c >> 2) & 0x3f; spare = c & 0x03; out.write( charset[s] ); break; case 1: bits++; s = (spare << 4) | ((c >> 4) & 0x0f); spare = c & 0x0f; out.write( charset[s] ); break; case 2: bits = 0; s = (spare << 2) | ((c >> 6) & 0x03); t = c & 0x3f; out.write( charset[s] ); out.write( charset[t] ); break; } } /** * Flush the stream. If the stream has saved any characters from the * various write() methods in a buffer, write them immediately to their * intended destination. Then, if that destination is another character or * byte stream, flush it. Thus one flush() invocation will flush all the * buffers in a chain of Writers and OutputStreams. *

    * This version does not buffer, but Mime encoding may have some trailing * stuff, which needs padding. * * @exception IOException If an I/O error occurs */ public void flush() throws IOException { switch (bits) { case 1: out.write( charset[spare << 4] ); out.write( pad ); out.write( pad ); break; case 2: out.write( charset[spare << 2] ); out.write( pad ); break; } super.flush(); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/AllFilenameFilter.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/AllFilenameFilte0000644000175000017500000000404307622026475034004 0ustar drazzibdrazzib/* * AllFileFilter.java - 0.9.0 01/07/2001 - 12:30:24 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.IOException; import java.io.File; import java.io.FilenameFilter; /** * Allows all files to be accepted. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since January 7, 2001 * @version $Date: 2003/02/10 22:52:45 $ */ public class AllFilenameFilter implements FilenameFilter { /** * Default constructor. */ public AllFilenameFilter() { // do nothing } /** * Accepts all files. */ public boolean accept( File pathname ) { return true; } /** * Accepts all files. */ public boolean accept( File dir, String name ) { return true; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ResourceInputStreamGenerator.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ResourceInputStr0000644000175000017500000000557207622026475034157 0ustar drazzibdrazzib/* * @(#)ResourceInputStreamGenerator.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.InputStream; import java.io.IOException; /** * A type of class which can generate a new InputStream based on just a * partial name. Useful if a resource is loaded from a specific location * (classpath resource, file system, URL, etc), and it references other * resources which must be loaded relative to it. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class ResourceInputStreamGenerator implements IInputStreamGenerator { private String root; private String orig; /** * Accepts the name of the 1st file loaded. All files generated from * this generator will be relative to its location. */ public ResourceInputStreamGenerator( String originalName ) { this.orig = originalName; int pos = originalName.lastIndexOf('.'); if (pos >= 0) { originalName = originalName.substring( 0, pos+1 ); } else { originalName = ""; } this.root = originalName; } public String getFullName( String relativeName ) { if (!this.orig.equals( relativeName )) { relativeName = this.root + relativeName; } return relativeName; } public InputStream createInputStream( String relativeName ) throws IOException { return ClassLoader.getSystemResourceAsStream( getFullName( relativeName ) ); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/IInputStreamGenerator.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/IInputStreamGene0000644000175000017500000000442207662237463034040 0ustar drazzibdrazzib/* * @(#)IInputStreamGenerator.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.InputStream; import java.io.IOException; /** * A type of class which can generate a new InputStream based on just a * partial name. Useful if a resource is loaded from a specific location * (classpath resource, file system, URL, etc), and it references other * resources which must be loaded relative to it. *

    * The generators should be first created using the original full resource * name. Then, each stream generated is relative to that first resource * location. If the first resource location is requested, then it should * be considered absolute (not relative to itself). * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/05/19 20:31:47 $ */ public interface IInputStreamGenerator { public String getFullName( String relativeName ); public InputStream createInputStream( String relativeName ) throws IOException; } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/PropertyDatabase.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/PropertyDatabase0000644000175000017500000004725007622026475034127 0ustar drazzibdrazzib/* * PropertyDatabase.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.IOException; import java.io.FileNotFoundException; import java.io.File; import java.io.PrintWriter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.ResourceBundle; import java.util.Locale; import java.util.Properties; import java.util.Enumeration; import java.util.Hashtable; /** * A database of property files. Internally, it uses a * ResourceBundle, so that locale specific properties can be used. * The format is for the application defined property files to be defined * as "read-only", and for a user defined property file to be the * readable/writeable properties (i.e. modifications or additions or * removals of the default properties). User settings override the * read-only settings. The user property file is not localized, and is * stored at $home/.app-name/user.properties (or the filename * may be specified). *

    * By default, the properties are loaded from the Resource streams, * although this can be changed. *

    * Before using this class, you must initialize the user property file * by either {@link #setApplicationName( String )} or * {@link #setUserPropertyFile( String )}. *

    * The stored data is only of type String, and multiple identical key * entries are not possible - only the first one is allowed. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since January 7, 2001 * @version $Date: 2003/02/10 22:52:45 $ */ public class PropertyDatabase { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Protected Static Fields //--------------------------------------------------------------------- // Private Static Fields private static final String USER_FILE_NAME = "user.properties"; private static final String USER_REMOVED = "<>"; //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Protected Fields //--------------------------------------------------------------------- // Private Fields private Hashtable resourceValues = new Hashtable(); private Properties userValues = null; private boolean doAutosave = false; private File userProps = null; private Locale locale = Locale.getDefault(); private PrintWriter trace = null; private File appDirectory = null; //--------------------------------------------------------------------- // Constructors /** * Default Constructor */ public PropertyDatabase() { // do nothing } /** * Specify the Locale to load the properties from. */ public PropertyDatabase( Locale l ) { this.locale = l; } //--------------------------------------------------------------------- // Public Methods /** * Set the application name and thus the corresponding directory that will * store the user properties. The user properties are located * at $home/.app-name/user.properties. If the user property * file is already set, then an IllegalStateException is thrown. * * @param name name of the application. */ public void setApplicationName( String name ) throws IOException { if (this.userProps != null) { throw new IllegalStateException( "property file already in use" ); } if (name == null) { throw new IllegalArgumentException( "no null args" ); } // find the home directory. File home = new File( System.getProperty("user.home") ); if (home == null || !home.isDirectory() || !home.exists()) { throw new FileNotFoundException( "user.home property not valid" ); } // for hidden unix home path name = "." + name; this.appDirectory = new File( home, name ); if (!this.appDirectory.exists()) { // need to create the appDir directory this.appDirectory.mkdir(); } else if (!this.appDirectory.isDirectory()) { // error - app is not a directory throw new FileNotFoundException( "application directory "+this.appDirectory.toString()+ " is not a directory" ); } // get the user file this.userProps = new File( this.appDirectory, USER_FILE_NAME ); // if the file doesn't exist, create it this.userProps.createNewFile(); loadUserProperties(); } /** * Returns the directory where the user properties are stored for the * current application, or null if there is no application set. */ public File getApplicationDirectory() { return this.appDirectory; } /** * Set the user property file name exactly. If the user property file * is already set, then an IllegalStateException is thrown. */ public void setUserPropertyFile( String name ) throws IOException { if (this.userProps != null) { throw new IllegalStateException( "property file already in use" ); } if (name == null) { throw new IllegalArgumentException( "no null args" ); } File f = new File( name ); if (f.isDirectory()) { throw new IOException("user property file "+f+" is a directory"); } // if the file doesn't exist, create it f.createNewFile(); this.userProps = f; loadUserProperties(); } /** * Saves the current user properties. */ public void saveUserProperties() throws IOException { if (this.userValues == null || this.userProps == null) { throw new IllegalStateException("database not initialized"); } synchronized( this ) { FileOutputStream fos = null; try { fos = new FileOutputStream( this.userProps ); this.userValues.store( fos, "User values" ); } finally { if (fos != null) fos.close(); fos = null; } } } /** * Adds a resource bundle of the given name to the database, from the * specified locale. Note that * if a user property already exists with a given key, then the * user property overrides the resource property. */ public void addResourceBundle( String resourceName ) { ResourceBundle rb = ResourceBundle.getBundle( resourceName, this.locale ); if (rb == null) { return; } Hashtable rv = this.resourceValues; Enumeration enum = rb.getKeys(); String key, val; synchronized( rv ) { while (enum.hasMoreElements()) { key = (String)enum.nextElement(); if (rv.contains( key ) && this.trace != null) { this.trace.println("Resource "+resourceName+ " contains a duplicate key '"+key+"'."); } val = rb.getString( key ); if (val == null) { if (this.trace != null) { this.trace.println("Resource "+resourceName+ " contains a null key '"+key+"'." ); } if (rv.contains( key )) { rv.remove( key ); } } else { rv.put( key, val ); } } } } /** * Retrieves the auto-save setting. */ public boolean isAutosaveOn() { return this.doAutosave; } /** * Sets the current autosave setting. */ public void setAutosaveOn( boolean yes ) { this.doAutosave = yes; } /** * Removes a value from the properties. If the property is defined * by a resource, then the user list must specify that it is * removed. * * @param key the key to remove * @return the value the key was assigned to, or null if nothing * was removed. */ public String removeValue( String key ) { String val = null; val = this.userValues.getProperty( key ); if (val != null) { if (val.equals( USER_REMOVED )) { return null; } if (this.resourceValues.contains( key )) { // remove from the user list this.userValues.setProperty( key, USER_REMOVED ); } else { this.userValues.remove( key ); } autoSave(); return val; } val = (String)this.resourceValues.get( key ); if (val != null) { // we know the user values doesn't have this key this.userValues.setProperty( key, USER_REMOVED ); autoSave(); return val; } // no one had this key. return null; } /** * Sets the given value to the user properties. * * @param key the key to assign the value to * @param value the value to be assigned to the key */ public void setValue( String key, String value ) { if (value == null) { removeValue( key ); return; } this.userValues.setProperty( key, value ); autoSave(); } /** * Retrieves the value associated with the given key. * * @param key the key to pull the value out of */ public String getValue( String key ) { String val = this.userValues.getProperty( key ); if (val != null) { if (val.equals( USER_REMOVED )) { return null; } return val; } return (String)this.resourceValues.get( key ); } /** * Resets the user property to the resource bundle's default value. * * @param key the key to be reset. * @return the default value for the key. */ public String setValueToDefault( String key ) { boolean needSave = this.userValues.contains( key ); this.userValues.remove( key ); if (needSave) autoSave(); return (String)this.resourceValues.get( key ); } //--------------------------------------------------- // Convenience functions /** * Convenience function to convert a property to an int value. * * @return the given key converted to an integer, or Integer.MIN_VALUE * if there was a parse error. */ public int getIntValue( String key ) { try { return Integer.parseInt( getValue( key ) ); } catch (NumberFormatException nfe) { return Integer.MIN_VALUE; } catch (NullPointerException nfe) { return Integer.MIN_VALUE; } } /** * Convenience function to convert an int value to a String property. */ public void setIntValue( String key, int value ) { setValue( key, Integer.toString( value ) ); } /** * Convenience function to convert a property to a boolean value. * * @return the given key converted to a boolean, or false * if there was a parse error. */ public boolean getBooleanValue( String key ) { try { return Boolean.getBoolean( getValue( key ) ); } catch (NullPointerException nfe) { return false; } } /** * Convenience function to convert a boolean value to a String property. */ public void setBooleanValue( String key, boolean value ) { setValue( key, (value ? Boolean.TRUE.toString() : Boolean.FALSE.toString() ) ); } /** * Convenience function to convert a property to a byte value. * * @return the given key converted to a byte, or Byte.MIN_VALUE * if there was a parse error. */ public byte getByteValue( String key ) { try { return Byte.parseByte( getValue( key ) ); } catch (NumberFormatException nfe) { return Byte.MIN_VALUE; } catch (NullPointerException nfe) { return Byte.MIN_VALUE; } } /** * Convenience function to convert a byte value to a String property. */ public void setByteValue( String key, byte value ) { setValue( key, Byte.toString( value ) ); } /** * Convenience function to convert a property to a char value. * * @return the given key converted to a char, or Character.MIN_VALUE * if there was a parse error. */ public char getCharValue( String key ) { String val = getValue( key ); if (val == null || val.length() <= 0) return Character.MIN_VALUE; return val.charAt(0); } /** * Convenience function to convert a char value to a String property. */ public void setCharValue( String key, char value ) { setValue( key, ""+value ); } /** * Convenience function to convert a property to a double value. * * @return the given key converted to a double, or Double.MIN_VALUE * if there was a parse error. */ public double getDoubleValue( String key ) { try { return Double.parseDouble( getValue( key ) ); } catch (NumberFormatException nfe) { return Double.MIN_VALUE; } catch (NullPointerException nfe) { return Double.MIN_VALUE; } } /** * Convenience function to convert a byte value to a String property. */ public void setDoubleValue( String key, double value ) { setValue( key, Double.toString( value ) ); } /** * Convenience function to convert a property to a float value. * * @return the given key converted to a float, or Float.MIN_VALUE * if there was a parse error. */ public float getFloatValue( String key ) { try { return Float.parseFloat( getValue( key ) ); } catch (NumberFormatException nfe) { return Float.MIN_VALUE; } catch (NullPointerException nfe) { return Float.MIN_VALUE; } } /** * Convenience function to convert a float value to a String property. */ public void setFloatValue( String key, float value ) { setValue( key, Float.toString( value ) ); } /** * Convenience function to convert a property to a long value. * * @return the given key converted to a long, or Long.MIN_VALUE * if there was a parse error. */ public long getLongValue( String key ) { try { return Long.parseLong( getValue( key ) ); } catch (NumberFormatException nfe) { return Long.MIN_VALUE; } catch (NullPointerException nfe) { return Long.MIN_VALUE; } } /** * Convenience function to convert a long value to a String property. */ public void setLongValue( String key, long value ) { setValue( key, Long.toString( value ) ); } /** * Convenience function to convert a property to a short value. * * @return the given key converted to a short, or Short.MIN_VALUE * if there was a parse error. */ public short getShortValue( String key ) { try { return Short.parseShort( getValue( key ) ); } catch (NumberFormatException nfe) { return Short.MIN_VALUE; } catch (NullPointerException nfe) { return Short.MIN_VALUE; } } /** * Convenience function to convert a short value to a String property. */ public void setShortValue( String key, short value ) { setValue( key, Short.toString( value ) ); } //-------------------------------------------------- // Debug aid function /** * Sets the trace stream. If you set this to non-null, then warnings, * such as ResourceBundles containing duplicate keys, will be reported * to the stream. Errors will still be thrown as exceptions. Autosave * will send any exceptions to this trace. */ public void setTrace( PrintWriter tracer ) { this.trace = tracer; } //--------------------------------------------------------------------- // Protected Methods /** * */ protected void loadUserProperties() throws IOException { Properties prop = new Properties(); FileInputStream fis = new FileInputStream( this.userProps ); prop.load( fis ); fis.close(); // if no exception was thrown... synchronized( this ) { this.userValues = prop; } } /** * */ protected void autoSave() { if (isAutosaveOn()) { try { // attempt to save saveUserProperties(); } catch (IOException ioe) { if (this.trace != null) { ioe.printStackTrace( this.trace ); } } } } //--------------------------------------------------------------------- // Private Methods } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ExtensionFilenameFilter.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ExtensionFilenam0000644000175000017500000001460107622026475034120 0ustar drazzibdrazzib/* * ExtensionFileFilter.java - 0.9.0 01/07/2001 - 12:35:59 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.IOException; import java.io.File; import java.io.FilenameFilter; /** * Allows files with the given extention(s) to be accepted. You can also * specify whether directories are allowed or not. This filter is * case insensitive or sensitive, depending on the settings. By default, * the class is case-insensitive. *

    * The extension strings passed in are the end-of-name Strings, meaning * that each file must match at least one given string at the end. So, * if you want to match all "DOC" files, pass in ".doc" to match. *

    * By default, directories are allowed, independent of their names. If * directories are not allowed, then the directory names must match the * extension list. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since January 7, 2001 * @version $Date: 2003/02/10 22:52:45 $ */ public class ExtensionFilenameFilter implements FilenameFilter { //-------------------------------------------------------------- // Private fields // this list of extensions *must* be all lower-case. private String extensions[] = new String[0]; private boolean allowDirs = true; private boolean caseInsensitive = true; //-------------------------------------------------------------- // Constructors /** * Default Constructor. */ public ExtensionFilenameFilter() { // do nothing } /** * Specify a single "end string" to match. */ public ExtensionFilenameFilter( String extension ) { addExtension( extension ); } /** *

    * Slow, but it works. */ public ExtensionFilenameFilter( String exts[] ) { if (exts == null) { throw new IllegalArgumentException( "no null args" ); } for (int i = exts.length; --i >= 0;) { addExtension( exts[i] ); } } /** * */ public ExtensionFilenameFilter( boolean caseInsensitive ) { this.caseInsensitive = caseInsensitive; } /** * */ public ExtensionFilenameFilter( String extension, boolean caseInsensitive ) { // must set the case first this.caseInsensitive = caseInsensitive; addExtension( extension ); } /** * */ public ExtensionFilenameFilter( String exts[], boolean caseInsensitive ) { if (exts == null) { throw new IllegalArgumentException( "no null args" ); } // must set the case first this.caseInsensitive = caseInsensitive; for (int i = exts.length; --i >= 0;) { addExtension( exts[i] ); } } //-------------------------------------------------------------- // Public methods /** * Adds the given extension to the internal list. */ public void addExtension( String ext ) { if (ext == null) { throw new IllegalArgumentException( "no null args" ); } int len = this.extensions.length; String temp[] = new String[ len+1 ]; System.arraycopy( this.extensions, 0, temp, 0, len ); if (isCaseInsensitive()) { ext = ext.toLowerCase(); } temp[ len ] = ext; this.extensions = temp; } /** * @return whether the filter allows directories to pass. */ public boolean allowsDirectories() { return this.allowDirs; } /** * @param on true if filter allows directories to pass. */ public void allowsDirectories( boolean on ) { this.allowDirs = on; } /** * @return if the extension is case insensitive. */ public boolean isCaseInsensitive() { return this.caseInsensitive; } /** * Accepts some files. */ public boolean accept( File dir, String name ) { if (name == null) { throw new IllegalArgumentException( "no null args" ); } return matches( name, new File( dir, name ) ); } //-------------------------------------------------------------- // Protected methods /** * Tests if the given file matches the list of extensions. * * @param filename the name of the file. * @param file the File object version of the file. */ protected boolean matches( String filename, File file ) { if (filename == null || file == null) { throw new IllegalArgumentException( "no null args" ); } if (allowsDirectories() && file.isDirectory()) { return true; } if (isCaseInsensitive()) { filename = filename.toLowerCase(); } for (int i = this.extensions.length; --i >= 0;) { if (filename.endsWith( this.extensions[i] )) { return true; } } return false; } } libgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/FileUtils.java0000644000175000017500000001430707662237463033500 0ustar drazzibdrazzib/* * FileUtils.java - 0.9.0 12/13/2000 - 15:41:52 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.util.Hashtable; import java.util.Vector; import java.util.Stack; import java.io.IOException; import java.io.FileNotFoundException; import java.io.File; import java.io.FilenameFilter; import java.io.BufferedOutputStream; import java.io.BufferedInputStream; import java.io.FileOutputStream; import java.io.FileInputStream; /** * Simple and common file operations in a Utility class. * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since December 13, 2000 * @version $Date: 2003/05/19 20:31:47 $ */ public class FileUtils { //--------------------------------------------------------------------- // Public Static Fields //--------------------------------------------------------------------- // Protected Static Fields protected static FileUtils s_instance = new FileUtils(); //--------------------------------------------------------------------- // Private Static Fields //--------------------------------------------------------------------- // Public Fields //--------------------------------------------------------------------- // Protected Fields //--------------------------------------------------------------------- // Private Fields //--------------------------------------------------------------------- // Constructors /** * Default Constructor */ protected FileUtils() { // do nothing } //--------------------------------------------------------------------- // Public Static Methods public static FileUtils getInstance() { return s_instance; } //--------------------------------------------------------------------- // Public Methods /** * @param source the source file to copy * @param dir the target directory to copy the sourcefile into: the * name will remain the same. */ public void copyFileToDirectory( File source, File dir ) throws IOException { copyFileToFile( source, new File( dir, source.getName() ) ); } /** * @param source the source file to copy from. * @param target the target file to copy to. */ public void copyFileToFile( File source, File target ) throws IOException { FileInputStream fis = null; FileOutputStream fos = null; BufferedInputStream bis = null; BufferedOutputStream bos = null; try { fis = new FileInputStream( source ); fos = new FileOutputStream( target ); bis = new BufferedInputStream( fis ); bos = new BufferedOutputStream( fos ); byte buffer[] = new byte[ 4096 ]; int size = bis.read( buffer, 0, 4096 ); while (size > 0) { bos.write( buffer, 0, size ); size = bis.read( buffer, 0, 4096 ); } } finally { if (bis != null) bis.close(); if (bos != null) bos.close(); if (fis != null) fis.close(); if (fos != null) fos.close(); } } /** * Recursively descends into the base directory, looking for all files * that pass the filter. * * @param baseDir the base directory to start the search. * @param filter the filename filter to search. If null, then * all files are allowed. */ public File[] findFileRecurse( File baseDir, FilenameFilter filter ) // throws IOException { if (baseDir == null) { throw new IllegalArgumentException( "no null arguments" ); } if (filter == null) { filter = new AllFilenameFilter(); } Stack dirStack = new Stack(); Vector files = new Vector(); dirStack.push( baseDir ); while (!dirStack.empty()) { baseDir = (File)dirStack.pop(); String[] list = baseDir.list( filter ); for (int i = list.length; --i >= 0;) { File f = new File( baseDir, list[i] ); if (f.isDirectory()) { dirStack.push( f ); } else if (f.isFile()) { files.addElement( f ); } } } File[] flist = new File[ files.size() ]; files.copyInto( flist ); return flist; } //--------------------------------------------------------------------- // Protected Methods //--------------------------------------------------------------------- // Private Methods } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ReadByteStream.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/ReadByteStream.j0000644000175000017500000001316307662237463033762 0ustar drazzibdrazzib/* * @(#)ReadByteStream.java 1.0.0 04/13/2001 - 11:44:03 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.File; import java.io.IOException; import java.io.ByteArrayOutputStream; import java.io.InputStream; /** * Reads a byte array from a stream until the stream is finished. * You can specify a maximum size to read, and the block read size. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 13, 2001 * @version $Date: 2003/05/19 20:31:47 $ */ public class ReadByteStream { //---------------------------- // Public data /** * Read in an unlimited number of bytes. This can be very * dangerous. */ public static final int READ_TO_END_OF_STREAM = Integer.MAX_VALUE; /** * Default block read size. */ public static final int DEFAULT_BLOCK_READ_SIZE = 4096; //---------------------------- // Private data private InputStream m_is; private int m_maxSize; private int m_bufferSize; //---------------------------- // constructors /** * Default constructor */ public ReadByteStream( InputStream is ) { this( is, READ_TO_END_OF_STREAM, DEFAULT_BLOCK_READ_SIZE ); } /** * */ public ReadByteStream( InputStream is, int maxReadSize, int blockReadSize ) { setInputStream( is ); setSizes( maxReadSize, blockReadSize ); } //---------------------------- // Public methods /** * Sets the internal input stream. */ public void setInputStream( InputStream is ) { if (is == null) { throw new IllegalArgumentException( "input stream is null" ); } this.m_is = is; } /** * Sets the internal sizes. */ public void setSizes( int maxReadSize, int blockReadSize ) { if (blockReadSize <= 0) { blockReadSize = DEFAULT_BLOCK_READ_SIZE; } if (maxReadSize <= 0 || maxReadSize > READ_TO_END_OF_STREAM) { maxReadSize = READ_TO_END_OF_STREAM; } if (maxReadSize < blockReadSize) { blockReadSize = maxReadSize; } this.m_maxSize = maxReadSize; this.m_bufferSize = blockReadSize; } /** * Read in the byte stream, using the current settings. */ public byte[] readByteStream() throws IOException { return readByteStream( this.m_is, this.m_maxSize, this.m_bufferSize ); } /** * Read in the byte stream. Does not close the stream after it has * finished reading. Uses the default sizes. * * @see #readByteStream( InputStream, int, int ) */ public static byte[] readByteStream( InputStream is ) throws IOException { return readByteStream( is, READ_TO_END_OF_STREAM, DEFAULT_BLOCK_READ_SIZE ); } /** * Read in the byte stream. Does not close the stream after it has * finished reading. *

    * Note that there is no variable checking, for performance reasons. * The user needs to verify that: * @param is the input stream, which cannot be null. * @param maxReadSize the maximum number of bytes to read, which * must be positive, and must be modulo 0 of blockReadSize. * This is an "estimation", and may actually read in more than this * many bytes if it is not modulo 0 of blockReadSize, but * will always return all the bytes read. * @param blockReadSize the number of bytes to read in per read command, * which cannot be more than maxReadSize, and cannot be * less than or equal to zero. */ public static byte[] readByteStream( InputStream is, int maxReadSize, int blockReadSize ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte buffer[] = new byte[ blockReadSize ]; int size = is.read( buffer, 0, blockReadSize ); int totSize = size; while (size > 0 && totSize < maxReadSize) { baos.write( buffer, 0, size ); size = is.read( buffer, 0, blockReadSize ); totSize += size; } baos.close(); return baos.toByteArray(); } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/MimeInputStream.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/MimeInputStream.0000644000175000017500000002062607622026475034015 0ustar drazzibdrazzib/* * MimeInputStream.java - A Filter stream for MIME encoding * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.sourceforge.groboutils.util.io.v1; import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; /** * java.io.FilterInputStream implementation for Mime base 64. Not incredibly * efficient, but it works and is small. * * All we need to implement are: * read(int) * read( byte b[], int off, int len ) * skip( long n ) - for translating the # of bytes to skip into mime bytes (4-to-3 ratio) * available() - for the same reason as skip * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.0 Alpha (early 2000) * @version $Date: 2003/02/10 22:52:45 $ */ public class MimeInputStream extends FilterInputStream { private int bits = 0, spare = 0; /** * Mime character set translation */ private static final int[] charset = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R', 'S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j', 'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1', '2','3','4','5','6','7','8','9','+','/' }; private static final int UPPER_START = 0; private static final int LOWER_START = 26; private static final int NUM_START = LOWER_START+26; private static final int PLUS = NUM_START+10; private static final int SLASH = PLUS+1; private static final int pad = '='; /** Constructor! */ public MimeInputStream( InputStream i ) { super(i); } /** * Write the specified byte, performing mime encoding. * *

    Override this method, since all other write methods call it. * * @exception IOException If an I/O error occurs */ public int read() throws IOException { int s; int c, val; // find the mime value - fast way doesn't loop through the mime charset for (;;) { c = super.read(); if (c < 0) return c; // EOF if (c >= 'A' && c <= 'Z') { val = c - 'A' + UPPER_START; } else if (c >= 'a' && c <= 'z') { val = c - 'a' + LOWER_START; } else if (c >= '0' && c <= '9') { val = c - '0' + NUM_START; } else if (c == '+') { val = PLUS; } else if (c == '/') { val = SLASH; } else if (c == pad) { throw new IOException("end-of-mime character encountered"); } else // ignore out-of-bounds characters, per specs continue; switch (bits) { case 0: bits++; spare = val << 2; // didn't get a full byte - continue the read break; case 1: bits++; s = spare | ((val >> 4) & 0x03); spare = (val << 4) & 0xF0; return s; case 2: bits++; s = spare | ((val >> 2) & 0x0F); spare = (val << 6) & 0xC0; return s; case 3: bits = 0; // val is already masked (&) with 0x3f return spare | val; } } } /** * Reads up to len bytes of data from this input stream * into an array of bytes. This method blocks until some input is * available. *

    * This method performs in.read(b, off, len), translates the * mime characters, and returns the result. * * @param b the buffer into which the data is read. * @param off the start offset of the data. * @param len the maximum number of bytes read. * @return the total number of bytes read into the buffer, or * -1 if there is no more data because the end of * the stream has been reached. * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in public int read(byte b[], int off, int len) throws IOException { // size checking if (b == null || b.length <= off || b.length <= off+len) throw new IllegalArgumentException(); int s, i = off, j, sofar = 0; int c, val, ourlen; byte buffer[]; // out-of-bounds values may throw us off the correct count while (sofar < len) { j = 0; ourlen = (len - sofar) * 4; if ((ourlen % 3) != 0) { ourlen /= 3; ourlen++; } else ourlen /= 3; buffer = new byte[ ourlen ]; // translate the length to mime size in.read( buffer, 0, ourlen ); // find the mime value - fast way doesn't loop through the mime charset for (; j < ourlen; j++) { c = buffer[j]; if (c >= 'A' && c <= 'Z') { val = c - 'A' + UPPER_START; } else if (c >= 'a' && c <= 'z') { val = c - 'a' + LOWER_START; } else if (c >= '0' && c <= '9') { val = c - '0' + NUM_START; } else if (c == '+') { val = PLUS; } else if (c == '/') { val = SLASH; } else if (c == pad) { // end of mime b[i] = (byte)spare; return sofar + j + 1; } else // ignore out-of-bounds characters, per specs continue; switch (bits) { case 0: bits++; spare = val << 2; // didn't get a full byte - continue the read break; case 1: bits++; b[i++] = (byte)(spare | ((val >> 4) & 0x03)); spare = (val << 4) & 0x03; break; case 2: bits = 0; // val is already masked (&) with 0x3f b[i++] = (byte)(spare | val); break; } } // end of for loop sofar += j; } return sofar+1; } */ /** * Skips over and discards n bytes of data from the * input stream. The skip method may, for a variety of * reasons, end up skipping over some smaller number of bytes, * possibly 0. The actual number of bytes skipped is * returned. *

    * This method performs in.skip(n), followed by a quick * translation to mime size. * * @param n the number of bytes to be skipped. * @return the actual number of bytes skipped. * @exception IOException if an I/O error occurs. */ public long skip(long n) throws IOException { long p = n * 4; if ((p % 3) != 0) { p /= 3; p++; } else { p /= 3; } p = in.skip(p); p *= 3; if ((p & 0x03) != 0) { p >>= 2; p++; } else { p >>= 2; } return p; } /** * Returns the number of bytes that can be read from this input * stream without blocking. *

    * This method performs in.available(n), does the mime-size * conversion, and returns the result. * * @return the number of bytes that can be read from the input stream * without blocking. * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ public int available() throws IOException { int p = in.available() * 3; if ((p & 0x03) != 0) { p >>= 2; p++; } else { p >>= 2; } return p; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/HashtableInputStreamGenerator.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/HashtableInputSt0000644000175000017500000000534107622026475034073 0ustar drazzibdrazzib/* * @(#)HashtableInputStreamGenerator.java * * Copyright (C) 2001,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.InputStream; import java.io.IOException; import java.util.Hashtable; import java.io.ByteArrayInputStream; /** * A type of class which can generate a new InputStream based on a entry * in a Hashtable. It will create a StringBufferInputStream based on the * toString of the data. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class HashtableInputStreamGenerator implements IInputStreamGenerator { private Hashtable map; private String orig; /** * Accepts the name of the 1st file loaded. All files generated from * this generator will be relative to its location. */ public HashtableInputStreamGenerator( Hashtable map ) { this.map = map; } public String getFullName( String relativeName ) { return relativeName; } public InputStream createInputStream( String relativeName ) throws IOException { if (relativeName == null) { throw new IOException("null name"); } Object o = this.map.get( relativeName ); if (o == null) { throw new IOException("resource '"+relativeName+"' does not exist"); } return new ByteArrayInputStream( o.toString().getBytes() ); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/WriterOutputStream.javalibgroboutils-java-5.orig/util-io/sources/dev/net/sourceforge/groboutils/util/io/v1/WriterOutputStre0000644000175000017500000000446307622026475034210 0ustar drazzibdrazzib/* * @(#)WriterOutputStream.java 1.0.0 14-May-2001 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.File; import java.io.Writer; import java.io.OutputStream; import java.io.IOException; /** * Converts from a Writer to an OutputStream. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since May 14, 2001 * @version $Date: 2003/02/10 22:52:45 $ */ public class WriterOutputStream extends OutputStream { private Writer w; public WriterOutputStream( Writer w ) { this.w = w; } public void write( int b ) throws IOException { this.w.write( b ); } public void write( byte b[], int off, int len ) throws IOException { this.w.write( new String( b, off, len ) ); } public void write( byte b[] ) throws IOException { this.w.write( new String( b ) ); } public void close() throws IOException { this.w.close(); } public void flush() throws IOException { this.w.flush(); } } libgroboutils-java-5.orig/util-io/sources/dev/about.txt0000644000175000017500000000015207521071676023361 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/util-io/sources/ut/0000755000175000017500000000000011271425773021360 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ut/net/0000755000175000017500000000000010011472777022143 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/0000755000175000017500000000000010011472777024466 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472777026657 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/0000755000175000017500000000000010011472777027634 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/0000755000175000017500000000000010011472777030243 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/0000755000175000017500000000000011271425773030574 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/ExtensionFilenameFilterUTest.javalibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/ExtensionFilename0000644000175000017500000003415407622026475034144 0ustar drazzibdrazzib/* * @(#)ExtensionFilenameFilterUTest.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.File; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class ExtensionFilenameFilterUTest extends TestCase { //------------------------------------------------------------------------- // Global constructs that only depend upon the class name private static final Class THIS_CLASS = ExtensionFilenameFilterUTest.class; public ExtensionFilenameFilterUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Test methods public void testInstantiate() { createFilter(); createFilter( "" ); createFilter( "a" ); createFilter( ".a" ); createFilter( ".A" ); createFilter( true ); createFilter( false ); createFilter( new String[] { "" } ); createFilter( new String[] { "B", "A" } ); createFilter( "", true ); createFilter( "", false ); createFilter( "A", true ); createFilter( "A", false ); createFilter( new String[] { "A", "a" }, true ); createFilter( new String[] { "A", "a" }, false ); } public void testInstantiateBad1() { try { createFilter( (String)null ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testInstantiateBad2() { try { createFilter( (String[])null ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testInstantiateBad3() { try { createFilter( new String[] { null } ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testInstantiateBad4() { try { createFilter( new String[] { "", null } ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testInstantiateBad5() { try { createFilter( new String[] { "a", null } ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testInstantiateBad6() { try { createFilter( (String)null, true ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testInstantiateBad7() { try { createFilter( (String[])null, false ); fail("did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { } } public void testDefaultDirectorySetting() { assertTrue( "Must allow directories by default.", createFilter().allowsDirectories() ); } public void testNullAccept1() { try { createFilter( "a" ).accept( null, null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testNullAccept2() { try { createFilter( "a" ).accept( new File( "b" ), null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } public void testEmptyAccept() { noMatchFile( createFilter(), new File( "a" ) ); } public void testAcceptCaseSensitive() { matchFile( createFilter( "A", false ), new File( "2/A" ) ); matchFile( createFilter( "A", false ), new File( "2/.A" ) ); matchFile( createFilter( "A", false ), new File( "2/asdfA" ) ); matchFile( createFilter( "A", false ), new File( "2/asdf.A" ) ); matchFile( createFilter( ".a", false ), new File( "2/b.a" ) ); matchFile( createFilter( ".a", false ), new File( "2/.a" ) ); matchFile( createFilter( ".a", false ), new File( "2/asdf.a" ) ); matchFile( createFilter( ".a", false ), new File( "2/asdf.a.a" ) ); matchFile( createFilter( ".abc", false ), new File( "2/asdf.a.abc" ) ); noMatchFile( createFilter( ".a", false ), new File( "" ) ); noMatchFile( createFilter( ".a", false ), new File( "4/asdf" ) ); noMatchFile( createFilter( ".a", false ), new File( "4/asdf.A" ) ); noMatchFile( createFilter( ".a", false ), new File( "4/.A" ) ); noMatchFile( createFilter( ".a", false ), new File( "4/.a.A" ) ); noMatchFile( createFilter( ".a", false ), new File( "4/asdf.a.A" ) ); noMatchFile( createFilter( ".a", false ), new File( "4/asdf.a." ) ); noMatchFile( createFilter( ".ABC", false ), new File( "4/asdf.a.A" ) ); noMatchFile( createFilter( ".ABC", false ), new File( "4/asdf.a.AB" ) ); noMatchFile( createFilter( ".ABC", false ), new File( "4/asdf.a.AC" ) ); } public void testAcceptCaseInsensitive() { matchFile( createFilter( "A" ), new File( "A" ) ); matchFile( createFilter( "A" ), new File( "asdfA" ) ); matchFile( createFilter( "A" ), new File( "asdf.A" ) ); matchFile( createFilter( ".a" ), new File( "b.a" ) ); matchFile( createFilter( ".a" ), new File( ".a" ) ); matchFile( createFilter( ".a" ), new File( "asdf.a" ) ); matchFile( createFilter( ".a" ), new File( "asdf.a.a" ) ); matchFile( createFilter( ".a" ), new File( "asdf.A" ) ); matchFile( createFilter( ".a" ), new File( ".A" ) ); matchFile( createFilter( ".a" ), new File( ".a.A" ) ); matchFile( createFilter( ".a" ), new File( "asdf.a.A" ) ); matchFile( createFilter( "A" ), new File( "B", "A" ) ); matchFile( createFilter( "A" ), new File( "B", "asdfA" ) ); matchFile( createFilter( "A" ), new File( "B", "asdf.A" ) ); matchFile( createFilter( ".a" ), new File( "a.b", "b.a" ) ); matchFile( createFilter( ".a" ), new File( "a.b", ".a" ) ); matchFile( createFilter( ".a" ), new File( "a.b", "asdf.a" ) ); matchFile( createFilter( ".a" ), new File( "a.b", "asdf.a.a" ) ); matchFile( createFilter( ".a" ), new File( "a.b", "asdf.A" ) ); matchFile( createFilter( ".a" ), new File( "a.b", ".A" ) ); matchFile( createFilter( ".a" ), new File( "a.b", ".a.A" ) ); matchFile( createFilter( ".a" ), new File( "a.b", "asdf.a.A" ) ); matchFile( createFilter( "A", true ), new File( "A" ) ); matchFile( createFilter( "A", true ), new File( "asdfA" ) ); matchFile( createFilter( "A", true ), new File( "asdf.A" ) ); matchFile( createFilter( ".a", true ), new File( "b.a" ) ); matchFile( createFilter( ".a", true ), new File( ".a" ) ); matchFile( createFilter( ".a", true ), new File( "asdf.a" ) ); matchFile( createFilter( ".a", true ), new File( "asdf.a.a" ) ); matchFile( createFilter( ".a", true ), new File( "asdf.A" ) ); matchFile( createFilter( ".a", true ), new File( ".A" ) ); matchFile( createFilter( ".a", true ), new File( ".a.A" ) ); matchFile( createFilter( ".a", true ), new File( "asdf.a.A" ) ); noMatchFile( createFilter( ".a" ), new File( "" ) ); noMatchFile( createFilter( ".a" ), new File( "asdf" ) ); noMatchFile( createFilter( ".a" ), new File( "asdf.a." ) ); noMatchFile( createFilter( ".a" ), new File( "asdf.aa" ) ); noMatchFile( createFilter( ".ABC" ), new File( "asdf.a.A" ) ); noMatchFile( createFilter( ".ABC" ), new File( "asdf.a.AB" ) ); noMatchFile( createFilter( ".ABC" ), new File( "asdf.a.AC" ) ); noMatchFile( createFilter( ".ABC" ), new File( "asdf.a.ACB" ) ); noMatchFile( createFilter( ".ABC" ), new File( "asdf.a.ABCD" ) ); noMatchFile( createFilter( ".a", true ), new File( "" ) ); noMatchFile( createFilter( ".a", true ), new File( "asdf" ) ); noMatchFile( createFilter( ".a", true ), new File( "asdf.a." ) ); noMatchFile( createFilter( ".ABC", true ), new File( "asdf.a.A" ) ); noMatchFile( createFilter( ".ABC", true ), new File( "asdf.a.AB" ) ); noMatchFile( createFilter( ".ABC", true ), new File( "asdf.a.AC" ) ); noMatchFile( createFilter( ".ABC", true ), new File( "asdf.a.ACB" ) ); noMatchFile( createFilter( ".ABC", true ), new File( "asdf.a.ABCD" ) ); noMatchFile( createFilter( ".a" ), new File( "a.a", "asdf" ) ); noMatchFile( createFilter( ".a" ), new File( "a.a", "asdf.a." ) ); noMatchFile( createFilter( ".ABC" ), new File( "a.a", "asdf.a.A" ) ); noMatchFile( createFilter( ".ABC" ), new File( "a.a", "asdf.a.AB" ) ); noMatchFile( createFilter( ".ABC" ), new File( "a.a", "asdf.a.AC" ) ); noMatchFile( createFilter( ".a", true ), new File( "" ) ); noMatchFile( createFilter( ".a", true ), new File( "a.a", "asdf" ) ); noMatchFile( createFilter( ".a", true ), new File( "a.a", "asdf.a." ) ); noMatchFile( createFilter( ".ABC", true ), new File( "a.ABC", "asdf.a.A" ) ); noMatchFile( createFilter( ".ABC", true ), new File( "a.ABC", "asdf.a.AB" ) ); noMatchFile( createFilter( ".ABC", true ), new File( "a.ABC", "asdf.a.AC" ) ); } public void testAcceptDirectories() { matchFile( createFilter( "A" ), new File( "." ) ); matchFile( createFilter( "A", false ), new File( "." ) ); matchFile( createFilter( "A", true ), new File( "." ) ); } public void testDontAcceptDirectories() { ExtensionFilenameFilter eff = createFilter( "A" ); eff.allowsDirectories( false ); noMatchFile( eff, new File( "." ) ); eff = createFilter( "A", true ); eff.allowsDirectories( false ); noMatchFile( eff, new File( "." ) ); eff = createFilter( "A", false ); eff.allowsDirectories( false ); noMatchFile( eff, new File( "." ) ); } protected void matchFile( ExtensionFilenameFilter eff, File f ) { File parent = getParentFile( f ); String name = f.getName(); assertTrue( "Filter must accept parent '"+parent+"' and name '"+name+"'.", eff.accept( parent, name ) ); } protected void noMatchFile( ExtensionFilenameFilter eff, File f ) { File parent = getParentFile( f ); String name = f.getName(); assertTrue( "Filter must not accept parent '"+parent+"' and name '"+name+"'.", !eff.accept( parent, name ) ); } protected ExtensionFilenameFilter createFilter() { return new ExtensionFilenameFilter(); } protected ExtensionFilenameFilter createFilter( String s ) { return new ExtensionFilenameFilter( s ); } protected ExtensionFilenameFilter createFilter( String s[] ) { return new ExtensionFilenameFilter( s ); } protected ExtensionFilenameFilter createFilter( boolean b ) { return new ExtensionFilenameFilter( b ); } protected ExtensionFilenameFilter createFilter( String s, boolean b ) { return new ExtensionFilenameFilter( s, b ); } protected ExtensionFilenameFilter createFilter( String s[], boolean b ) { return new ExtensionFilenameFilter( s, b ); } protected File getParentFile( File f ) { String pname = f.getParent(); if (pname == null) { // no parent return null; } return new File( pname ); } //------------------------------------------------------------------------- // Global static methods that don't change. public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/ExtensionFileFilterJDK12UTest.javalibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/ExtensionFileFilt0000644000175000017500000001062407622026475034116 0ustar drazzibdrazzib/* * @(#)ExtensionFileFilterJDK12UTest.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.File; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class ExtensionFileFilterJDK12UTest extends ExtensionFilenameFilterUTest { //------------------------------------------------------------------------- // Global constructs that only depend upon the class name private static final Class THIS_CLASS = ExtensionFileFilterJDK12UTest.class; public ExtensionFileFilterJDK12UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Test methods public void testNullAccept1a() { try { ((ExtensionFileFilter)createFilter( "a" )).accept( null ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException e) { } } protected void matchFile( ExtensionFilenameFilter eff, File f ) { super.matchFile( eff, f ); assertTrue( "Filter must accept file "+f+".", ((ExtensionFileFilter)eff).accept( f ) ); } protected void noMatchFile( ExtensionFilenameFilter eff, File f ) { super.noMatchFile( eff, f ); assertTrue( "Filter must not accept file "+f+".", !((ExtensionFileFilter)eff).accept( f ) ); } protected ExtensionFilenameFilter createFilter() { return new ExtensionFileFilter(); } protected ExtensionFilenameFilter createFilter( String s ) { return new ExtensionFileFilter( s ); } protected ExtensionFilenameFilter createFilter( String s[] ) { return new ExtensionFileFilter( s ); } protected ExtensionFilenameFilter createFilter( boolean b ) { return new ExtensionFileFilter( b ); } protected ExtensionFilenameFilter createFilter( String s, boolean b ) { return new ExtensionFileFilter( s, b ); } protected ExtensionFilenameFilter createFilter( String s[], boolean b ) { return new ExtensionFileFilter( s, b ); } //------------------------------------------------------------------------- // Global static methods that don't change. public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/ReadByteStreamUTest.javalibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/ReadByteStreamUTe0000644000175000017500000001450307663521306034012 0ustar drazzibdrazzib/* * @(#)ReadByteStreamUTest.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/05/23 22:37:58 $ */ public class ReadByteStreamUTest extends TestCase { //------------------------------------------------------------------------- // Global constructs that only depend upon the class name private static final Class THIS_CLASS = ReadByteStreamUTest.class; public ReadByteStreamUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Test methods public void testConstructor1() { try { new ReadByteStream( null ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor2() { try { new ReadByteStream( null, 1, 1 ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor3() { ByteArrayInputStream bais = new ByteArrayInputStream( new byte[0] ); try { new ReadByteStream( bais, 0, 1 ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor4() { ByteArrayInputStream bais = new ByteArrayInputStream( new byte[0] ); try { new ReadByteStream( bais, 1, 0 ); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor5() { byte b[] = {}; new ReadByteStream( createStream( b ), 1, 1 ); } public void testReadByteStream1() throws IOException { byte in[] = {}; ReadByteStream rbs = new ReadByteStream( createStream( in ) ); byte out[] = rbs.readByteStream(); assertEquals( "Did not read empty stream correctly", in, out ); } public void testReadByteStream3() throws IOException { byte in[] = { (byte)1, Byte.MAX_VALUE, Byte.MIN_VALUE, (byte)0 }; byte out[] = ReadByteStream.readByteStream( createStream( in ), ReadByteStream.READ_TO_END_OF_STREAM, 2 ); assertEquals( "Did not read 4 byte stream correctly", in, out ); } public void testReadByteStream4() throws IOException { byte in[] = { Byte.MAX_VALUE }; byte out[] = ReadByteStream.readByteStream( createStream( in ), ReadByteStream.READ_TO_END_OF_STREAM, 2 ); assertEquals( "Did not read 1 byte stream correctly", in, out ); } public void testReadByteStream5() throws IOException { byte in[] = { (byte)1, Byte.MAX_VALUE, Byte.MIN_VALUE }; byte out[] = ReadByteStream.readByteStream( createStream( in ), ReadByteStream.READ_TO_END_OF_STREAM, 2 ); assertEquals( "Did not read 3 byte stream correctly", in, out ); } public void testReadByteStream6() throws IOException { byte in[] = { (byte)1, Byte.MAX_VALUE, Byte.MIN_VALUE }; byte out[] = ReadByteStream.readByteStream( createStream( in ) ); assertEquals( "Did not read 3 byte stream correctly", in, out ); } //------------------------------------------------------------------------- // Helpers protected InputStream createStream( byte[] b ) { return new ByteArrayInputStream( b ); } protected void assertEquals( String msg, byte[] expected, byte[] real ) { if (expected == null) { assertNull( msg, real ); return; } assertNotNull( msg, real ); assertEquals( msg+": lengths are different.", expected.length, real.length); for (int i = 0; i < expected.length; ++i) { assertEquals( msg+": index "+i+" is different.", expected[i], real[i] ); } } //------------------------------------------------------------------------- // Global static methods that don't change. public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/AllFileFilterJDK12UTest.javalibgroboutils-java-5.orig/util-io/sources/ut/net/sourceforge/groboutils/util/io/v1/AllFileFilterJDK10000644000175000017500000000637207622026475033620 0ustar drazzibdrazzib/* * @(#)AllFileFilterJDK12UTest.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.io.v1; import java.io.File; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since 0.9.1d Alpha (sometime in 2001) * @version $Date: 2003/02/10 22:52:45 $ */ public class AllFileFilterJDK12UTest extends TestCase { //------------------------------------------------------------------------- // Global constructs that only depend upon the class name private static final Class THIS_CLASS = AllFileFilterJDK12UTest.class; public AllFileFilterJDK12UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Test methods public void testInstantiate() { new AllFileFilter(); } public void testNullAccept() { AllFileFilter aff = new AllFileFilter(); assertTrue( "must always return null.", aff.accept( null ) ); assertTrue( "must always return null.", aff.accept( null, null ) ); } //------------------------------------------------------------------------- // Global static methods that don't change. public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/util-io/sources/ut/about.txt0000644000175000017500000000012207521071677023231 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/util-io/sources/iut/0000755000175000017500000000000011271425773021531 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/iut/about.txt0000644000175000017500000000021107521071677023401 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/util-io/sources/eut/0000755000175000017500000000000011271425773021525 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/sources/eut/about.txt0000644000175000017500000000015307521071677023402 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/util-io/CHANGES.TXT0000644000175000017500000000432307622026474020720 0ustar drazzibdrazzib v1.0.0 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Created two primary javac structures - one for jdk 1.1, and one for jdk1.2+. * Integrated the GroboUtils 'util.io' hierarchy into this hierarchy. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/util-io/xdocs/0000755000175000017500000000000011271425773020365 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-io/xdocs/summary.xml0000644000175000017500000000447107655132717022616 0ustar drazzibdrazzib util-io net.sourceforge.groboutils.util.io.v1 Groups of JDK 1.1 and 1.2 I/O helper classes. File Filters Helper classes for generating filters for the java.io.File class. Input Stream Generators Classes which generate new IO Stream from a given relative URL. Example implementations are provided, including File, URL, Classpath Resource, and Hashtable. Mime Encoding Streams Input and Output streams for Mime encoded text. Read Stream Utilities for reading an entire stream in different formats. WriterOutputStream The basic JDK has classes which convert from an OutputStream to a Writer, but does not provide any implementation for the reverse. This class fills that gap. PropertyDatabase Has a concept of pre-defined properties, and user-defined properties. As many "internal" properties may be added to the database, but any properties the user sets will be stored in their own property file. 03-May-2003: Need to finish up tests and documentation before entering RC 1. libgroboutils-java-5.orig/util-io/xdocs/about.xml0000644000175000017500000000255507655132717022234 0ustar drazzibdrazzib About $Date: 2003/05/04 06:40:15 $ Matt Albrecht Groups of JDK 1.1 and 1.2 I/O helper classes.

      Helper classes for generating filters for the java.io.File class. Classes which generate new IO Stream from a given relative URL. Example implementations are provided, including File, URL, Classpath Resource, and Hashtable. Input and Output streams for Mime encoded text. Utilities for reading an entire stream in different formats. The basic JDK has classes which convert from an OutputStream to a Writer, but does not provide any implementation for the reverse. This class fills that gap. Has a concept of pre-defined properties, and user-defined properties. As many "internal" properties may be added to the database, but any properties the user sets will be stored in their own property file.
    libgroboutils-java-5.orig/util-io/xdocs/requirements.xml0000644000175000017500000000054107657022156023633 0ustar drazzibdrazzib Requirements $Date: 2003/05/09 21:58:06 $ Matt Albrecht

    The primary purpose of the subpackage is to be a clearing house for all I/O related utilities used by other subpackages.

    libgroboutils-java-5.orig/util-io/xdocs/design.xml0000644000175000017500000000026607655132717022370 0ustar drazzibdrazzib Design $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/util-io/xdocs/index.xml0000644000175000017500000000072707736117715022231 0ustar drazzibdrazzib I/O Utilities $Date: 2003/09/29 21:10:37 $
  • About IO
  • Requirements
  • Using
  • libgroboutils-java-5.orig/util-io/xdocs/using.xml0000644000175000017500000000554407737323757022257 0ustar drazzibdrazzib Using $Date: 2003/10/03 16:46:39 $ Matt Albrecht
    Contents
    1. File Filters
    2. Stream Generators
    3. Mime Streams
    4. Stream Reader Helpers
    5. FileUtils
    6. Property Database
    File Filters

    Back to top

    The various Java versions provide interfaces for file filters, which are used in the java.io.File methods and in Swing file choosers. However, there isn't an easy way to create a robust filter.

    These classes attempt to fill the gap in the API.

    Stream Generators

    Back to top

    I have discovered may occations when a generic API of mine has one input stream referencing some other input stream. As an example, XML allows for inclusion of other XML documents through the SYSTEM entity tag. Being able to load these other resources without knowing the details behind where they come from seems incredibly useful in these situations.

    The Stream Generator set of classes try to fill this need by providing a factory to create new InputStreams.

    Mime Streams

    Back to top

    MIME-conversion streams. Nothing special, and nothing particularly efficient, either. The JSP libraries have better versions, so I suggest using those.

    Stream Reader Helpers

    Back to top

    How many times do you find the need to read the entire contents from a stream or reader? The ReadByteStream and ReadStringStream classes provide the relatively trivial (yet repetitive) task of reading entire contents of a stream or reader.

    FileUtils

    Back to top

    Provides simple helper utilities related to file systems, such as:

    1. copy from one file to another file;
    2. copy one directory to another directory, recursively;
    3. find all files matching a filter set that are in a directory, recursively.

    Property Database

    Back to top

    The PropertyDatabase class provides means of having a set of default properties, and allowing for per-user alterations. Useful for UIs that allow for user configurable options.

    libgroboutils-java-5.orig/build.xml0000644000175000017500000002656610040160453017503 0ustar drazzibdrazzib ]> &inc._init; ################################################################### # Core build file for the GroboUtils Sourceforge project. # # The 'make.bat' and 'make.sh' scripts can correctly invoke this # build file using the expected library dependencies. # # To compile an individual project, use: # $$ ./make.sh -f <project name>/build.xml # "-Dbasedir=<absolute name of project's dir>" # # The available project targets include: # help this display # all runs clean & deploy # main runs deploy (default target) # clean calls the builds for each of the sub-projects, # invoking the 'clean' target. # deploy calls the builds for each of the sub-projects, # invoking the 'deploy' target. It will invoke # these builds in the correct dependency order. # # A complete build needs to call this ant build file several times, # in the following order (Windows and Mac users will need to adjust # the style to suit your platform): # # $$ JAVA_HOME=my/jdk1.2 # $$ ./make.sh deploy # $$ JAVA_HOME=my/jdk1.3 # $$ ./make.sh deploy # $$ JAVA_HOME=my/jdk1.4 # $$ ./make.sh deploy # $$ ./make.sh -f _projects/build.xml # # ################################################################### libgroboutils-java-5.orig/testing-tp/0000755000175000017500000000000011271425773017761 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/deployed.ant-inc.xml0000644000175000017500000000032107547162334023636 0ustar drazzibdrazzib libgroboutils-java-5.orig/testing-tp/build.xml0000644000175000017500000001076607561622145021613 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/testing-tp/log4j.properties0000644000175000017500000000047307521071666023123 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.tp=DEBUG libgroboutils-java-5.orig/testing-tp/sources/0000755000175000017500000000000010011472760021431 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ait/0000755000175000017500000000000011271425773022221 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ait/tp/0000755000175000017500000000000011271425773022644 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ait/tp/build.xml0000644000175000017500000000000007521071666024454 0ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ait/about.txt0000644000175000017500000000021007521071666024066 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/testing-tp/sources/dev/0000755000175000017500000000000010011472760022207 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/net/0000755000175000017500000000000010011472760022775 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/0000755000175000017500000000000010011472760025320 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472760027511 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/0000755000175000017500000000000010011472760030134 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/v1/0000755000175000017500000000000011271425773030475 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/v1/log/0000755000175000017500000000000011271425773031256 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/v1/log/LogTPFactory.javalibgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/v1/log/LogTPFactory.j0000644000175000017500000000400607622026455033745 0ustar drazzibdrazzib/* * @(#)LogTPFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.tp.v1.log; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocTPFactory; /** * Test Procedure entry point. Generates Test Procedure documentation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:29 $ * @since July 21, 2002 */ public class LogTPFactory implements AutoDocTPFactory { public AutoDocTP createTP( Class owner ) { if (owner == null) { throw new IllegalArgumentException("no null owner allowed."); } return new LogTP( ".", owner ); } } libgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/v1/log/LogTP.java0000644000175000017500000000733407622026455033114 0ustar drazzibdrazzib/* * @(#)LogTPLog.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.tp.v1.log; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; import java.io.PrintWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; /** * Test Procedure entry point. Generates Test Procedure documentation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:29 $ * @since July 21, 2002 */ public class LogTP implements AutoDocTP { private PrintWriter out; private int overalCount = 0; private int stepCount = 0; private int setupCount = 0; private int teardownCount = 0; public LogTP( String baseDir, Class owner ) { PrintWriter pw = null; if (baseDir != null && owner != null) { try { pw = new PrintWriter( new FileWriter( new File( baseDir, "TP-"+owner.getName()+".log" ) ) ); } catch (IOException ioe) { pw = null; } } if (pw == null) { pw = new PrintWriter( System.out ); } setOutput( pw ); } /** * Defines a step which occurs during the test setup phase. * * @param description the text describing the step. */ public synchronized void setupStep( String description ) { printStep( "setup", description, ++this.setupCount ); } /** * Defines a step which occurs during the test tear-down phase. * * @param description the text describing the step. */ public synchronized void teardownStep( String description ) { printStep( "teardown", description, ++this.teardownCount ); } /** * Defines a step which occurs during the test proper. * * @param description the text describing the step. */ public synchronized void step( String description ) { printStep( "test step", description, ++this.stepCount ); } protected synchronized void printStep( String stepDesc, String text, int thisStepCount ) { ++this.overalCount; this.out.println( this.overalCount + ". "+stepDesc+": " +thisStepCount+". "+text ); } protected void setOutput( PrintWriter pw ) { this.out = pw; } } libgroboutils-java-5.orig/testing-tp/sources/dev/net/sourceforge/groboutils/tp/v1/package.html0000644000175000017500000000013107521071666032752 0ustar drazzibdrazzibnet.sourceforge.groboutils.tp.v1 libgroboutils-java-5.orig/testing-tp/sources/dev/META-INF/0000755000175000017500000000000010011472760023347 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/dev/META-INF/services/0000755000175000017500000000000011271425773025205 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-tp/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.spi.AutoDocTPFactorylibgroboutils-java-5.orig/testing-tp/sources/dev/META-INF/services/net.sourceforge.groboutils.autodo0000644000175000017500000000043307521071666033723 0ustar drazzibdrazzib# Service Provider Interface for AutoDocITFactory # # Author: Matt Albrecht groboclown@users.sourceforge.net # Version: $Date: 2002/07/28 22:44:06 $ # Since: July 6, 2002 net.sourceforge.groboutils.tp.v1.log.LogTPFactory libgroboutils-java-5.orig/testing-tp/sources/ut/0000755000175000017500000000000011271425773022074 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ut/net/0000755000175000017500000000000010011472761022650 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/0000755000175000017500000000000010011472761025173 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472761027364 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/0000755000175000017500000000000010011472761030007 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/v1/0000755000175000017500000000000010011472761030335 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/v1/log/0000755000175000017500000000000011271425773031130 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/v1/log/LogTPUTest.javalibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/v1/log/LogTPUTest.java0000644000175000017500000001165507665402663033762 0ustar drazzibdrazzib/* * @(#)LogTPUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.tp.v1.log; import java.io.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the LogTP class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:55 $ * @since July 21, 2002 */ public class LogTPUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = LogTPUTest.class; public LogTPUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); } //------------------------------------------------------------------------- // Tests public void testPrintStep1() { LogTP tp = new LogTP( null, null ); StringWriter sw = new StringWriter(); tp.setOutput( new PrintWriter( sw ) ); tp.printStep( "a", "text", 0 ); String s = sw.toString(); assertTrue( "Did not print right text (got "+s+").", s.indexOf( "1. a: 0. text" ) >= 0 ); } public void testPrintStep2() { LogTP tp = new LogTP( null, null ); StringWriter sw = new StringWriter(); tp.setOutput( new PrintWriter( sw ) ); tp.printStep( "a", "text", 0 ); sw = new StringWriter(); tp.setOutput( new PrintWriter( sw ) ); tp.printStep( "b", "other", 18 ); String s = sw.toString(); assertTrue( "Did not print right text (got "+s+").", s.indexOf( "2. b: 18. other" ) >= 0 ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocTPUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new LogTP( ".", THIS_CLASS ); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() { return new LogTP( null, THIS_CLASS ); } } ); suite.addFactory( new CxFactory( "C" ) { public Object createImplObject() { return new LogTP( ".", THIS_CLASS ); } } ); suite.addFactory( new CxFactory( "D" ) { public Object createImplObject() { return new LogTP( null, null ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/v1/log/LogTPFactoryUTest.javalibgroboutils-java-5.orig/testing-tp/sources/ut/net/sourceforge/groboutils/tp/v1/log/LogTPFactoryUTe0000644000175000017500000000723507665402663034022 0ustar drazzibdrazzib/* * @(#)LogTPFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.tp.v1.log; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.spi.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the LogTPFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/29 13:05:55 $ * @since July 21, 2002 */ public class LogTPFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = LogTPFactoryUTest.class; public LogTPFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new LogTPFactory(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocTPFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new LogTPFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-tp/sources/ut/about.txt0000644000175000017500000000012207521071666023743 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/testing-tp/sources/iut/0000755000175000017500000000000011271425773022245 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/iut/about.txt0000644000175000017500000000021107521071666024113 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/testing-tp/sources/eut/0000755000175000017500000000000011271425773022241 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/sources/eut/about.txt0000644000175000017500000000015307521071666024114 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/testing-tp/CHANGES.TXT0000644000175000017500000000421407740047473021436 0ustar drazzibdrazzib v1.0.0alpha2 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Isolated the 'testing.tp' hierarchy. * Moved the license from LGPL to MIT. * Task 79415: Improved documentation. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/testing-tp/xdocs/0000755000175000017500000000000011271425773021101 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-tp/xdocs/summary.xml0000644000175000017500000000122007740047474023317 0ustar drazzibdrazzib testing-tp net.sourceforge.groboutils.tp.v1 Test Procedure generation classes. Includes SPI connectors for the AutoDoc framework. 23-Aug-2003: Currently examining the viability of the sub-project, as to whether it is the right application of technology. libgroboutils-java-5.orig/testing-tp/xdocs/about.xml0000644000175000017500000000046107662237461022742 0ustar drazzibdrazzib About TP $Date: 2003/05/19 20:31:45 $ Matt Albrecht Test Procedure generation classes. Includes SPI connectors for the AutoDoc framework. libgroboutils-java-5.orig/testing-tp/xdocs/requirements.xml0000644000175000017500000000042707662237462024356 0ustar drazzibdrazzib Requirements for TP $Date: 2003/05/19 20:31:46 $

    The TP area is still being developed beyond the AutoDoc integration.

    libgroboutils-java-5.orig/testing-tp/xdocs/design.xml0000644000175000017500000000077507740047474023111 0ustar drazzibdrazzib Design of TP $Date: 2003/10/05 17:05:00 $ Matt Albrecht
    Current design

    Right now, the implementation of TP does nothing more than capture all the data passed to it to a file. Future versions will allow for processing of this data.

    JavaDoclets are also being examined as an alternative technology for TP.

    libgroboutils-java-5.orig/testing-tp/xdocs/index.xml0000644000175000017500000000072307662237462022741 0ustar drazzibdrazzib Test Procedure extension to AutoDoc $Date: 2003/05/19 20:31:46 $
  • About TP
  • Requirements
  • Design
  • Using
  • libgroboutils-java-5.orig/testing-tp/xdocs/using.xml0000644000175000017500000000067407740047474022763 0ustar drazzibdrazzib Using Test Procedures $Date: 2003/10/05 17:05:00 $ Matt Albrecht
    Integration with AutoDoc

    To integrate TP with AutoDoc, you only need to add the PMTI Jar file to the classpath. The AutoDoc framework will automatically detect the PMTI SPI settings.

    libgroboutils-java-5.orig/TODO.txt0000644000175000017500000000032107737323756017177 0ustar drazzibdrazzibRemaining TODO list (in approximate priority order): 1. Finish adding/upgrading/completing subprojects: a. util-states (may disappear) i. testing-mbtf 2. See TODOs in each sub-project libgroboutils-java-5.orig/util-thread/0000755000175000017500000000000011271425773020105 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/deployed.ant-inc.xml0000644000175000017500000000032407547162336023767 0ustar drazzibdrazzib libgroboutils-java-5.orig/util-thread/build.xml0000644000175000017500000001122007561622147021723 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.util-datastruct; libgroboutils-java-5.orig/util-thread/TODO.txt0000644000175000017500000000025207552134632021410 0ustar drazzibdrazzibTODO for Thread (in approximate order of priority): 1. Create more tests. 2. Run code-coverage numbers. 3. Convert to Release Candidate from Alpha version.libgroboutils-java-5.orig/util-thread/log4j.properties0000644000175000017500000000050407521071703023232 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.util.thread=DEBUG libgroboutils-java-5.orig/util-thread/sources/0000755000175000017500000000000010011473006021547 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ait/0000755000175000017500000000000011271425773022345 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ait/about.txt0000644000175000017500000000021007521071703024202 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/util-thread/sources/dev/0000755000175000017500000000000011271425773022346 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/dev/net/0000755000175000017500000000000010011473005023112 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/0000755000175000017500000000000010011473005025435 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011473005027626 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/0000755000175000017500000000000010011473005030603 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/0000755000175000017500000000000010011473006032053 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/0000755000175000017500000000000011271425773032422 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/BackgroundProcess.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/Backgrou0000644000175000017500000002505007622026500034072 0ustar drazzibdrazzib/* * @(#)BackgroundProcess.java 1.0.0 11/17/2000 - 13:41:07 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; import java.lang.reflect.Method; /** * Creates and executes the given process. Ensures that all the output * is properly read without overflowing or dead-locking the process. * Outside of the streaming, this class has an identical API to that * of {@link java.lang.Process}. *

    * Creation of a background process begins at the creation of this object. *

    *

    Changes for 0.9.1d

    *
      *
    • Each IOThreadRunner which handles the background process's * IO have been changed such that they now close the streams when * an EOL is encountered, and have no delay between reads. *
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @since June 4, 2000 (0.9.1d Alpha) * @version $Date: 2003/02/10 22:52:48 $ */ public class BackgroundProcess { private Process proc; private OutputStream stdIn; private PipedInputStream outReader; private PipedOutputStream outWriter; private PipedInputStream errReader; private PipedOutputStream errWriter; private IOThreadRunner outThread; private IOThreadRunner errThread; /** * * * @see java.lang.Runtime#exec( String ) */ public BackgroundProcess( String command ) throws IOException { setupProcess( exec( command, null, null ) ); } /** * @see java.lang.Runtime#exec( String[] ) */ public BackgroundProcess( String[] cmdarray ) throws IOException { setupProcess( exec( cmdarray, null, null ) ); } /** * @see java.lang.Runtime#exec( String[], String[], File ) */ public BackgroundProcess( String[] cmdarray, String[] envp, File dir ) throws IOException { setupProcess( exec( cmdarray, envp, dir ) ); } /** * @see java.lang.Runtime#exec( String, String[], File ) */ public BackgroundProcess( String command, String[] envp, File dir ) throws IOException { setupProcess( exec( command, envp, dir ) ); } /** * @see java.lang.Runtime#exec( String[], String[] ) */ public BackgroundProcess( String[] cmdarray, String[] envp ) throws IOException { setupProcess( exec( cmdarray, envp, null ) ); } /** * @see java.lang.Runtime#exec( String, String[] ) */ public BackgroundProcess( String command, String[] envp ) throws IOException { setupProcess( exec( command, envp, null ) ); } /** * Initializes the background process with an existing process. */ public BackgroundProcess( Process p ) throws IOException { if (p == null) { throw new IllegalArgumentException("no null args"); } setupProcess( p ); } /** * Get the OutputStream that is sent to the StdIn of the process. */ public OutputStream getStdIn() { return this.stdIn; } /** * Get the InputStream that retrieves the data from the StdOut of the * process. */ public InputStream getStdOut() { return this.outReader; } /** * Get the InputStream that retrieves the data from the StdErr of the * process. */ public InputStream getStdErr() { return this.errReader; } /** * @see java.lang.Process#destroy() */ public void destroy() { this.proc.destroy(); } /** * @see java.lang.Process#exitValue() */ public int exitValue() { return this.proc.exitValue(); } /** * @see java.lang.Process#waitFor() */ public int waitFor() throws InterruptedException { return this.proc.waitFor(); } //------------------------------------------------- // Protected methods /** * Initalize the process for internal use. */ protected void setupProcess( Process p ) throws IOException { this.proc = p; this.stdIn = p.getOutputStream(); this.outReader = new PipedInputStream(); this.outWriter = new PipedOutputStream( this.outReader ); this.errReader = new PipedInputStream(); this.errWriter = new PipedOutputStream( this.errReader ); this.outThread = new IOThreadRunner( p.getInputStream(), this.outWriter ); this.outThread.setCloseInputOnStop( true ); this.outThread.setCloseOutputOnStop( true ); this.outThread.getThread().setSleepTime( 0 ); this.errThread = new IOThreadRunner( p.getErrorStream(), this.errWriter ); this.errThread.setCloseInputOnStop( true ); this.errThread.setCloseOutputOnStop( true ); this.errThread.getThread().setSleepTime( 0 ); this.outThread.start(); this.errThread.start(); } /** * Invoke the correct Exec method for the given parameters. */ protected Process exec( String cmd, String[] env, File dir ) throws IOException { Runtime r = Runtime.getRuntime(); Process p; if (dir == null) { if (env == null) { p = r.exec( cmd ); } else { p = r.exec( cmd, env ); } } else { p = reflectExec( cmd, env, dir ); if (p == null) { p = r.exec( cmd, setPWD( env, dir ) ); } } return p; } /** * */ protected static Process exec( String[] cmd, String[] env, File dir ) throws IOException { Runtime r = Runtime.getRuntime(); Process p; if (dir == null) { if (env == null) { p = r.exec( cmd ); } else { p = r.exec( cmd, env ); } } else { p = reflectExec( cmd, env, dir ); if (p == null) { p = r.exec( cmd, setPWD( env, dir ) ); } } return p; } /** * Attempts to invoke the JDK 1.3 exec method with the given dir. * cmd is either a String or String[] type. * * @return the generated Process. If the process is null, * then another technique must be used to execute the command. */ protected static Process reflectExec( Object cmd, String[] env, File dir ) throws IOException { try { Runtime r = Runtime.getRuntime(); Method m = r.getClass().getMethod( "exec", new Class[] { cmd.getClass(), String[].class, File.class } ); if (m == null) { return null; } return (Process)m.invoke( r, new Object[] { cmd, env, dir } ); } catch (java.lang.reflect.InvocationTargetException ite) { Throwable t = ite.getTargetException(); if (t instanceof IOException) { throw (IOException)t; } if (t instanceof RuntimeException) { throw (RuntimeException)t; } if (t instanceof Error) { throw (Error)t; } // else swallow it t.printStackTrace(); } catch (IllegalAccessException e) { // gulp! } catch (NoSuchMethodException e) { // gulp! } catch (IllegalArgumentException e) { // gulp! } /* allow this to be thrown - it indicates a programatic error catch (NullPointerException e) { } */ /* allow this to be thrown catch (ExceptionInInitializerError e) { } */ return null; } /** * Don't change env! */ protected static String[] setPWD( String env[], File dir ) { String tmp[]; String pwd = "PWD="+dir.getAbsolutePath(); if (env == null) { tmp = new String[] { pwd }; } else { int len = env.length; tmp = new String[ len ]; System.arraycopy( env, 0, tmp, 0, len ); String s[] = new String[ len + 1 ]; for (int i = 0; i < len; ++i) { if (tmp[i].startsWith( "PWD=" )) { tmp[i] = pwd; s = null; break; } else { s[i] = tmp[i]; } } if (s != null) { s[ env.length ] = pwd; tmp = s; } } return tmp; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/IThreadObjectListener.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/IThreadO0000644000175000017500000000351207622026500033773 0ustar drazzibdrazzib/* * @(#)IThreadObjectListener.java 1.0.0 11/17/2000 - 13:42:02 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; /** * * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since November 17, 2000 * @version $Date: 2003/02/10 22:52:48 $ */ public interface IThreadObjectListener extends IObjectListener { //---------------------------- // Public data //---------------------------- // Public abstract methods /** * Initializes the listener when it is first created. */ public void initialize( Object o ); } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/IObjectListener.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/IObjectL0000644000175000017500000000346107622026500033772 0ustar drazzibdrazzib/* * @(#)IObjectListener.java 1.0.0 11/17/2000 - 13:41:07 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; /** * * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since November 17, 2000 * @version $Date: 2003/02/10 22:52:48 $ */ public interface IObjectListener { //---------------------------- // Public data //---------------------------- // Public abstract methods /** * Called when a listen event is sent to this listener. */ public void processObject( Object o ); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/package.htmllibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/package.0000644000175000017500000000026607521071704034014 0ustar drazzibdrazzibnet.sourceforge.groboutils.util.thread.v1 A collection of classes to aid in speeding the development of threaded applications. ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/TimedProcess.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/TimedPro0000644000175000017500000001331507622026501034062 0ustar drazzibdrazzib/* * @(#)TimedProcess.java * * Copyright (C) 2001,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; /** * A Utility to run a task in a thread, and to kill it if the thread runs * too long. This will first attempt an interrupt() on the thread. If that * doesn't work, then a stop() will be executed. This is a well-documented * bad practice, so you have been warned! * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:49 $ * @since 15-Mar-2002 */ public class TimedProcess { protected static TimedProcess s_instance = new TimedProcess(); public static final int REASONABLE_TIME = 500; /** * Implement this interface to have your own method for killing the * runner and thread. The caller will perform the Thread.join() manually. * If the thread is still running after every possible attempt to stop * the thread has occured (run this interface, and join), then a stop() * will be called on the thread. */ public static interface RunnableKiller { public void killRunnable( Runnable r, Thread t ); } private static class InterruptRunnableKiller implements RunnableKiller { public void killRunnable( Runnable r, Thread t ) { t.interrupt(); } } private RunnableKiller interruptor = new InterruptRunnableKiller(); protected TimedProcess() { // do nothing } public static TimedProcess getInstance() { return s_instance; } /** * Runs the given process in a Thread. If it does not stop within the * specified time, then attempts will be made to kill the thread * (see earlier text). If the process did not complete in the specified * time, an InterruptedException will be thrown. * * @exception InterruptedException if the process did not complete within * the given time frame. */ public void runTimed( Runnable process, long waitTimeMillis ) throws InterruptedException { runTimed( process, waitTimeMillis, this.interruptor ); } /** * Runs the given process in a Thread. If it does not stop within the * specified time, then attempts will be made to kill the thread * (see earlier text). If the process did not complete in the specified * time, an InterruptedException will be thrown. * * @exception InterruptedException if the process did not complete within * the given time frame. */ public void runTimed( Runnable process, long waitTimeMillis, RunnableKiller processEnder ) throws InterruptedException { if (processEnder == null || process == null || waitTimeMillis <= 0L) { throw new IllegalArgumentException("no null args"); } Thread t = new Thread( process, "TimedProcess" ); setupThread( t ); t.start(); joinThread( t, waitTimeMillis ); if (t.isAlive()) { stopThread( t, process, processEnder ); throw new InterruptedException( "Process did not end within "+ waitTimeMillis+" milliseconds." ); } } /** * */ protected void setupThread( Thread t ) { // do nothing } /** * */ protected void stopThread( Thread t, Runnable process, RunnableKiller processEnder ) { processEnder.killRunnable( process, t ); joinThread( t, REASONABLE_TIME ); if (t.isAlive()) { // We'll give it one more shot before we really kill it. t.interrupt(); joinThread( t, REASONABLE_TIME ); if (t.isAlive()) { // ok, that's enough. // Let's do this the hard way. t.stop(); // we know this is bad, but do it anyway if (t.isAlive()) { throw new IllegalStateException( "After stopping the thread, the thread still lives. "+ "The thread cannot be killed." ); } } } } protected void joinThread( Thread t, long joinTime ) { try { t.join( joinTime ); } catch (InterruptedException e) { // ignore } } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/LoopThread.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/LoopThre0000644000175000017500000002223507622026500034073 0ustar drazzibdrazzib/* * @(#)LoopThread.java 0.9.0 06/02/2000 - 23:55:23 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; /** * For threads which loop endlessly (which is a common thing), this * class implements the pause, start, and stop routines since JDK 1.2 * deprecated theirs. *

    * This class delegates the Thread object, so that this class doesn't * have to emulate all those thread methods. In this way, a LoopThread * should act just like a Thread. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since June 4, 2000 * @version $Date: 2003/02/10 22:52:48 $ */ public class LoopThread { public static final long MILLI_IN_SECOND = 1000; /* thread state: request a pause */ private boolean tryPause = false; /* thread state: request a stop */ private boolean tryStop = false; /* thread state: is it paused? */ private boolean isPaused = false; /* thread state: is it running? */ private boolean isRunning = false; /* wait/notify object for paused thread */ private Object pauseObject = new Object(); /* delay time to sleep */ private long sleepTime = 6 * MILLI_IN_SECOND; /* Thread which runs in a loop */ private Thread thisThread; /* the runnable to be executed at each loop */ private Runnable runnable; /** * The runnable class - keep it private so no one * can directly access it in a thread but us. */ private class LoopRunnable implements Runnable { public void run() { isRunning = true; isPaused = false; do { // this slows things down, but we're // a low priority anyway, so it doesn't really matter, // besides, it makes the check more than safe. synchronized( pauseObject ) { if (tryPause) { isPaused = true; try { pauseObject.wait(); } catch (InterruptedException ie) { // stop execution tryStop = true; } isPaused = false; // after pausing, we should check if we've been // stopped. continue; } } // sleep if (sleepTime > 0 && !tryStop) { //System.out.println("[Sleeping for "+sleepTime+" milliseconds]"); try { Thread.sleep( sleepTime ); } catch (InterruptedException ie) {} } // Run the runnable if (!tryStop) { //System.out.println("[Running loop]"); runnable.run(); } } while (!tryStop); isRunning = false; } } /** * Used in case the implementing class needs to postpone initialization * until after the LoopThread construction. */ public LoopThread() { this.thisThread = new Thread( new LoopRunnable() ); } /** * */ public LoopThread( Runnable loop ) { this.runnable = loop; this.thisThread = new Thread( new LoopRunnable() ); } /** * */ public LoopThread( Runnable loop, String threadName ) { this.runnable = loop; this.thisThread = new Thread( new LoopRunnable() ); } /** * */ public LoopThread( Runnable loop, ThreadGroup group ) { this.runnable = loop; this.thisThread = new Thread( group, new LoopRunnable() ); } /** * */ public LoopThread( Runnable loop, ThreadGroup group, String threadName ) { this.runnable = loop; this.thisThread = new Thread( group, new LoopRunnable(), threadName ); } /** * @see java.lang.Thread#getPriority() */ public int getPriority() { return this.thisThread.getPriority(); } /** * * @see java.lang.Thread#setPriority( int ) */ public void setPriority( int priority ) { this.thisThread.setPriority( priority ); } /** * * @see java.lang.Thread#getThreadGroup() */ public ThreadGroup getThreadGroup() { return this.thisThread.getThreadGroup(); } /** * * @see java.lang.Thread#isAlive() */ public boolean isAlive() { return this.thisThread.isAlive(); } /** * * @see java.lang.Thread#isDaemon() */ public boolean isDaemon() { return this.thisThread.isDaemon(); } /** * * @see java.lang.Thread#setDaemon( boolean ) */ public void setDaemon( boolean on ) { this.thisThread.setDaemon( on ); } /** * * @see java.lang.Thread#join() */ public void join() throws InterruptedException { if (this.isRunning) { throw new InterruptedException("can't join - thread is running"); } this.thisThread.join(); } /** * Sets the runnable instance after construction. It cannot be * changed once the thread is running. */ public void setRunnable( Runnable run ) { if (this.isRunning) { throw new IllegalStateException("can't change a running thread's "+ "runnable" ); } this.runnable = run; } /** * * @see java.lang.Thread#start() */ public void start() { if (this.isRunning) { throw new IllegalStateException("can't start a running thread"); } this.tryPause = false; this.tryStop = false; this.thisThread.start(); } /** * A non-deprecated, nice-to-the-system, thread suspension method. * * @see java.lang.Thread#suspend() */ public void suspend() { if (this.tryStop || !this.isRunning) { throw new IllegalStateException("Cannot pause a stopped thread"); } this.tryPause = true; } /** * * @see java.lang.Thread#resume() */ public void resume() { synchronized( this.pauseObject ) { if (!this.isPaused) return; this.tryPause = false; this.pauseObject.notifyAll(); } } /** * * @see java.lang.Thread#stop() */ public void stop() { if (!this.isRunning) { return; // tried stopping a stopped thread! } this.tryStop = true; // In case the thread is paused, we should resume it to have it // quit naturally. resume(); } /** * */ public boolean isPaused() { return this.isPaused; } /** * */ public boolean isRunning() { return this.isRunning; } /** * Retrieves the sleep time in seconds. */ public int getSleepTime() { return (int)(this.sleepTime / MILLI_IN_SECOND); } /** * Sets the sleep time in seconds. */ public void setSleepTime( int seconds ) { this.sleepTime = seconds * MILLI_IN_SECOND; } /** * Sets the sleep time in milliseconds. */ public void setSleepTimeMillis( long millis ) { this.sleepTime = millis; } /** * Retrieves the sleep time in milliseconds. */ public long getSleepTimeMillis() { return this.sleepTime; } /** * * @see java.lang.Thread#toString() */ public String toString() { return this.thisThread.toString(); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/QueueThread.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/QueueThr0000644000175000017500000002257707622026500034112 0ustar drazzibdrazzib/* * @(#)QueueThread.java 0.9.0 06/04/2000 - 13:31:52 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; import net.sourceforge.groboutils.util.datastruct.v1.SynchQueue; /** * For threads which endlessly process events from a SynchQueue. This * is a common technique for thread pooling. *

    * Users must make a implementation of IObjectListener. * If the user does not give a SynchQueue, it is created for them. * Once the QueueThread is created, the queue and the listener cannot * be changed. *

    * By default, the underlying {@link LoopThread} does not sleep between events, * it is a daemon thread, runs on the lowest thread priority, and has * not started yet. Of course, this can all be changed. *

    * It is advisable not to use the methods {@link * LoopThread#setSleepTime( int )} or * {@link LoopThread#setSleepTimeMillis( long )}, since these will cause the * QueueThread to not respond to incoming requests during this sleep * time. However, there may be occations when this is necessary, so this is * left available to the user. *

    * Since the {@link SynchQueue#dequeue()} method can wait indefinitely, you may * opt to set the dequeue's timeout to something other than 0. Without setting * this, the thread may wait indefinitely for an incoming element to the queue * without ever checking for a {@link LoopThread#stop()} or * {@link LoopThread#suspend()} signal. Thanks to * Dominique Gallot for pointing * this out. *

    * After a {@link LoopThread#stop()} is invoked, you may allow the * object listener to finish processing the remaining elements in the * inner queue by calling {@link #processRemaining()}. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since June 4, 2000 * @version $Date: 2003/02/10 22:52:48 $ */ public class QueueThread extends LoopThread { private IObjectListener m_objListener = null; private SynchQueue m_queue = null; private boolean m_isProcessingObject = false; private long m_timeout = 0; private int m_nanos = 0; /** * The runnable class - keep it private so no one * can directly access it in a thread but us. */ private class QueueRunnable implements Runnable { public void run() { if (m_queue.isEmpty()) { m_isProcessingObject = false; } try { Object o = m_queue.dequeue( m_timeout, m_nanos ); m_isProcessingObject = true; m_objListener.processObject( o ); if (m_queue.isEmpty()) { m_isProcessingObject = false; } } catch (InterruptedException ie) { // whoops - how do we handle this? } } } //-------------------------------------------------------------- // Constructors /** * */ public QueueThread( IObjectListener ol ) { this( ol, new SynchQueue() ); } /** * */ public QueueThread( IObjectListener ol, SynchQueue sq ) { super(); initialize( ol, sq ); } /** * */ public QueueThread( IObjectListener ol, ThreadGroup tg ) { this( ol, new SynchQueue(), tg ); } /** * */ public QueueThread( IObjectListener ol, SynchQueue sq, ThreadGroup tg ) { super( null, tg ); initialize( ol, sq ); } /** * */ public QueueThread( IObjectListener ol, String threadName ) { this( ol, new SynchQueue(), threadName ); } /** * */ public QueueThread( IObjectListener ol, SynchQueue sq, String threadName ) { super( null, threadName ); initialize( ol, sq ); } /** * */ public QueueThread( IObjectListener ol, ThreadGroup tg, String threadName ) { this( ol, new SynchQueue(), tg, threadName ); } /** * */ public QueueThread( IObjectListener ol, SynchQueue sq, ThreadGroup tg, String threadName ) { super( null, tg, threadName ); initialize( ol, sq ); } //-------------------------------------------------------------- // Public Methods /** * Retrieves the internal listened queue. */ public SynchQueue getQueue() { return this.m_queue; } /** * @return false if the thread is waiting for an object * to be placed in the queue and be processed, otherwise * true. */ public boolean isProcessingObjects() { return this.m_isProcessingObject; } /** * Set the maximum time (in milliseconds and nanoseconds) to wait for * an incoming element on the inner queue before checking for * {@link LoopThread#stop()} and {@link LoopThread#suspend()} * signals. * * @param timeout the maximum time to wait in milliseconds. * @param nanos additional time, in nanoseconds range 0-999999. * @see SynchQueue#dequeue( long, int ) */ public void setTimeout( long timeout, int nanos ) { this.m_timeout = timeout; this.m_nanos = nanos; } /** * Set the maximum time (in milliseconds) to wait for * an incoming element on the inner queue before checking for * {@link LoopThread#stop()} and {@link LoopThread#suspend()} * signals. * * @param timeout the maximum time to wait in milliseconds. * @param nanos additional time, in nanoseconds range 0-999999. * @see SynchQueue#dequeue( long, int ) * @see #setTimeout( long, int ) */ public void setTimeout( long timeout ) { setTimeout( timeout, 0 ); } /** * Retrieve the millisecond part of the maximum timeout to wait for an * incoming element on the inner queue before checking for thread * event signals. * * @see #setTimeout( long, int ) */ public long getTimeoutMilliseconds() { return this.m_timeout; } /** * Retrieve the nanosecond part of the maximum timeout to wait for an * incoming element on the inner queue before checking for thread * event signals. * * @see #setTimeout( long, int ) */ public int getTimeoutNanoseconds() { return this.m_nanos; } /** * Process all elements in the queue until the queue is empty. * This may only be called while the thread is not running. *

    * This should be invoked with care, as it can cause an infinite * loop if another thread is pushing in data after this processing * thread has finished (but, that could also lead to an out-of-memory * error if this method is never invoked). */ public void processRemaining() throws InterruptedException { if (isRunning()) { throw new IllegalStateException( "cannot call processRemaining() while the underlying thread "+ "is still running." ); } if (!this.m_queue.isEmpty()) { this.m_isProcessingObject = true; do { Object o = this.m_queue.dequeue(); this.m_objListener.processObject( o ); } while (!this.m_queue.isEmpty()); this.m_isProcessingObject = false; } } //-------------------------------------------------------------- // Protected Methods protected void initialize( IObjectListener ol, SynchQueue sq ) { setRunnable( new QueueRunnable() ); this.m_objListener = ol; this.m_queue = sq; initializeDefaults(); } protected void initializeDefaults() { setSleepTime( 0 ); setDaemon( true ); setPriority( Thread.MIN_PRIORITY ); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/ThreadPool.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/ThreadPo0000644000175000017500000002465307622026501034054 0ustar drazzibdrazzib/* * @(#)ThreadPool.java 0.9.0 06/04/2000 - 15:13:54 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; import net.sourceforge.groboutils.util.datastruct.v1.SynchQueue; import java.util.Vector; /** * A pool of QueueThread instances, each containing an instance of * an ObjectListener implemented class. The Class to be the listener * is passed into the constructor. Requirements for the Class are: * 1. it implements QueueThread.ObjectListener, 2. it has a public * constructor without any parameters. *

    * The pool handles menial tasks such as: *

      *
    1. Growing the thread pool if the number of waiting objects * is above a threshold number, up to a maximum number of * threads. *
    2. Finding the thread with the fewest number of waiting objects. *
    3. Optimization of determining which thread to pass events to. *
    *

    * The pool gets much of its functionality by sharing a single SynchQueue * between all of its threads. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since June 4, 2000 * @version $Date: 2003/02/10 22:52:49 $ */ public class ThreadPool { //---------------------------- // Public data //---------------------------- // Private data private Class m_objListenerClass = null; private Object m_objListenerInitData = null; private QueueThread[] m_pool = null; private SynchQueue m_sharedQueue = new SynchQueue(); private int m_maxThreads = 10; private int m_numThreads = 0; private int m_depthThreshold = 5; //---------------------------- // constructors /** * Default constructor */ public ThreadPool( Class objectListenerClass ) { this( objectListenerClass, null, 1, 10 ); } /** * */ public ThreadPool( Class objectListenerClass, int maxThreads ) { this( objectListenerClass, null, 1, maxThreads ); } /** * * @param initData if the given objectListenerClass is an instance * of ThreadObjectListener, then the initData will be passed * into the initialize( Object ) method. */ public ThreadPool( Class objectListenerClass, Object initData ) { this( objectListenerClass, initData, 1, 10 ); } /** * */ public ThreadPool( Class objectListenerClass, Object initData, int maxThreads ) { this( objectListenerClass, initData, 1, maxThreads ); } /** * */ public ThreadPool( Class objectListenerClass, Object initData, int startingThreadCount, int maxThreads ) { this.m_objListenerClass = objectListenerClass; this.m_objListenerInitData = initData; try { createObjectListenerInstance(); } catch (Exception ex) { ex.printStackTrace(); throw new IllegalArgumentException( "Class "+objectListenerClass+ " does not create ObjectListener instances"); } setMaximumThreadCount( maxThreads ); this.m_pool = new QueueThread[ maxThreads ]; while (this.m_numThreads < startingThreadCount) { addNewThread(); } } //---------------------------- // Public methods /** * */ public void setDepthThreshold( int threshold ) { if (threshold < 1) { throw new IllegalArgumentException("threshold "+threshold+ " is too low"); } this.m_depthThreshold = threshold; } /** * */ public int getObjectDepth() { return this.m_sharedQueue.size(); } /** * Adds the given object into the shared queue, so that the next * available thread will process it. */ public void addObject( Object o ) { checkThreshold(); this.m_sharedQueue.enqueue( o ); } /** * */ public int getThreadCount() { return this.m_numThreads; } /** * */ public int getMaximumThreadCount() { return this.m_maxThreads; } /** * */ public void setMaximumThreadCount( int max ) { if (max < 1) { throw new IllegalArgumentException("maximum count "+max+ " is out of bounds" ); } this.m_maxThreads = max; } /** * Waits for all expecting objects in the queue to be processed, * and for each thread to finish processing an object. */ public void waitForThreadsToFinish() { // wait for the SynchQueue to empty while (getObjectDepth() > 0) { Thread.yield(); } Vector v = new Vector(); synchronized (v) { // find all threads which are still processing objects for (int i = this.m_numThreads; --i >= 0;) { if (this.m_pool[i].isProcessingObjects()) { v.addElement( this.m_pool[i] ); } } // wait for all threads to finish processing their objects QueueThread qt; while (v.size() > 0) { Thread.yield(); for (int i = v.size(); --i >= 0;) { qt = (QueueThread)v.elementAt(i); if (!qt.isProcessingObjects()) { v.removeElementAt(i); // don't need to adjust i because // we're procressing backwards. } } } } } /** * Stops all threads. */ public synchronized void stopThreads() { for (int i = this.m_numThreads; --i >= 0;) { if (this.m_pool[i] != null) this.m_pool[i].stop(); } } /** * Suspends all threads. */ public synchronized void suspendThreads() { for (int i = this.m_numThreads; --i >= 0;) { if (this.m_pool[i] != null) this.m_pool[i].suspend(); } } /** * Resumes all threads. */ public synchronized void resumeThreads() { for (int i = this.m_numThreads; --i >= 0;) { if (this.m_pool[i] != null) this.m_pool[i].resume(); } } //---------------------------- // Protected methods /** * If there are not enough threads, then add one into the * internal array, start the thread, and return the created * thread. * * @return the new thread, or null if the pool has * exceeded its maximum thread count. */ protected synchronized QueueThread addNewThread() { QueueThread qt = null; if (this.m_numThreads < this.m_maxThreads) { qt = this.m_pool[ this.m_numThreads++ ] = new QueueThread( createObjectListenerInstance(), this.m_sharedQueue ); qt.start(); } return qt; } /** * Checks if the depth on the shared queue is too deep (beyond the * threshold), and if so, creates a new thread to help deal with the * situation. */ protected void checkThreshold() { if (this.m_sharedQueue.size() > this.m_depthThreshold) { addNewThread(); } } /** * Create an instance of the basic object listener class, as given * in the constructor. * * @exception IllegalStateException thrown if there is an error * creating a new instance of the class. */ protected IObjectListener createObjectListenerInstance() { try { //System.out.println("Creating an instance of class "+this.m_objListenerClass+ //", modifiers = "+(java.lang.reflect.Modifier.toString( //this.m_objListenerClass.getModifiers()))); IObjectListener ol = (IObjectListener) this.m_objListenerClass.newInstance(); if (ol instanceof IThreadObjectListener) { ((IThreadObjectListener)ol).initialize( this.m_objListenerInitData ); } return ol; } catch (InstantiationException ie) { throw new IllegalStateException("could not instantiate from class "+ this.m_objListenerClass.getName()+ ": general instantiation exception "+ie.getMessage()); } catch (IllegalAccessException iae) { throw new IllegalStateException("could not instantiate from class "+ this.m_objListenerClass.getName()+ ": could not access constructor "+iae.getMessage()); } catch (ClassCastException cce) { throw new IllegalStateException("could not instantiate from class "+ this.m_objListenerClass.getName()+": instance of wrong type "+ cce.getMessage()); } } //---------------------------- // Private methods } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/IOThreadRunner.javalibgroboutils-java-5.orig/util-thread/sources/dev/net/sourceforge/groboutils/util/thread/v1/IOThread0000644000175000017500000001362507622026500034001 0ustar drazzibdrazzib/* * @(#)IOThreadRunner.java 1.0.0 11/17/2000 - 13:41:07 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * Loops, reading from the input stream and writes to the output stream. * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since November 17, 2000 * @version $Date: 2003/02/10 22:52:48 $ * @see LoopThread */ public class IOThreadRunner { private static final int BUFFER_SIZE = 4096; private InputStream is; private OutputStream os; private byte[] buffer = new byte[ BUFFER_SIZE ]; private LoopThread lt; private IOException exception; private boolean closeInputOnEOF = false; private boolean closeOutputOnEOF = false; private Runnable ltRunner = new Runnable() { public void run() { try { int read = is.read( buffer, 0, BUFFER_SIZE ); if (read > 0) { /* System.out.print("[IOThreadRunner: read: {"); System.out.write( buffer, 0, read ); System.out.println("} ]"); */ os.write( buffer, 0, read ); } else { //System.out.print("[IOThreadRunner: EOF]"); reachedEOF(); } } catch (IOException e) { registerException( e ); } } }; /** * Create a new ThreadRunner, re-routing is data into the * os stream. */ public IOThreadRunner( InputStream is, OutputStream os ) { this( new LoopThread(), is, os ); this.lt.setDaemon( true ); this.lt.setSleepTimeMillis( 0L ); } /** * Create a new ThreadRunner, re-routing is data into the * os stream, but uses the initialization of the given * LoopThread. Note that lt must not be a running thread. */ public IOThreadRunner( LoopThread lt, InputStream is, OutputStream os ) { this.lt = lt; lt.setRunnable( ltRunner ); this.is = is; this.os = os; } /** * Retrieves the most recent exception that occured, if any. If no * exception happened, then it returns null. */ public IOException getException() { return this.exception; } /** * By setting this to true the runner will close the InputStream * once a Stop signal has been encountered. */ public void setCloseInputOnStop( boolean on ) { this.closeInputOnEOF = on; } /** * By setting this to true the runner will close the OutputStream * once a Stop signal has been encountered. */ public void setCloseOutputOnStop( boolean on ) { this.closeOutputOnEOF = on; } /** * Retrieves the LoopThread instance that manages the operation. You * can use this instance for setting up the thread (such as setting * priority and daemon status). */ public LoopThread getThread() { return this.lt; } /** * Retrieves the output stream that the input is redirected to. */ public OutputStream getOutputStream() { return this.os; } /** * @return true if the thread is alive and reading the * stream, or false if it is not reading. */ public boolean isReading() { return this.lt.isAlive(); } /** * Starts the stream reading. */ public void start() { this.lt.start(); } /** * Stops the thread from reading. */ public void stop() throws IOException { if (this.closeInputOnEOF) { this.is.close(); } if (this.closeOutputOnEOF) { this.os.close(); } this.lt.stop(); } /** * Post an exception, and stop the reading. */ protected void registerException( IOException ioe ) { this.exception = ioe; try { stop(); } catch (IOException ex) { // ignore } } /** * Stop the reading and void out any exceptions. */ protected void reachedEOF() { this.exception = null; try { stop(); } catch (IOException ioe) { this.exception = ioe; } } } libgroboutils-java-5.orig/util-thread/sources/dev/about.txt0000644000175000017500000000015207521071703024210 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/util-thread/sources/ut/0000755000175000017500000000000011271425773022220 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ut/net/0000755000175000017500000000000010011473006022765 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/0000755000175000017500000000000010011473006025310 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011473007027502 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/groboutils/util/0000755000175000017500000000000010011473007030457 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/groboutils/util/thread/0000755000175000017500000000000010011473007031726 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/groboutils/util/thread/v1/0000755000175000017500000000000011271425773032274 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/groboutils/util/thread/v1/TimedProcessUTest.javalibgroboutils-java-5.orig/util-thread/sources/ut/net/sourceforge/groboutils/util/thread/v1/TimedProc0000644000175000017500000001217507622026501034102 0ustar drazzibdrazzib/* * @(#)TimedProcessUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.thread.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the TimedProcess class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version Jan 6, 2002 */ public class TimedProcessUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TimedProcessUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public TimedProcessUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstruction1() { assertNotNull( "GetInstance must never return null.", TimedProcess.getInstance() ); } private int runCount = 0; public void testRunRight1() throws InterruptedException { Runnable r = new Runnable() { public void run() { ++runCount; } }; this.runCount = 0; TimedProcess.getInstance().runTimed( r, 60 * 1000 ); assertEquals( "did not run thread.", 1, this.runCount ); } public void testRunWrong1() { Runnable r = new Runnable() { public void run() { // sleep longer than the timer. // give it a bit of leeway try { Thread.sleep( 2 * 1000 ); } catch (InterruptedException ie) { // ignore } } }; try { TimedProcess.getInstance().runTimed( r, 1000 ); fail( "Did not throw InterruptedException." ); } catch (InterruptedException ie) { // test exception? } } private boolean stop = false; public void testRunOwn1() { Runnable r = new Runnable() { public void run() { while (stop == false) { Thread.yield(); } } }; TimedProcess.RunnableKiller rk = new TimedProcess.RunnableKiller() { public void killRunnable( Runnable r, Thread t ) { stop = true; } }; try { TimedProcess.getInstance().runTimed( r, 1000, rk ); fail( "Did not throw InterruptedException." ); } catch (InterruptedException ie) { // test exception? } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/util-thread/sources/ut/about.txt0000644000175000017500000000012207521071704024060 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/util-thread/sources/iut/0000755000175000017500000000000011271425773022371 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/iut/about.txt0000644000175000017500000000021107521071704024230 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/util-thread/sources/eut/0000755000175000017500000000000011271425773022365 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/sources/eut/about.txt0000644000175000017500000000015307521071704024231 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/util-thread/CHANGES.TXT0000644000175000017500000000432707622026500021552 0ustar drazzibdrazzib v1.0.0 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Created two primary javac structures - one for jdk 1.1, and one for jdk1.2+. * Integrated the GroboUtils 'util.thread' hierarchy into this hierarchy. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/util-thread/xdocs/0000755000175000017500000000000011271425773021225 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-thread/xdocs/summary.xml0000644000175000017500000000443107655132720023444 0ustar drazzibdrazzib util-thread net.sourceforge.groboutils.util.thread.v1 Collection of utilities to help with thread and process management. BackgroundProcess Class which allows for better interaction with a spawned Process. It forks the process's output streams to other streams. IOThreadRunner A thread which pulls data from an input stream and pushes it into an output stream. LoopThread Implements safe pause, resume, and stop for threads which loop over the same function endlessly. Allows for a sleep period between loop iterations. QueueThread Thread-safe implementation of pulling objects from a SynchQueue, and passing them to a listening object. ThreadPool A pool of QueueThread instances, which handles menial tasks such as growing the thread pool if the number of waiting objects is above a threshold number, up to a maximum number of threads, finding the thread with the fewest number of waiting objects, and optimization of determining which thread to pass events to. 03-May-2003: Need to finish up tests and documentation before entering RC 1. libgroboutils-java-5.orig/util-thread/xdocs/about.xml0000644000175000017500000000260207655132720023057 0ustar drazzibdrazzib About $Date: 2003/05/04 06:40:16 $ Matt Albrecht Collection of utilities to help with thread and process management.

      Class which allows for better interaction with a spawned Process. It forks the process's output streams to other streams. A thread which pulls data from an input stream and pushes it into an output stream. Implements safe pause, resume, and stop for threads which loop over the same function endlessly. Allows for a sleep period between loop iterations. Thread-safe implementation of pulling objects from a SynchQueue, and passing them to a listening object. A pool of QueueThread instances, which handles menial tasks such as growing the thread pool if the number of waiting objects is above a threshold number, up to a maximum number of threads, finding the thread with the fewest number of waiting objects, and optimization of determining which thread to pass events to.
    libgroboutils-java-5.orig/util-thread/xdocs/requirements.xml0000644000175000017500000000027407655132720024473 0ustar drazzibdrazzib Requirements $Date: 2003/05/04 06:40:16 $ libgroboutils-java-5.orig/util-thread/xdocs/design.xml0000644000175000017500000000026607655132720023222 0ustar drazzibdrazzib Design $Date: 2003/05/04 06:40:16 $ libgroboutils-java-5.orig/util-thread/xdocs/index.xml0000644000175000017500000000103507747255440023062 0ustar drazzibdrazzib Welcome $Date: 2003/10/27 17:51:28 $

    The documentation is still incomplete.

  • About Util-Thread
  • libgroboutils-java-5.orig/util-thread/xdocs/using.xml0000644000175000017500000000026507655132720023075 0ustar drazzibdrazzib Using $Date: 2003/05/04 06:40:16 $ libgroboutils-java-5.orig/website/0000755000175000017500000000000011271425773017325 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/build.xml0000644000175000017500000002152307760503500021142 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; **************************************************** Use target 'deploy' to build the website. **************************************************** libgroboutils-java-5.orig/website/log4j.properties0000644000175000017500000000050007521071704022447 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.website=DEBUG libgroboutils-java-5.orig/website/import/0000755000175000017500000000000011271425773020637 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/import/samples/0000755000175000017500000000000010011473056022267 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/import/samples/Belief/0000755000175000017500000000000011271425773023471 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/import/samples/Belief/Belief.java0000644000175000017500000004263207521073272025525 0ustar drazzibdrazzib/** * Computer-generated religion is not new -- we've been using it * to help us develop our beliefs for years. For example: *

    * The Eastern Sikh Faith believes that the Satanic Verses was * written by Walt Disney, and argues that Man will yield to * the Last Trump. *

    * The Sunni Taoist Church denies that the Koran contains a * direct reference to Mumon, and argues that we should beware * Nirvana. *

    * The Southern Sub-Genious Affiliation for Aliens suspects * that the Sargent Pepper album proves the divine origins of * David Scott, and explains that man will succeed in avoiding * New Coke. *

    * To generate YOUR own belief, choose one from each section below *(in best buzzword generator style): */ public class Belief { public static final int COLUMNS_PER_LINE = 79; /* null after a group, two null at end of list */ public static final String[] LIST = { "The", null, "Arian", "Athanasian", "Roman", "Sunni", "Presbyterian", "United Reformed", "Unitarian", "Anglican", "Jehovah's", "Jewish", "Fundamentalist", "Shiite", "Hari", "Shinto", "Zoroastrian", "Christian", "Salvation", "Seventh Day", "Saphardic", "Zen", "Hebraic", "Palestinian", "Galilean", "New Age", "Reformed", "Orthodox", "Southern", "Northern", "Eastern", "Western", "Universal", /* MCA */ "Bavarian", "Allied", "Brotherhood of the", "Greek", "Golden", "Silver", "Hindu", "Ancient", "Illuminated", "Renown", "Mongol", "Hermetic", "Rockin'", "Aztec", "True", "Asian", "Zombie", "Converted", "Gidean", "American", "New", "Alien", "Rhode Island", "Alaskan", "New York", "Native American", "Young", "", null, "Catholic", "Baptist", "Protestant", "Muslim", "Moonie", "Mormon", "Witnesses", "Sikh", "Buddhist", "Krishna", "Methodist", "Fire-worshipper", "Parsee", "Theosophist", "Adventist", "Confucianist", "Shamanist", "Taoist", "Atheist", "Rosicrusian", "Sub-Genius", "Episcopalian", "Secular Humanist", "Revisionist", "Masonic", "Shriner", "Pentecostal", "Charismatic", "Thetan", "Odd Fellow", "PreClear", "Satanic", "Twelve Step", "Druid", "Lutheran", "Four Square", "Bible Thumpers", "Flat-Earth", "Whole-Earth", /* MCA */ "Paved-Earth", "Star", "Generation X", "Christian", "Thelemite", "Liberation", "John Birch", "Elder Thing", "Trekker's", "Illuminati", "Science", "Discoridan", "Baccus", "Republican", "Democratic", "Libertarian", "Communist", "Socialist", null, "Church", "Faith", "Sect", "Heresy", "Liberation Front", "Elder Council", "Lodge", "Society", "Temple", "Army", "Congregation", "Sunday School", "Cult", "Fellowship", /* MCA */ "Scientists", "Revolution", "Foundation", "Order", "Militia", "Fan Club", "Affiliation", "Movement", null, /* MCA */ "for a Better Tomorrow", "for a Better Today", "of Latter Day Saints", "for a Better Yesterday", "for Women", "for Men", "for Aliens", "for Lesbians", "for Gay Men", "for Bisexuals", "from Tulsa, Oklahoma,", "of Ohio", "from Wisconson", "of Mexico", "for Eunics", "of Germany", "of Russia", "for a Unified Europe", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", null, "believes that", "denies that", "is strongly divided over whether", "rejects the notion that", "posits that", "preaches that", "insists that", "professes that", "proclaims that", "suspects that", "theorises that", "concludes that", "announces that", "refutes that", "is confused over whether", "agrees that", null, "the Bible", "the Koran", "the Magna Carta", "the Kama Sutra", "the Bagavad Gita", "the Talmud", "the Torah", "the Satanic Verses", "the Mosaic Law", "the book of Revelation", "the collection of predictions of Nostradamus", "every Norse saga", "the new, controversial eleventh Commandment", "the Apocrypha", "the Sargent Pepper album", "the Athanasian creed", "the Rosetta Stone", "chapter thirteen of Dianetics", "a transcript of the very first Ramtha channeling", "The Writ of Common Wisdom", "a certain part of \"The Last Temptation of Christ\"", "\"The Prophet\", by Kahlil Gibran,", "\"The Profit\", by Kehlog Albran,", "a secret document hidden in Fawn Hall's underwear", "one of the lesser known Dead Sea Scrolls", "Marquis de Sade's \"Bedroom Etiquette\"", "a cryptic notation on the back of the bar tab from the Last Supper", "Darwin's \"Origin of Species\"", "a particularly crude example of poetry from the men's room wall", "Elvis's Will", "The Pentagon Papers", "Shirley McLaine's \"Out on a Limb\"", "an inscription found on the basement wall in the Temple of Karnak", "\"The Life of Brian\"", "a certain scrap of MVS source code from 1971", "an IBM punch card found on the machine room floor in 1978", "the private diary of Marcia Brady", "the Book of Mormon (with introduction by Charlton Heston),", "grafitti once found on the A-train to Far Rockaway in 1969", "a certain limerick containing a reference to \"Nantucket\"", "Randy Travis' Copenhagen ring", "a mysterious pattern of cat box scratchings", "\"The Yosemite\" by John Muir", "\"No Bad Dogs\", by Barbara Woodhouse", "\"Atlas Shrugged\", by Ayn Rand", "a certain cryptic coding construct of Richard Stallman", "Cher's secret tattoo", "the bumps on the skull of Thomas \"Tip\" O'Neill (if interpreted as braille)", "a particularly obscure pattern of crop circles", "scene II, act V of \"The Search for Spock\"", "a forgotten screenplay by Sidney Sheldon", "the pattern of crows feet around Nancy Reagan's eyes (as interpreted by her astrologist),", "a certain old \"Leave it to Beaver\" script", "Nancy Reagan's \"My Turn\"", /* MCA */ "Windows '95 document files", "the Necronomicon", "the Principia Discordia", "The Egyptian Book of the Dead", "The Tibetan Book of the Dead", "MS-DOS 3.3 user's guide", "Bill Gate's income tax form", "OS/2's original source code", "a never used function in Word", "a large lump of Spam, moulded in the form of Elvis", "\"Common Sense\" by Adam Smith", "the script to \"Pulp Fiction\"", "Frank Herbert's last, unpublished \"Dune\" novel", "Aleister Crowley's \"The Book of the Law\"", "the pimples on Ronald Reagan's ass (if interpreted as braille)", "\"The Joy of Lesbian Sex\", chapter six", "that greasy stuff Spam is canned with", "Gram Hill's odd birthmark", "the scripts to all of Elvis' movies", "Einstein's tupee", "an old stop sign shot by a buckshot shotgun (if interpreted as braille)", "\"How to Win Friends and Influence People\"", "The Gospel According to Bob", "an abandoned and neglected Mac Classic", "all the world's Giddian Bibles", "a certain Sunday edition of The Family Circus", "the Constitution of the Iriqois Nations", "The Mr. Bill Show", "Gene Simon's chest hair", "the stained blue dress", null, /* MCA */ ", if read backwards,", ", if held up to strong light,", ", when pasted together in the correct order,", ", when translated from the original Turkish,", ", when played backwards,", ", if rearranged via the I Ching,", ", if spat upon by thousands of green yaks,", ", if decrypted using Jesus's original PGP public key,", ", in reality,", ", if cut apart then reassembled in a certain order,", ", if spoken by James Earl Jones,", ", when arranged in a specific order,", "", "", "", "", "", "", "", "", "", "", "", "", "", "", null, "predicts the eventual supremacy of", "contains a direct reference to", "has been misunderstood by", "proclaims the divinity of", "can be read as denouncing the divinity of", "is an insult to", "is a heretical misinterpretation of scripture by", "was inspired by", "denies the existence of", "contains coded messages from the Inner Child of", "was dictated by", "encodes the personal opinions of", "can be deduced from the writings of", "implies the divinity of", "justifies worshipping the sandals of", "explains the holy writings of", "can be interpreted as the memoirs of", "reveals cryptic messages from", "reveals a message from", "follows the teachings of", /* MCA */ "was comprehended by", "divines a New Testament by", "was revealed by", "was divined to", "sheds new light into the life of", "proves the divine origins of", "predicts the divine birth of", "proclaims the Word of", "suggests the divinity of", "justifies the worshiping of", "conceals the teachings of", null, "Salman Rushdie,", "the Ayatollah,", "Thomas Aquinas,", "Billy Graham,", "J. Z. Knight,", "Elijah,", "Elvis,", "Elvis Costello,", "Elvira, Mistress of the Dark,", "Jesus' little known brother Tony,", "the Reverend Al Sharpton,", "Louisiana State Senator Merle Jacobs,", "John Lennon,", "Buddy Holly,", "Andrew Lloyd Weber,", "a certain bombastic revivalist preacher,", "the creature from the Black Lagoon,", "a particular White-Supremacist from Hayden Lake,", "Jerry Lee Lewis,", "a twelve year old stigmatic from Lubbock, Texas,", "Zeus,", "King Tut,", "Ernest Hemingway,", "Mariel Hemingway,", "Ernest Borgnine,", "Ernest P. Worrell,", "Ernest P. Worrell's love-child,", "\"Jake the Snake\",", "Ann Landers,", "Bess Truman,", "a fire-and-brimstone street preacher from Provo,", "the last living Baghwan Shree-Rajneesh loyalist,", "a certain white-shoed car salesman,", "Crazy Eddie,", "Howard Stern,", "a certain Australian footballer named Bubba,", "Father Guido Sarducci,", "the last practicing medicine man of the Mohicans,", "James Randi,", "Our Lady of the White Go-Go Boot,", "Verleen, The patron saint of Big Hair,", "Helga, the patron saint of Unseasoned Food,", "Randy, the patron saint of Big Pickup Trucks,", "Maxine, the patron saint of Press-on Nails,", "Tina, the patron saint of Polyester Stretch Pants,", "Boopsie, the patron saint of Large Dangly Earrings,", "Mahomet,", "Walt Disney,", "Ezekiel,", "Dan Quayle,", "Murphy Brown,", "George Bush,", "Oliver North,", "Thomas Merton", "Leo Buscaglia,", "Marilyn Quayle,", "Ernest Angsley,", "Odin and Thor,", "Adolf Hitler,", "Linus Pauling,", "Pope John-Paul II,", "Bishop Spong,", "Mumon,", "Martin Scorcese,", "Bill Gates,", "Abraham Lincoln", "Daryl Gates,", "Robert Gates,", "Robert DeNiro", "the Mormon Tabernacle Choir,", "Jim Bakker,", "Tammy-Faye Bakker,", "Jimmy Swaggart,", "Susanne Somers,", "Richard Simmons,", "Richard Lewis,", "Cardinal Richelieu,", "Charles Manson,", "James Taylor,", "Tipper Gore,", "Hillary Clinton,", "Dolly Parton,", "Jerry Falwell,", "Robert Bly,", "Joseph Campbell,", "Zig Zeigler,", "L. Ron Hubbard,", "Captain Al Hubbard,", "Jesse Helms,", "Jesse Jackson,", "Jimi Hendrix,", "The Juice Man (tm),", "Clarence Thomas,", "Long Dong Silver,", "a certain paunchy, ex-Chippendale dancer,", "the shadowy leader of a certain gang of biker nuns,", "a spaced out, pot smoking crystal worshipper,", "a certain swarthy wild-eyed, Eastern European anarchist,", "a certain middle-aged bag lady with a personality disorder,", "a certain pornography-addicted TV preacher,", "a certain washed up TV actor that's now doing infomercials on cable,", "a certain philandering, saxophone-playing Southern Governor,", "a certain flamboyant, gender-bending rock star,", "a certain female talk show pop-psychologist,", "a certain truck stop waitress from Cocolalla, Idaho,", "a certain small town sheriff from North Carolina,", "an avowed heterosexual female tennis player,", "a certain absent-minded, father figure ex-President,", "a certain blonde, pointy-bra wearing pop singer,", "David Duke,", "Robert Mapplethorpe,", "Wilheim Reich,", "Kreskin,", "Mahatma Gandhi,", "Abbie Hoffman,", "Timothy Leary,", "Jack Kerouac,", "Allen Ginsberg", "Paul Krassner,", "Marlin Fitzwater,", "Ken Kesey,", "Helen Gurley Brown,", "Tina Brown,", "David Geffen,", "Howard Cosell,", "Cy Sperling,", "Andy Warhol,", "Ferdie \"The Fight Doctor\" Pacheco,", "Madonna,", "The Beatles,", /* MCA */ "Anton S. LeVay,", "Gautama Buddha,", "Kali, destroyer of worlds,", "Ed Wood,", "David Koresh,", "Aleister Crowley,", "Les Claypool,", "Ben Hur,", "Michael Eisner,", "Erwin Schrodinger,", "William S. Burrows,", "H. P. Lovecraft,", "a gigantic, shiny, red button,", "Frank Zappa,", "the aliens from Alpha Centauri IV,", "Alice Cooper's snake,", "Terrence McKinna,", "Great Cthulu,", "Eris Discordia,", "David Scott,", "Robert Anton Wilson,", "J. R. \"Bob\" Dobbs,", "the face on Mars,", "Adam Wiesaupt,", "William Shatner,", "SUPERMONSTER GAMARA,", "Andrew \"Dice\" Clay,", "Dr. Van Van Mojo,", "John Miller,", "Peyote Woman,", "Yog S'thoth,", "Monica Luinsky,", "Stanley Kubrick,", "Pac-Man,", "George Washington", "The Amazing Randy", null, "and", "but", "yet", "and likewise", null, "says", "explains", "claims", "believes", "argues", "insists", "refutes", "denies", "professes", "preaches", "suggests", null, "that", "that soon", "that after the second coming of Christ", "that ultimately", "that inevitably", "that if we are true and faithful servants,", null, "we should strive for", "the world will end with", "we should beware", "we shall see", "the ungodly are about to experience", "only the faithful will achieve", "the chosen people will soon experience", "men will yield to", "women will yield to", "mankind will yield to", "man will succeed in avoiding", "woman will succeed in avoiding", "mankind will succeed in avoiding", "the Seventh Sign will be avoided by", "only the born-again will actually enjoy", "only the chosen people will experience", "the chosen people will be spared by", /* MCA */ "the doom of humanity shall be", "the fall of humanity shall be", "the world shall be consumed by", "a rebirth of spiritualism will come about through", null, "reincarnation.", "Judgement Day.", "the Apocalypse.", "\"Apocalypse Now\".", "Oral Robert's prayer tower.", "nirvana.", "Nirvana (the band).", "Mount Olympus.", "martyrdom.", "the Second Coming.", "the Second Cuming.", "the sound of one hand clapping.", "birth control.", "better living through chemistry.", "human sacrifices.", "cherry pie and damn fine coffee.", "damnation.", "Papal Infallability.", "enlightenment.", "the \"666\" mysteriously found tattooed on your head.", "pinball heaven.", "phallic idoltry.", "pubic hair on your Coke.", "a guilt-free afterlife.", "guilt-free sex.", "guilt-free bingo.", "government, by the people, and for the people.", "remorse for their crimes.", "\"Crimes Against Nature\" (at least in some Southern states).", "the Turin Shroud.", "purgatory.", "premarital sex.", "a feeling of oneness with nature.", "that oh-so-fresh feeling.", "that not-so-fresh feeling.", "shiatsu massage.", "chiropractic treatment.", "ESO.", "tetrahydrocannabinol.", "lysergic acid diethylamide.", "psilocybin.", "quinuclidinyl benzilate.", "phenylpropanolamine.", "Xanax addiction.", "Prozac addiction.", "a life made livable with clozapine.", "colonic irrigation, twice a day.", "self abuse.", "real tears from Michelangelo's \"Pieta\".", "the face of Jesus in a bowl of spaghetti.", "one man, one vote.", "a resurgence of tribbles.", "a Popeil pocket fisherman.", "\"from each according to their ability, to each according to their need\".", "the upcoming Vernal Equinox.", "Buddha Nature.", "the upcoming Summer Solstice.", "trout fishing.", "rolfing.", "engrams.", "utopia.", "the ThighMaster.", "bliss.", "the monolith in 2001 A Space Odessy.", "the writings of Douglas Hofsteader.", "the end of the world.", "the eventual domination of world.", "backward masking.", "megadoses of vitamin C.", /* MCA */ "fire.", "\"liqui-gels\".", "\"2001: A Space Odessy\".", "assault-style weapons.", "anarchy.", "lemon-scented sprays.", "the Rocky Horror Picture Show.", "Spam.", "a plastic imitation foreskin.", "sex with Ted Kennedy.", "smokin' Dope with the Pope.", "trendy papsmears.", "removal of that dangly thing in the back of your mouth.", "New Coke.", "the death of Bob Dole.", "watching all of Oliver Stone's films, back to back.", "the ATF.", null, null /* and one last null to end the whole list */ }; public static void main( String args[] ) { int i = 0, l = 1; if (args.length > 0) try { l = Integer.parseInt( args[0] ); } catch (NumberFormatException nfe) { l = 1; } for (; i < l; i++) { printRandomSelection( LIST ); System.out.println(""); } } public static void printRandomSelection( String list[] ) { int i = 0, j, cnt; String buff = ""; for (; list[i] != null; i++) { /* how many in the current list? */ cnt = 0; for (j = i; list[j] != null; j++) { cnt++; } /* pick a random string */ j = (int)(Math.random() * cnt); buff = cat( buff, list[i + j] ); i += cnt; } /* print it out, breaking lines */ printLines( buff ); } protected static String cat( String s1, String s2 ) { int l1 = s1.length(), l2 = s2.length(); char c, c2; if (l2 <= 0) return s1; if (l1 <= 0) return s2; c = s1.charAt( l1 - 1 ); c2 = s2.charAt(0); if ( (!Character.isLetterOrDigit(c)) && c == c2 ) { s2 = s2.substring(1); c2 = s2.charAt(0); } if (c != ' ' && c2 != ',') return s1 + " " + s2; return s1 + s2; } protected static void printLines( String text ) { String tmp; int cnt = 0, j; boolean firstOnLine = true; while (true) { j = text.indexOf( ' ' ); if (j < 0) { j = text.length(); if (cnt+j+1 < COLUMNS_PER_LINE) System.out.println( " "+text ); else System.out.println( "\n"+text ); return; } tmp = text.substring( 0, j ); text = text.substring( j+1 ); if (cnt + j < COLUMNS_PER_LINE) { cnt += j + 1; System.out.print( " " + tmp ); } else { cnt = tmp.length(); System.out.print( "\n" + tmp ); } } } } /* -- Selected by Brad Templeton. MAIL your joke (jokes ONLY) to funny@clarinet.com. Attribute the joke's source if at all possible. A Daemon will auto-reply. If you don't need an auto-reply, submit to rhf@clarinet.com instead. */ libgroboutils-java-5.orig/website/import/stylesheet.css0000644000175000017500000000175707663521306023553 0ustar drazzibdrazzib/* GroboUtils website stylesheet * version $Date: 2003/05/23 22:37:58 $ */ /* * Source Code Styles */ /* General Java code block */ .javaCode { background: #000034; width: 80c; color: #ffffff; } .syntax0 { color: #ffffff; } .syntax1 { color: #b6ffff; font-style: italic; } .syntax2 { color: #ff699b; font-style: italic; } .syntax3 { color: #d6d5d5; } .syntax4 { color: #66ff66; } .syntax5 { color: #ff5890; font-weight: bold; font-style: italic; } .syntax6 { color: #ffff00; font-weight: bold; } .syntax7 { color: #ff61ff; font-weight: bold; } .syntax8 { color: #7d7dff; font-weight: bold; } .syntax9 { color: #8b8bff; } .syntax10 { color: #ffcc99; font-weight: bold; } .syntax11 { color: #99ffff; font-weight: bold; } .syntax12 { color: #ffff8f; } .syntax13 { color: #ff0000; } .gutter { background: #ffffff; color: #000000; } .gutterH { background: #ffa0a0; color: #000066; } libgroboutils-java-5.orig/website/import/test/0000755000175000017500000000000011271425773021616 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/import/test/1.html0000644000175000017500000000001607521073272022635 0ustar drazzibdrazzib libgroboutils-java-5.orig/website/import/images/0000755000175000017500000000000011271425773022104 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/import/images/logo2.png0000644000175000017500000013126107562364440023641 0ustar drazzibdrazzib‰PNG  IHDRÓÍ"ÛE2gAMA± üabKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ 6þ×µ® IDATx콘]UÕÿ¿Ï=·Mïé3™TÒH =ô"D4Xx°R,¯¾Š"bCù"úS@x•"R¤H—ZB =„”ÉL’™Lï3·œ{ÿë³ïì;gnßÙÏsî9÷ì¾ÎúîµöÚM©a7La S`˜ÃØŸ(`¥&vkI–¼óÉå—ˑ˖K©¢âÄsvaTþyUV¡£ m•]¨TN~ÂÏ—Ûã—í¨ŽöD<Òˆ´Úª­9ªÚ½ª±QümyVª¡>¯µ1Ú´ÍñJºNUS†Ž·%š§ýªBDš=ei Q˜d¹¢…)‹ü/ „ìñÞ5{VØQ¦Újää¨*›ìU…eŽÊ#iföÄ ’~Ÿ4ñ—(KZ?ÿ~Åsûùu9%Ÿ^º$ž¥,žüõK/Õ/6„rF{êÞ-aå;D:uË7êlMøuµšt~¦œ-òýzéÔמŠ_žð á2rß!3Wxi”ä—)ÿóÅ ZÇä¹Ýõ²å¿Gü¨_Tž»Å¯»'¿Nùo¾-´ ºâéoÈOyÅÏ|wOOx >tµ}ð¥k£Ë¾öZWÝ娷µÕÏã‘«Ûó½Ž.þ æú€é„ñÅGL*š™ôN’ˆ”0ÖÚ÷$bµuG¤Ê®iîv:ÂŽÝqâÝᘠEãV8s„)°ÅmËcéx~[Y~Ëã¼–ô{œâ,¿ág¼*'è³$/§83fO°;tÚ“‚ :^q±¢lNƈ,&ùÊ•, ~=Ú»¾^Å7v©%m9Ö¶æ.g£¼kêˆ8mÇEâ:ž”I§éµå(M·_Ðöèx&?·_·Ó~fÀrú|–)oŸ:½ýÇËôõï—á³ÌOʸS~BzýNèïdå;½qiŒ”4D–4DNiAW2Í‚±vŸr¦«»¼KO—\ ˜ýZ“iJã©NMi0íÊ–h¼¦©SÕw„­Æ®¨‰Äm¡­]…vñ ¯’:[#ó¦ì;Õ:·w6îaî:¿ö®¨. <‹Ÿ\ÚOè¡+ϵ.ùãEŽzøö·w8÷.ý­-`Š ˜ˆÛ$×¹6  šå> #íŽÈzí±sT‡œõ%¥F¦TgL©V¥š·GUW£¥Z›-‘&H¿j®©Æzoך-1abK˜Ø&vxH³€Î+@‘ø °X礬J錬*.öª‰Ób"9,•›o© ‘pY¹:žòeÓÚH¼\Ê%W&Oø©`_wŸ&Šøu"«Ä¯5&eµtY?Xê¨MëüU¯l =ßQæÝÔ‹I™¬öPÔÂê4…°=ñÈO3éºòÓ-ínùI#“6ž4<=uèÍO¢žúõÍÆ©·î½~Ò`íV9¥KÆ“F%$ ŠW5&Œªé) v¼º,´;•3]Yzè–,§0ç ñ„î:?¡‘Ž×‰…Úº¯'&m³òäølG^¿”#$á¼B·˜4Š–4ŠºR~¿”?í÷“¦?IO©óNߺK¹u9¡IŽß¶–üX´ cÎò_ð…„LÞÐÕÆg­Dz¶ª®ÖWUgó}j󦵞oT (¡HT»yòsH3”šuì“OUŒ³„ÆÝÝ>µ}»OmÜØ®ZZ:äê–wÕÚTáðÕÖ–¡"‘ˆêêê’ÿí*‹©xBHšaEGÙÒˆ^(S™oeª¢¢"•›ëQÁàv•—סzyê2˜{ Íes?ó*‚ gž»»»õ î---ryT}}¢|­­­R¶°rô·ÔX4JÜ“U×ÿ÷ô×›>}hávvRq¿=Û‡¦Ý×¥{×7ÄÎÿRãøý~¡y@™;474NGÿÔMØÔ÷CýŸ#ùn=÷,ùf¹òŸïÖÖÖ¦š››Uƒ¼sD Ц¡Y07¨233“å¦üéßÚ8Ãü7ïáWãüBã±'ªK>§n»ì6uü'/W}ýeuüñQÝk»ÕWÎkHC/ö¾­Ê–~ ÔïLÔ´÷äI"Ji®Ô5ª¿"Àxÿý÷Õ½÷Þ«êêêD K©PW@äåå (r“w*—­™À|@ ÎÕÞÞ® c×ÖÖjÂ566ª-[¶èJšp¦¢†ñÓ–¸ç¥aJ“w®œœ}•——«#Fè‹wî²¥2ºIk üvdž$Õ}Ty¥æ“úŸï‰ƒ¶\Qé:qšÃlæ™pnFäÿPaÚþ»A0ùf¼ËÈÈÐ`14só€›f”Ñ”?]æÛºã¸ŸMúÄ…& êÆoT&LPUUUjäÈ‘ê'?ù‰ŒVõ»´F'ed=|Ak¾uÕÿË(méò4ï’`’ÒqËì[«H”‘´<ð€*((ЉŒ 0hIÈpÛ¶múN«ÒÑÑ¡ÁÁG2ŽÊeeei0ø¨Q£48ap A —Ž&÷ÝMh“—a >&e¬ýàR>ž)¢³Sw¸5#¹ÓèÙŸ çþ@æ÷taÓ½7ÌmâöJtóf÷ïn†IM?ÊÎehnœï€3÷Ô¸æ¿ oþïÊÝ 6¾ïÐ*¸óÝ ô„VЇ²»ËŸ._7ýͳ›ÖîgÒÊÏÏW矾ڰaƒæ%K–¨k®¹F¿?k¡!Ɖ€'|ïæþw/S§ËXÞ%Á”0.ÐÿÈ×¶;v¨­[·ªÛo¿]=úè£êÅ_ÔBà \H§±cÇ&%ïÜĆ@€ f†©)4R 0ÒúALwÝ儨ý¹þ˜Á ¦|HÓ1cÆ$ËgTÒŒiÜy§ÖÉíç~v‡s¿OÍ+õ¿iHLœT°¦þ7á¸äçgèiîÐÚs™FÉ0 ‰gÞ›ÿ{ânêjmByà Ãðtâ2ß²›òV7˜çÔú‘÷“O>©f̘¡þýï«‹/¾XÝu×]ª¦¦F½þÛöö_ýé3ÝïþN9\·%‰•þòMι(ó­¤2‡ŒQí@- M™2EM›6MKèF²P *è? E\˜«¤¤D‹Q£“éôdŽwæN¼tŽ0ý9ˆmnT=Êï.#„4Œ“JTÒ*ã ’ ÅAãÌÇ4ï¨+—Û öŸ°Ñ`¨þnZ»Ÿ‰ŸZÞáú{ŸðÚojCÃóÍh”ùnðŠùf€ˆ|á.ÊŠ6dÊœš«;}ÒÅ¹ïæ™÷„%íM›6©… ªŸÿüçê‡?ü¡ÒêÕ«5Ÿ¿°¦Îÿ³Ëö^ýÔmöÊKÎÅ`2 ëS—H±H;#LòÝãšÑaFT;þ¤9sæhÐ"¥eH0&HMMMºTG LÁ`Dw¥Hð™Ê¹ ¢èù¡âÄ#ãú{&,yºACYû“‚¤I‹9T@™2ìÊÝiW☰wæ>Ÿ Ã}¨áLh¸'éõ÷}÷d>&-êKcÍËð¹ónúôéú›£-Áïô›èŽÐ‡ÊñT;on¨—Îfq\$L_Ë‘ÉÄuO‚IL– ½Êãf8†GUÅÛ·o×êiÐ’1}+À‚q¦5-1áˤ ØèÇ BM:T0¡3»Ÿx8÷;Òp— ·Èwç Á¸0” êQF#±xo>*uÛSΤ™šžÉÃø›ÿHxœQ{xNUÙûOãÜ´0ïRï& ´2ô¤1tNט|˜FÀäoêlþ›:S?èÏàÈÐÁ+8üø†ô³ÝáðsoS/ÞGÝ.,ãoøÀÔ÷ÔɈ%ãqª¶=,˜ØÙdÒpß“`{¾­:dä;?¦;ZÉæjŸ~úiµyófÝG4H­>ø@‹^*AÜ}*C@ H‰Î?ÄB:€"í!£réD4~0 éò1ÜÄă0€"!Sv>~†iÌÝÄßÝ»ûƒ¸ÓH}ŸÚ¸Â/ݳa¸T¿þÞ§†3Àänèm¡'Ïnghî~÷ažá%ãŒÔƒ7Ì÷0üASVž ©'å4~æû&õ;‡¥¥¥ê¨£ŽR3gÎÔuC¸õM­3þ¦Þ2±| `¬X\AâݯK‚IÆœµU~4Z0ìû0#…ùö·¿­;kH É8˜Ð m ŒMÅ H@ Ax±¶‘6ý'âöçOz¦ÅG€ø†ÐîxäG™ŽñàƒÖe ¬†yÌÇ0ÇÆ‡yNÇÜ6TR¾tuï¯Üî°|_.hSs‡¶†Áyþ(œaR“6ŒÌ;¾‡é‡óÜŸƒ”Ñ”?5œùž¼§}饗ÔwÜ¡.¿ürmE6–]üÉ—´Lygœ«þÍ‘90CWó$‚Wf98jtX¾DëNeÉ  –M”.úN˜)˜­bܸqºóHkóC<‚÷Þ{O뤀i#¥Lçæw;S)“iŽ=ZÀifü‰K.€i®µkת×^{MKPò4ŒeÊoîî¼?̳û£štÜ`r?ãïf þž —®å½»þüïÏ™ø„‡~î»y6q‡š¦ ?ÐÝ|G£º–ÆçþV4”\4’ÆŸ0”Õq— ?wXÂãÊÊÊÔç?ÿyýüÆo¨O}êSú™Ÿ¼ÓÉ£Rq †n—i-ŽL"’MdD¦†0¾ûî» ,ÐþH_×­[§ïè¦ËÍè†`øarG A€‡YŠXòsçiò–2%ýL¿ÉS ©`@u¢|< "´Rä ¸(¯Ñ !i™÷”K—Vª¤7ù’'Àv3™[ ¦¦Ö{°:˜ð€ÚqAGßà ¶ÁÒÚ÷÷44€^FÃÔÙ”;ô÷LˆÔ7åw—ÁøóŽx4þð+ ;FTIÁ€‰t¹L½‰ënÌä/ƒ´"ôÔ®¤G¸tÎ ‰i¼[3¹“9•ç3bl˜:uªþÿç±÷«Ë[ŠÂ¯Õ·Z'•z£·}¡J©ÓŽóªÒ!å²)P@5opTå{J½¶Áû³'rBb%ÉÞ°¥¾­¶z] gK†ÈÊd1Ÿ×ô†:»£Ù2î¥ãIë M’è¯2K#4ªÐ“=Þîh[0·; z›Ì\/VjìTêHNä×Ñ(ùÉlàíëTÕšïýuå¡È޶ìÚúζ–N'Ð1WÉ<-/hõÄ£œ ±.7=’ùkÉ:0ñq}ó“x.­ŸÌ}ë“¦Ì Il¦Ì…Kúõ̇KÖAæ¹%ýÈO:ÃI?ù‰ªióÃO®üdR«¦§Lle†½ïmòÊÄÖLhÍV¹…m²*@âu9z@šú¥KSÞ%¾mšüÒûeȘHc’žzÕ@k£bÅÀku£BË[s²7T·¶ÕwtdÎ^¢Ò5:…d‚tö¨‚Ì6©GÀÔAòp}«M&ÌêºS¿…Ÿ”U‹Ž :éêìgÞúQÛO/¸)ð̽_Ž©¢2ëž¿Æ4,4꯼òŠî맪æ=Ò. y“Ø04•ÇôŽ€ÚÉÄJ%“Xå¹3NKJbˆPwk˜(€ÉÒè«uÛÛ“¦6Þöò/„¸Þ¸ºù뮥%NESÌßÖ å½ÞòOì3e•VÖg>e]ý•3å›&âS&ÌnzÑ«–<S›×[+Vùéì9¥å]~ùÈ!ùÈR> ØÂËdÛjGï‡ðß*è­iju„›¬†Î5:^w4†H Ãòbò¬É£‹­9¹ÝÎUç6ûÕóÅzË2b*+Û°ëx¢HèxWòó3ïFw:)‹\.?÷¤X™rªýü09tL/Õ/9û}hf÷üâ¿ÐC5†Ÿ%d?JVð—<†ä’`’Ц@IÓ¸±Ò¥¦äθ¾Óã“çïR³/yoæ ýç귾ѤZšêÛïµ·ÕDkBÚ¼èÌÍk¶<ªT]üÃ㜋gm«¸XW>ï?÷çÎwÊì+÷ªº–Äš&É/Z’—çÍ ™Lœe¡r»½*­}¥Û[{ós†ø õKˆOù);uÒÖaJ•Ÿéu D‡šP2*:³Dy¨sfœ% Ñʦ*•%‹só™’œŒ'q¥#&’ü8}ýðél7 Óë—É6ívöó»üÌ¢8ÊéM.:á˜l iÚ^“‰Ê³ ÀÔ¯<=~}ë./û/‹0ªŠÉ`¬Ø™T¼ÛV!Yh×ÝîMÖ©C¶'òîêY,ØK‹¡å—‘BObõ¦•™Øú …öBë@ÐQY,è“…}NØ«‡h¢z=R"^¶|#[ülQ¹Pµc.¿D]{¿ƒG)Q¿Š =õý詇üÈûÌÆª_iý욥óVæ6æì³ÏÖZ×Ûo¿­ûcôÃèw¥ô™¼Â:€É4”§_ç’Њޙté,%ƳTÑ¢LŸÄ­mŸZ’Ùä™zk­ñWj[ï#Oÿ‹éûÞž‹ÆUš‡=oÀ¸ €ë32t÷¡Õ¼³çóNq¿£ÀíEßM”éWG:Ócud{«­MÑçõ;ŒhÿøÇ?’K;Ü…§{#¶eEÝo7 ”;XŸçäЮ¬„M,EW¹ýÎ!1fHúLné$)ÆU¤^Í'*×°¦À~HŸ½2ÎÎözâsÊrb Ç`Yf‱ì¦H$STúx a3 KJ&–”KH"iº éR0`*%çÒ÷¡éL«£Çò–.üð»a ìK Èrv%CIßP÷âo3¼!SìÚ´õU¤“ô]“Xé¯ÉìÍ fQé¼e꜋‰h2玟±èÉÞ !1c‚ZFeø>Lý‰ð§Þº G^$Ëæ6¸!¡\ã‚tyÀ†øº¤šÇ¤>éŒ8n€Ò_L4î²JŽ˜¤%ÓL•ØÔ‡Ý0öO ØzbÂ@á*¾#2F›ÆåÖØ\~;=ö‚IÌ£ª¸\D`Ѓe  …ÜcM¼3 žL¹k—d¤Ÿtd°5)évÊiøÅ0ö!d°—†@ÐÚÉ¥ö™Œ&&‰©O;EJy‘“Ì.Ód¶ˆ²Ì( D8@ƒ3êalÅ`\@Àd‹½PQ¨þ¦ÀÞ§ =ü‰…N;—:§ÿ»§$õ!},®Ay; &Ù’K+¶~å 0·É-…\(Õyà´:X\•핤Ÿå‹ýaPQ¨þ¦ÀÞ§`€?ÕžŒB k=¦q1@øŸ‘“ìm'™èÃ0@1êÀ¡ƒÆx¸ãÇ3 “=ðdüUf'Ê*1Dì} ç8L¡Q a\ÓLj4®A¢îži\íAnÔfÒŸ 1HåQ÷xÖ“³ Ù½U@³Â½A)ã°÷0öPÙ’NkWÉ;=´õL0ƒJ´¤d’iA¹Ú4N²8<(:iF2$=¥?»0$FuQÃNgHÏ‘"ø°¦ÀþFÁ޾VjßÈÝ1à‚ÏÅõ˜ÆeÚÕ®ô™dn Ïžr2ë;ÅÉÄkžQó’Óȉ9²­d¶eÓ‰aÓx í†ÿî7°{¶œTCu„ÝuÓ¸^7‘½º¥ó“f*z²Ï˜Pñ4(RVn»Ìž72ÙtPQH”a7L½MY5 iÜH¤4åÒj¡ÌÌOãÕ÷U2D…,‰Põ‚İX £}T¼¾QzÍåZ\ú²2³VŽ&iµe^ó® >5ÙáÿÃø()@CökO5•÷´˜¸åí¤$‘¨Qµ}“­F·XFÍoЊ>iúJ’`Òõ.©ÎÊ1²vh{\ƒjðù€É4†z){`N,€ôËBH¯Ü%dM—ê¨ír¬,³e¡etye‹·©3â´JßTŒ=]yvèÍí¡~'&÷¦¾ožb¯œí¹ìª×3ol Èé>h.›Z}U^À@ßÇ‹0’-‹eónçU¨gE³‰ë¶ÓsLmaYæ»òuGN“8`bfÕ&“¹;…„:XÈäÁ¸f¦=«ÜÜa†ŸEév^ À+›-ÔT¤Æ–µôJUnHú¶e=êÇxU»ý¹O;}ÖnUHå窬…Ö…Ó“åùe²sÔù¨rÀœÊf]Iƒ¤·MÕ½·U½üPä¹Ç¶9w¯ŒÚ«ªÛ•¬ßrNŸ5ÒþÞi-auö×#žò_Êò{×ýð„q~uØ9”.¼´ÒÑ!;zI ¶Lγ7lhq¤ì{Ýi›L^•>Pÿ; ¥”j÷LãbÞvä¼%;£z•–©AÄf'€ÊìÔcáHæ—°Šøí±ùa« Ó'{hS/’‰ü>Äj®õ«ï¬x¼"ãoÛ ­OÏüÄȆÎH©œC4Zf‹ød›±9£:ðÁ&Èu¤|ƒqrçì$Ù{¢%,…òw“U˜ñž#Rß/-¥_¦Æ8Òhûì¸-k ¦—lR3æ7ž|ë—â'çÏ’”%¹ºç-u÷/¢W<˜yẪ>?+ë-Ç67|ûòˆš0¯Ûãûâ€ç I¦ÊÅÞü”ÿÀ3;躎ƓÆÛO–ÄÆÈ¬ëéw°ˆì™9ÅöëËëîuo*»!GÖk‡*[Ÿ8ð5úàT8­‘%7TéD2%æ'  öïß2&~áKãµµÓôÞwììÂÎ>Lì‹Çn6nS¢ä’ߨڱÁ!'G¥Éã?þUì……+þô¼÷¦ÕÁŒõõ¾éÓ¯ãdýLQ^fcžaìˆlÿœ,¿3 bÈÈ:'.ZQ_‰l å•¿¶@˜·|Ÿt<åįxÔçUòGŽÈ%L¶ñ®öʈdGøpìGëgÌTë•“ótEäôœëÚ,lìpY.úÊ/œ›®š/ß·r“zè+®¸%¸í™Ãß|êŒâÊØÿNÚ¦>ye£ ËŠágÿ·Ó³hùS½bÎ"… §fž8}ÝšŽËžXTÑù®upوأ=Ð%PÛÒY3:·³íéMC;Þš}X'›¬Z'®´Î¥ÞÿÓ¸²eÉ?ñtI0Í ¨åÛ¥oöökñ; ô†’l¢¾fͽy#© ò™~”+ÕY†P ]öè‚ T–ÿ®áåùÎk™««;FL;÷©ÒâLïØ‚¬HÞŒÑÙÅ¢öN"L—+·¡;žSÛeåíYYõm!O{Dæ^ɦD4JyEyªLvµåL ¶=c£N¶ ÝŸ¬Ô‰—=Du3 WÖU·õE«{ž'TÖǽµjÚ”—¬œ‘Åe#λeÆMçyºÕÊ»CÏýú±MÇ}oÛJë®ØqûѱÚ¿¼¢*ÖyIµZúTsõ]EÆÞ¥Õ±žìvãöä-Åê7ÍÏ Ø§¯ªÈ,~£ÖV£Æ©/^´Àsþ—&Vo=1ñ¡?mX-`Ú v; ôIP¸‡|Ò¥Ú3Ë|Ȧñ$˜8+Tε^ZôÔÖÕjS8›>"™8à "£ò1sãOœV4E4]tˆÔ­te[ÖèWªÀ ‰c@¡ RfÞ¼9êÈ#ÔÇñÎÿáì€qôÑG«Ã?\rÈ!:,{²!"›$²;ñ™û¸p à°o!ß âOc‡Dã»ð~ýúõê‰'žÐa‰ØØTҴĨ”1*38aîØiêGǬ¾Ñ3éù5µGܳhkìèIË7Üqvý«ÖW$>ë IDATùfìÂQ›ÕʛՋGäpä!‰ËþY8Yøè˜KTxn» dÒ`x6ƒüΕWÆ¥‚·ù?—聯®æ¾W×a/ý@H‡É«©ã¨©¶WyˆcÉÖb–숔”h.ÿ>I0Ig6zkÔkPÓhn÷$· æ*ÜâÅ‹õFûlo zZ/ÄŸæ«ùÿ1)ôæ–ÖàÓ+jJeï€IŒÌ9P4G*8­Þ Ž~|G0]]·ÕÔT¯¥ÒáœsÎQ‡v˜ÛòÞsÏ=z¯AÞŸ û´Á`H#ö>Gò›­›Í¡Üi¼ áÑø’m¥é»4‡ºøLÁε•••z?8@ÆÖÕì Ï;Ò^ºt©ãŸä³É^Þ¢Ü@ÑÈüQS²Û<õ£gÝä-/ùãOçˆ5pÕ÷>oרE߬ˆ]1m«ìzCžüËÓJ,¡UùšêöFågžÞÙé”oïTZ*Ï;W–wÖÓc7>xy—Zùl÷Ìãÿâ¨ÆíIÞÛK àÏóukbóKÎï‰;`Q“ KÇUž›œ­MÝáΈOoYLL@Ããã±!?’‰í‘ø°´¦2È«ä´õx¡§¯­~À\÷sÏ3&eell a›ðéCFO‘å)Z y“ß,~m»òUíhìÐLŒ„9õÔSõ>èè׿þµ¦Ûg>óuÅWès‘ €ÆLHNhTßýîwµ&€`¶sFP&Mš¤5ÄïP÷H‡-«-@"@ËžðŒÀAu‘sˆN;í4 RTtÂr‚ û`ófO«Vô³‹2ýDbá±¼W=ïž7X^ÆM'f,+É ®–òlœ?&°UìLmÏ\?¥] z¶©DTߣÄ¡ìµ0ëe]AøfãÆºqùñ¬®|ôQ—d“пä-Îü«­ª×ÚÒ›úï‰ûxo‹Xݘ5Nšn‰DÕڇMd÷Lãb’ýåžµe¼É†|4Z@£SÒBò¡Ù8ŸÁsÂÊWa/iËñ|¹¼ÁjïèíÜí ì‹4)ñ•œuÜ%‡šÓ6OloÓZãâÇšF¯j¶=0/ (//WŸþô§µÇ^Öwß}·ª¨¨“ºWW_}µTH*Ó·`¨|§œrŠºð 5ý«V­Ò Ä¡±B-‚þ\z‰‹; .¤­' Âp(?ùÉOêr‘Þ3Ï<£þô§?i-‚ütôË~øaÝ"É;âˆ#túÔ¸¢"z6lÛ–ˆ‡r&ÉŽ¸¹ñÑÙ¾²+oí—Çm]Uú»‹× ÞWÍK7¿÷ÙÔ\÷®Ï Í‹äBÙbnnmFYvCCHçùÏþSožæ™gª®–º¸zò¯Ž'b2„WÝ­ûJ‹Ñ} øg$‘þÓóí{\› AÈîþ­Žlx™<Æ3õÞ l²ì°úb¼±#÷ËnÁX˜`¤›ž*Ì@SiÉT½.$“d£²±Ó¾þã»8ðÈÑÿñÓK¦œXÒu´TN—1Ñ™ÍñÌ‘7WOËYÔ—þ60„‰Ÿ{î9uÙe—i?÷ÜsõisœŠ¿üå/Õ1Ç£.½ôR­na}óÍ7uc„dç2­!÷X¤[ú”Œ)E¬’,_\v\µfZsrC9ã½õí³g…jÂÔhb?ðív‹×‰îÈ‘éÉlˆ6El;âäÆóóóPF€ñÒK/©n¸A‡£&1 B³øûßÿ®%@\ô©Ž;î8uÆgh•ðwÞ±V¬X¡VU¶eÏ—™uÃܶ1¥?¼®T•œr¼ª{ºªé§×¬øã¦’-ÛZ[½2n6]ÆÈæwóмãfj‰=ØÇûw¿ûúýï¯>xöv5¢n™šý‰nKL"©|¸7þƒ€dõÎÞIdk¾ÿŒðà¨yIÓ¸x%–ˆµóo/˜Jg¨òâLµ£5Šž­­BÒR2˜E‡Ý›ŒhQ0FÐòª–æˆ0 ûxÛÏ¿[%ÊÊsÙßPàõœ:½¨øœÒèÌs›Ž•¢žº­:köU3²ž­ñk5È€µ½Öî¿ÿ~m}ã ¶+¯¼RÓ`¡Š¡£¶q„ÉŸÿügmÍB"°Oû´g$ÍÔ¢`lVcžS>ú(o@4„°š9ϧJ报k„ìÚîT‘ >Ùê9¬*Þ³UK£LÝ’«¡Þ“WÔËkÛ˜¥ò¥ýÌ+,P£'Z²]´§½Ó=xœ'8£xVüÉ—s¬·V~ ™°,X°@KU¶^¹r¥ý6¾/ã„ 4øN?ýt}Ö+ ”¾²uÂßZ¼‡¯~nä%_÷ª9ó;öÇ×NºíÏ?íøáËãƒËª#ŵñ¬`éÄ©ZݽꪫÔ×¾ö5 ^Èà òüâ­VCñïlÅI|š©eNC«=tÁŽŒï%óuƒ åVûÈ3, ‚ŒOíºi\6±w¤óhåd´{BÂ…ÖuÝÛH%TÞ¡£ftU?Ó^ÓâˆøìãÝ Î=D2¤ÑÙžzÙôŠù3Æ/Ùóžx'{òï7—Ù0ªì¨uýë_ÿª[u,q×]wîç¼üòËjþüùZ¥úÑ~¤% Z¾|¹ºþúë5˜ÌG¢B½‘ˆUê‰ÞzüZ:ã Žš}žpò›TÝK!õð7ܸ2òüšë7lm ¯•ùw;“›X’í,̯¶§ÏaìÁÉaÛ¬æjUøðö²‰«ëÖÎØ\÷\Îæ†.oDöN—q¯âq…Á¬,ŸíÌz<«:b^ÊJÈêwòÉ'ëoŒ”¢a¤®ô­ª««5ÀX #Ò—÷Ä¿ðÒ›£W@9úCþªæMó© Â8à§žzJKã[n¹EKl^fOïÍÕuñ¹ÙAÝ¡§L|o‹§!›ÆS¬}p DKÐuèÇ"×uÂÙŒÆ Š4!8œ à*úG¨~ BÓqEç¿Í*´…«l9BÆÞP«÷à(¿ýÆO€”=oBþé"…:uÕòÎW;?sÙÆ©Û-¾õ­oi³îwÞÙD´b¨@H, /¼ð‚î§ ‘hÝûÛßêVŸáÂrÑ ú•Ÿ_ÿ¿c¶‡ ~|mP•œÖ¦–üºñšS¾Q÷вšUGOÊß$¦éú«n¾¼åª 󶉭JŽÅiW•«¢jùR¯hÔÎïçÙÛ»³•LÓq&øZl9ÈÀwñg Æ©‰³ÇªÉ³‹TöˆLÕZ_¬>xý@ÙÇ}â¯_/ÏìªjÎç åG•G ¹>¶âM¿çcNVtþhXhQMü‹ïK=Qé_¡Þ"q ]¨/'Jޱ.ú†€õŽt7lØ ý¹ˆÕÞÍñ<ú$€sï5'Çç¯k'g›Ì©¯QïL_Šï%§xÅpa©.}âFR¢™x©w˜‚Ñ£KjìŵcÍÒ £®`Q:ôÐC51`€E ñPÙ;Ѧha–LtõMomÔ+Sóدþ‹A¦»¨ã ‚‡ÈŽL§.iË8éÑõx£F‰qáÝñGÅiheia‘Dœ–MhD°Æa-ÃìûÀè>á–,Y¢n»í6Í0ªª£±.žïˆ]šéÜýý¢˜Zô÷µä–êsŽùÍ"­–>rÛ¡«¯=þçÕ wn½íw‘§îº³kKÓï£k›¢iæÐ±_;W¯+Ï^U—á[½¦$û¡Œò‚ 3o|náWØ26pÖÙã¿wÙÑ%*£x‚ª\6[­~½4¾ê ¥¶æ¿ÌðVyOñ0„ãûò=Ä€Šþ2Æ,FZ!±¾ñoè#X8T %ñQ#Ùzø/ù‹~wÞyçé4¤AGEV¹2HkÌÍ.ÞÓEø¨´4”Y É|)³ÛµÏÕ§2eÕ§…¸Ã¦{N&,ž^1;Ù½aTJ†àNÆ0Cœ£² 2lŒt©™£³DõÊé9{µ±IWŸß ürЙtSì#eöðÉK¶´Uí9ºA†P`žÙ³g«/}éKÚðÂÙ½¨º?øÁ´”BZ¶l™®3}¥É“'ks4’ú7¿ùÞðA/ZrèÍì–êXF¨Ý#çW…äØfQ骯9åó+–lnZýÔÓ­RÑØæï}ý‘mÿ8ï¢Ðî.O¨hwû øÚ^©êR÷¬hj¸å{똞]>kÌëÁÏM :raùuøiX§_v€…ÙÇ8ÑÑÊö¬^«;vi‰‚a‰a£–bRÞ4cÚGSA A#4 4 yóÍ7«O|âzl’¸Þ¸žØÛÛ¡çÈ×½ëØ«Y›ó2ÉÅü§Ìâ²E¢1cbH’Ô&阋ª×dïAZ:È´(0wL牄Y•Vš÷mŽcVž+­}«%ç÷îm z—ñ‘l±TÎ ø¬SÚ"ÎiµÍž9 Ž/àñ4ªñãÇk†þ’…VøsŸûœVñhy1sÓjãÔ„g\ ]{íµº/…ª‡42¦kìÁæÑÝžsÕþ«‡¯Ü¨ªV½qðÈO½½ì[áuÖC7T|ïìß¶ÞðÊö!Í.´‚)d™C׆–®.Àµ´2°cÚŠÊóÆßÿ–H¬²ÀIÇMSe³•#]ŽœhŸ4î õ™×¯îò¼/i`æÛ×ÃTú/Ϩð},´TXãx‡Ä¦1˜ø™Ù2&. ˜ðGgLLí0õÞî3™bjÓ¸ùÃz¹ßËsB’¶4"™\XI Õó× ª÷ï­ˆÔB4Ä6-³Ä„a `’¼³'TǧHz–ªqÿ“N2[²¥)t¨´L§‰…椕1Í“‘cM¾ãB˜¯™Ýñ•¯|Exâ‰ê‚ .Ð@aúÒ—‹–˜~ƒt¾õx -4ea”0@B ÂeGšã‘ÚMñmmõÍãÆ5^òÈŸ–«Îúב·Ä¿»úÚ÷Õ÷wx ®J;“ ç»ìÑÛÛÕ¡˜\­"±Z×Õ–ÔM{¿bݧŠ_^+ý­’¬Ó‚usÆtÏÏíhóª‚B+» 8©™À|g*îæ¢ð…ñ„H+þÓ‰§ÏH|—ÚD”˜™—{ÁÑÐKbÚìÜj_ÏXS¯$Ý%ÓxOò"Ö⥅C7±Pù ÌèFf„r Žž$=Øvi^ ª¤%ÜŸÜ%‡—Œ—i.Gçí…Ò?¶3X4zÂÈR­²"@Z‚ª‚…½«* u…‘hD˜R…eë­·ÞR2£ œíãtóµïˆ{·X­‘ðåÇŒ­¹ä‘ûß¼kÑ¢'VVç½þú–ë+d-‘V3ön«N«„§Œ»°^ÕªˆÖÔ„ŠOYWÛyØäœxÙñS¢™•…ª!s²VSMc‚†6€Ãðƒ™7H]xF›„IuÒ-°d^œ¡Ùs|fÇÞWód€²ö$¯#ã§19¦4ÎÉŠ©uJýï’L’I–>“ºvL¤B0ž¹0•GÚÅ,æ¨ËY¥ù^µªw,Ť³¯î·5~òÛ­'Êalç…ãžy­…Sò'Œ+WbÖÕý>¬QX¦T¥>ÌÜ~ÿý÷µ ÃŽº&T[ú‰ v"‘|}öÙgõ´$ub$õA]Wø†SJ¶,¼ÿÁç¯9åSOÎ]ró⚺›}_ÜW¤Ø)ߟ<»Po¼eáøæF±=d|§È<ýü ³gÍÉ|#:ÙZ»)Ó¢µ®¨¨ÐV9T]Ô7*5jw¦8Ñè¾Áß´ö^ÛŠË&¥!ÕÑîÈl YeÜ<(sO9™ˆ-*“¬óZ~ìˆæû¦¦o´2×û!KR7˜¨¨É€Ì”ó !yG¦H¨QùެT;Èî¸÷/öÂü€ó?®RìËGYoT~ßVu’œÐý9o 0wspJÖÔ)³tŸiôï|GÏØþÙÏ~¦gsÓ/¢6­.e<¨¹ô‘JûÛßô ”GyDW‰s"rŒûÖørYÀô…ùãªÞÏs¤‡HKϾ¯¦}_Òb ¼¿ùø–†ÏûºÊµjÊÙÒ˜TºP•M;øˆ±yù#òê¼ÿZì·fΜ©Õ[LÝÐ P‡DÂA@E·gì<{e›E9+\&¶úu+ß°wû[¢y^Ë#Ó“ýrÚ}ÏbpøÜ€ÝÔ…;ß²‹F5T¢¹À${w4(ôÄ>Î ¢ÀH>„“±©¨ìM—M?â_šS¹W[›>…tý‰ýmz‰,?JF¯?Y8*óðÅŧû•Ù H¬M¨g—\r‰–:L·a^„uw¼!2uÅBŠ}ó›ßTH4:Û ¢EUÎ’Úßá¥9W?uÛ[w-ºà©X\í×@2$ûÌCÛ¨èšØõYÒ!– ‚í5òÿ°Iöê²™+_Ìü[ì$½Œ„å"4, `˜14‚8hhf¯óLÃkߌ€tu´©êM¡ƒòÛxk“‹÷tôôgykÀ‘•϶œCæµ;d"‰L•3ÚG:PI’¦qy”·]’‰|írÂySF8Äéñý8ÓrC,.Ô’…qÙ=GY³XÞÃ2ÿ}çbï~1[½öÔ¡2maD9摎Óüó¦LÑæøƒfÔ4$Ñã?®4Eü©‹q–þBc2¿[&².Z´H·ÌÌÒ†¸ØŽm¼Sí¬ªï HŸ±íîg¿½LÝð™Çÿ¹Â·ä±õ­½Í·I|?¾Ëº¥ŠØÓùX°¶ËAÌÅÚwú¦ºø¬ÊÕf¾óf±çÀ¹‡é±$¦˜1ϵÏÍ„H&”iS4L 7 NAÛœLËji“s¼½GŽª·×® HKß?Ÿíi2m¨nµó2í¸LbŽùEäÜ|?s'?ÊIy1˜ 8DOKΗ}%µ¬¹À$Qêm‡¶!Np€ZQ1XH®~OuS—¥F— ö˜b ¿ÍVï½8OŸzÆòú§¿Ú|LÆìIc4n¼ñFM¼Ÿüä'Z²0»1aÀ@Hê 1>ÍìxÆ“ûÌ­ÃÒ‡õ5Æ€oJ¬*º±®Ã·£-Ò¶òîÃßS5•tCtñІ®ºH·ßzyN{¹!¶fÖ몫¾VÑxÑ!·.¼÷Œ¹]MO=Uo#•ÐfÙ SÊ Žþj1ÿégB'hÊû‚\;Þ\-€bY#2âol*¾©Ükt½9ÔaåùjΘ€õ䟶֚²ÒPfînÞƒE[Ó6'TÌwä ?7VÒ–Û ÛnZ[¯ fBü/56ÌÄ%Öi^üQöES…c…©éì©ÿ1çñµéÅC%½O´O?óõªƒsKKGèV’é=Œ Á¨u <£²L:U‰20ñ ˆõÇ1ûᡇÒ“>‰aö…6ã<-ñH8¤64t7‰åî]õ‰Ÿ<4Ü™/¬hˆTèÈÓÏŒß%Ô¾È_:­…6ðØãMÝÛÚ?t|né›õM63ÁÍ8j]µŒ71dh #ŒiîÐ ‰C¯ŒñÉÈîzKMž¥ê_î;‹ã£&•Œ1:2™ÙZ0·Ýº³ú =UŠ2²ìÕ•òÓÀû4ž|_q×êFyŽ*·ëZºí3%-wJÕ(‰¨*[¢qƹÁ„”êé”i¿äOnaŽì¨èè–åþìAEa2Þ|ˆ9/W͘c÷_­Å|ò©óÊóAÝ` ļ2æ‹¡+³þÕ>}?³6ˆgle Œ›0iõØcÕ–>Ò„ØÒ#ˆg‡›Ãë¶·7O* ¼}É#¿¾ï®E?-ã9ö`ÕöiRbƯPS{Væ ÞÓrž<~œ³ñ/:Г~#ê.³=˜^ÐTàZwÄZñ\’—iù-WZzKf¹s¶ì Ì¹'+/í§Èa~ÇŸå  5‘DðÓä0” ¡Õ^ÿømGúZ1•?.. E½’©n³¸Ö¶6îhóDòZtǤB£î¦Ä&Å¡T˜~AXÆ™þߛޞ¤ÄiÅœ·Æ)Uq‚X‰µÙ…‡?³nl~03O·8üãu«ÃZ€Ä‡EÒðñgž©3DenæoÆ£¨7³? :ƒ‘|‘Žp,ÐÐíT¿vãÄŪréK?T¹Å¤õŸr÷d}£.¶þòWN~úï‘çßoͼðÊCó~~ĉ#Ժ÷Þ{µ‘•‡QC?$îЊç<$.féôÉ‚¼BÔ¦A™sOÒpÚiè8ÓVò¿A÷‹0Ž*ÀÄìy¾?¥±àº¶(ékYÊ7NÕÉü`®—ùW/µkš:m­¡¨Õ³Ï- ™&Ãø@ë“"¡è¹C±ú÷jksžËRªvºlÍ|ŽäÄÛk‹r½ÞÄ.´L¶Äý×ý—^¤ÇGFº îñqMCpÆz‡šGÂìg–Óßbö4óó3.ÇŽú¬˜·²¹»ýìÙ#שEw/ûüA§îЉüþx¦ÞÚ.{í-;è[ eþcÎá7|=?î#d èq7èÇ tÀ„ƒF¦±2ä°Tܳt²C/ï÷ªsÔ„,¯:àháÏòPII‹¶:R^xéjº64–ô“ÑV º3½›ê:E7͵:£½ë LRï½jÞš7£ÒI³›ºœz$¡æp73 A-Ò =ñHË#ûaCæZíƒùVÙ#e»áÃD*Í~smqnC[¡.Û£>ª;Æ ÆÞqÇZ¦õD­s &0@2„¡^2Hɦ(¨1Lj¥ÎlD¢[-Ùr´/ÌF’ލ-•¿ºù¤WÔC_}ÿ¾•ÍÉ;S®}~?ùËm—3ú3¾,SǪf˜9÷Ü3õ¸Ûƒ>¨û 0¥»¡…?ŒV—yã²0o—æºíÉ:Ÿ?¾ I£Ÿí…¸èë!…°NbÁc쌆 ¡½Cuí‰×íÈn´ƒJÒ$˜V¼Þî I$†i°Ò0#˜ñ:h\ ‘H¦ŠŽ¦èÀÔ íU'êlhXy¸H¥Ã?¨ò|¿"SKÄ53XІéë­¦QíŒDrƒ€qÑ:!•˜:Ã2 Æ£0Z`fMjÁøË—ïóÈAÍgϽTÍþúç\½ië^­ü>ÈÌ3òÂÿäÄ …Yþ'žûúuOffæožX¼Úaï Vs¸›¶¦¨H&yèuEͶ ÜjÆ1þõ]$áÓî|ŒA‰¾%|ACJÙMú¤¬ÊlÙÛBÔ–V;7àT’&ÁôZÇ*gËÞ6èda’‰¾pZžÉÕkࣅ²Û#[C¬½B QïdMNëdÒimž£–®+È€(4L÷a[-¤ëK/½¤E6­P:g@„õ¦ƒJ Ñ©;“`i`ЇŽÔwÊRŽ•WÿjÁ³ê¡¯¯üçm;OFK—áÇüç »Ú¹Ô~ûÊg›ŸTuÏ.ž‹9oH'¶þ™09ïÝõÛº{È¡Þq}õ«_Õ»Ñ0‡¤.\LÜ‘¾nÇc`` Šyh¬obß9$0õþAù†¸ì«îÛX×Õq÷¢ÖÔÊ?V¹Óø¿ò|Ó53Û{oÇ;Rÿ—óZP9î†"X¼döÂòæ†õëb4F¬´EÕHh4¸&µda¦6Ëiˆ0õÞmˆëAƒðg0DC‹ƒS1žh+d®,)B¨66ZC1˜$Á$‘¢² 0• b'QžÑ3±É,î"È IDATÔÂè¹Ma9¾sÍ›ñÒéq9 è#kmdº”µû‘J‡nªË™Öޙز™±Ø}ùË_Öžå5ŽÿèÀ À¤SûxpXM S Ö±a#u„)æÍÍðªÆú®Å4½Û·Š—©‡®üW2tìþã“ [¯ùò}kÕ¢_¯Íó„Zê_½/θß„~'¼sBqppÂ4.L=º 4xS?XvÁ_ò ѧ÷Ëv²¡¬h&ý9(ñeÉ,YM1$Iê“·µ[Oñ§fDæ\Æ¡úÁdH)Y¨˜Ó§ž/˜ú(÷1A¤ÒQbt8rÅš``FcL‰eæHVÈÒ—ÃAÔ3¬2ÜéX T!ãH„@H'îƒ fŒ-ܱX"¥ççÖ@Ìî—žmgÂÞ;jÑ-›<‹–ÿŸ•JÐ'Ò©ëáwk6«HýÒK'miر­*N_Cä4Ft L]¡­ü€ˆFšî5'Ê”ä&ŠŒˆé2¡ÎQ6wÃk Ô3Ó';;ËZ(ûÊ~ƒ¸$˜‚^}2šÝU+‹=Ĺ3p?›ôP†5"b÷¨‘­7ºF~$Sx‘i¾H¥ÓÖnÈšgè¾ãHlL‡ëê §E4ý<:Æø³G: ÂK$`âB¿7:>i±]¼0 œë¯Pjý:ß+£1Z˜g+ë}†Pà ‡ÛñÜEW-+¸î·k–Ó‘³íºßÉÚ/&³¨’~jwHNyK³ÏšÏä¾WÜóe’–Fƒ¹Gj&ÁÕ§0… I*K“两A%iL’ˆ]ÝÒ뉮ÀÐoâ9 `4=ß*$S‚G•;­{~ì ¶ù*i²'+Õ¸ ½¹u—²¼þúëÚŒTB:!Y\âY?cHA21F6a *þ(Ô>ŒÄCõCÅ›7ož6^0É{ˆ±›jC±»–µ¾·­}ý%7ž»¹ãÚJõù(ÿÁþç_]2î´FåÏ{á«Û7Øï¾a.$ûñ¡V3% )ß%‡ÂË’(Ñ«ïEºÔw",j$ï˜O#‘ÒI&®ž¢%%©—4¨ H¢MÎìT2~¢Áq$#·s«y€ EË‘=d™j®]+z¢y¹ÇîegɾSõåLZ¿)« ¶é ¨l[Œ)i‚:fÀOÞFrÒ6ulpQPÔ¢â:€>Æœ錽]o[ïU6¶ÎŸ»F¬WU97ýöÿ¼Š§‰Óó3¿<›úÃùoÏþé×§Ï~ð–ÑÞÙãFýóñÅz!! ¾EK;sÜvm¸;û,¬i«ˆì8ì‹:ð·“I7Dæµ#†‡˜Œ‹ I’&%“˜Ù×Ì{èw q˜ÇA2z&Ï8ˆãríbö}(×éì|•+Þeufó†±2®T´m»mÁül’‡ZÆ^ UÎìYGy1’PC4À†ÅÉDXþãP’´T¤EýPЛ»ÛZ¢ollËš¥®»6c‡Zò›ÕêÙ!ùCûKëc§þºé}5ñÜ·Õ×S}ðá(†  èñ:–ý7·uÂØžiáê¦À^UóÚº#4ôô›ühéœáù¤_–æÆÅT¡t4sI0‰ÕÂfò¦ 8 ÃÂP@Üa8óŽ;azÐŒƒ0v»ë„Á2Š¿ ÐzTdý8ÕX9qÅû¾1á°G›´™tÊrÔ;ÃÇ2Á0‚ €ÉŠüP€ˆ‹þ“œã¥ì¬s". DŒ„º­­Íá̧xÔ'~ÓqÅw÷íJEþ„‘Óä;îZôùuÊçY‘yÓ… £rýºÁc˜U/‰Z2ã,[ŽÃÑz!IzŽþˆh%ë§¼²w;@î;íÅ•ß=Åye¸‰Ê5¨š—“ÖÈ ˜háa(Ë< T%˜˜÷2ߊx2#sH¢PÂî‚“ è«Ö¬*7¶z£7³PϘ«a~LÙtr‘(\H',wfþ ê–9¤Žò$3u„)÷(ìe'Ž–jŒ,ÕvÛ§n’1•ªçÖÖ'õÛ]¨È|п®jÿ}YCÅüþ{õü»½—Ÿ?^ó †vÁ-!WÐÖzY¶îlTrbõ^t=ãD4úió5꿹÷haZ’ÊdnGÊ<¨$u'ìí9»& PHÔÈÔ¹Ç\¨ÿâgœœH­{–{rñ¤Ì —£&nŸ¤Ö¾}TUÆœéᨌJ‹4dHö°Æ XznÖÎв Êxú>H%Œ üÇD¢^üÇ¡*r!ÙF XòHKVgƦfg:WÌìn©´âšS>½uucô?{©…ù¨»q—½Ó[Õ¿þw•*›øADZóG¬},ž¥Ue¡åisʬ5+šé;øeJ‘-ã¶½ ´yíF1ñæ Ÿúc” -aÎ%ùÜ'³(oBóT’&Á$öt*g‹8ö‚„Ý:&ϦCSJï‰À¢Žéæž#PdE¦ì2T&úêŒÇÎRãd ÌZ€ÑYRÁYH¨vÉ”‡g¤Ba*P”™>êœ k‰„*//×–Aj™UÃDnFü°â\köŸÕ­êžß&Ǿ4êćÒR@vÄ:ÿ°Y<—f­~ñ€’¢ã²0@°ÍôùŸ;×3/¾Áá/µfY¤>4²—ÉÒ¦¶g_Šº&}°!»PJƒŠãÃt ¸›ÿÚ3ñÓ&L?/‰—ŸG·šGå0q¤‰»A„ê—DlŸ$´ j5ûz}ˆßxü{ìãï•-©)°Pí***ôò H¬n©Fþ3P0ñPùPõObl ©Ðh áXI H‘H€¿ñ™áø%‡oµÕì/„ž»âÿk>÷àQÃ*Þ`ŸtéSÛÔÒ§VËvÙ;fs.8®X½ùüSjâ´)já/>WÏhynEVƒ,ÁØ«Q…ðg®ô}d–8Ó¨,c©6 ,ïz†‚’¦q‰2¨ pƒÉI«læHÆ023jžÌ–¹êb¢(4é tÕ\ë¹ýþΑÏT:ã©ÎA%黡›݆Ì`0i&#¡jŸ±Ü*@Ä‘V8Ǹ}'&ó’ndPf98_uoúÙËí•×}ÿ€z¨:àðO/V/ ©êŠU²íÛ+òwlúâ'uOË ©×®¾4¤JgËHù³‹…–.:¤2½ŽÕ›Ò}’ ",2„/Á'nƒƒ‘V†¯™ç~ȃÌnÑEDP›`‰´Óÿê UÄ‹øîôÒ‡ÊÛ?ÿ4óßë³&ÉLöƒeÖmöƦtÒIŠsRqf*H•P¼3})…º˜¸'-ih™¥gQ Ço¢æ¾°¤»SÔ’zµòÑ•2mj›Ì–Þ«­éPHµ¿…ñ|£*{ PŽ!l~Bu·wËÞ{Ç=òã’ÑGþ÷Öê»'}ã¥P,þ┢ŒMöº÷ªUT–Έö¤O¦ö# àx»ÑÄ|Ø\“´$“~žzÛ€äv3?j€´£•’¢‘J&~Š÷®ÿ½ìŸ…#ÖÕ6(1ËZãak‚<`žG¢`H@z@T7£ç@¹Aežñã",µPã¸p\¨‡f­–OÈ Û+ûäxÑhǾRÁ!e¯TUêðÃ?SÀ³hy{ìéã–È’œÕ^»D÷ý¢×GÜß°æ®×6JÌͳîkþ('q¦-ܤ`¼.ü ™ñRÂý;983fÉŽJVAý7˜€(õt‰O÷µzâ§ 3äw²OxÆ‘Wn*•µ÷sdØt”i5Ö;ãP7Mß©ÅEÿLJ»“¹ 2ªï¸LÚH;ÔÚ %ÓAhX|åί— _{Y‰ý•G‡Á¤ 8„Ù¶3¶¤lj©¯T–,:þ¿¢3Ž:¯]¶K.¹B2{2ˆIv8éËó:}Ãc†\¶H4Gv9vfËA€C–L2•¨¹jwÄoŸ~Ö‡¡€ô•¼²ûæX9Dmr(îÓÀF]8LZE£¶QaD2ïèÑÿI,Êd€Æ3à!<ï÷äAÚL>_,.güŠÊ›k=³¦.~í‘—J¬wˆ:ì†HÏ¡÷œÄàÞã|„Á’ðiTƒ™-Å4¢©ù&ŒÁÝ3Kb¨xdȵ+Žðô³Ð-IãC¹¯oÊM,²d¹°ŒE$„$†–¤cf@" hU¸6`@…©›ÿn ¹ È{ ¨Ä%}\‘?fÉ¿ÒÀÔFd7S9bL¯ÆÀðólj>Ð¥îUým¢†oïÈ.´n-.mlw€äj•-mà~^Â}¨DŒýÚ늆î¨ì”¹‚p·4&-P1]3$‰±2òÎËô…Ò €ipŒ#. Õ3;ïL?*3(‘gÒª*_Ù4¹8S–é®¶äâ}<ïð§É«ÁdŒ ƒT†#`cPAá“IwWU¶=j—-´rGùüùa_V1£"Ê…|8$æG €Å{â4ž±Ð0že¼ÃtÎøù@Åf¡H£™óêÕÃ\yæŒümžòë‡-yšâÛ„,œW²W‰ËÑèÂÜùî8Œ]¼GØ!›ÆQÏŒ#"¨u¿3~Ý÷˜iü½Ïf04=Z&ÝN•Ót3©³¼1[ÃäHLÖ8€ÁÅ;€ÅÀ+‹q%Ô@$Ò PA,cHŒ0̘`Ê’É8¦É!n>U27z׋výÅçù†g>â|Lﻋz l^?|…3«©ÿá\Â4VoPµÐÄwLj22݇($®‰¿+qû„ýÛöÂLY¹[*S›¦vÆ}>ú@ìÄnªH%*He©4à2ÿ¹ °C:P‘™ÏH%€X‰kÒ&-1>Š£²Y}XýÝLgØ}<) »J‰¦…‘cË“´© ßÜH&4 Ô?( ï•x– ‘XªYï1`åÝ`êAî¾3ËÁà[ 3|óåä\‹Ž ©Ì|˜0aBJE{[*jj€H ¨ ’‘T„EZ!µ0:pÇLNx¤„ŒDÄø ©E­5Õ2$2jê€DöÜÿ)XiÛI£è¥A5}&¾94Z ¼Ã÷ç]šW"ž4¬ú ÀÁjéî3yå”T½Mã0"™õè”Jv¼$–` –× þrª„]¥õÖHKDÎ@’Ê¡†mÞ¼Yüñº¢¦ÕÀgÀ3@éÏ™>­p¡Bòž4ê^³äôA¡M³lOCÌ÷ѳM áûLJz¥­j{@BÇã›ÞI¨t ^TƘ%+s³%ž_¶t¶;6lTcK‚IVÙÂ0Z]3@T$l:f† {˜×–•¶ Ê’£é?Óµu9QYdÆþ}”ƒþÖ6Ƙ`ütÎÅøQ.ogþ›zý+³—:ÒÉ9 fIžT'«PN7®e²ÑLwû°šgˆû1½Ë:=%à™ãQ ÞÀþà™wð€‘Lš×;ZÛd_9G´Ði\_—Ä áÓ9w&.*–¶æ‘(R(Õñ?86T‘0‚ÚLGZñÅtmaÇ+ý%»ÆÉ’‰PQ-=Èó6 bÎÎrôç’RøÑGb!!ƒÁH%†Å1§fK6çïh”½ÁZVLÅ?‚½-ú+øðûŠ4ôhÚ `xÇ‹ïïæ+TAÕÕГŠÆØë"r¯ª°l}ÐÒ³rÓ85 J•Ld.ªaN{wXt® ‰èU·f8§L&Í—1¢ÝçõE"]ÉY äo¤‹;>ù¢¸ŸÝaÜ 2ÄÂpr±2`ÂÂÇZ)$S;pKƒì =ªZê´Crñî<‡Ÿ÷K ÐÐ(®~à2S­Í„ÉRûøÖpb ¼~#ŠGÒ¡ÑÔŠŠåyI©B¹»Ÿñ3 .lôŠÜ :‘X¼8Ê8Õ¯á•!3§JeÝÉ i:ésÓ¿1€&1 q„çþ.‡4¹è/–ɲ9¿Âª‡liëŒÉyU²£p•ì+^¥|ÁáMTR?ØÇï? "€ê¿cíª“› ‰Êïòéÿ1 &éïØl+Ì¥oØã˜`d.,ã×ÃÈÉP éµ8¢p÷œÌÌõŠ1c¬ÄžÜ.ÇØó§0sÓI¤‚=yöÉ$Ý;ðÞ\F0ñŸú&òA…d^ ëGãÿl!똲+d«·9(910Ñ'×á?3 ÐÐßý÷ R+ÔÞH­&¬©úþOJÙ¸?JE¦œ|¾Þ.à2s•Ì3`‚é`T`T–º£rívŸIfæf¼MY,âênö²Ú×¢CˆdÂÄmœQëÌs§,øqw;#Áxgü¸Ó_ÂüÉ ¤æwꇉÜk÷,ßÒDKÖé•“Ýé ?l)àÏ$Ï¡&x&î€QÜ {ÙÁE¦œ‡ýþüä*T w*L¼ªÚvöpö¨Ä†îC®’]a¥ÿå“üý²A‹ÞuéQæOØý€0€(F““ ÏDæûÎ3R U0 #•™œ¹í4tv Û£ù“žzHªÃîãJ½·I‡˜ÆóñԾÿuÊ–î_Z^öF´ßœTó¤£mÐgÃl¨t©`g˜UþƒvÒAîI^ÅÉ®°²——íÈ,Ýp¾ß£ ÆT‰jæÎ{°ôLÙÜ"ÿ¹ð7*,„å?`Â)UV’듃ý*Ra+ JÄÁÊ3ì¿ï)ÀnÅb£ Úšçn„(]b¯ñ_»OÚ(I0‰/ã;qafÍÈîÐfPËýŽg˜]¤YQþ:҆ﶚWÓÜéŒÌ Ør>”LN4LZ댪I¾$<Õ¥Æ1}@ €q¹S§Ì€/,‹åìÈíŽñ;(‡Z†ápû”4ô¤îä8ßg´ý§ï}¯Xóì¶Ä 1}}Sþ%Á$V+ã§¥N•Ln@ásr sDªI¦Ý¶G ~"µÉ$õ.-'pÇE4ij³ýÉq,w8Ê• Þ ÅÕЄE"+¥[mÅ?;¨\ôÊñ‹ö肌ݖ¶&¯áû¾§€6’iSw§/˜þ5ß—jÜÒª œË${IŒx{WdPA‘“DÀ’g‰–ã~G>;9Àƒl‰Ó.Ë&¤“väx÷ÕŠ 09”7ž3ªX[™?x†(’u9—!"éADÀ„„2„4„Ñ—1¯˜jod{P"îD áû¤ï•ï)ß²ÕÏ÷6<ÅÝÝ…€Ü ¯ØÖdÑ[þ꓎Øã`'cDV™€‰„ä2Ò ?Â`²>4§- G…HÜF[Žwÿ0­xB çë2¡r™Öƒšw@á½¹ÒÕÚMüùÑcXÆü®[£Þ´nÝûwøécNzx,iwk9†§M5ØšõÑr¶R®Õ!ûð¿þînIMì-NÖ3cÉ3:%ý˜÷‰ëpoCTNw—½²¶Çåx÷ÝnÅ'εC‰G}Y‰…ýz(ïÝ„"¼¦Ä fG"Æšh<†‚"­Ï2š JÄ¡”g8Ì>§ßþÔZ2‚  ›1c<§Æå¤ %ý‹þsÄGãEeR¡­šëƒ‘Žv-RA¼3WI¦‹GX‘´˜§ŽXï°¥>†À¢æA‘±™2ÙµðÈQõ‰µÌ&âðýcI=ï4›iAl‘Ü{Æ<í¶ã¿è.E~q›žÈÝÖìdgøÜZÁvrî¶4Ò2¨UG2!}`h23} &fÌŠ’bH[µi\žw¿ŸFWÍÍÏtÈ©ØÑÑú,á„$ay„[¢ðìþ¿Sz^¸AÕ_ÀÑŒÔ5áDÒ:9>;¨V¾91kòØq?<Áªûù‹[÷«™±gOÌR¹ù>™Œ‰9ÓQµv|óFµvM€ãZø|¾¯[E1ÏÑIª©_?âÉiè&¬’ƒÉÌs¿iJžÚ¯¶ËïÔ‡< r*9IÒ©jì²··„÷9±À¹ia‹­¾ôYæ|’¤Y/šÈ†¨œ éU%GÊ ukìs¹Z1¹ÈùÞÝ_³UÞ(9|¶Ý+³öÙ#ê)¸j·÷á`ªœÐK€”i!Œ–%éjoÃWôÕáþËœ¼åÆp1:¯ïÞ&žûž“X¯ï³ ã$fúG:Ñž ÄÈó!öxóÝéýyÁ¢má§¶Ý¿¥lCI06M"¨뎘R”ê†(âô*Ýòô$jÒ¢¡‘ðʈ÷¸‚`ÁãïeL_øÝùãVÝüÜ ºß€É¹N7=úÂd)ӤךFe¯iÚ«ªšãU-J›-¿ÝèŒÈöÚ ‚K£Þ(±hñ‘{ÞÙN·ÌÇ”ÿf\ÑåG½•p?~½iJ|/èk%-¶äÏ’è#sƒÖñÓJœóK*ìÒ3æ8ê°SlU6OÒ,— µ–ª[æ¨ÕKE*tTÉ4[NŸÔùɦþ–òúå¸Ê0ÇÀˆí:—Íß7ĺïÚä ^Ø,Ï»ìFåKŠË©—÷‡/øî<ÃëÜÍž¹d|É)ÎòÇTÕ†x=aÀ|“`µKž% ˆêG#Ó×"ZpkÿE-cj^˜Œ«[do®Ýt{Qׂ²ŒªåÛCk FŒ8Yv` @ýrØ0>Ùèü{òÓ• ïTPÞ¨«¤cüé;NÊ‹M‘}'þñ~GîƒÎ,ÜÚô8Á=@~•—Ù’%³Ø'[-êJ™|ìL1–LtYgnYßþÈ?­;ÞqÔÊ-õñí!ÛSš•+ÌÉ€ÙaRËÃ9Ìþ§+ɌǤ_§Hã'u‘ÿr§ã¥úeô'']ÏãóÆ-9q¯Cxe»ã‹ßÙr '~Ÿ¨÷=-i=/ñG­%²‹n~0î[扶¼{òÚeÖ}¯mŠ7sœuì/Q›òãNKl[ÞYZص]åzYåß'€Z#€Úe %Ã.²Ê5[Ÿ©÷çûÃ_ð3¨Ûz /h~9Q -µe½:)+±–BôçÜÌ/È-¦e‰Ò:£Ê¹DôŸ˜~£wô©¯È8“´.e¶ l·Ý ÓG´¿´®vÇ©ù[%‘‘Ì‚=ÓŸ!q7 Lfn``?óйú.À”3¦0öÕÒ­ö¢uòMóuF÷‹ÞüIߤ5›ÔñÛ–ð-p|/N?<á„Ô9ß:DoB³xñbõ†,ù‡^îp‰o›X  #Ë[1ï†t—öÔÝ 0ÏѺqzðÊÖ#ô¢“&MÒŒ¡s•k¨E ª'žW—ߢéÿû{ÞS”ýþhGÞ_GÉ´Ñ9ñO«Yb-º|“”k—Á$ã¡ÂëúT‹ßž€.n>\ü碌"Çp¶V[¥Ó¼8Û$˜dùM“¬Ï•-ýòÓÑ× c¶®ªéˆÆc¶ôµÆÄkÛD,wõ™Ñ¿¿‰mkî† hÀ2cœ¼€8© ‚@ÆbñlˆdˆgÀƒqLcAC’!ýÆÒcLJÝ*4 ;r|¤ÔkgiMܽíþqjÈ/}Û¬5ÓNõ¼Üº@o4cƒ²P¿Ç\Ýwß}ê°ÃS—^z©¶XšrÒ »tM5 ÿtï5“™܉K#ÈâËgŸ}V­]»V}öÙú›þë_ÿR§Ÿ~º:ñÄõNƒ|÷Ýwõxj=;RÍŸ?_kNi—úTÓíêŠÇUöa·øsž­¾µW5 ÿ4^´:òŸX@âéäË Žá,(Óªmšd{_%Á$V ¯XæÈ0m߀ ˜ø02Lþ|G™èÛEÌgª¦ÎÄÔŒÞäwñéÓ—yÃ?¾Î½1œ#Û@°÷ã@0»iYMŠ©@â=ïÜ2aSïÇ€?ê¡Ã0Osg†ONçòYžm¢8·Ú2epÿ@’”uìwÉdÂ©ÖøÆ`tAU§ÚQñvüû—ÝÏÉ̈úÈRkm[®ç±—–èÓã/¹äuë­·ê³z :º·ÄO¥ÿÓ/]8÷;â Qpèög?ûYuÄG¨oûÛúÝŒ3ôBLÐ?üpuÜqÇ©óÏ?_KÓH«h³Êm‹O/'žùîøMW©–¯zIã÷ß¶D< ¼|Ü]óìÞPÅÔßÝøšw&|âž›0'úƒò@LbµíSÙég$£öÔRi.Y4eˆ³"s-9{'¡sô-ÑÐÿ•œæL*üµ¹W¦œªVYÓb–JÀTÚÉÜMîÚýÎ9ÆÒ î(,Rë ës·Ýò][fÈX¯<ñÙbi\¶Ú¼´ãö?ý8°ú_oZ§^üEÏ_ù†uæ™gªW_}U/'v|BåÂiÍsjcdè…ÎÝM¼éûKxf•&Â"?ùÉOª¯}íkêî»ïÖG§žzê©ê¢‹.ÒK_Xb“^Ï]ù7•Û]óWl§E†aÞŒÙñìn5é •õÙZ IDATrâàbÇÜPÓÒœÁÐ7çÿõn¨ÒiÁOµøæ”‘ïÎÿðþ ^hMÎï¨í”’„aÄrRW…bOBZ5*™KúÿÛ;8¹ª*ÿߪWÕÕ]½oIgï,„ì {dì¢APFQÁç¯à0*ƒÌ”Å¿3 *ŽÊLÄ•Q@\Ø  +d#I§“NÒkzߪº^½ÿùÞêSy]tÒQ’@æß÷óyu_½÷îvîùÝsî½çÞ+jÈr¥Ëþv×µÔ½hfYË¢×k[s ú’ ½^P¥KÊQù¨xÔKu^™üd2ƒN¿h PÊCœøH%¤éô»ˆËGF¦Þ]#¡1?ÄÙFUÆK¼ ê8þR1u ™uKâæ£7Fd¿>ÓÛyάÂOÎz® oÙoÜãÿá³YÏ=—Ú\qB"›zB+UÛ´!Qÿ¯É*´Óx`DèÉ^„H#ÀÄ)ö«V­2ŸøÄ'ìÉšzPºÙ»8_òN_2¥ÇŒ:¿UFõ¤Q"yBó hñݦëWj>{Þ‹¾ªÚØÂ ½«k• (›ªfÔè@âbp‹FZkþÃ/i)Õ×þÉŠNÍÊÆ!y &YþÀP ¡ï‰´YÐÀxƒ9Ä8‰BA|ÿ^ãA'á¾»ŽE×íÿÐý¥ÏŸ¶ó¾—w½]Ú×3+ËÊEÕ£cÍ.B3gÊØÕ Î(^+€¸Wp¥ ÄCq & biIu;1ZJ½«5' Œ1µUaâ}wD*ÉCòtŽ;æm[%²ÇåZ?æÌ‰ec_¬ _tËV÷?Ÿ¾Öuá\™Ÿ)ñÚ/WÏxluç´­¿8±àìî.mê ew†òkÖ¬±{«ìc³€‚ 2¸Ö©ê¨ßÓ Ñp¡^Òg#î×_Ý\~ùåV¥³+™³h®ºê*;ʆTùkA¤eÎ4¥A´wÞy§¹ÿþûmÿ‘<Þeg½3N/IääˆéXãÒ9x{ùןm]vαeëïýú„íçyU½hH²—\ Æãê|·ûp4võ%Ìò%2ù5%«¾>u°uhØD‡r š"©xfË%‹ E¢1]$Ý™äA4óO*‘Ì@$ˆõ‡ŸHbˆª0ª D¢a žtdÞ÷à›4RÔ5wÈùÞ_-ßmd;{:úi§f~úÓŸZi¢’fРò<é7¶uÉø÷”wH'Zʉ'Z5äüóÏ7/¼ð‚e†äÈVÀT"&EseÆ8™(­qn3©¥3â|/þhÀ¸Ì‰DvN©€­>i\þªË~þ͵-_ÿâù_y¥èä‹gùÖ·¾å,Z´Èê†n°jŠºµL$ìO+!r¿ƒ†êhx&;ðr¿ QPh4Æ3¦;ÉœœÝaóü—\¿rÕ¤¹­Ù|÷ËfÅïï¼·ºóöK¿Æ\Õ!w±>/T³¡Ë7ui¬­í[NêǨ#å†ÇH-Ë;í­¡þ݉±Cò6 c¹J-T(²"D é2€‚8*¥4œøÔ“v\´&ïÊuÝtyâÖ/Ý-ƒ»e!ˆ»mÛ6Ûi¥µC­D¯U°øÊŽJ$žsÏEyði$xÃp&$`ee¥m¥ØökéŠcòÅ”dÒ¼¢Î±­µ‚í£È-¯õ°Z>25ú¦ñ’¿ÿäÓ¹¿îˆ¹¯<´¬¾áÞÿû-sÍ5ר†òþç,]¨[˜}?ÚÇ;Jˆü@ò‡ãˆTsö!Dí³ó‘Ca¡ç)–Ï?Ð-@Z/fCOÝûÜ/K¿¶MŽíl¿ýÙ‡Hd^4¸4V:=KV…à%@Oþ)7{&âÈ«ò ü.uuÓÅBCVÚÉÛi02–tí¤VœHaZ&fñA.‰ÐÚÀ|H&ehÖÖc>¦éK½[÷±ÿ‰vš§fÚˆèúP2ÑÁ€i#!ar6<Ñ´3Óâ;œIA¤ÒÿêCDî©lFù˜ç¨©©1MuI!d·Ù¾%qÞœ®,1ÛÁî¨sŸxtwRΑ­oìè[ñÃS;Ö=s÷1=Kr¼üà†¡sÞzë-Ë\~@ø’YèÌwŸžz¢ª®®¶üCƒ ÓNNšÖ]nÛ)ýî?ßü{Rô‹Õ™ñŽÿù9Ž#ó—Þ²]¥IêZyˆ:§‘ÕÆ„üÃsð…Ù½%OLå²DÍà ÁŠüå- &1%1ƪÒ^‡ˆ&$BõQ&û#f¿=‰§7 Å!Eá2û窻“¦ñ•úÛŽë«Î &›z;;l¥Ì›7ÏndzCœ‚B}ž?xô»L é·HZF¸éÎ;­ÊƒjòjK-Qxíú¬ 9n¾³¼>ô®ËFšï•“mž;e8}‡ùÐg›îºaV†ûí·ÍI'd8…>:"§àøkóJxâaI {:ú4‚0.<5~œìbU½ºãÁWë×<~÷1©½î3[ÿÚ4þÖïK£aú?fEG¾̓¯qä 0ÁSÊß'¦rb*'ý‚"׎˜‘xLòÌcÕ5%*jU¦TŽ>¨…Ù†…aý»èúŸÆæ|ï­£òî“èñh9,X`[P•š¤â$ø *|}Ç=NŸÙ?¾m$.^ºt©Õï!&—Í(™zb¸ºáèÞ¼_Ú;FÂvˆ1é–ȱ'õMŸ>ݼøâ‹ÖühõêÕVÕ¡Þý@Ræò‘+ÍpþgÜŽðÐFLЩ úã™7–6Kkÿ–ùÐõÛÇ,Ü@ 3îCñ_F«]Ñ ÈPw@ë0Á+ø8Ê |$+0• ÉX‚ÓÕ+"kç“~êÑÅ)zõ…ß§µé•ùÒI{÷Vã¾È¿¿xOÌ”Ÿ½G"jeZ-Áagôg¨œ¨ž*æ”D ߪxçAQ[QKV®\iŽ=öX[ñ •wx‘,Ù5)G,GÕ´ÅÑ;jÝ+5=ñ潦V °yÔ¤Ml Í)}ú,ÝÏ´vÈ,ì`àòƒï‘ôДνÖáÊË£ÂTÑ\9šÅL,Íiu϶V™i®ÿyÙYŽ€˜¡nWÁDZðü¡`§1å•ЕE³IY¶îÌjL= ²ÊV÷Á„ H%OýýR6¡¤÷&•w·×¸?þù•EÝæÁ+jný§9«Çäë;ší­);¯2ƒOÞ „‚‡ð™÷þ8õ{žqïÿOyÇo'y?iÒ$Ûª&¤k Ñø¹²´a\rï¿‹IæÑë6õ•ÉÈK{{^Q´— &¢ìÐÕl00½2K®@Âç"ê`bPþA'Nè ¯xI!¦É¦"B¹ìøÔÓ>¤Ú4hÂãÃé¶IPì>í1œ€†|âüš à‚È{Us2$&e’ff ­™ß4˜Ä`Uú=l…”Œ öÑ{!8kˤLª-ïÇå$ä2ékE"š>”I+±¢ýÆÛ2L¾©<Ü×¹nÝ:3{öl;Ü ÀÕ¢d:}h¸ÇGwÏï(Då&‡+3÷0CG2$úµ×m_K.˜V–k–ÿé‰e&þ>þ/Œ$ÇÏÛE|vk¦@€ P¬ H€‰–႞ø:,‹sj_–+K’²W6ß‹”8bNÎ¥uã²¼ALuŽúSVð(à..Q c2p# Ê–]%‡>{, &PhúöHÀî8@â‚ ø;ÓñŽG¶ú’cwÙe\Ö‚0¨wˆÜÓU]=|qÙóá{×|~NöÞ‚®ÝVÇ?ýôÓÍ’%Kì10£G¶`þ‹,èòÉ=>—J$ˆÆ…C2á¦M›fÖ®]k%ß„ ,3´$ÙæÅG²ïø¸7òî_¹©Y>ûõÑ÷Ó?Wb™  ýÀMh‰µ¯¬Òf°ú¤ïtd”mù´'îîžK7é¸ùYÊnÌhSQçˆÞ%›IÊâ´þÆ“üAùå9>4¡q‘Ñ¿¼9œE^”©\šûeg ¹ÍB¥£5Ç×Äìü@8€s² ‹l%,ñ´dÊ!E¡Æq0¾¬‰l0~lÝÂï\Y3>ÚׇÉþ‡?üaóòË/[FàMò¨!Nî¹<*‘J0 -2DãÂ!‰! }%Ô=æ^0]¢œñdÐ<õxK¡¹úŸ¦¿¼¹q\²ïaVݽ®Çöû”¥“ª8ê¨`™@â?4RMÐÀ„Ð_û$Ç`Nó¶rbùú™{v@ö„3ìœæ’;¤ïägQ5=È !¨òð üÎ<=d`­CæPE-Nº¢ì hƒe. &éh;fO•Ø¢ïñˆH"2÷ .eVÙ<&4©seÊC*ºÿfy÷ü»š¶‰ùýªï^ÜRnØlÍR°¥Ãx²²²ÒJò1¸4_€ˆ{@äe¡EÖÑÊ„:¢åeQÚ3ÏuåFó¥_·ß:kYó¢Ë.»Ì®Þ„!T:)ˆ”I}š‰ìÐ áh(#K(7“ØáfÍšeN$PÝÔ-ÅÚ¼SÆN2K~[a_…?b°+˜!²ívÐE%R…:ÇQ¿ ÿ½ÿ@R©D8’áuLumetFx™^½«#`–þIÔäYr¸Ù½áòŠÍø~fÌwŠsWÎM¶ª&&•u> Ÿüó~À b¯Ì-U1¤ßìIßiHA‘S6H[6dë(»†H { üÙweeýCãïÞj|°´îýчzoz¦ím³î‘M%×ßÙ1+ú–Ç@@A:a !0 *ÿyç—®šŽ‰VÂbKF\sçÎ5Ï=÷œY°`U â¡lóìÏÊ~ò‰î9Òo“lýáQ©ê‰Á®t°ìÈŽ@hãà«óK&}¦¾Œÿ $tP©T[[ki¸gÏÛ¯EŃ®;ë½û—³‚ÞØ„Y¡P½áÈJøñSc "NØ d!9 fc‰Dÿ›|2Em(îâ±%ìª3#óöÑȾä' &úsì\Sgs‚Ö "Á€´à™jQF<¤j¹iŸ‰t‚óõ¬þfÞö³>ü«•2½÷ÌLõ",‡f/T &\A&PïdÄ…£<\ÚORûñpnð×{do·ð¤œp Pn6½rTJ¦ssw CD¥Žd«é7B'êPAñ`Q á륕£`R©„ЇŠÌE|Ô4ÅG탶=q9¶ž™ÏÖ=I‘žÙË4Ìtá w|aÈ_”‚oèÏ!5Œ¢oŒ&ð‘XÔ=Ý‘d13c¾k6¯tGÄQ?˜»Rئ8@Á©d²|?¢q‰4c”ÄŽ‰ý’ï«CwË>i7ÿøÊõ/oÙûgsÏÙoÍœ=³KÊo·1L޹êDâòƒ‰\@D¥s"ée¡Ò!(ú2û&<òÈ#æÔSO5£ÆUšÍr’|ãâ¼[ÏÊ;¦å'‹Æ'«oöÓîÐö0Æ$†®ÂÀÙvh\ÁäOÈ*ß!•íL€‘QShˆ:¥ã¹LîK'µ= Òxí-Jê0¼+pNÏmð*Š£IÀo“7RŠr¡•0¿.‘dyfü”,Y9àT }ö˜Ÿ!@‚,´›ªØDôG[&•LQ%SÊrB6T WìÚ tˆý`å¿ìY|ߌ%3ïî{Ƭøî®ù§T$ØêŒ3ΰLÀ+EBi_‰ä‘:¤ ÒeËøfà[|ž1ÈéUéÔC_ãwÿQtÞ½ÿp’¬ :ÙŒ™1Fã>º|4TæSŽr«„ÒgêSïêH &è }ò4Jð>ŽÖžxaLh ¿„d}Žœ0Ér†õa‡§åÕ â+ìBÔyƒ§ù¯ål4òm‡ì“ÍTÜ9ñ!ûx~0A9ÛjÙ”2~Hâé2€ÛzKSCã2KÜ¿ÝnFÈCø÷#_yûw:/_pÅŸ—å$W´ÌžUè]rÉ%¶•yôÑGm%Ò‘Ô‰Y*” íqÏEå¦L@!hµØÛ©H§è˜©fÉ«‰lS~þ”æžÄ9² ÐŒäÇmêž0°,ÖvXkůâé3£ŽzÏï´AU&„ 5ßf:¾%ˆ\²4»Ùnreÿòw~˜ðþÏr‹Ç81+’ò§ü ˜PéðùSÍF¾H÷%$ö„ŽìÍ>$ø÷QM"g7î·wý?~qȆx\b ˜/«b¥Ÿ•åÈV_‡u¸SöˆÏøï¬«,‹>ó­KïY3yrS׌é#í`– ¨|‰$N%_8~ñ_A×_\ûž‘ÖúÐyf²@-KN’s¨^˽ëƒù36|ë'Ç›]5Rà >L!ù„)l=Au0ŽºÅ¨Ì‹w\*•`@mTýqÙúà\(è`š•'ÍBÝ|½gäaå•þäýž–Ý<™N…„>ï/Œùw²„“ƒ †¿LJúŸ¥Ñ ˆ¹$¨Ä“}ó:eBKô)»Õ×¢°ïÆÉç½þÇYKŸÛØøôsŸúò¶éÓÛâ3gN4çž{®cÉ4"Z[\€ƒRé½D€I )† ³páBóðÃ[S£ºq íËþ’<ïÛJ?ó¼w¢©˜6qÉÕ…Gt«qaà^˜"öçŒHÔ=ÿH„$ô?¡¯Pþ†×¿ˆ%OÌÎ:dO˜œ,ÂI‡Wüé [‹>WBÙØW"ÊBùàZ |ÐL[#}<?'ØwúIGf‡¹–ÊVÏ•„p~)Qye±©VÃóêðº.®~íæèK_}ºõysû{N×’<î¸ã¬x^¼x±Í¯ШZ§BíƒX0C¦ó‡cxéD«ýøãÛû•m“eÁùùS+¢ÓÌ£ß>æÔë¼³™ËŒôýóŸ ¥ÑÜ×zôçºT€©RP)ˆhLùúÁpПÁR02[y’‹å²õ5/$[g9õrÜLÒGʳeƒ×˜JKøš¼Ò pO߉wŒ@R.YËfûx¹#ìáCæ7 &‘Dž>¡%ôK#}–áËlz@ž '6É„?ìÎnûtõ­›þûçù“…–Æî¸¡ùCcVxX,`]Îv]:ªGå+0?€¨t­xõ—‰†¾„fÏ·?üáv¿¹:wn »»ÕûÕ­ .½³q–ùÀÇ&‰tJÓñ°þÝ%Ch׎I  *NåWé L†ê‹äf^‰ÿ\Ð Zjà 0aTèH\a9CxÌ•‘±¤™0ÅëŠ ½AI:ƒ‡äF_KTi‰H¹É-ådHœrh£+–/1³s«œëTâöŸyuÀœø™ $qÚ¡ñ†—ýJÿg¶‡ép¸ïEÝëžñ/_]%Xø‡ðêûî}©sdëKúOTªŽìÁ$T4¾^™ùS A`½‡tVü¢‹.²+2A¹aƒ–ÝSËš»âóÍî;A¤“¬mÿ;éø 3¥†Æ)'£V0-2>@#Q|hˆ-6ÒšNæã¸P«yCò­š™u@V…Úwðží”u÷î_Í<<”ðæ•xBm©ÖBìð2ê<õʼåDÒ’ohÊ3õ[³Ì䩎â6d†ý`J·Z§­ŒýÓÿ£-•Á%§8Ò±$ˆ4¤(ôÇõnïe¸¼qÆCß_"OôÄÝ·^YSÕJôÚJƾnb¿eé@*X/þåø0Á0œØ0uêTó½ï}ϬX¹ÍTï4‘k>0bÊÿïŽóD:°ûZó¾_ž!k‰¤Èd³]lÍÂiÑèÀPH¥j> ÙˆÒ"Ztø†ÉP˜Ú‘Ïà£HX†©RR?•Ó%Ä?‚NBreÑtŠOmº4šðyL4.”ƒÆ‰ÕÑëvˆ$™Â’ƒêã¥EžÄîÈ0·7®¹I¤Ìx›˜þ¨ªQ¸ÏL OPkÏ0:"jžæ _¶±Ú!Ë"ÿ⣛ʼ_üKñ7_*˜ôV_8$“²&r œßQá*…ô¹ÿ¿6*´Æ j î=ôÐCP-»?ø?óºò¿ûBÛIæ¿ï¬uÓ—[ïkúʯ<µch”jbGÚ?Nfóa¦¾jiüÊ­í6ˆÌú#™h4`(uô j­µ_¥ã{¤=L¡- bÉNiÍ»”£+Ðzy[³kWÛö¿9B^ªì>0v•Àðš2’wÞÉ®æ9N&TœR‡L2¡eò´ƒÆ¿tòß#ιd6;_Fiì DÈI ¹jDGÌá¿Þ6ãg½¸iѤ»®«+1kž/ý՛ݦ; º±·¢òµÒÉ—V~f33© CŸìóŸÿ¼ùùÏnî{è¿Í’‰¡²hWÅmÿ;÷®Ëæµ\õ’6Úp87SÌÌï_õîÙÒØ‰IÑÆ%‰––ÖÈ“–Q·Xwû‡LIûH+¤L¨ +-9  ©@òç-ÖDzu‹§f™m[Ù¿}`Ëæÿø°ÜË~ñ]ÍîŽD¡K’ò«Â†²Ó¯Ö2Ù>žH “]äÉ*å!EL’WæŒ ¤±W‚’J#ÊGË!!À5±®«SFi¤ùétefÂAŽˆ“Ý@ãK®^½î„Š=¹ø££Ì韘ÿÉ3ƒù‹—½ªj'€tR0A¬Á*;3£*•Pe¹çbuíµ×ÚÅØ,ÜŠ”ìjŸh^yäBsÁçw߼↦۟5u™ñ½/þ—ÏK˜µ:æO¿ŒìLL²ÛÀPГ]z¢y¥Ì4.ø¨ú_™ >€'pð @Be„oxçwñ¾„'Û²×w¬æ™§Üë&šÐ-þû½ôyvlqjbÑ,ÊAw…ºU^Ø'Aß‘‘yÇë}üÌòeïh1 Â`:”Úg’`#²´^Âö:‡z¥­Mô NÿeÛÞOÏ)~mäòwžüdD@5oÁ §çŽ+mÌ ªñ%DS•O ¹¿$`4S¦â?ËÛ9EÅŠ&¿{{Ä[öÂ13¯8/rù§š–Ôý~É“;s;îyeÏл½ï/ñÃò|DH€ä~û•±ñ­#¶Ú=/0Fe‹3öYG:©B½ë€ ðßèwd•g¨Fð…ßAC«z^ "Û‰˜™'†i\çÜtžÓsÿ6ÿ§‡ù^L™Ú›ÝæXÔ+O“7ùDkþy/ÚZ« ÓÛã܃Wó$¾„ì7. Ø·pfƒHÊtJ|¬ h…r*&$"áÝb°Õ["¢twjÆÛæðÿü|mËŽ“Gu¿pé®ÜÄüµ«[nžóä¬ÉçžU¾ð˜Êü‡›GX›,$`RGÙ´\ú ¢f¶V*ÝðQw蓱DC†ˆgWÎp'›qS{N¨x¾!¼úK§”o½Yãûæô cª’³tk“S×ø–anŽ ‰;gλ\Éíwúàà \~§¼¡Ï´ñQépÕø˜’§ª'ß®ëð̬‹…׎·Ÿù IDAT$˜:]Ù×aî(&ÆàZïšo|íÞ¤ 99I"v5BØÐù)Ã=µÇ8 ¦å‘ (Ì¡Lå4“®óLóNŽªæ½ø#Öo^ìv7¯««©ª+>íÄÍÕg¼ìåy×”çý[àät–” (K&høHŸÁHêxÆ ¸éC:Ñ'[Õ6!ÝS™ÕyN¬±ë„®Þ• Æe=yÕ1…©Ù¨q¼§þÚ?$o[sÌë詳½4Ø5ž}öÙvkhFè´ìä•òSï™tà¶êÐ:ò ª€R†„Ox.…`…-¡*;ØPeÔT¢8‚®×YÒ5B6TiOÍ;eÃá“oxš²ô¿gèHïÐØäÙç}&gA*`ú#˜È! b ÑðEvÆ/ šË³G ½€*ña¼‘ÓöL)ôZÖìéªièŒ7n*/÷FFçö¬Íu[²’85çägÍåäR"ësõ•ÑXÂ-œ@:¡FîÙ“ç[;*Q=fäGÇw–žzõ¼ ‰yÉ«[_5Û«:‚ÿ§æ=UûZ~ú°ÙÑ"Lï¾/*çͲS.Þ”§eä~0ñž²ã+°‰¤oÊviÌó1Bˆ£_M¹Y^à´r¡É4tÊf§…öüdûÍ‘ù‘]kEÎpD y÷;€¯¼M="…)›œ;&+ƒ]™<“½Æc ?VüÁÓ÷þ@ŸlßÒ4`4/a."§•aTôrñßLš«(z”Î{nnã¢0òa¾ÙÚæ ãºãn²O&ßÙ¡Nùøx[èõ…ÂN$϶@ZÙ”OPþçþ÷Ü£êñž‹J B^ípå©Î÷®“1âÓÏ;Äí$é(ã&7&/ݵݬ~¾^LÞPýã’b7áuÆä†ƒ ½Y¶! AdpÖÚ߯ D”™²ÂŒV+‘ÿø4¬•••vé7FÁ¿ûÝïÌ5×\cé÷¤‘/2 çí.nw¥NddK }$]ŸÝô’Á„AT2ÁÓ¾¾ @0B^¾ÏÄ”š­Jk*?ÀÁ`¢ãC ›hxt¾lDiÙXíȤ ˆÂ÷„OäÕÿG¤ÔV‘RˆhieL³¬ä™5î¨|™Gt£v^DƒŠG}S©ï:¨Ó{–ŠÀ/ÕïáDžΑ5n†Y|ŽYÿʉf£™2o¥9éâ7’½×l0U+wgü(=¯q.õ•99Ÿ{¾«´4ÛÉ«{ok£ì#}G“pä› W̰¸WgLý#>ÿ©$ Â'N^üå/içi89Ζ/_nùFPž4³åë¾]YQ1!7}GØ"\àÈ’ Ûÿ¡ ä‰úEóò'% ö•S"êˆ9²!ÁŸ–LleÄ ²r6è'æ¾xS„ä4¥G;e#Êø’Æ wáY#%¾5þ ï‹{‘RÕ•y£Mrí–ëœxo|ʌ†hYNQ V6ÑNP.$¯Î© Â) Ô§DN}O8ZûUkŠ‚kÝ)£KžýsÅÓ²wGcÛ sÊ _ýÀçÇ·4Ûý£AíA‰ÂÌ ©ÿÕnãôâÐ_$½¦¾¤WÛÓç]('[ÌÔ½§èšÂÎKn"²ÐF˰(@Ò¥íÜ«ôQÐøóÍ3*‡Ï·˜ØP)ååcÍêy7;cÏ74¬)Ü´¥¹â¹ÉqγkgŽ.Üôö´Qù®ÉÇOØmfžÚlJ+e¦ `ÅX¿e#âçî‹*snúH_HÖWɉçKýåÉî¡ëG™?Þ>^6‚qï[#ëÛ»fK4Sj»¥»ºC¥=‰»‚UÆ¢Né;ÁøHÀÃ3æÃfÍ9 ÛP6V úÓŸ6¬xæ?áé/a»§Öd½–·vµÉ-;£ÁvQ¯¡£ ° %ÆvmÀDÐ ¢RpøÄÃêßù¾Ê”N=)¸vÅëy;6­™ÓÛÓ=®¶½¯µ¹§¥û¥Í^Uüé5ëDª7‰ Ô- Û^Ùjz÷üÑ‘]R/}ݲ£¯üw&GÌiÇ”ºG€#Gwœ)áqj'»¥Ž‘Õ\³ø¾1Î,hY²ñXÑŽYÓ>¢$œËÍ+ÉÑÓç„DI·@9C8 šµZl¼ `È;ƒ0ªfXÕÕÕÖ€°«ÛS_sÍ5VdéóÇ?þÑÒÞ ô(ôzWŽlt¯øh$h.¸^ø¤{ï'Üõæ¯n.­2OýlÐFÛ>,?Ù®¹:yÙ%!ê õ–ºHªê‘wÊ®W4,Ê“tvluež aq@—–Lb$¦1Ò1,+‹Ó)™$FÄ~§@ÓI/gµ­wBXF·üæïþ8äýš¦8:ð69@¹Uú”»P›^ÜØpfÉ/Í´ëoz)oòù+zsI­óÇ¿´ÙQÊËÈ“šì ÔÁðFSi5HcAð8,™ÖžÎ=q\ñ™Ïñ.(Œ•nzãõÒ¦º:/p§S™="?Ë•m°•ÅÁÙ'aéMU¹§ÌmfÉ‚™q¦ì5C²Îެ ®i|Ã1‹4–Ž”ÉÈébC6E&©Ïì½9c#ÕcŽ/ë+‘^Bbj`d°ÈŒ—rêÉé"·Þz«•*,Ïì‡ôa aÄp±ÏÆ)§œbGü°ß[¶l™}äF…OÔF#f|~ qõ˜XàŠ³zúÌß]ÏRÿÓøü®ëNúÒë2}ò{sÙ­Ul’£aŽŒŸåÈ^^s(©>€>×þ?õÈ=õ…$.ËÍÊ3ãdC•ןwf¹C‚? &Ù/\Fãv:fö•Náò "ˆD £Ä"1˜K[ –}ÐÙô?xí9ñ@ÍÆ~S‰#Cw•ŠÌGí@½&€Ú¹«-¾úÑÕ Ç›{VŸrýMæ”Ó/øXéœÒíÉÿúþªðc»rl+M)s±äЩE+Žº]¸´Ï…e®Ø%³l»L¦å¤~ðƒ„ ˆê”³jÕªIË«·›hm7odNrveÅÌâòÉî‰ÇÎÚe&Í ¤=ÜLuÀ4nrMmUVËÞ®ÐöÀœÒ`¡iql–W~Œi‚Á|[žäo”äõ‹Ó7nÜhçÆ8èŒãy¾ñoؽ©ÓW^yÅ }˜À录³Á yG½CBS^å ÊCIç~ªX} 2èÜú9JõªöLÑ©mf磵÷,¼rËÏ—îzù•+¯ÿàáu¢¾î%Ü‘u)5\Ò P^$޼óp!¥€«(ó§Q“br@›{ºÃÛøI‘í_Ç9Á3£'yEE©°hyIHŒB"<§EbnÂԮɌvÂÌžï>òênÉaµ~þ¾÷Pè$UÒ—ªßÙß,€ªjþöê–o~®ú„‚ÞXxã-‰Rç[/GÞÓØT“Ðbã  Ò P.vhHq$6ôdH%ÂКC/¾A: 0–t,H〫¯¾ÚªNÒ× ˆtpžÜ²%÷׫ûïÛfŒñºM »@Â9A*}²­x#ûv0 @zÛÖn³ T! € 0@ú°SíÓO?mÁŨ’“>ý K/½Ô|æ3Ÿ±e|Øé½úê«|Ú` µl°t0‰dyŽñ¦Š°üàÔâø—Î“S¿pk‡ Ok6ϳñ“_¿cý–ºî Ïþ]|ýM¿ûñ³áµšƒíÿ!v© Uv™€ôÞ¬óÂ&ÊÈàqE^¶œˆY4:ôZ]™sÞ)ŠÖ!™ùKƒ©Tkf.h3o/ï“Ðï±” áuøsŸºÕÿ<îwЕg51Ž“1ì@+›÷·ÉÛi0I Y^˜‡(Ü×IêO (ô~ZBˆ¯«/_hÌIägwʰx¶œÒ>ô,q”ï{ON.Lšª.±ø.oÝðxtã–ßuáܱæÃ¿úÁËŠN3~`ÆW¿»»ôŠžˆ\vüÒ’;®+4žv£×Þ=.ØÒ’B/VÒOA¢ z!µ4¯ÉQŸ4HÐPpÈ¡æq!)ˆ‰ÅEü©†ZxÖYgÙÑ:êˆ8Ò’uWø*ÝDyŽ Øs½h(i*²Mø˜òìž ÆG ÏTÿÝõ]¦|è52Ì¿âg»<ëöú-ÕÝñdë…³Gì¹ë£]5×~÷ë͘i1P·XsG.:P1Þëw€þöó|:OÔ|©±å‹ÉÞ讌¬ºÞvöÏ8°óGÌ= (SöWH'PJÒÒzòŒŠ¢ó  úÚzŒU(`$Ieÿos²„‚f+~»üܾ»µñܧ¾]sêioÉ<Ïø{ËÉ«~?᩼:ç¢[¶ŽÚÝþ…œá½möÞ§çD[ÇÌŽí Œ×DòÅ£\o´É6ÛÇb-L +N5$Ž:$>ÏõÏ©h$ bÄIçF¨R FÀ§Ñ£nHcDrc¢X¯ÏËiðÆ­2¥¡®pñÞ:ÎK Ë` 3aVÐL?Ù1ãfÈÀÁ±iH˜uO4?÷Õ¾ýÝ×îÞ\ßÑ·wáÜ‘»-x~ô-Ñ]G˶MbfÙÓÝ"˜f8Z``.4ghˆÓº€–ÜsACŽá”¹»¬óæt9ÖDd<àB͆ן4˜ä0\N(½Æ+"PT&ê ‰ÐÁæ@"ÜSaÉž„#GJÓš„ƒ¦û¿×±ývá¶ûÚŠZõ²n)b>pîÈ…÷mÜB™S‹Ì›ÏV¶<·wÖÝ/½¾fK ¦m]Qkw"_¬.™öë-Š„rå„ÅÎ1åÙ‘ü"svy»©¨Ì v—OõšrŽqœ¬/”“›ŒQñ&$†²‰¾Þ¾Êb#û\ê#Í $ËÊå\ù,ÈMò.*ÚzIIXæpB¬w³³> š›ÎËy¢rt›ŒýÉ0Js£œ9”£R8á!Póíïõ}okEÕK››×‰fýSKþý¦çÝ~C­™x¢œf “ýù×Á‘·¤‘¼u®½Y¤Mt@‹DB !(èÿrOÿþ–­¾:d5DLÎáuŸzy»`¥ú€ENƒÉ.~ª¯’¹Ñ‘L"ÇT*—"8wc¥Ñ°TV¯Ûo’tÀÿ7¼ìß4Å*Ú÷-\Ýx|á⪉á¶È¨i¹2í_RQ|ñYãnŽ–ÅËMIÅTS0bª f™¶º>ÙŸ"KVåÆÿíµRgé¶ï;ëdÃ’7œŸ½=R‘÷R©LÜFdâ¶cWDW§5¥9Ìgç\ù_GL©;î£RwrøssgO_O—´‰<—IP×ãr˜‚#{À{í±d zÙê£Jì0×-ÎnšXp¼ñÎ/î¾÷?´Ósònãd7›:™ÇBòLý¡-#ý.éÊÄv SìO­F% AÊ"„D‡ß™R@ Lõí}³niÈ\õU§ªqÝ‚" &A¡3(ò:-ˆt¤ ¡¯ƒbœJ)eúÜü¼œ©¸^1ªOWôÑOûƒ,‹ÖZ$W—9s\²¾­§~›0nHxÝm”HìqrÈVqeq¶ùÈÔ¨sÙI¹îÍwžá˜)s<kšæ=Q9`¬ÙºzNËkÛF-i©ð6´†’L†Kø„+RIÆËÂq§¬Ðx²‰<Á;ÒMŸ« Lœ¼ÆäÕšQ•²3ˆ=|-C8D6^Ì–¡]GTq' õn§XlËîš ÒL×9fçz±bZÙWûƒE½c-:ÂV ’›#æ:Œ±ëZºÝ¶HJ<€Aÿë Ú<ΑO­.O.üÚ ONˆ?ø>S#MÚò%ˆÀ`}}±E*::¨Íì £öñœŒxñdg^v–´`Ý®Œ€¥ÁyÄhô>K蕚Jìq2.«9´­^¶3.Œ‡ÊrLr~gbÍž˜³øì£O*€*Ä¡î)j±9C†ÉÄÜ‚˜l¨²ËË˲³ÌC¥9ü~ ¤$ZO¿º8ÈÃÞžþ¥»£%ÆúÞP£ð-ˆÉm,JPð<½ì뺇é×ä¶úØòj;¿äЏRÍCï¶NÎï mkèreÞ(Ž 2Žö›Ð)²Xˆ@Ô<.٨ψi»l?ÓnÊ ßû U´<Ãþ0ü¸ÿ¹¨#RÜ›>"7‰ÆÅœ€a¢«±‰´â þc…2wt$¯¥Ç›¹NF¬uàÇí€û4˜8‰º®-îˆÑª£#y0ñ)„´ÂT¨~¨y²·˜3gVûÙÏš¯|å+fá#ÿ/+1#oìlsL¥œL7ì†)ðþ¤€ƒ1·˜Ì¹ì÷G¿í ÁÁøœg «–÷¯ÜÞêÎPœ4K=ÙywHA‘©æd®)HH‡Æ¡ ± CŠØ/}ýë_·³ÆHª—~øzgw,_üöýÏûã{’t8Wÿ_R`g["AFVÏfÑ'b‰9&¤¼Í\]öÛHvΩ;an=sWÀ¬yÑȺ/óýWL:?óƒ<ú< À€F*™ÈÀOΑ© ‰_,Udí}i`ÀÜ,KÙJYŽ…!Ï¢Í$d#þPqNØQåȞ܆}¹ÙNX,bä³)&ûRȦ; í½NC{Ø}ݲµhüå#Fh¶ïÙ¾òì0˱¡§]V=³Ó®©Zê™O›–Ÿügà7»&¸Ò:;½q»¾Iâñò¤ÝµhúWŽ•-¼NŸîæ~ê3ε£&y²u›|R"qÒW[ë~ K~%Ÿ˜Ý]º„.Uki4\NP—A(O6l4»âY²=–q›ãé½ê$¼kÁuI0pݸ&WŽrÌq§¹†àËçIœ#䩇ÖõÒiYí˜åO Í¥±Í~™~²1g]¸é¦©ýy‘µ][SW-&;²Ë5t‘ɤ±s½ÎMòIDATLéØþ†c´Ä)kUªž¬}èy·+.ªgËè\A8;lÁDÿâĉvÏBö[gû3À¥ö¨23㧸5?Ê;Åò ií×íSË*·qtIöxˆ<úIH,$Æñl^A,8®0RhNþÈÙÕÍ>Ñœ{gÀüñÞS¿Øæ­i— ÛE‚ÈRaÊ»µÚ“õORP»R4!ýÙwbÎd n-ÐûßÉDr:œÌƒ&Nî#¨ýqÚçߥÓ;ÈwíÍ´¢ŠSÀbÓÀe˧„ìTéìÍŠwö–8²ØÎ“µF^O_GPÖÙp½‰ä€¼È ÁèòìDN8&ë“6Ä…qŠ¢µËU¤ŒAZÂLœ‘“ãRa¶!aËi ‚&9n–?ë´<ýª÷£m¼­µÅÁ­ ‰ÆÎ¾ˆXȼ¼gi =¥¾ƒy2Wø¨¬–.}qw|òÈç9áÏ;½¼Î“ Wd¸¶,!yŒHÃ'Ã]¬Òà¥òY![6Ÿ,;ùž1³;ãæ¬]N®,Ã9¯§ÝpÙz{Ítý‘–0{*Ÿ#/OÓGDZJFK^à‡OöOš·V&dÿt9ï«1.u ûƒoôŠwl‘½Öçåpé„)?^â/û4ŽJil#/eKÙCò.(qöJœÒÊ9ËÒ [Z:Q}fg„rn-œkÏúíokÎ=÷\óØcYKq6 eÛjº3 DŒ, æIy™\uZkír»ç“+ ‰¹`B"ér Pá4Ô;¾áZ×Ô™P6!òðoBE»¼ü1÷ýp•Þhj>Pcd3 .Äè¢Ï¡\¨dë”8qå"Ímöß¾÷ü%uþûÌwúÍßä÷‡š ÂAʧŽû€\yHiŒ}Å/’ © }ð¹püÏtô=³¤Œ²Áµi“ûe⯖ëÅYÉÙ"f+±¨ צ/-[2Ùa+“x¶Åà˜|ðŸ!\MO}hÉE?€¥3¹¹3„fsMï™7˜Ò™{'êz–´Â岎îZ¤³ýМ°0e"ñWK?bWÿôG4)GË&‚­ÁôD=}îî6±m«KïîK¼¨M™ñ¤G½­ãHd½¤ù¶M;9úÞì!˜Ÿ¬ôÕç3îsÆÚmém‰ÀÒEX©ï/}B‹½2ú¶ÍÚˆ’žßÑÿ¡<ð(B ;{”ü¿ÖgJ|Ó\sf½ž/õP]]mw»½üòËm|OÞ KŽÎž9¼¸5&RÔݰFNk?ØÝ‰$FPëÉÄ­æ…ÀZYž!DãÒ÷$ عä’KÌ·¿ým»¿5º'ßø2lý?0‡Ÿù4-õõ[ÿÿÁ¾×ï†òÉ‹ßùãõßû¿Ñ0Z|½(VýF™’ð KÁI:ÊĺRY™O™Q÷ @à{Â*íy‚Þ\Üû§0~³ccs±6Õ¦e·XãøóH–ð¤O_™N¹ægš/ê€2Ðr3ϸ14 Mk$*…WÚ(ˆGx€ÀÚ!¶p&mm0È;å#.¿ó§©üGùõ;ÞC3".´'ýõ{ÊEzŸúÔ§l×…ôpš?î‰O´Ø ÂyêelW«yµ_·O2啘hx'ZÔ(±5³¼ÐgÜkÅ‘ÀÄ) ÿøÇí&ñtàã÷šA2§Î§Ÿàþ{ýFf°wŸÿ>ÓtùïO[ßküVÿë{õ5,ñé½NìñLŸûï5ìP>i’> ÈR|.€JåóŽï`\@¥ Cz RMG4•f|CGšy€FÖ²hXÍ ik~*++m^¨wHü|ÇÍ L =H‡8UZv¦Óòð\ËM|HâôçøéÒвS~-‡æ‹x(?ñãa¹ø–Fž¥¨éÄþêHFÊAC  þîö˜+*gÒœq±·¾æ±âü™Ê¸ß¦\;Ñ™ ×O02Mæðá$ÂÅs|2Læ8×§¶¶ÖnZOæh) :½×ÂësÿÿÁ*@ŸAÿ© –_*ÀÔIf\úœüOT7v~¥N õ‚¯eÁ×òãshA_óAþˆä›´(qÊMš7åÌizÄ­ü¤Eã LÄÅsâ§Ü~šòŽ8¯4Õ8ø^ëŒ<òŸ²@Sâaù:ãЊF‡òâd0Ó<õŠl¨ò…ÓMMÛ¯í³ýìÓ¼³ùSÖºu²cbÇÔ™–Qõè”Õ‚`*@üj†!,Äçò;}ï¦÷„9—‡Ÿ4¼ÿÄÄ©?X:ÄI ‡¯•£` *[•…Ó ËŒßŸO¼„ñǯ ÈsÌE܃1”2ÀeQ­'ëmP«`ZX|u0(j ÀÃG;@¢îTuÔüˆ.¤K>i4¨{ÒCM„á¸Ççâ;ígð½Ÿvš§ýùÐVËÌ=y‡ä{¿Ó²*=x—™Vf”_/è `Ñ{újªÀþë^x¡•Þ4´V ÇÛCý»)¦òg*ã~˜Š¦$n}òV9 rOäñWg™•+WZÑN% ²é¾ÙŠ©ã¿V¦ú¼óßû¿×VIÃãgÎÿΟù]æÿ·š>¾ÞûßÖ‘/|þ{x½×2iüú\}Þë7øT< §@ã^L“ãÃ\¨NZñê3šJ#— Ÿøõl¨h\*•È#yÒ¼úÃRn¥÷¤«ù`2“g~0Ò€h9ý †?ÎÁî)'N$œƒ}¯Ï´ä¿Ò‘{<4úySz%í;²µW¥¨²ð7çh}ík_³ÃäÄkû~m{cì³'»¹2‡uðjÞ“/}ýÔ¨+“—ñ;Wϵ•uË-·ØÓå¾üå/ÛŠ`ݼšàY ¤ÏxÏóý¹Á*sßò\+M¿¡Õ<#me:¾ã¿¦© EÚÊkü™-^f0:NËI¼zúùNßãë½Æ~Üÿ£éâ“òÈ¥’îùæ‚Æ/‰†R#o~ª:ÉwäGñáH[ó€O+M:<'.â×N>qkZÊç`¾¿Q@ðŒ~!×`Ž´pê–Ž?Í#ßQ~$å¦qЋJ8 É}ã7ÚÉZ*$.£(±+OìùDr™]K¡°Ìõ?K7Ïüä®lÛ úœ+§_i øÕ¯~ÕÜ{ï½æ¾ûî³êÇšhīӊà?ÄWç¿×gïÆ÷W¾2.ñ¡øª?¤ÏåÏß)c‡ª·ÃßþúJÒV°jžøFÁB¼ "MCÁJ~È >ê š÷0Ï•û˳æOÁ‘™¶æ—´µüþt‰—üàØ\*E@šïwëkƒà”‚g0•t°ôˆƒð”p  .î‘8¨v•ýƒ+ô%‘XŒ*.Z´È6¼‡.²a‡XlÐڠ⥱2Xº<Û÷Ì`N:KΊiõ^xè{HÖÍ7ßlÄDÖE]d޶¨þ ß_ä<ß_%(ÌPï”A”2™‘ðþü‘eÛÏT„׋÷þ–“ÿÚzr?˜ó3•¶˜š¾ÒËÏ èäèð8²Æ;X>É+@¤âiÐ` Í/¾?¿ûË«æ‘üižHSó©éNã׸‰&ÍŒf׸5Ž¿Æ×øüÚ_xïISÃê÷™qP6èI#¤ª*Їjà  ”5½ÿƒD*CãÙ²÷ƒH¦¤#Ößgºè11Í^³ÌîoéÙa¦M›f·‹EµÃ°S fˆ5@+>S*ðî`Æq°ßó‚H[zž©$à^2ªúú_Ôïësý.3NMWßæûË£tá—æÃÿÜtî3™›4”Á‘J4ÍÛþò¤ïË£æƒwšýNÃi¼ü×{|ÿ{þë;mà4|Cz ÷JÂøéÇ?ÓçÎÿ½ÞãõU’#Å¡/eŒ4,H<.$ऑÓïr:z½Î#­Ï¦>±÷­íÀš^Z2mi3Ƥ=´³£Ìéˆ_U^›øìÕ^ôÇ·´w^¾'bþþ'“ØÔõ‰ÍWëé™¶¦Ž,é´&#š j"b±ÿ8ƒ>ð]ssÆ;«§ ×5Dœ¹©8KŠ±Ý’³A‹Rq† ¦××>0ŸÍÖdH²$Ô%.¯$._š Kœ¹vïT^¾|F}eÈö•ÏšüøÞÅ}ï(;æ=¸îTœ}íù²Óœ£ÙžÊg‡H'ìÏšÅX© ºätÊÿˆØúâì§gi™ĵРŠ«æb£h;Ä’^¯/Ÿ~Z÷ƤŒûÞ[CÊ.v¦¹?\W×@š™®˜ØOJ¸ÞN Ÿz—G4.¿(U¾pÆy¢å¥òÆpˆzßOPG¼KÓ…s¬Û'éåæeä3#½®ÎT8Ù–ËtôÈ[_¾in•M£…ž;¶$Ĩڬ]ŸåˆyXLÌÃò›cáNÌÜÄV1žX1»6ÄOºn3¦(âÍ_èUƒ²ËKB,¬#ba-'F‹½Vj¢—qî”M„–†I®ý¿KY“f`¸¢Aìí ±vî³M˜0­Íž0œºÖœ«óˆXÛôÄêÜÆ))6/äS¾K^Sá Ä>¬½9O —°ö]XûN¬Öm8±8O—AôgûNŽoP>9Ê%]†¼œð€wä5_ì´ÄOfMÙð‰µº'yô$öä/ek]Ь [:N ›ŠS¶S#¾þˆ“oSï0òÌ|§¶q™áŠúéYè£u¶ØÜõŠÍPªñÛ§æTýAçT¼Á~§ÒKYü{B¿wæó@õžñNʪ[µ³,MÕŸ¤™ÊËÞ¦é¥ó¢ùÔpä1v](_v‘cms <±ö—Δ4šáTÝJ£â£Yö¾²Ë†w’ŽcW××Ü|Û ÿ~|õ/ÞœÿÏ÷ëÒ`⋹er†öÊ5¥­×-¼hfIø?î˜ášs>ëÈA^ž©ÛbLmuÀì¬r[6·8µ-w›é"¶xï´jî?þľ“oÑ;ù^}¯¡Ç³“ûLÌôÓï$ œ~§ßس‹"I#XHüî¨â˜S4*>PPLåâl8¯Ýnò⊡â ù4\©ÀNå3W*ƒò¥–“Å:™2è±-þ²Gû-Ü9¹bÓȭ䥷ß¼Ýî]-VôbˆÙÕoñ¼·Ù%Ÿ’GWhjÓZ¥Âí£•+eðNhç ½l>…NN—ìþA q¶ì²ÂZÙ¼Èrˆô;¥±„q%Lª|áä¯]F!¾ 'áßQ¼£=gßõç/]öÁÊ ßH2ðLó$÷žäK¼Tœ,åûtœ¼—Î eÿâ”ÿö™”M}¯;¥$:ãv~G^¥Ã‰±ò€8 /'º°%Cý‚)UŸû·n•³ªöY ðõ ŽL pMÎe(.ÔÔÈiîN$rÃNhJY¶;{|±sîˆV#‡z¹£N瘉“ä˜ð¢ÔúžTaˆG3˜õ<¨úà»ÔÀ‡+kƒ Bê]®½‡Š2SØÏ”ÙVíJÅÁ*XÞÅX^ Ä-Ä·Ò´KÖµÊ޲­!Q—öŸ^ÿr§ß%$̾|Š* ïb]©ôäÛ~Ée¶÷Úp{z­zª‹¥•@âöÅ©åóÑ¥"b™ÖÆ9:;6¡¥ÉdÃEÊs9 <•—+eög!mž„‹ ÐsPOåHgh–-gGd„UiDëÝÛ²tòåE¾…î ù>•^„¥ Ö¹6õŽpZ¦n´ºþòESeGœ{“’ûŠpþºµù¶é§Þ¥ò•¦µ-ƒ ÖŸ^fœ”Oó»@ÿú,Ïæ{à»AêA¾ß—ϬmrÁô}Â$ã©2Äã®Hëî`Åm”H6üðÏ0†)0La S`˜Ã¦À0†)0La S`˜Ã¦À0†)0La S`˜Ã¦À0þF ü?´3/NbbIEND®B`‚libgroboutils-java-5.orig/website/import/images/logo.png0000644000175000017500000014710507550512634023560 0ustar drazzibdrazzib‰PNG  IHDR‘dG IgAMA± üabKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ |Çž| IDATxœì½I—#I’&ö‰èjwÈœÊêâ›~ÅÉÇù?ø#øGyæÇ™á#c¦§»9••[„;ÛTUxP3¸Áîá™Õ••σÁ &**Ÿlª |¡/ô…¾ÐúBŸIô×nÀKôîùöñG¾*ÓqA¼rî }¡/ô…¾ÐçÓ¯ DV Ax¾}¯i÷5Àx._€å }¡/ô…>Ÿþê òîÒ«X¶ç%oƒ¯Ëï,Aâ9pXÉùï?éÅÆ~¡/ô+£w‹1ðkßÕx–_“‘öîãŒÏ¢_ßÿšôW‘w—Êÿ9ïã9 XÒµóõçiuÍß½Püz÷r]£_•¢ù5Ó ¼Ï]åã_JžŸQÊk£î9ú‹ôûGäï/¥ïÖÏñw%Óÿ¦ ²èàÇR8¿L;.;vXKÏå‹ù&¯£¼É×Ò:Äø…︪¤ŸùüK|ûY÷åüÚ|åÕüäºMËsŸ¢€?¡]/ѧ>Kzîùþn"ÿ& 2uôZ¸–à°þ\=sþÚ}ž£k ±ìÌøÌù5Ø@ú{²,^Kïûé}¬¯Ö|¿øì·>ð>Fï^6ž^âû’^âñ«eú™ñ;Ó§y/µé—¦_Ê}-=÷l¿iyþ‹2øŠðÑêàÕßÀóàrM ^ʉÌWŸÏ™×§ÕgËsX\ÿ%«å:ôø©J¸VÄßÏ_à+ð8®ù³ˆë´–í%½¤Üžó„žk pà^j×ÇÚðZú˜×ös½åçèp¬CçÑŽßš<ÿE@ä™Áp <€,tËsëWZ]û±ö¯¿¬þ^vz\¼¿öùòÜùž¿5!x-½ äÖJåS,Àe ž@àï€çW<%8<籯Ï]ó¢×<}.7ø­ÇïúÜ’®ÈsíºjµB»–í[¿)ôsÂWkº¹À%ŸDE~KžÉ/"ïžzkà`<õ@æ÷¯”k–ÚLëðÕrÐ$\F\]w LÖ 2ßû7gQ¼DQr×¼ÅÉsaÄu?ÿ­òû…1³?ÀËý°¶øŸ3ˆ®)¸k´±kǵö¼ÆY÷íçÛ’ÖÆÌòü5Àø%dm]‹f¬ Yà7$¿ˆ¼{^àæóK€X‚Æòïõ5×x‚šY€—2Ÿ ¸(×<”k!¯¿ ùˆa<{àuqû缿kçß |@fù®óxí©¬a©´âêܵ‹àR¹®= kFásತkùú· …zÍS{ t_{Ï5Éêï5pOõÆÚ0~#@ò‹€È•pMð— ± uå=¯Þ¯Ýû—á9$â)˜Ä+çÃtŸ°úþHðÇç㽿 zeß®àD–Êåšò¸Ôë¾›é7$W¼»uAÉ5ÞÎ×¼dH½¤ÌféHÏ ²¤ç¢Ë×µg¾÷Üže»fú%ÆÑÚp¹ÐÀe;ÎÜ‘k|\ƒõµ(Ço H~6ˆ<£d® þ5ÀЋk5Ácù÷Ó0=+¸‚(¶ö2"½°8'¸–%¸,?‚ð[’WÈô׊å9oä‰G‡Ë>¸6à.ãß:\):yÎSòxX+óµ7¸¤u˜víi¿ÄÛ™>ë>ŸŸá%º¦`gú%¼‘ç —åùçÀîS=”k@½èå¹k¼¢Ë@ò³@ä2ƒ„Zógó±Z\K`((04€€Á ¨6!!" $FÈÔ¡ò(–@2.Þ/döJ® ÄoHÞ]WV×<ĵ‘0÷A® Lšx•{gé!®ݲ~S@òî©ò}á•?çŸ ¼J«çÿ ‚„8½_Aë¼ ð”—ׯó:¢ ¦ßgÈtÝlâ=…„¹¯¯….× ôSê:Œv)¯júüR/ÁD ®ƒÉÓ3—¹Ž¬k"ÒUþÎçÖŸ¿ ùlyAÁÌç—ÞÄDÌâó $3‡†Aƒ &ÉÀ¢iD< ]<ƒLÿ‚ ãy0DÂP2pÌ@±‘%¸,$­Ž³0ý-+¶™VUXkËwi.=ÉÜ· ‚†›znVt4uSM}3"" !"@.@:­^×à}ù[âù ¼½ KðȆC¡˜xO hš•$2å‘O"""ÒÊpº&¿K¥¸ö&×!f5™ ¹¿óxÍí×DÐÂÓHËFF$Œ ÃaþY·‹ó£ux*óVMpë Ï@ò(‹Œ(¿0“– ò÷lþæt^  $‘é)³,“D§ ù]æ^¯£Ïÿ·$ÏÀg‚È @–ÇsžÇìqÌ,Áƒa `¦Ab2Œ‚‚‚‚††"MDYh1˜&X=CB„ˆ HBB”(£d°$ L`1bÄ™Dv  Žš4=*·„$Ad‚Ž,ñAF g ^*·uˆvIëÖc{r;4ˆÔ¹Ï4, H6 ¡“8©Ö„q¶'F^"s߯yšÏñä}¸ F )80LŠxò”X‚Ð9.ÑI¾ë8Å.d2PÍt?‚!š´œ@Q“$éü,=F$ gÍ<¿Æ÷YŸ¬t™sýUË5ð ò‰² Y™'¯ ;‰¦¢üÞ’!M†4 2œ“"EšŠL ’¥K "¢$ )ƒÈÆ4bD12`#Fé3°`DÄ€ˆ‚¸8ÂêX[K…v‘0››õkqSß=pkºxÎy K24 ˜ü4y”:÷ª&E†û)’ÈFD9¥} èeÄ€YÙ;ÎY-½”_5,*—´æíkÄ€&ÞÚÉÐòd©PŽ4yÒP¤Î÷ž*2Ä­d̼•€n2”†³ÏÊ ¸Œå/Û7‡ŒÛc¦Ñj¡áÈÀ³£‚2¤6˜Í;$A0¤„ ‚^‚RÀ(Ùx˜Áä2w ,ÇMxJ2y²‚5¯ ‚¢‚Ô$‹ CL†F ‘. F9%A+i¾™ ÙĵÄpLd‰aòßÙ@dLÙ0=É }1 ó=`DÞÏå[×Ïù¬«÷¿9ŸIÊÅ«8î²RjV*³à]{þ;ÛY Ü 0ìÉ’%Çž-9vpÊÀ°%KVi0k²Ì`RDÈÿ $![)Jˆ†eL½ôq¤>èR>ö©—½t¥G/=4FhzŒO KA^ZmO•ò—ü¥òz•À|Âý_k4¼”T½‚A‹‚ ¦¾£Š,c©T–œ²Ð¤Ï¿’H/½´1PF9„N©‡H@ LŠŽñòLç¥IøÝ_0ð‰}øŸŸãíõ¯‡E Ëy.X£TŽjmá”#Gúì'$ŒåGéÒ€Sä;p@Bh¯¶+M¿·4€ÖÉóÜçz³ž Õì©Ñ•v䨒æA 0 AÚåpå$ DhDŒ–3=Oa¤9dz¤¸87‡ÍrÈIÁƒáˆá•FMŠc©Ò†<dƒ†!úDÒ¦(]L°!‰N]JˆR°¬àˆ©TŠ ¥¨RNÍ¿(IFÑÆ^Ê8àˆ^ö±ÇrÌt••eHk)gs0ðâúw/È÷_Ã`ý$YÐÒ%_ÈKžÇ  fCž=yöT*O{8åPjO…¶ä•ƒÕ–œ¶d”&« +R¬ÀÌS+&S’˜"bŠ2„€!Œ©ú0HzicãØq—:C+]줕ƒô¤E˜â½ ÂE®gôÊqú,âé`\ÒçTŸÐ»Oü ô±Ì‹ßÅõJ¬e++ºŽ,•ìig ÚXÏW¢Ö•¹ßÀÌ 1Jz9ކ~´°c/&´øC¶ 1bÄ¥œ­+yæ×¥yöÙ‰Ê+•SÏÑk¯{î{Ž r¼Õí\Á[[ ¶^y²Ê’f$JjÃ(Çá$c+nTi5F ÍÊó"‚mZÒš$+-,6\P£ ÚO)yc<*SSެ6`°DÆ¥Žã˜Æ¶aC':ØÇÌ”¡äüôvúu @AM)ünÆaô 0!–ˆJeh£ Ý:Ç7Σ±ž¼2°Ê“B„È“‡$û±×1cLÇÑÅ„@€!¦‚ m¬¦­µ\ƒÆXr*GBˆÒ¤gC›ŽÃ‘c—ìØÉ><¤­tð tÏŽ=YôÅ:ÙþšêÆ z·øÎ¿U±Ï«AäJ"}þ¥ëû˜ëxô>,u– .©TUª@¥ *uA•-¸2%*ç¹Ðž káŒ%o Yc`´&­˜X)0˜;'%‘”1F 1b A†aT]¤†tz9 ÇVNÃIöà ûx¤chåOÒ&ƒQ aJÐâZ*‹qÅž¥R›Û³îÀ×*œ—bÀ×h}ÏÏÉs­cõËsë ¡GE—#ÅŠ,U\Ò+éÆW|ëjÚÞùšJçÉjKÌ I’ 1¤nheßå}{Jº=&ÐAF(¸!§,ã4ääBæÂ¢½3ŸgO–MêZ²ö}ŒüÌùO¡kÕŒ—Êz6¼hÊ×2~îûërÞe?X¸l-“£JWÔ˜ŠoÜ–ÞT[õ¦¹á›º¡Ò×d­ƒRL""Ã8б=IqÜ'­ö¬DQ<$¤.1¶‘‹&ÃÙë[¼¥›/«s×xø)Øòwž„ðóø <öåD–^毸[G­JÚØš·nÃwÕ–ÞÔ;µ«·T59WÖ ’ƒt}/ÇvOåá>郋"Š¢€ºÑ£"`¤§×òˊ;“ÃXdP°§­®xç¶|[løMuC7õ†·Õ†+_ÃZGÌJ’ˆ c¶ëPžŽPjŸÙ§ G£ALsAK:Ç11Jf*µ¦F)òZ“× £ÉÕPÒÆˆ6ŒéaE! ‹ qCLµ6´1žo}ÅoëF}µÙЮ®¹òÕ$‹""]èжäÝ))}L …ÔARD7†¶ÎòmQòÛ¦¢»ºâmYRá-Í ˆ„8HÛµôp¬’Q÷I‘¡$ÌA†(EÐ ` “4Ïzs6ŠžóKºÖZÒl°.ÇÄú~sì/üù(ˆ¬’±ëXîRø—᫜ÿ`xhx(x8ð\  ’*US£KÚÙ†¶®æ­oxëkÚ%×e‰º,TUz* _vÞDb=„ANYR"ðbL' ÙØDE5óÈ12´AÚ¶—ö4ðñÔ¦ýñ˜6§£Ü·Eºo )z+÷ƒ3èÄ‘Ð&„ϼÎukÆÏ¼X'çØæ§vÔ2±ù9ô’’»¦¯]3Óµ9¢&AÁÂq §Jjì†oü–ïš;õf÷†o¶7TÕ¹ÂCiI"C7ÐápHÆV ò2FÅ]@:Ž nú(¡EÐpéí.s%ËÒЈÇ~˜û`âÂâÚkϺäÏ5<÷þSéZ˜péÌ9C†…‚E¡ òÊSm*º)¶|[ÝñíöNÝín¨i6ìK­5@„0†Ôµ­ì÷´rHP2FI]L¼SlcÄ qª( üX{Î’LE/޼òTèšÛЮ¸áÛÍ¿ÙÞòv»¥ºªÉùÌŒ$À8ŒéxlÙ>¢Ã˜tj“¢ã¨É+#meÀÊòL(YñÖ(jŒ¡µT;C…Ѥ5AHdLQNã€}?€©K A€ˆ>†œTgE^9ªlAÛ¢á»zÇoonx·ÝqU×伃Ò)IêÛ‘üáDÊ ØË4„)ŽˆIPjK7Þó›ºæ·Û†ßì6êf[QQ:£Œã˜ºÓ1¹‡J}”Ô†DG%rŠ+2Å.–ß Þqñ~Ök¹]çI®ÉÕµïòýòZ¼û Q^㉼@Öå»@rE»ƒG‰‚+ª¸¢FWؘšwvC·~Ã7eûªámUÓ¦*¹n ªjOEi£°ÂèâЛ”D%fN± ‰Ä€H ‰Òdhq’”„‰‘¨”ÝmÝ©;9J:îKnöejÕÇBŠ“M¾5ɲf HÖó°Æ'Jh>f%qÙ™¯ ¥¬és¾{-ÜòsB]Ke÷Ô Q°9RNŽ {*TI•i¨ñ7¼«îb]}õÿËÿCÔ6ŶÒÊ’˜d8žÒ°?þýÛæŸšm­äԋ컯#9Ž¢X ¢L0‡çv¬s Kdi-gE/-³kü\Ëöü÷’oK/pŽúÜÐáòw.gq`rdؑϼåÚíh[ÝòÍæÍú—ŸþÇ`îwŶQÖ;@c7¤Óý> îÿç|û0‘®rèG)Õ@½hŒÈótæê·™?À#ÏèÜ.šàƒa¡Ù‘cB—TÛ†·åŽvõíêþù?ûº*ªbS)Öš†c›ŽïÂ×UñíÛ]ý_åÔ“ì{¦M8 Ë1Yˆ$&”JñVkºõ–nœã›²à¦°TXc˜„“ !È¡;%w꘨E”SJiÌ5U äHÃ+‡ÊTÜø oê›P”_ýÇÿ÷»ÿ)ê7ESkí IŒè÷Ç4N§?¾Ýü—z×|+Ç^áÔéØ="ƒ*m©±íʺi¶ÿôãáßïïü®VÆ:J m—Žá¿»­ÿéî¦!ôCJ‡>¢èŽà¡Açy(—ò3ËÀµ Oà©Ì^ ]­¾¿,8¹æ© ~ÁB”AdUÛ>?,p)üó˜=ÙB-Îù‚kÔ\ÓV×´sºq ß;¾­·|×4¼kÞlJn6WwjOU<øH¢a4“6ÄÖ“1l˜4X[€óÔõGJÙMSB¯RßšqèdéŽ}¥Ye}Óªjs’òÞQõ਼w©°Nkæ¨'D`ò”!•õ¶äÍRi=—\ÿ]³œ?&kðX+·Ÿ‚™ƒ ËœW~•ÉbÖäI“'¯K*tM¥ÛPU쨬n?ôßý~ú¦ñ†Ä„CwB8õ¿ÿæî@…9Qu©0#¤9L©_`ž—-à1v\´i].¹;¾†‡K=ç-\óT>9ñ¹ú5@çqôÈ[Fæ­75•nÃu¹ã¦Ù}è¿ÿ¦úí¶tpVƒAèCÀýéêCÍMó§t:*yÝÁ©9v¢â‹yÚ_¦°jÛ<©ð<‹ YX*É«•©©rnÊ]Hüæ‡Sûcñ±t0Š‘bD;öøp8bÓÔ‘6Åz8$*L‚S‰4C4i J¥x£5ÝzÃo}Áo›’o›’›Êçð‘a$Jþçì›·Û?ƒè˜B: - c'1hRä”'¯*Ü–ªbGEuûÃáOÿ06­`’@bÄápÂxh»?üîÍ;ݦú ( ¨ÔcLThG¥k¸.6´m¶‡ŸŽ_ÿp<½m 7E@N}‡÷{|õv{âÚßKu¨2=º#§zhÁ@0òèG¯z–§eAÎEÙú+dk)ßëÜ -ίÿ> ?×+ù˜'rͺ]O:›Ëc"à¡rž+T\óÖlèÖnéÎoÕ›jËwõV½Ýméf»áÝMÉÍ®èB¨Ž~(… uQ²+6оÛ¤ °²àiºHc­›7ó! ¥8=dl)ô' í=§ƒn¾+ [•Õî­UEåÈ{KÎjRÊL³â!”óô A„ \(l…G·tNä~NUÐ5 ä5Þȵ<Æ/ "kÏsVt€ƒ"§ X*È©’¼­É»F•U³}»Uä,6oÞBùˆUíqôïÙnë’ÒÐÓŒêHs+,=F0å £rvï—Šmž<‚É<@–³€çùZ@)ïw X€—sU«ŒY盞†ƒ,yUÀ’‡W%¦¢ÂÖT–ÍöíNoœÆæí×ðõÌ ÝñÆ*ÄýQQQ6ä]KÎ4äÔ† (:A«:($„‹ÂG¹½8“…Ež,{vªÊíñµ%WÜ}½ãâv‹úÍï`G Úû÷ЊPnG¥©©t#y=Àp€!B¤†PÁškùÖ—üvSª¯· ßÝTÜ4ùÂŒAÌÿóÿóÍÿùýËïþ÷ÿíù?’“nÐtìŽZÑI¤Y‘fÇV9rº$ç*å‹j{·Up›7o`|‰4ŽðÞ¡{϶® ’¡bg†du"ÍJH„¼rT¨ŠJWQYÕõíÖðM‰ÍW_Ô5Çý(E(¶›‚ ®©0'²êH†ŽPh‰Ñ‹¢團uAÒ,³kY}NÄÕ5råu9hq~öÖ—`ÃSEãgɳ ²Èì_º·×K=íùPSe»C‰’kT\óÙÒ[·ã»r§Þ6;þjsÃo¶;¾»kh³«#ëêý‡÷UàdÝv_ÝAhSµ8ãÔœþH % -¼9ÆtM6žy¡7\èB ßhhßS÷ðCùðý¿ú]s{¬Þ|mÉ{KÖ²š‰@“/"SÂ>FÌ*k€ùÌ<?× žZ¯£µ%ýkù5´Và“D-\ºí¡PASM–k2º†÷e}»Qº®ÐÜ}[4H¡ƒ6 !S ¨`tK–O¤¨…V=0F`r1—27È ÚK@Yz"ËÁë^ûe¸l]…¸•ñöS½‘l„©)¥þÈ[Mª`Uk*r®¬nëÌÛ¯~_ÜLpõ#z£ΗäMÇ%4•dÙ‹f„n2–ñxà±h“ELyƆ#CŒ F•0º&gkcKß¼ÝQ}ûª·¿‡ö`è`œâïJÃU²º‡á†G0%RÌbb$§™kèÖ|×TêÍ®á¯Þløî¶_•öÇæ?ý‡ÿüöÇ?¿wõMêfs'CoèxRôáDR(BK"xª$PÚ“ÒÖù²)˜‹õͬ¯ÆœÏç8’vÞ"ˆƒRŠ ˜š ²º€3%y[–»Jk£°ùêØj‹”"t‘ŸÑn*K:åþ1ª‚æ šZ(ô Pò·”ßYÙ¿$§× Ìe(r Ë¥™fO=­ŽùüÚèåÏñJ®‚È»ë–ìr­cäYàæùŽ ”\ñF×të¶ü¦Ü©¯š[þjw£¾ºÙñÝ]#å¦ichNí‡RÕ57›·0ÅÚmÁÚ¬òèN‚”„0 ¥ˆR @šùƒÜ=üXǸªEDÄQ1D$‰ˆÒ˜"’R ! €Ìa-,ø±ì¸eÇ.yø\ü|}íÇÖºF×,æu(ò9zIÙ]…ä)] 8ˆX9909hvd”õ…#[7ðõÚ7@Æáø”1©Ïž ‘Q‘B?ƒõ:ì3¯o6ËÞü~ "ëµ¶>öŒ×@Cá)€¬ä—Êy»~™·€…À‚§°p‚àÀäI‘#ÍZ;Wx6e _m`Š0+0 úªw'"¥,)åˆÙA‘‰òœkÉó­—<Û¸‘Ù™W‹È“K,˜,49(¶¬µ.¼'×làª[hÛ ™>µè«J[…-”òÐìÀä¡(@IS$ËL¥qÜø’wUÃwÛ m·Ûêæý?í~úð¾®n+Ò^áá‡PUm¨Ü'òf$§FhJ¤ˆ„eDFšd2%ƒ¼Ê3+h¥Á¤ XZ Yåé &H–'™ž7ŸµÐäH³%­öŽUá2Ï«HŠ@Ñ5Œ5jz>†(÷à1¯å—y<¯Ê0{K9]ÊÍÇÂYK™å}éφÁ¨ò˜™Þe> ø yÎy)á8ªËRÞ "–JTªäFWØš-¿)vü¦¾á¯¶7ê«Û~óf“ʺ9vífTwÿ¶ù*]€ÙHptH¡EˆÃ iìÆ$,ÙKË@‚(‰Öl<”«ÁºÛ̬KpéÁ¶Ùl<µ?ý©Œ‡½jŠŠøö6ñ8ɳ݃ôqDGÒ(½Œˆ …‚›À5A¸Æ×ù¸V¼´FÖÇs´Ž×_*ÅüÿsUEó:Aׄw¾yÌ d i ,@ ‚Á‚É€HcÈ8íŒ)‘’‚vÖ°b" š­îTBp¼¼Œ‚À€1ž” 9,(Z IDATÈ s»®-+qÍ™Ÿu)ÛËðìü¬|åõ‘¿Ùâ½–'0q5=ð×jý—¼µ@gÞ¦lýƒÈá*&CDÚEÆY(S@Û*D…Æ9«‰˜ó\“9§±`±id¥pù\3=:ÈT¥•¿?0Ò¬uaH;mK°­À¬mSx¨Ä Jfòh²áÁÄ Q$p¬PjGµ«i[nx»ÙþùÇûoö;UUúö¾Àè÷÷Ð ¢¢('`y MA˜òLyFHF†ddˆ,c€ Abß#1!tG0)]‹ØHÃ(2È!j$I€pæi0Y0e‘sЮ€6EöDŒ‡uÄÌÒ“Çfów~½,ºYCÀÒpÂâŠGzâÊ ´‹µµ6¨hqîñ>Oñ³lþl™i©˜–Çå¤3LëúÌ®¸£‚ ®¨Ñ ݺmcmnøÍÍŽßÜmRÑlÝaùæÍ`ꯡý.{R‘†#Òø€±û€Ðî1I3G+Hf%H”–’ˆ ‰e8 =ü‡³õ[¨rv7Ó€ó`»ÍÖY0k:þð/þ0tÛmsxÃ8ÏrO]¨£Óˆ ‚F‚ÂrQ»¬®)ëç”Mžm›í‘¼òÑ|>+øt‘ú|êÝ̯ ÿq…ã¬ò¢k£àQ™f%-leA|’d½Lƒd¶’E²å'‹¥m˜”2L¬4”²`­ •†6LP<•ŠÄŠˆIML%—1ù|ßiZЦ…2ã“E2#žz&Ïü²_æç»yeâyUb€aÀ“ÒzJ4õg8·ˆˆxZ"\ާ9ßô&€Ä@dRàÐ R¤lr k“ gmÀJCkžA.¯†AIÓ»r1~—¥Ðs²õ’´ˆÄB$¯´MÄJq¶ôYC+ƒ„ÒZ1ˆˆæßŸûyö“a!Ëš¼òTšŠ«¢¢º.¿û—½Ýýáw\¿ýtµ’ÀZ…ØŸ@Öx2ª‡aOŒ,F‘1iéÉi„»$Õ)÷‰mÍ £? Å€Óûè>$6u”ÐGiG‘>aèé9§ —¤´b¥AZÚ€C[“ŸQ+B'ïX¦>›¼‘7iŒyýßÙøÉÆgÖcRc6ÿfºôhÒ ‹Xæ…ãUð˜'J®O€žï»zÐk½‘' ò̼å@[[)ù˜$/_RR£+Úš†oŠ ßÕ¾ÛnÔÝm}Õ»Ã&åê»?Àm~öÛœûH )º{ŒÇïN !$g‹Qi(Å\z%1"‘؉HˆÌD¬ˆ”&QJ•Ö*@L8}ÐC¯l±ª;°¿ƒÖX×°¥8ûéÇÿæ÷íi»ÝÞôèûQÚ¾£SßÒahé! TÆAº¡d‹9á,˜÷ȸ\U˜'/ù‰É†¼œ…³²É+žæW`® »"Yede7ï𠦻0ˆ–)¢GiZõ5‹\œ~!²˜|.,žõ2ù+b!“’14ïÃLë‰M¬`­@šÁyΓ F„‚¢XÊ_J’W¯%ô“R—ïWa6HÓ‚òó²þé<@g·ý%YzmëDgfeœ!d^=—CåÅŸR˜–»Ÿ‡vB„ž@eíË>\WhY²U+¢‘$WlArŠ„Y˜949GÌ`=/â $–Y B4”$Ì3Ðgpž½¸¹=MOžÁRA$ ‚b"&â\ì¶&Sn=öé»$@Ì 'ÀUÞ(lÁÞûæ¶Fu{‹r÷ºØNáë¾.€\“W¿È¡£~’GH”„>²G’}+rŠÑ=ŒÇïïSÏ‚Øö0Þ"ňîÃaß"6UHi r袜FA³‘ ÂQ’ÛMÄD¤iz®©ë™ ´a⇈†ˆ‘y<Ì¡5L ’&^j’ɉ»“‰BçµÃÔ{4ë@$!N³}æ×qÅÙÐZÏA¹î1_þ=ë´„Ok]óD–Jcí…,Ù2Ñš'xxª¨ä’6¦¦]QómUóífË·7 mvu?ŒM4Ê•wßÛ|]Þ‚Ù"¥iØchÀ¸ÿ¡Ý'oŠÑúbÀØè»ºS® a#†cÉsC@Êæ“³ Þ+.JmliŒ/L™öðMã‘Í&å×к›oQl"Ò8Ð÷ÿ\5Í*Þn{nÛJm-û¾ÅÃ0ÐAuâRÀeJKi¬½Ƽ47MÜTS÷çsŠ&žûcù D‚äOä½ hasà|ç¬ìyÙë@4)˜ia>=« š­"dÚ»“‰0ƒX.Î`b$Á"Š™xËb!Zê.ž½½i›CÆœ„!”ï?Û¼—!­eeÖ<Þ³ç9{Œ³‡™Ã¸òxOaÞéijKfɤbóò³y5©L‰P`,Û¼x£rd•…ÕÆ—¶¨ ]¶6Æ0À¤IQÞ6BÑ¥†VC$ä8=t¿¤¹÷oÒ6舂+†$‘¶étÒO]üþa”÷§(§#‹ÒÙN`b@ˆ&Îg~§‰íOrŸÇ ’XbXüy šŠ«-²Î0DpÌdIAƒÈªig¥ ÙÊ#P$Ñ(Q"b %¢—óöC>УÇAaê·G@y)ç1çÉ^=Mác‰õ¥ -äq†z.÷Ì{€xÊ«ðÖºâox[Ö¼iÚ쪠LÕ ûÂïÞ’Ûü;èò¬b:[2І™439&Î@¢8{Q†dL#â(Ç0È1Ž¢cžõ:HÄrÅR C ²Ó«g¯ 9¥É³Õ š³ß£6sB’$XÄ€!Eéã(m>Ð¥ m è$aÁ™æÇLÕ+S8+M /‰A(j »LJe!U“e:ÆtSdȱãRi£4+Jä PœÆ¢“e2 ¤aZÞ¿G[éS6õÒK‹!@º)Wb§ ÈæÅ¯çDfð`èI’ ,Y8¶äÙ’g¯y•ù«ÙÀ°&£ÔÄS>Ë„¼ŠôÆ¥‹Aº8RGiÓ } èdDŸ"#òöGá<¾æ 8—½‘†zô(d^Çí‘¥¸2â³ÜaR†ó½/s=—êržÈ£³©¤Îá˜Ù8’Ç¥®%'YËOÏA”w™K †^™Ì_mó«Z)kÀÆ€­Îù4((­ÁV)VЬaÙR¡<*¨2Iú$”š 1íÀéþ”`%… ݱ‡7‘”bˆˆ´C”C7¦÷mǘöä) ňB"²àùìü­yÎÙ ¡ìí O oD¦o6fI°”Ì䙨`…Bi*”"ÃN«¬'HAÑ4`dÞ³5¯PRÄG 2Ê{éb‡>öÒË mjÑ‹“½äÝaô‹ xº"ù²ü÷Õa­—@dY'Õç-l§=È‘ç¥.¹¶m|EÛª¦Ý¦¢²)ºq(á å6_Cû[°ò€D¤áãñ[Œûïűt mzÿS—~ø¾‹ï?œä§C›ÞŸ:yèût:9†}Þ'${"")Î bHÃ)M¥6T'm/Ç®—~,Cd)›78õ'êþd ”ÌZ{h×@Ï÷÷÷åÛíÖ’÷޼säƒa Í&%¤©¦Ò¨ÐŠ*m©2†¼Òg+ÂHHB É«y¥É[&«5Œ"0aZV:ÈÚ0¤ãÐÓÃÐ¥‡±Ç>ŒÂ!àò£3¤áYqÅ…6TkK•¶T7ñÀ‘5F)ÒSˆ¤4í…ƒ !  £´aSå8ôrŒCC Ò¥ˆSŠS:{ÜYð¤ìò:¬FrÈ„'Eó¨ÄÚBÂ('× gÒØÄ –-‘ `NP*’VL„‘!Žâ Cè¥ -Ú±•cèä:œb‹cìÄ$‡cꀩÅñœõYëÚ@4Ô Å´ÑRÅž¼r¨çJyÆQ©ymÉÆòþ6*oÔي(IbÌûØ aDÆÔŽÓÞ¡“SdFœâ(*è%G° ŒÇxy®ªÊÞžž¼<•y+ÏUÚ] ^HXdšyƒ³7¹åÍ c™yZL3…ÇÎJuN¿ÐžéË”#›’C˜ MN yÍTK¥uðÖË ¢…ÒÌùÈåú Ú*@kg ÖQåGn†ˆV$EèØcH ‚˜€>°œzˆå”8&M5mkÛŔޤc'Ò„!Æ”M‚$ŒÇ礅1xæë’°$hÉy.’P¡$/ £(Á¨PDÒTiÊhªt^#¬Ðš¼Ö0:ow¡‰ÎÈ%È^nJAB 2„Cè¥ DNc'm8É)89ÄÚÔ‰Jy•»^òðË+•aêo}ñ—^©\y½J盬êsÿ?/PyÒ¼0›eO–•º Æ•¼ñoªRÕ¬Š~l]y÷ï¡‹[h[ÂáCû=âá1l+hÓý]üî»SúóÇôÃÃ1ýÔ¶éCw’û¡Ç)öé ) H¶Ü§e²³Ly“NËš ¶Ti#Ç¡>ŒbDJ0)”Õ-ïTÏß1ØBÛ °‡vx°]Û{gœ&c4´¶¤•Í#ia \iMµ3´óžë¨4ެÊÛúJd¤H#@BP¤È&o5ygÈ[EÆpŽp#ïMУœ†Ž]—ª¶…ï[Ñ]— ƒ°do$÷\Þ$§V–㨶Ž6ÖsãU΢0Ž kÙ «5X1åŒ`Vv’DbŠC”!i‡AÚ¡—cß§}ßËÃ0ÈÃÐÃÂ(#ÚÑ MVí²RkVvJ I"4{!Kk9'¤ˆ •"o m Ç"J4„#i“HÖ‰Œ0Åœ2M1Ž2†ýÐK;¶rêÛ´ï[Ù÷'ÙGÙ‡ö¡ '@2LÞÈ $™æh˼F­ƒcG5;ªµ§F—T-yã ªœ§Âx*¬#o ·%PJMý7e]¢HˆQÆУtÃÀíЧcßã¡oÓ~è¤y;Ø0È1Eœb†æ¼ª#/ïÎY˜B„2yx9q=H?«‘©(B–¹‘9¤±ö—ã‹¿—~o>G¸T¬Ónë>õŒ$LŠ4kr d”Peo ÇMa©* ùB“õJy\ªïò¼/°) ]²žÉ—šêÚò®/dá¤R;(9…1%h’)Œ;U©‘Håð‰pDö•I4»Ïõ’ê‘ogõ ™™û?_?‡w…,^%X¨ ®•¢ÆhÚÙ¼Èdã,UÖRi •N“3†ŒVЊI1Ÿå+‰ ¯Rc! ÒƒôC'Çá$Çþ$Çñ(‡þ$eØËq<áC`é„/¢¹HÖsMÎCôñÂó—^4ZžK¬¯“ëK~Í1Ò9ió"|äP¨‚*SRãJjÊ’šº ªñ‡Ó}©«†Lqm7$sÖþ{P Áhß§ûúøýwmúóÇø§ûôýé”~ꎸOi?öhe> Ó\óòX±D“U© `ÈÀq/Çh©‹cÊ1D!+¶ÄÚ‘U^?ü¹`2He̲RºÓ öãç O ¥@¬@dHÁˆ!!DN+Ú:Çw•绪àmQRí¬Î‰XD–8b(ŠY£È†ÊR“óˆ¨ÉʈQú~SßÉþØRq8ÁŽ¢¨I+ £ô1‚ˆÈ±F­ o§]áyë Úžkï©)ÞwެÕ0F‘Ò f¢ì‰@D$/—¢ŒÃ(]?JÛ r8u¼ïúôÐvéCÛÊû¾ß÷IÙâÑKŽ‹çšx#;U¢èiã£Yìç˜øBD ¬ 5“3ŠªÂp 碊ÄF`¬qÈ@¢„˜$ïÌ£Ä0NËû÷Ò¶}:¶'Ú·'yèŽé¾-Å÷G1Ã11YáЃS‡^–IMf'‹’-Õli£KÚÙ’6®ä­+y[V´õ%ÕEÉ…w(¼#g Y«H› œ§M¡D€”Bˆ2ŽA†>H×Òö=ÚNîO-Ý·mªúNŠ®M~èaÆAH$ä%uh‘s”ó<)¤<Hzy`Ÿ¯• @˜_—†áz̯õÀ4&®e™tÃÇŠwhfûä#‡W½HíJÍ7£íÖòfc¹l4ÙŠuQÛ Pà<Í‚mSÔ`W+.·Z¶½Í% ‰Ækœ=•ÞËù¤yŽŽ&C‘,ƒjÍ´µ†nåÛÒñÎ;Ú”ŽëÂQé NÃ9CÆ(RŠ¡TžM€H¤” ŠâdG†Aº¾CÛÒát”}Hûî ½•ûΊ fë@BöÌç9nsG†Õ{ ïþã3y’—ª³–ﯗö2r¥Š"MŽ,UºÈ‡-¸. ®j/Æ»~2Móh×ÚOѸ#bûR¿O¥Ýö8~èÓ?véû÷§øíý1}{8¤ï»ƒ|[Ù‡VޱËûË0UáÌs@‘ò\‚)ZŒôiDH1%ÉéKfÑDÆ1Ù‚us§¥íÌ!ý7íû¬ Bßa8uèŽNìönˈr5Ê.&•ÚÐÆ{¾«jþz[óͦâ¦(È ÍJ$²¤ˆA “uš\©¸l´ÖÝ0Ø”ÃRÝlZJaHÇc'åCKÆÁÊE‘ÇhÒ@‹0˜J£icß–žo«‚weIÛºà¦ö“EgÙ—Öi©¡ëuAñ¼˜ $ë‚Ñf”ÐGé»QºÓŽÇAöÇž'®m,O­øcj[Ñ4&M£–•Zi¶–¡¦X9x-J¬ÀÊ€)GLAK³hCEö ã!¤hè{•BŽ%mÝhŒ†(C7¦Ó¡ã㱓ÿŸ´7m’äȱ ‡~DDf’]UÝ+³²"ýyÿÿOYÙ™žîªbf\în§À~Pó¸˜d%k”ŒŒËÃÝ\MP<<< ã$§qD;\¤r¦Á 0)eäÕ’d¿ÊÞñ¶‚kr踢©éྭ:º­;¾i{¾i;>öïû–º¶¡¦­¨nùÚ’¯Œ(Ùy8WLLU2ºO7³æ˜±.Y×%Ê:‡Uúa–Ý8S7ŽÒÚ Õ2©]e19b’ŒEh#ƒzù8KÕ軓ñׂ]MÂǃá[¸úm qÝïK﾿:–pJ}󜈈©”´žÈzæcïøæèÍÍ­7û[ËÝ­áêÀF'°/¹J¶ €õ{HsªŽlºÕ’@3<ˆ"s!²žÄ]X*khY‹&WW™ò{O»ÞQS—•ˆè¼ˆø1Öh"ÃI¢dÉ”´@ão›¢•¨ëÍóÕé¾ÀýdàQ³!¡Þ+ËwUÍw}ÍŸwºš}E}ç©iÕ#ç ØšW—b4¼±(ªL$Ín¿"GÑ’Æ5è2™§™ÆqÒaè<¥+©‡5Äve±JI@ 3¼N>Þç·ëâc¯’_ |·è[‡ñ7}ïPŽjªQÛ ­«¨¯*Þ5 u]Mí®‡S뺙î¶Þ‰!º"…3ÒøÇu¤¸y~XóÃÓ$ßN£|ù:úG=¥I§î;>ì;ìö Wm‰ëeši¸÷1¬Ž¬Yó¦§ïÏÊmº>´u»TínáÝqáýe‘ói–þÜR[MT]F±< ÓĺAJP¤ÍAÓ‹*€Ý¢<y1Þ¿oÏ^!'~c_ å¯{ùí×o)Ð߃³_ó*//ô£Ždcg1ycˆ QÓ0íz?eêxIÞ‡h«ÙÖwàêfs$ \ßAT8+( qʰ1ǨM^µ9|:>’%–ÅF"€ûÆèñàOG â­…a"’Lš#D¢Æn×l–1‡HSÒE¦r }æ~7ï³M:my«Ix8²Èhó±2ô©­Ì—]ß÷ ¾ih¿¯¨ßUT7n ¡.—z]&'LÄÖm©LQÒã7e"©ê&U¾ ÝíÏ#§eÖeš1íÎ-wu#MåÄ_H†J1'Á Єô&"¹ÚÓ·‰õ·0×N¬¿ßKª—¬m+’)ÉHnmÍ­o¨­|åÃrñõí¿Âºm1( aDœï‘–³4íç ‹ùéyÕÇËœ¿“Ü/£>ÆAOiÔ!—>Åq«(¼èkÈõñ^š— —·8%Lbq‘ÉÍ$n ±lLE&“;ýç·Æ<œ¹ª[%†`Îé_7CÕÄ“Oq”Ë”t ÐEyÓØñlÑÛ†vÍŽý.vÍíþ÷¿þ«4T÷7=|ã@œa I·ÿËhw‡¤ ž‡³;=~­¹ó¼ûô¯`×ìÉHëBóéÙŸ~¹÷ÿõõq¿·ÕîO‡æ¯öЂ–™•r䜉oøØV|»køÓMË77­öûZ¬k¦ui.ÿ_5WžÝn‡¾ª7K“}]ñ¢œ ¬‹×É?ýíîöí~iÛýdªv榛Ñ4 Õ~NÎT°—Y EWJ‹ÜkRý·¿ÞB°È@˜ŠìL³#6{fÀg:cyúÆãùÑ×ÀÜÞÂ9ÿ¢Ú &ˆ( ’£Iq1ó¹–ÓýaßïÇn;pÕ6Ô45ÕUMÎø¤ð̃ÕŠ’Œš¨D#v3”-;Ú³§›ª¥/MÇ?w;þ¼Û™O‡žïnz>[­š.±mžÏO}Œ«3MKnD]Õ¥Bœ®5ŠÛ´B€(ÅYçæy|n$$ÙïsÓߌ\·µ}CÍSC•oàíK•33‚EÌY‘¥D#…wÅç7cöÛGâwy’½æFÞF$ß3ŠÿÈ\ëBÊcÀ™ýêÙK$Â0jk‹¦sß¾~ëLšÜ¾Ð×@×ÃþX{sp†l†mÒøWá‚u9™ezvãÓ†¿?bù:¤Ûÿûß'ÑDäɪ!¥¾·8ôõßÿÇß>åñR5Ç=Lí‘cÆú|A>Mé¿ýégñ7È2- y]5')¬;b(ñKîçW“Øuÿ IDATñî­½:‚¡Réä´f…5ÊûÊЗ¾2?íkóÓ±á/w n›ll3­s;žŸ*¶†]Û¡=Þ­ý·½”¼:‰&ÎaµcXêÇÿüïû¾;Î}ß ®jnÚZëÆ£rfc­B ÂЬŠ$1E,9¡HД:“_§.~¥Bý[ÖG'ò=æÇÇɵ‚·TñZ²äÙQÅ•©¨ñ5µ§ºñË2ÕjÛjë»-²–ªôùoºDqŽ2\‚ž†Ež§EOaÖs\tH³NyÁ¢ V$D^Kà€×¤Ïõ$õÚǸÔ+'0 e„ÈF#faXÃÙ:öÄUÅ;1–#Û~W§¦k×þ_ÚAΗEŸ§|º ùq rZ3–H’ÅÁO•m¸u5íêÖîûæðó‘yçÑÝ}BÕ× BþÓŸ=W½ Ó]}óùùæÆíÛ€ÙA$#/3¬iÒ¼ðó/§ÃMã/ûÚê1ªsß8ºÙ׿ÓmC7wVM7¥Ð.óP‘÷¦ûòئ…uma¶Ø·Ð£ô_AW¤õ‚0œë§óƒolÝÔu7ÙÏÞÃYÍ …Å h¢†è%y‹³o‹† ”ÅàzØ|v{"Mœ×aH,S÷é/€­ÁTØ8°WnÏU¹œÆ uZæ–Ës¿<Ý7]ÝÍáγu`k2ŒdµÄPPƒ¤‹ŠF @@ELq|ð ÝÖ-îzóå°7?ßìùñ‹l»Ë4î’Do›=5Ÿþ¥Ô-¸1óÊù|7§›Ã“€g¤yàe:uãùR諭ñýa4Î{2ÖÁpÉ%%X,”רª׊ø«ôË–ÿ¾A{;èº3Þú òßw&ß{ÊëóüúT®¿ÎÖ¿Œë/¶b:&"XCÞ1*ÏUSÃô5l»‡iàê6=ÀÍ«a¸söGØ&@³B¢"O qÀœº6¨½…&"Ç ]ci¿«v_F–¦FssÛ´±ôX›™ãÎÑlŽðU W{üôçÏk¿ïA—§Šªœ¡ýΛ»ÛÚÜ~®™~œÇ.[võíøî®z[€·BdÉ€ä¢:z4Þ »-D2©¶9·ÂrâðüЄyp]ݹúî'k”ŠØ‹¨C'IT3‚ø¥§Ì».½]9ìŠ±Ôæy} ÑD¦ÝÃÔü²ÿÊ&‘í³p ¶0ÖÜÂàßá›–áÁ ù)Ù¾Ýú¤l²Rf ™5d‹˜=²%I "4lhç<«–ïÚÎü´Û›/7;þü¹×~߯‚ݰœ[ªjÛ~†­ö0¾¬{ÝSQ¨ÈË'`-À zÉðM@Ú].f|~ì#×6­5ŸÈ&‹¬Œ˜&±e‘¬ÐÂÙgõ¸Öw¨RÑFøù·{äûtܶñ-´ýºß_ë[ŽEßÒ^ß½“¤ëÊ "&%&2\"e³¥6¿ù"Ç HYZÌ…U 6E‘-ØØò·…æ_ðÇJ•%ª½EÛX³'³Û¡¹ý¶ê 9ÀØ­€¢k-Qv¨m„7†Š­8÷whêߟçõ1 ;rd¨¯ ßvž?óåS#ݾ–©šêúæùý lÕƒ¬ßæ«ìUΛzÉKõƒÅÖ‚Øl·}áÛ„á‰ÇÓC?ŸÎþÐ÷¦=Ü*§5çÈ! yÁœZóª³,X4 ´b.4¥WGruomìoû}Ïi\þ¶HÉlõžyöTYOµ¯¨ª]&òb\ÕeOãʳ¤y¹€D„rNyš¢SaYe«NyÕEV¬7çñê@®QÈ«Tøõ´`7øê-ƒýõÌ¥›0[Æ”2¹5*cÍ¢ÄKt³KÕÉeBÖ,kÌ:.AOó"OKÐçEô²ª,™ˆ” \t yXãÉ[OÞ¹zײ;Q?Ãu7`kUâæÆÈzù–œßƒy“ª6C$œ iFÊ+$&mwm²•Nê¨2JUMèZknn+s÷¥^D»q¾t¼ëMwü ®9‚] fSråÖ"‘VHNå”ÌTºCz5uQ365¸j!US÷ðUéù;ç.ÚþÓ2Yб ÙhÌ"I‡x•¡Ø´‘>²YW‰þr’ÜêÝ4’B`ªˆ+¤€¸B ÉD6(–¹Ð=] ëïÀ®\³ñ-lÕa©¾ñòø­¹Œ#·Ð”TC$]"éY–leÁ&·A­±tpÝÖê{þtÜóçO;ôÇnJa¿Jlüþ†ëýg˜æìü† ÇÒè,ÌHqÞZä2¯†ŠR´«¶Fj…žÊ®‚©X×ÁV-ç¯Õy¼˜¾îŒ»»#N™t ¤1“¬ÉP”PÄ-„ˆ7«úBÏý£ýv|ŒZÞG ß‹Fè;ÛŸþ‘þîµr ¤#ƒæ5,„´ÎÐ8i‚È‘FÜHQ¼™‹8ë: /Ò< M#Ò¼ ‡¤h&2˜ Ϊ*ã»–ìn‡z ª÷Ѐ§¸ª˜Òb©²ž •Ìéë¼Âx¿ãH63Á:¿1dŒ¥CãøvW›Ûcý±Ã² «îË_Èïï`|äI 4ŽHë +$Çm 8LçÁ®ìU㻢zîö0®‡õ=¸j1>üÕߟN·?Ý~ŠõáfA æ0ê‡|‰i&ŸœzµÈjÁ[¦ð­­ï 3~ωàÃÏ~íTÜVžUÀ, dž*c©²•sTy›•,³­šÂÈÚò5"'XWgsÖyJ2­QÇ1Æ€1 ^$,ò;RhšÅI\EÊU]Õj·ôŠ’ìVêJWñ<†t‰¢‘F„¨h¦DŽ ß_T5¤¬S CÔKÌ:D‘)QH ˜åÀpT¢†{Ë&{øºk°í˜*€Ä”Îdë=$e@$ J¾7%HL…v~Ær~ÅœëÞF’0*ë©r†÷gnîª5k7†©µ‡ƒ©ïþ Wß‚]E:×Â|²¨16;6[™!ËJq¹°2±­;ØêÔûKØTèÇbþn槯­IF›OŸ¡1A×b˜sÈDDE™ m©WFË›·ñ0lQô`)]À¶-Âzq¦i~Fžgµ¶ïºl­•‚€0bZLZ'^× ›ª#ÛÜÕì€ÃºÃ&™ï@Ö‚4ÞmM{{{, é´’Î%§Lk,}õ£×5Hol`æ‚só\?) -g¤ó=³ô»Ÿå˜5…Œ0*AU™á¬çªê8Ùe~v!®Æ÷è>}¶· &°(M_ÿ£^µÝ¹›ÕiV™fд°.«$€‰yï=ß45ßö-ßznºHÜijºÏ¢êøgØæ¶$,Hñ‚<Þ#N'5ìÓÍá爲Æ(д9AÕô [qLÁ­ÃÙ¥y`íK³5ö{puÈ¢5þÓž†Óîfw¾[”ç:Õ)bŽ Í00/M¤oeýoÐV³ð[yŒwy«7_¤úþ–-ø'µ24+4fÕ5 +ƒê!Ý}¾ÌOwÞÜ}q®ÿÉšúάã“a³ƒØ @({:A–¸êNMŒÙï+1©'Ÿ²k¢´>ÈÓ)k\2 Š=kˆM!kX[FÙYpeÀLErØlŸ™hÓ3û®òÂïŽÔ1,ª,¸« ïÛŠ;‰›YæÊ\‚on œf¤õYá|Ÿ ïÖQt™ë$ÐR$ cà¬gò 7~gÖ¸Ø8üb‹ãºÛp=|—ÐìG<žÎÕããóíMÛT_j††*W£²ÞX¸ìpØ|Ͼ}ÛõðŸRñ};¾c^[e+"tÖrΑs–œ7YĨ³LþŠûo}BòŠ”V°m…âšu I—eIQWI%!ë5¹öŠ(Çv;‡y<ÔlÐKWTsMÎTp(Ò$ÐkË^ ¢B“$½ÊÖ—èÄ‘¡"“Î Ýjð䪫Zœ¥!%ÒLE~ùmŸ†M ûš„cS$¢Ùºr \•¼„lo!Mˆã7äù¬Uu“lHœ5{9T;yþ_· ÷¶Ú»秨뤀0Uµå~çÑô~Y皚ƶw‚Ûý¶›³ŠgÄñÄ˳6õ.øÚ­2ž’ÎC’u)¯#¢ 9g¸n˜›ÎîÚƒ )UÓéÑ[‰Œ.ÃV·`ßÀ²Ž€ÄÀÓé¹Û5á»[åqQ4„¤ ÀÑU†ž@ -¢“o¿[n¥gÌi¼G:ß«5U®ê&ÈðópÎ:ÏIcÈPQ²TU¬mg¸ÛÛ¶>¤V‡¿;0ˆ›O`ÛÁ67(4Û…†û‡öfùæ fU‡…t‰Œ&ÐÁ;¾i+¾Ýu|sÓ¢jÚËðÐuw?Quü3|sØ HÒúˆ8üYæÜ¶ÇÕªD=ý’d¢®«hJ U"ï˜›Îø¶·¶éÝæj=ÿ݉¬TàúX n´ª~ùÿÜe8÷»ã1›yÕa!™k–Q“Õ«¢®ê?mÀÿ7ÇoÁ_?6Šþ¬"«"¤Œ)ª¬"L öÌh ¡ó¤]CÚt”æ{c›„[°UˆÌHñ aü Ûú,óc–ËפÏOQÏž.‘ž†§5Y©³L¹dƒ¤˜6™|ó^5`21‘!¢ëÁú‘Âüñýÿö]ç"´ê-ÐV–ºÆQÛ¹Äp°ÞÔûÏpݧbô‘ò”g­š›LyMzþšäòœeœ².kÖ”¥H;Y¢¦µáÝÑÔ»»„ U|þ›ƒ¡ùpauÙªCUwx¸Üÿò§ ¾ªÈùЬõ䌅3Ä ƒ3 2 ðRIõñ>¤€¿Œ¡øþ:©Ž+”DËvC³dÙ³†¬5º.\^×f"’8vB’Ec„(ºfAÈ›hÝK)áµÇ†l·òê@¨8¶ÔÛŠw®¢kÐÙ–jÛÂqE–6J‡ž=ÔTê ¯òÖ ˆ_Nwzͨèš#|ÎpÙÂÄJYKÞ6`«$¾ª“PÖc™o.¹5¹60K3Âü ‹6íçÀaJr¹O2MkÈrFÌyϺù$yž%Ÿž3 „ÚTµ¡¦s1k•]sü\ó¹8Äñ+òt‘®=¬œbHß~ r>†¨ó5DÑ,JL ç8·µå¾ó¼»xw¸‘ýásžæç:ã«a¶`{¶ lsƒúø†°ðæºíw™;Õ˨:L-=K®ª®¯{êý(IB‘OHóÒü¬ÎvÙª®ùþ¿‚¬¹:~@ï=±ƒef[àûOH—ÁLã¥kÛ>Ó¾Ú ÊãL¢9Ѿ²thj>ìÞ«óxn]ß³ß)ˆ¯!’â qø “rjÛãŠeùüä| 2 sHš’¨*ˆ QíŒtå~çyÌÍþS¶ªõ2<ò³l÷Å‘tíÍŒñïÿ£ÊÜ5æpÈ|²žŠ B¦åÄDú"»¾aõÿ(Éû[7á· ë°ÅÇßÿ“š¾~RYQTç˜!±ð=jfj‘¶1ÔîU×3$L·b!i„ :>«Œ’Ÿïs¾Hrò0=ÏQCr˜š4e…¼÷¸|…WùJ.¡€W0¼Ø„·ÌÏß³~}ˆŠÐ ±2WÖRSµÖfIδ-™¦Dú°¦¼Ç¼ÂúZXDäò ùô‹ä§ç¤§1ë¸&]sw2¬ÜVD}gô8„ÕV‡ŸTT0=ýÕû˜Šl~Š(%G„á<øËóÐô/'\6¥#å}2/ëê;y°¿çD¾ÇÚxõP¼Mî6a`.½<Ø3±!bWì-™myfhJP…B²jŠ¢)eÄœ%#i¯®=»JƒÑ ÚÒ>Eƒ¦cSN’¾æÛº¥CÕÓ¡ÞQí;ª¯}œ‹$GéN†kƒY)X¡W&Ñ+ÛEP„ÙVÉXS–1%BÒóÕ­QÇ P)gƆU—Ž@ÝJ‚®+3JÒ„´œ ËY½í"–sJO_ƒœNQ.cÄ’®)#”9Д”$©%ª­á®r\Õ®¶!,ÞõGrݸޕ$z¸ ®÷e”ÚµÃäù~Í÷ßy'yey“ž×¬KÍ*ĤÚx¢Ýœu 1 ²jÕßax~¶il›B„aÄ:¬ôüõÑw‡úŠç²¾Âuùåý¾Í‡\ïØwÇÇäúï9‘ßz’òbå|ÄTŠYЏŸa†5$’LFfg6šéÆmÞ e`ÙªŠ(rM9kÊù*¨¨ºE! ¯QÈk6¦6†zcùÆ{þÒ6ü¹ÛñM¿§›öÈ]ÓSå8Sm}‘íÖôèZˆÈ[lÛWÌX¯'¥¢’¹fÑ9dר§%äf â¦CkT¸™VZa¾¡È¿Ÿ2‘Tfñ‚4?À §óé!æo_ƒ<<¯ò4BÂ’“F)1”àˆ¨µ†\kÈ8BÕ˜(ê’FÓu7°Õl=rÁë§“Z2ÉH rzXó·¯sþÛý$÷êÏó"C(FYŠwm uÎéqñ:¯YcRˆÙ²5•Ióà“?•œ–ma«r{ƒpy21$oš6Ñ®ÍÔW‚eMH™¶F[ïq{Êäns!Ó ,¡qŸtxŠùþ>Èßî×üí¼ÈãT —”^ˆ3|Y]q„¢ "rÎøî&Žad™O Û¾ƒu{Øîy¼pÊÉû¾K²k…†,Ùaоv´k=w½»L§ÚízrÝ ØïXHÖgäé¤mu\1ŸB~üºæ¯ßæüõi–ûaÑçeÕ1FD)M§ ÕÖÒ¡ò:¬Q—˜UŠ'uÇ/Fleâøh­ë‹° ­·ÈéÓx±Q¤²}©¯õ^èbUs˜+wøŸÍ§¿,ÎÎà­ñøø¸¿û¤ýc×£ïþUÍ*ˆšuÉ @¥LÚ°,¶î‘Tr"I…Y؆’ƒèºfç¬ç9ÊÓõqŽrI‰ ‚A̲5Ã*×ÀüRÓsåþ_¿¦×÷ôI”×?}]iÌDDl˜Œ!QeÕLÖzXã·:£2‹/å„RH7ÈY5F` Ð%¨ŽI4HV4E¥5ÑöþJÊ™”çÎßþ£6í„,â¼`x|Æó×g–§©þÓ¿ÿ9é’2BR!Ûûý­5ð1?ö‘îûCNäÝ´àíRð¶ñµw.…ˆåêÑùÊùÞ*yE€"B«€Hq$RN'ªYE¢[¥9^ëk¯oÑ‚Q³áw|S×ü©ëùËáÀw‡¾=ÜpßõTU yW iºòIÍË ã]èvu/‘4gÑóšå2釀ʭ XÑuÐ H 8ˆ®ZFoçô — ¦ÎuRV“u“ºrßE"\XiÓ#d<ÈÉ生ƒÜ?ò÷Ë,몗0§¨! BYæä5i.Ýß,sÝö­qÆÚ¼žXšc©ˆ·5\³CjjJÃl󖻯ißåȰ†¨k,uc\F2M{„u»â˜‘ iBžŸÀÊ™sˆùôòýÃ’yšäï§I¾Í‹>¯«N9"l}m,ÕÆÐ*SÒ, È"ïMµûb.Ë“Ië3±ï‹¤‡ï`º#¸þÆaZo;Ë}㤭5&cå’$fººç?fØ~u~W¬øÑ)¼Ýëߣ|^áòÄú£a %kTvv†jTEȪ@¦5e]RÖ5 RÍ¢š3Þt6Þj$ehʪk]RÖ)&B’KÌ“¨cP%@Ò+é¿Ðìì2_mƒ¾ûÙu(ôâ’6²´ Øžž·\6`»Aà G°ä<‘÷¬Þ¹L°J•‘TtM„ç¦ÌÈlT•Ô«™OÿñµÚ}Ê™½—Ö·Ñ·ûxûonlUÑËt˜“ 1뜋ÚDBéÞ°Õ½K]àÍ÷ÀoC¿r"ÿûþ½x)÷'Šè$¿ô€¾>¨øŽm%Ia³”(@ñÒ\êã­¸¶š5(ÄÚš-뱫>v-ßîûgåùŸÿÏ_ÿ¯þöàºck]WçËEÊL[Îì%ŽýÎÈ ÍYó4³®ÏgÁy 7]ód? !F#’ƒÆX -è $ö‹mDò… õ‰I *2ž“<_’<\¢|B¾ŸW=Lj9'd8:kرBÈZ¢ª&r §ôdªz·I¥”žô)Hᬎ}¢´F9Ÿ‚®Ÿí^Ká»K<#­O@ b¸I:|‹òtŠòp^åÛ´Èý2ëãºèðr½ET»QËY3ˆT¼aj¼ÉýÙSH¦Ý¥+q ø} LÛìçÙÁqÛft•P®Æuµå¶± ⸩É4{°o6 ëq¾è®¹ òü÷œŸNAΫ|½¬òušå~Yð™%•Š_ UÉÐ’3¥MºÖ¢Êjjgê«]›â|r¶¹-¬ëáëq^Œ0;jÛH·¨]†W#ÄïW?¼—‚ Õ|lJu¥t¾u xùúþ߉„®×¤Ðrp„@‘„E¶rT¤Íf½ëþÆVdQÄ‚`Ù>GÉH“R9¥ÿS×÷Þñ~´H?ôZ®›´ .×½Ú…’Ÿfv…UID9g2¾gÓYw“E@Œ M·WQ°ä ÉEl> dZ”í9 ‘ún'ÿþþÛJM§dl&PÒÊ®0tÁ0<ËýyÑç1à"¦œ5*°æíÚ>æD>úƒïæÍ~4ùýÁ#Ÿs}]£^¿4œ¿~}ÅÑõÝ)@7BxmèÔZϽohßt|0P_k IDATØíÔnï‡ñ Ž 1w0ÞCÛê, ›­è•^®äzy/m.Ë —{#’Ÿ ˆƒ ÙìoŽÇ•e'PXIgXzËEz߈¬“)MÈËœE È2ŒYÏc”Çy•ÇeÕûuÕsŠºH \ƒY±S c‰|ÅTÕ&V l«~«t§ÍØ uVë÷§¯QžO«<^–|?Íòmõ!ÎzJ«N´äš€'#«&ÊA@6ÆPs±²k=÷;kªÖqÎ./g#ÍxØTí`ªŠ²À°÷†šÊpåDb*T…¨€%¡!X!áŒ< ¡´¤|>'}Ö2ó¢OaÑSZtÔA^ HuEÑL†•!j½¥›Áë48®ûL`ÉëŤ&Âr ö LÕ!"UbjjÃmm%"6Ämm¨iMŠ‹1mC\÷`[ƒ¡´ ¯gX8A˜“\ÎAŸOA†EïçY¾­‹Þ¯³²`ÒÒÛf[\êÈjÔÄR(â­¡Ö[ê;Çû‹³»O6¬›â@ìå5}îö ñÌYÕš¦6T×–+—¤2¢¢wáß8Äýöx=Q¿‚߃´®ŽEÞüî½XãK'Cðÿ¡ky ýËš(qI† tu|Í„Ê?0ý¯]0Y³FÄ!jFiîE¿Î…üƒ"Áë¼ÐÇù¡?ì<7\„ „ Q q6ärZg®ò\(ËÆ¹û¤á¿˜`AÝ ØvÈõ™x7Š“ÑqÍ2¯¢kÈ(D%Ãöº\1 WUÄ2)1'$ XÒ¢—ù"§i’§qÖ‡)Èã’ä´ æ½ªK\i¾¿å<~w|t"ÿˆüýF^~| Q˜²úæÏ6ƒ½uÞÞºùQq@W qƒÇH?ž–誄@ ÏŽ*먮<ÕwFüávý§OØù Ýá¶èÐX²æuñÐKÏç—ka\±R.°K ¨ækûLÁ?‘évŽX=u.áb”â&i]Økø÷.ÉKb…„VrÊ:/YÇõ¢^RÐ!G$`-­oÅeQs9Å:Çì<¯ëlmUªË eZY¡a2Ô@Rš¦¤Ãõ´=­«žãªCZu”‹&D\ØPDPͺÈyõ|žƒŽceŽ)%LFÒ öºul`«yœŒµž©ò o™<+ opÖëú+Ê¢±8’uBŽA=»¬Ã)ë8G½ÌQ/kÀv­:êŠYâv½¹€Ø’Õ@PeÒ>YBÄeN2MÙÞHf¢,a1Òñ“Ù}r–$‘u†*/=À†¨ª Œ1À\µ`Sl!­–iDeë¬Ëu³\– ç%è%¬Òª“®˜4`Õ+›p3Ã*`U5‰¥1Œójù¼Tz£LSâ&‰.ƒAÀ¨!ìaL 2†$ [_1UŽQY†eF’÷¨4~È‚¿•)!à´¹¾·{ìí¾Ûòáš6ØHï µÆæìÎõ/®˜Ð•@ó aoš/ïŒ¼ÄøÛ#p͘^s¨ª¾{¦?:¶ýûq¶¼»Îš¨f¨.1ë² å,†Uâ4 Mgp5Û¦Ô­ø#¤ ˆÃ/L)’q-tGlªÁ~É2MF§9ó<‰.KÖuÄXÚ0£$4… I ŒY3¢®9è’‚ë*§uÕç%é)$ƒêœ W}Á·NòmdúO;‘ß¿âzO±ÝBP¹¿R¼‡æ"Y/I_B·«Ñ.I§ Vâ­ý51…ÓéÝ éu‘oáø–Ä7`¶dŒc1욊\Û¢jwðͦîaØ„esåÓö´ÖliWøãà‚Ý×O…~WPÊd|k)®¥u§3 GyÛRü’Wy;d{ßZ(Í*Q)CVÑ5f]bÆšÉX$bÕ„¨y Ø …1 gg ÎSÊÁ°Ûm]È @‰DâkLÖuɺÌYç5ꂎiÕY‚N°hDØtõeÉ”º™EIg14&«cˆ:­Q¦%É2gª:‘UòB€”ÛeŠìBÒ3“mÞ1¼eX.0Ù›LeagÉë|¤I3t]ÁU]®y^²L1êƒN9èœ#Vˆ/dï¼Í´"(aƒ9%SÒ9$]Ö¬av^cV ¯åPæH¹¸’RcÞ3U[Á£÷,“e²Îƒmiƒ]j™æâøë&c]Dç%ê¸DcÔ1GrÄ"qsÌq;Ccc¼H ŽC¶bÔq 2-ÉÌsFŠÙY+9/)›sf_C!‰‰Éy†³LÞ0Œa*ämêï=Š^%]¡©÷òEï£üê÷ `¢·§Õ?žšÑ«y¿Ú AimöÁ¼üÁÕ:ü Jo]…¼Àá?húÇ ÿŽýÑ¡oþ˪³èIÇ9až’íûÖàâðÀ¶=@|F[ ×º” ¥ùÅ˃ۨøB¾2•P·Ï,’±Î¢ë,º®¢aÍCFŠ¢)“¦”°fÕ%ŠŽ!Ë%ˆ«è˜²NA±d *!)¿ð^¯ÍŠ"ÈÇ<ÙÛï_âÚ· ­?g½ + VT ¢ZŠˆDKÿ_ak3¥,"i£v–žŸŒ"ž%2à¨ôEg&³¥è¬¼1|\ *€×“Òµý$# AÊaº@¹H›çˆ”X$lËþf)Üðkþˆy£J³s ærÂgÉÅ¡¤¹„Ž;Fe ycḴm"r/&óÝZ+.¾œÀ4gI4Ĭ!g ’4h,â.$b€˜˜ VXrŽÈ9‚&bë‹ØÛÊlŠ+ø}'ò[ÙøW\Ûi"‹H1YDsk(S&¼t†g”ÍË"RŠqŒ%rÖÀ†c‚¥Rür­ g©âÂèdeÍ ]³è³®k’Uòtµ}~¦Ê•æ5²v…JçÊ\‹Œˆ l·SªoŠ…c)»AE…Ëm\]ºð©!²\$^˜xÓR}ïD®3¶…ݬZ g*l4b#ÈY² JÒ¨éÅhæÍŠœ `äL‘q7–b˜Ù›Ÿ^¢røŠ´ÂVÇŒáTÔZ ²Í5o9C¶ÚÕ‰( „¤¬Q­štÉY×$1#Fa"Ñ”J~G2Àå„Oäs$TDdmIT3—ZzA¿_Ø;"¹¨§ÍÆzÕÿŸ¸7[’䨱]lñ%–$ïíé‡~¨?˜˜˜ÿ,驼$3"|±MUyP3ÈäR%-=Jq†g,îfêª ààà 'CÊŠ´Õ Y¶Íà銒or7Õ[°+–­X*ÅR)•+ŸUX4S1Õ¼G$z÷ýòGFäcäq`Ò Ü‚ÒŒRê#çb9+´˜.U\–øz²Q5 žÉ9!ïj¾£ªKx0æÛbß¼¼dŒYɆ¬vYTÏSâÓuž‡´¼ýãžL#æó bá‚€¯grDXÎ{¸6B⮚T½lŽX±J. TÖ:˜5BªÛf;4¾]pz7eš¬`°­…2 ­51VªÖ?°ÖÄTv[‘#£›¼µi!8^a7ª¡ fh)ïKÑlÈY-­Tá­x³lˆñï8U'ëïÞhµœ•ÙÕ¨f(jãt0W5Q 2˜·|ÖºÄîwïg­y-•çol(Ù³YZY5EõylE¦õQ×\£TÙ +¦õ WE)†RŒŒŒ jÂrûP˜@T×heWˆUé ­OÙßç+ D¬(j–³ZÊfÙÉÔ²)j¿L»Íí;:Ï«±¦ Ò@6ERÅRÔr6+Y+ƒn×ZáV©J®F¤L5râ»yÝXŒkMÓm‰}›±¡{CB®þöžë°›ØŒÈ¶×ß#»E"Õ{­Í jõð;U¾’)>ôUÙRƒ›éÀf;6¨jS£¸ïëƒþ‚ùÓñ_ádýÉøO^S¡X±EK†ºÔx¢&²„@}äóÛ[7àJ·LÐt…kà°_[±6’ÓT\ž¡:CÒ].dó@:_9ÏÒôæ5g ¾ËáËßž'ÑëY¨{c @’ÁœÔhAÁ„ oKpêQÌ­Çûö矣‘ïMÆ_6"À»uÿŒPZ=zLQ´zhI‹-%[N)aWRQÓ2‘j$ŠQ“‰c„(ÔF#®ª‹£ÀÁ͘Íß½Öˆ‡lV¶K2}õçY£ÿþåáßÿïÿëÿy·ë¨k!@į‡}˜jKªÈšóÌ¡!Š{æö‘‹*çô9ö€[*p­Oâ*«…›F°m¨ÿûã»~Þvz-Ô5cÕÕèšB­ÖÞi!…#%!…Ah•fà*3~¯*²Â„Ð\¯¯|4PõÄ^“}xŸís¶”¤¢þm)y£_ª‘©™®ýõ|¹œÔÜA¨;ýÞ©¶½]={+­{£=Ú:Õ€˜­ô{¡®îÃÖç`»Þ*q¶j1ÙÚ6Z×üËú⶘±Åbµ•¸@™LÞW¶ÚèzØ­×ZL­ØûçW>ì‹ûçÛu–Zõd…ÔÔªaP5µb¸]ëûœ1ÊkpË´A®9@­ŽÊ\~‡ñH¸û\˜i-TdÐ]£Ž­hÝÿeýJøèmz`mÏ[¿:ªšq+2Íá*·ND¼²ÝùÑR?Zº¯1[#Òo·™Ç»+öW Á»ÒûïB³þÛ]&3L¥ eÓbJ,€¬ ü‚Ç/?–Ëõ­?Oÿ‹—W ‡GPû÷àÐ×z%öUA:0và @»@ó ä9]¡Ë•Ê|–e8ËøúÀ ÒvûÉ5½ =1… Ñ »¢DI‰‰fÍæ¡ÙAñÞÚú½Vd «¼ÿÄ¿‡ê§ŸUxacT8&[Á’“¥œmIÙÒR8¶ÅJ2[Fª×ʘq-œïÒ,Þ¡&zꢧÎjÄS gŽ\q«W'·c00f³«À^ç¢áº€x¬Îæ…lwIhãR¼Dˆ¬…ݤ´‰IàD½X×9Þ?ddVÌXH¥_#‘ÍQº›F¢OÞÝÝôÒ÷½be©•‚ÚlÇÌjé=²³ÔÔ£cS+6€¬J"lÚgçàæ®›ÔPùèßñø¾?Þ¹,7_Ô zWö Oæó:û“¡X_ãýŸ´"Ûq#»ÝÃÇk»GÀ?ÞÃ-kïÿº¡úí%¿GIôqkЧ¯w÷»yþÅVžÿ‡Ù²[DþñÓ÷gkáìýOï#ŠÏ¡£®€÷R¦ÜvÜzZ̬¬NŠUc´ýíj4­b¸Õ 1óÚÁiÓLªêÓ@¼»ùÍ"ÝçC6#â@ä äˆáˆ©¶Þ«…`d ˜0mB«w7»::V‡R6gg?ÓucÙÝG`ø½®~ÿ»Çïìëûñýë¬{Ò’̪T) fL2ªõ"Ùúç'S Óx Óüo"íoTbOÜ ±û~¥ó‡ÚŠRs&®BòcÍ3æ2_PÆWZ./îôöºsp¡k÷âþŒÄ0e³)&d´4–ÆŠ(Å!¯Ž~ˆD¾—©ÔŸ:øŸý'ÀÜû]ÿ®Å±o®‚ È–-i²E³Í9a® D·;$'ÍidÕ¥bâĵh-¶HçWB+Ô4ŽÚè¨íÑp HÁfZMo~¾LÆvʦ<+€„l£ ‹ðy`íB¡Æ/p!äQEØLµ÷IG}ðv<4ƒÈSace7í²úw—ÕïÍÒç÷íê2Tî²Ö=b–~g4ð~@Ù7óþÝ½å ›zM÷Ÿê÷7Äí ½íËúäýl/óëønõò­¼Ï'ká.¡Âëk~Ÿ|ô­ñøüó{ÃðÙÀ~4›ŸÝü×{£óoqs >Û›ßýƒí}[a¾ÍóÝ·õþÉ=T/¶Zœ[ÑZ}.Tµ0V¥œ:ÃìD ˉ‰™kïD®ýt›ø^ݼº0uÜw ÝŒHUÂ&0Þ ˆ@Ø‘0“kY¤²áÖybe *­ ¸hЫÁìžE¥+tYUH>ä?Dþ÷Åÿyxì}W3i½^!AÕ¸.É8ÍÆÇ£öý.¯K’<Ÿ¤\/œœ'Š\Ü|Z°t@hVøÕ­†ÅCÃ.‘Û'øþ ®ûÓËOáõüUŽý“…~¨°yÑ©Le.#_S,sñHìQ´F"åiâþÜþý‡‰õ{#r¢oÿÞ¾wcfAQ –-#S¶l‹.˜ÓbSZl™“cZTò|qº\p¨VhJØ#é/ ·îzG}i"í}¤ÞG\Êl£F8Û2.€B (˜À…Œ¡ª–‘Ê‚Ë<ÙÛHh¤P”Ç3d]ü0O_•†)P+žZ³œ‰œgjö\ˆÌ¼_1êòÍLð—–ߌ›_ºd ¨€¨öFÙèÑëÒ3³é™­Ì÷ê®ë&+¦åîÓ]^eV jTù‘wîÛd€ žÛóÚb”nϵTo¦"_…YíݳÆGÅÔíî–"oôîn!"Za¦w m¢{UÕÏ×û.ü!+ŒVェZÛ½…Jj±*lª UX)k>BaÄPÚìøûùɼ^#Ö9¥Uzä.•|+Pû¼06û[…Jn0¨r\ï‘7xr 8´BVØŒÅú(wpZQ³¢&]k¥äís@ <¤CH¨˜ ‹c yrìL¸²ºdÛÍó7“P“èq56LB®î%ò"pN »”R” &hNpÝc±òÕ*{sƒ0í=ßucý%å/ÿUöô¯‡Þ¿Ð]íËúÚR€ëx"e[s¥Él í:ÇÝ.»®ï£ƒC!.×Yò0P!bqޏÙÕ¥éÀÒUbkÀÜ¡v…뫲„o0пÊëÛëáØôž“¥e²il\ÚrYKÐ%Õ$û{?ùï±³>ßèçî{9‘ÏFã£ùÃdK˜uÁ\òÌÓ²Ø8-6É9Ÿ—i9 ät¬-r]¨ý„cK©$ï»ç]ìÐF;ŒÑŽKc׼ФŲ•õ`"äu±+ ‹V˜5iѹd\Òlo3Q` p!GŒ B#‚-ÃsDËÆo”3“ÑýÁñ2X l• ù=ÉúnM¾¿Œ¾Åo¿ѽïl”ê`®F¢êj®HÿêÖ f¦jªjZŒÀ•y´½ÝÚ#ìPÒÂ$BÛŽž7¦ÛvìÞøu±l”Ï•} GLž©RK…´”èvwsRs$D7øL7c‚ùæã¬Q]jk/ƒD°ú¶·ß˜o›„ãæùÜŽdÜ 1¹UðS„È ©)¶žõïךÁäŒ@*¹‘R "kÄjÞge‚Šòäê|Š„™d¥¡¿›ßMõý6ùvWÓÌT?Çõ3b©fÒ ïåP€RÀÌÆ`SÓ*Z‡¢(µö.YI JXóUwg¿ó ‘w ïN<ñpÉq4ѶêwÖÝœð1göÙˆ< â)8GÁ ¹PƒkvTÛ>oGY‰µ`,k½-(V¶üÝç”þ3ÇýïÇÕÿU£qßEþ{ïögÒ»ÓMØÈЀ°Ì@\™hYÕ¦\ô2eRRº^‹¶çÌM#Ô4Âm'Üt"α±%fËÄ:\e¾¾0œ‹$îáºp>(EÝÿõ·Ñ ­ì“Ûb­‘áÝ®¡~†"×ÛV)Á%«wjάšVÈ£zžì=rYØ9ÇpŽ„É ×ÆÅäŒIÀ&Ø$Öl5@mó"`ò$ðì(0“W‹=›f&æµêóî Ì0ñZTU¥ŠiÖâ3®µi¨ ”ìRž™bOGäDj’Db›I{‡1„zB G‚@B…‚HmmêIadµÄ¦X­!¬æ„ÚNL 9r±ZP’}§¤µ×¶ê ˆ=T ™ ï¹¾ Oêæ¥l‰õZ©+È(–,Y¢EgóH—yäë8êå:Ëþqp^./Á÷Ï•Â& zøæ Ù¿ð”¦è÷Y†ÖÆ9cÎKVÍE¡Ĩ0ÈÒz¼Ö,}=vf‚bŒ¬0@!T $ d¸µ)®C¦®z»¶E^åæ·eq£'ÞÍß÷™FïÓý‚ú+ ¸.¬-Ç£+œuo”WLÃÄŠ+–KBÉÙJ.0UM3PòŠï1@ì#4©Œè]•ƒO‰,&·wàõÿ²òÄ= ¶9ŠGãMŠ‘3ˆÍyb^«äµ†áº$X-B4ËÙ,CV5¦÷²í¦ùýÁ.€$‚œÀÄ3/ˆ^¨qŒÆ9xªûU[T±Qek…‚ƒƒ#ÏBQÑ E'Ô&˜H˜\X'ºÔvÌi©,×&hsRsF¶d"_Ì4›•Dkƒ$€à*ŸÉ1B Š©ñ‚Æ9Dq䲘‡ß"¥¼:¼Î*#[ ˆã†µÎQ b"lLÌk­m³Cëµ¢d¤ê#¥R°Ô>3FjH…mΊ¼˜°g¨N¨…Æ5²aA®!ä‘£pÛxíB Îê\C]ΘµX•IgËÚ3ToHîÖ¿Ä#ÀÃ#PC‘ê¨á^u!P=šÆ-N™¸6Y K­ú_»˜²ÁL‹"§Ró¥Ö/UöàÆ8ÙÌÙ–ºËÞíÃ{¤ž>ÃAÁþ¦®yDØ=Cú¯<cÓÆ>RßEnCÐÎ{´Î!,¿ªDßd†oHÀ6Ó8ü`ÿü­ÙT=ï{íÞY•U”± Ù‚©Ìó„Kô2|½N/Óáá‡ëËéWv/Äá×x€#\<µ”N¿yûÈOÏ*iÉëBS¨©ÊD‰Ilгfdó«Æ»ŽÞº0°v€»áìüªË%Ää]Õ$ Žà=Áy"‚¼×±˜ßóÈÛú2XÍa­#]s-XWùzåT´e]ó£ÙR%*ä\«±SAZ4öÇ4ÎcÐ<Zj­† p®Ašß86pÛŠí§}ðÔ;o{ Én°àÆ¿ òˆˆìѳGïïÇMã(4RL…ÄQÕ•âµÌ¥N¼ÖФµàOƼBtu>nl¡µ)"8t ïI5 ņ© B­÷Ü9_ñÔ”l3¨ÕµV!’ e‡ŽõÎQïú(Ô6‚XÉØÖNšÖš” :Ïð,Ê9kžæbó\P”l™áŽ!cœ½¦ •ü¡k{ãFD&²ÒУ£>xî½·^¼µ0qAÔ fÔÅRùL‚@:öÔs ^õÁQ…ÚVLœÍìš}5"[¸•X1s`¯‹T IDATµœÔR.È¥ ¯’8(ls–mMPIJÄjËÄš'ÀëÊ~ì ¡E™® ŽúÎÑ¡ |l;N3M¹ î/2V3 [Õ PãëÕÅ@¤@=7t–¾¡CléÐ4¼ë<·½+ yb¿1[տ΄}•åXRÁ’3RÉ–5[±Z|TÅß÷Ñg‚Ä÷Ò¼·£n+3>øÐÿÙÈd3ï‘ÄVøxoHþpÓJ!!P`¢Ö1aî⇽çcïh×zj½0›f²e1ÕË v‹ ¬¶¨jÞ1EÇhƒp…vQhߊí{gǃðñQäð¬æ¢+ã‹dbŽ`ß®Ä#bwÀ4Ì®‹®‰žZ(zÏžy0œÕXÿó¬}/—úÍø½œÈ¶%€‰·íQ ä ‹-6낱Lv]&»Ìƒ^ÆQ/—Ù펓#——Ëo^º¸µÉ¾ÿ]YÒšþ±ðs*VŠAËê1k˜µ‹³Sò6Q²ÉýÜ8·†b´vd89rÙQW{±ó1:>6Âû–yß3µShˆE`Á­½$î0ÖT@[’P¼sVßEàÿlѾ ÆÛ]ò^T·¹]Ÿš,•d)'KKvÝ>—aBYF ' øºhaö" Ôv‚¾õ´ö> —ÈS)Zd‚عŒACžzö´—@{xvM ¾s‘-Ìnå¬5QšFè<™(Ê¢¶,©B/pÚú«Üæc=Ø×\½oáb-`iZ¡®qÔO½÷ÔKÀ Ù­Ulõµ< 1µì¹—H;h<ïZOmë@â™ï׃@žQæ(ظØ2LKÕ-#‹3Ù<)TUçA4@(ÕàIÇ)Í.„V¸ëîG{ïiçíò²zó 2º‰ÉT‡EÐr Ží| }´kïZÏMëÍy)ó,Îwµ‡;Í3JšQ´ Å–¹Øœ2æ’m)Û|0æÂ˜s²iΖRacËóŸ—J¸p~mtµGqolFŽûƒãã)è㹡˼в63âDpYlÆ‚EýÆ™XŒ uÔr ½4ôzn:~l[~è#í÷šÎ ¹°$¬Ûc†¦y¾ÀK)Û¼d›S¶T²ÖscSÓÞ÷ǃú;Ö£k5'%D7÷QÖª°íqŸ ü«ãf,n°Ú}Âÿ_®Ù.¯¶É& ¨3"™¡Çc´Ý.ZßóâÔL4/(I-î3‹,ªZ礳¡Œˆ ˆN¬sL»àèЈ=¶Å¦«³w¼?5]»Η·ƒë#çwpÎìášGènÀrþÙ/ZÌïŸL¶HV˜(8¦vpÚMÝ2Ó5/6”ls©ïœÍì½3—€×eåØÃ“£À­‹ÔK CðüØx~î9x~8:Ù„›C­vµZÞoS ȆJåÁZæ†ûú~_pß_­ïù¶(iÆÐõQÖhd«cd]°”TÙnK²yJŽhAVÍéÊ9Ï¡Ê$HÓâ(kv®ï=ï:¯Ç.ÒÃØÐyN–­Œ”ñÞ¦‡ˆ©cOè1D~lzì"zÏýÎ)±ƒó,±z4 šP–ež,º]¡q(6-jK.–ŠV©žºVn 5¡BYâ­ù0 åËU|Û ïz¯‡ÎÓáè‚MZHÕŒ•QOƒ#PÏžÎÓCˆôÐD>ö;ÏýÞ±’˜Bp¨]‘ç+Ô S§¢ãTl˜3\!k&Ø<±¸XÒœœ.#i›Ö6Ô.öHã/Ü´±]ïè¸ ô0Dº, M9"…™™#ߤ<„öìqp‘|äÇ&ò± ´Û´;1÷Ä¡_É †œgè|'Ub²yɘS¶9/6•„¥ØæL6¥dó’)§â|“ÒtM`3€ ¦&YCKš’p·÷|<ù2Ì)×k&ÒÀL {›,Ù\6iÎu©®$‹†îêr÷¼@‘°ÀaÁ¤“e¢k¹Úyîôm¸Òþҗݹ M?öÍôúsܼEnö5ÁÞþË Íç_È#¿ÌDâMpÔÇ@‡!ØÛ4ë%-4¤lcÎXL-«QÅv×h„ Gž‚xŠâÑûÀ}tŒºHO» _‚<}ñ´{faƒ’„#XúÓU XY`¥˜AÌjÆY¢àuùß±Ö>!¸‡­‹¬æCjwc¬*K´ê€¢‹%lRÎã<Û4/Hsñy.!öW¨î*|!|ì(-£wMïùp ò8$ŒS‹qÉ¥¢1bv˜tmJF¦^<=„ÈÏMË_º†w‘‡€vï²o"äB}¨Ö×ód¬”K¶i,˜æbS.Hªpv3"uSÝ-3®ŠÊ.ôÈÍ6¬"Ž÷Çç`ç!ÚeÎ(¦Êù,6—ÊZ L´G1ÐsÓðs×ðÓ®¡ÃÁ#v.kvpq…TªyÇ ¤ °X*ã˜l˜’ sSXœaÃ(îq—‡é5øùBšÇu¹ {,î7Nš½Û=/Á®C´qNXÖàNˆh(Î’˜˜˜Z:ø@±áç®å§¾åÇ}ǃç¦wã|õ®«ÅªÐg‚¦+òx›.šÊ4%çŦœ0—Ùf-Pb› Ù˜êÏæ)Ihò4^¬Lo”û+‚¬k" ÝÊé'QòžOÊË¢–‹‚™4ˆPç½—Y‡œh* Åt¥ W|Ü1£aÇ5šŠüØ6ü¼oùÇdžŸž#펾0;’È.>¬{‡«ŒþrE/ cEÎÙÆ)aœ“MyÁ\$ÛôѶcz‹Äï`óÏÈQ-ޝZrBä…Sç„zÇ486ƒÔ|ÄJɾÁ^¡xñž9ù5Ø®’¾QÖoÿ¾F"LWU¨ ‚¾uçñÔÓÜžZÄC‡ØDÈ2£ôÞl×Eéº˰’ÈæÅ4¦¬ÅÔ²¢ö‹/¢k:İíÆ<ХɶþU?®`kK])×rCåìîËgú½ñ‡Ó÷{ì¬ûhäÛ(ký¸ÁÁny‘ÙÆ2Ú%zZ.´ŸZ{»^lwŠÚ÷MÛíÂÛxvÓég¡Ð ¸Šßrs€¯Y_šO¿p@|ü;‘ Lmë´?y:^‚‡…Ïób×)ÙXŠ-Y‘JA1@`DªLÇBÁy4ÎsíÏû.Ðaçùáàùøèùøè’å$Ò!×<\[ÎV~û]fäe1™å’‘KMš­櫆ÖM÷çÆ=ŒE(ô®æÿ.ŽÅ‹ŠÍe¶!M6,“ ã¬ó¸ôýnz½¼…r8AÛ#8Ôæ5ܰ¤I ±—Ãc°y,–µ%g0±FqvN ¦’oµ8ÚyO1È—¾¥Ž-?=4|| ¯i¿P»ýåùŒ|y…˜FÉe“ s²)e$5Ìî<…"â*¾}¨‚{Šêµ'¤y´N|BšÆEÇ4Û”',º`5"˜2Ù¸0†Écîv™š‡7ñýêæjœd×~.WJÓÉÇîA幞äSÆ`§)Ò¸d›5#•²¶NFÅâYÐ8áÞÚÇ@‡>ÊÓ1ðÓSÃ_"|ãSœßÿ ®y¨*Ø4 Èó–áÎ$q)‹ŽÃb×y¶aYlÎÉ–’,ßvFm˜»u©kçVx‰º'Yàj»è&2í¡}ãèaö”‹B¸ŒÍ*èºÕK}ß+•­'3ÝÄöεÁGRö7¯Qó€uQtðûŽžš&ý:œÐ~yFûåG„®‡–Ëå+‘‘Gl V,-U(ARÁRÌŠFŒ-û~F[ÍÅT©¥­žk#lä’À`c‘bs)µîHk‰AMtnù°ßÈþ`ü‘ÞKÜ7Èè>'âÖ¯ 2<LV£‘Kôe¼PçêO‘ú®‘];7œ¾îÄäà:ªbcáì `GËù§˜ç$Ýá‹pÓ íöž.Á®×d—!ë8%—Œ9Õ|Ö›a‹c†‡Æ 7Á£m=÷­£]ï©ß;Þí‰÷ãtöˆ ûæ®ù,ûÕ‹Mk ×7,Óé:À<ª:îR²eËV‰°õš/7¨ê~æ¾dŸ IÕÎ2$Ð*'jÙØæ2Û˜'¦Y¯ÃÈÃ0IÛMî¦ë‹“ö¡Êì!ñ ¯€»Gøù+òéa=?<¯¢¦äQD/³Ç’+È„©Ž:Ï_|yjäùKCý£—kàГ4kÄ”ç–Ëo°9—Ð4³¾~]ì<,zž»¤)laR;_ Ç»þ0¿_}ؽBýn…ƒzH÷.2oMsübRR$qLˆÞñ>Lv]²¥RyMž‰¢:ÄÀ}äçc#_ž[~ú­Ý‡áò5ºÃ8à¡Ûµ^_†IÃa7éÛÛb×q¶Ë4Û5Í6”ÉæR¨Û f×…õ2½‹<–É»¦ó×Îï~…kvUÚ5pxö fÍn3!ðm(;g‡¸8mFGñä© ‘¼—æé ö2üöS§µ\ó v.<€Ùƒ\‹tþÙ½éCèb<|Yx÷0OÙ–1ó8f›gŲ(rÙË iq-”«Üþà(F¡Ø BtðÑ"7ͯûgøýƒkžàü#€¸öD¿b~E:ÿŒùå7¤ó 9Ñ0.6¤Ù¦¼ — v¼VŸo w‰7½_¨¨Ì."SSYK{ÊÍ Ô.˜˜ Û59;ÍÑÎCcçóÈ»ÃÐÆ¦¹œ~Û‡vG,.àBíŸÊâ²iöÏâZ‘ßwž.‘‡)Ù”kí S¦.zÞï<ž"¾4‰8æ2»¸ÿì÷`t¹"]Åôú ¼Iò̓ϳž®³§C.Æ€uÛ|ÜŒ¬>Ȫ­ääÚþ eºò2]Ch&ϱ€Ú†éxqtÍã\ÞΓ¾ £žæÙNS6'DÎgë®ÐÃIüîÀœ§×_¼ÄUR¢óGØaBzûŸ™UÿržÐD¡]ïítñ6.5*6 /¼k=÷ŽQ¾DtaœÎ ·;öýÀ­×:0_Å|új»v?ð2ùtí<¸.WŒyÀT&›M!Ê¥Ø%ÁNëùøzöîpœiÑ0Ÿþá\<€¹Ç#˜{¸æG(‰ÿ•‡óo±Gfß:Ú=¦1Û4›·ÆF7J}¥˜zGA(Fá¶ÄÎ!t.•9äåÕùÝýƒ‹Ï`«3;¿ _ÂôõgøbÉF;Ÿ&; ƒ§Ñ.i²¹Lȶ¬0UÚ¸yÜꣴ˜©jÖµfÝML ç:äxŽwÏŠ”<ŒŒ$˜6g¦Ý•mœk_牃mR,¿7Ø œRðMIb;ïÜígßùÛMl]æõ÷jDUÌÔ,g‚æâÛ˜:Þeµ"†„ì#Ä0ƒ4ÍÞ¤(5‘ép¾ŒÅÆÅJÕÝbfj=Ó¡~Ø{~zt¼ûÂæ;.ea°'p³ÑÎ(׿ë‘dñÂS™ÆÅæe²¥,:•„Y+VûÙíl·wùÇã÷ëÖÿu3,ŸYZµyv aÄhb¾Ää­™‚F Ô…HÁ‹8'»‡g¦…0}ý¹c€ôXbÕÓg×#´R[FÆž–áÕ_–³xÁ7mFˆ…ûcfU%-j%«i1¨jލ6Jb#bc#'ÅTRœ9fw|@láâ#¸9V=&@'ätA^0¿þ¿~ýwèuÊûnq)z&æÉ¦<#™šØM%dU¾dy]7F *7›¾Yw¦úûŒDLÙ X)–µs† lTƘ^–ȧ±Ñó¥¡ã¹ ûÇÁ©Äáõ—ȾXà\W¼.c:ÿì5Bÿ@ÎGÒv'z8§ÚVs©F—‚P…ºçÝÑYhbÂ<žC8þ@«QÏyB_0þÇÒ†~äá:ç·ól§q¶ë2Ûœ <מ›|;Õù°M$p†\ nþy¾ò<_BÓM㚎ùxu6ÅRRŒœcj¦nçxwô;?—ç2…æáïp~ ¹Í(à ¦×_@)çeÔßΓ®£Æ§e¶SÎJ*“§n4:\¨ìßx¿{^//û¹ýƒ\[uÞ$>B»‰Æá-Dá?À…–µÛ‰=\½MS±œÕÔj;㘺ÖQ¿÷Ô‚ºèçùÜaûÁn—+ÒøÓëÏà¬y÷°¿”ÿø×QÏ×AOãU/i°!6Û‚jb„±=OÂoCÐÓÉûýÞGüxzé]ü‰à:ñk¿øBSSbäZšÎ¿ÊÙùÐfr¡P»/T’ ±B?ƒ±qÍʪs\L]^.Ž| °ÿïpípau¾r†¦7,ã/_†Í)Gßt½Œåí2êÛuÔó|Å5˜ÊŒETf¯~B±dE³Í(¥;Õ%‰jE½˜c­Æî¿ ÏöÍÑñ Œ\ ¯DÍ v¾°¥¤Äð²JÍÀ6¢Œª×ýù¾6ïö'PT¬ŠC¢wY"ÓsÓ{]ÓÛkØ$WËõ³––&ïR'Í|IcÐ4êR }<@QÎÿ.sclqÓ±NN‡±Ø4W#b 8a Ž©o™w{áý£PÿàrN.Y¿{¼!*y>c¹¾ÀRÎMÛ6“s…ȧ4aÖÅòÚîÂû,ú½ñáûß‘O vûôøL÷­ahA0#ÁTÌÁÃÁ©çªYÕú' "êž~ý.%;ÌðíØU-ÇRùîÍÊtæ<ŸxZ¯©¨s¾0‘’ˆ‘8¥» ©Ò¤ŒÌŒ嬙ˆ “óäw?Bš=8à\_2ñ€a•T¾ _1ŸÆüÛÏÆI—ãîqpÓtÖ_¿^õí:èimÌ Š*E8(† #LMqÓ•Ú9©3˜­aq̓d%%S,°µ`ÍÀHP›tÍŒóâõm üz‰¶?E×õ~×¶þízvƒÿIvì¶vj”xD€"_~õº $ˆ<ýmq‡GoËTë´Î ‡Èæ¢Ó0§9dö?Bšg0‡5rÁ|þÓÛoÖ³Ÿ\Écy{õí2èiœì²Ì¶#PeÇÔFMŬ‰ëVW¶J‹lUáL.ì¡ý3æò³ŒÓ5ñ,9¤¬Ë¤È©wÞû†-4RÌü’ÆP`®9ü‰û5·ðŠéô3òp-»Ç †Ë¨¯o£¾\¯ú:zJ®¹`f2Z¼vƒÑþL¼ïXºÞµ¡óÓÛ¯-Ę«,·‹öxº¾EÏN|ì×î-C°e.(¥*ù@3 n)KX¦³§ÐHè¿€ã#/#Êø‚éõ'äóY»Ç³ž^}=]íõrÕ·i°Ór½‘¤ !ƤنdvžI_¯ŽŽg¯ý« ÏnÉðÃËö‘ÀŒÐ<ƒ¥]ó#²FV;äñ…óx ¥,&$jdæX´*Õ}DBT´‘š‰\$·û®}„ G°Ûä«™.X®¿`|ù7¤·mC7xÕK~{ôõ|Ñ×ñbç\ïgÒ  ™7[1²‚÷9gä”Ñœf©ýg´R¯±ƒk¾`I3§<:‘I,Á'¡À/ý—§«Ž— (Qp^ ºÖ½ h•cÙRªXó!ee‰Õ3­ÂÎkÒŸ6"‘i®:vÛÞÞZ?+y«ç2Ì2²f[TmZÔ®£³á27‡Çq.9.——vGpìÀ¡Ã@A¹þ,sž£/üðCv»Ç¬óP»kæRc{&"–Z1·,‹ËÈÎwO`ië½åéúÆÓWó†%ˆ\ízí: zGRuˆ­ù)]«ï>¶ø|þãÓóï‘ïXœÍÜnÑÈ}r½F"@me›áAÌæìª—ĘØÂàUˆim²#€õ‡G55›¾þÔåyàî0Â÷Oà¸sz¨kÀñYž e„-WÖ4qNSí’³wñϵ÷@BηÒ‚Bç»*©šJãeY% h¾@§3Òõ7L§_PÆ«Fi¦ØÐ€óéª__ýíí¢_/W;/†¼T3j!«‹Î ZŠš¦Ú(Jµ 焜 JÑÍK)0Ê ^êÜY2¬‘QEO±‚ÙÔ%½$¡Óìõåiÿ©m¼þÑu±u§·_÷ÌŽ;ˆ{€||¬ÁÌõEÆtm˜Ä‹Ra×]M\‘™rÑš&QS º/ðHX½Ëæó¯ýwDrSâ¿ý:è××Á^.ƒ¾M£]R‚* âÖ:ójDªYMs-P„Ž@ö•’“§µ ƒCÐ=aÞd˜/,ì@ŠÄN¹åê‹Ð’f±eælEà=‡öÒ«) Òô†éõ',/_uß®¾äKyyôå|Õ×áj¯ó€sšìš @Þš©XµÒ¿õ½´Ïœ§Ìãן€£Ö»ïên OyzóË<‰#a—98%âjì˜IÓÂZŠ”r%ˆ´rív95Z:ýŒùõ«î»Ã9h:ëËËU_Ng}ÎvšNvMuDÒ„dŠ6Ñ€kQ;%²×ÑÙþâ´{‰‘w»=¿çãðË¿ø´À5k¤Ý‚½ƒãŽÐö M*yÍ3RZ¥tdõ™jæ#ÈÅêÜù*ðÇÜ®½j t9#_Åøöo˜~ýÉúÐ_#ì¬/_ýz:Û×ËY_¦ ÎËÕÆ2`±‹åŠpZMòfõ–t¶TfKy±eÉd”—ñê›t…æévN€¾`¹þƒÓLŸ©ªÌˆp×b w h&™›Kîq3ëVŸsÇC»Ò|Hºl›œZ'œëðŸÛÞN?Ÿ<8Y°?!º#Bÿ×±ÑMØ6÷V…`å´·ùë~à/û¿{yG邟 ’¤)}Ó€%"s .‚¼Gíl™Žd‘‚G Rç –‘FQ( tI™SZe®32‚ˆ¸LÔ'â½3´3šZ«ªR›O?‘àŽº¯¿ß3ƒ¶¡DZº‚®ï@ª‚ =%?˜œFN‚xY;#*= H×dªLµÕ›°Ñ"»a|†}úµªÝ]»9â¸óÓsÏߺžŸ†QÎɈˆ*©'‰E(sÊ!Iòì$s,íÀ ©’FâË™¡æI5”ƒ3‘£V>¤&5.ÂCº&ÓOѲŸ<ê¥MÇ®”¦rãÊTÀÔ%iœÑŸàNÿ÷ôUî·C :ñós—ŸžOüíÔñÓÐÉÑwÜ¥A,[ S½‰R^%’ØHÈ5|râ¼ï|]µnß6íð\#³øÙ@á'˜¨%H˜Œóƒ3Y›ºªw‘2©©¾sæ˜%y_ëÂLQ¶Gˆ¢™%s–4éh˜ZŠA²˜9Õ–bföÉ[±gï}W¦„8IBâbB’fdÞˆ¶Õþúß47wúôôǽ҆¶œ¡7Ó¡À;Tª‚Ò %?èì­NE¦ÆkÄ\ÒsPDFTM¦Ù@7wÐfSƾG´G¸ÓWŒû¯òëç_ާS>;>ôm''7ÈF³‡-ÇMÁçójËåŠõ©…»·þ6=¾ "SJkùÁʼnŸ©­ËA¿RƒGpå]B  .5ZU©8 )Ü9KÊI§”«ÇÏù~³ >Æ]ÿõ?6a{TíÝõî3t½…Òs—/ …T=c¹¢5q1H:/äÎEù²m7YpÝ n|FЙÒÃæÁU€“¾s|Øü|ùëiÈ_O=FyrVº$q¦VHÂÈÐHÒ fÏ!¥ä¬ ï`šLà`a»Òà$7›hröÈì â‘áxˆ”[ž"¥IŒ0³ôh£ÎÏ^aÓ›\‚1JkR»ÇŸA²ÃáÛ¿ßs¨½ûfómZ@™*fn"qŽÄç…(»¥t9¿¡”© Â1ŒH¶CpǽܵwvWÕ'œö=?}øÛ±ã§nàƒµrŠ6g¥$I’Ä ‘kÄä9ÆäG'Òt0›§ò›ÕÌ}÷?É©hŸŠsÁSßû] 0ÓÔh©¼¦Ê:™25h®(ÌŒ’ßþ!Ž}þtÿ¹o^O={>å§³ä”Fr‚ç( ä UŒÒZÎÉØÔ@eD)%Û;>öÝãðÇ¿5ì=Õ?ÃTw £Af£* Ú9LózѳjÁ+T9õ&)€ƒCpGØÃWdëÒçûO]£p’÷.}:ò×㑟ú£ìýQºÐËÀN"<â´V¦1°¥YŽAdc%·§rvB)è_!Ÿ?ý,ƒ³Çÿ­ÙýÜ£Þþ½û S?L}¼õJ9€Ý¤" [¡0×y¡ö,¥´;§ÉNrø‚4Œùnû06 üõÛ‰¿Žü­;ð³=J:b›ýTãb‘rü5²‚O•ØÐÊè7bÇM»½xïìá›6Í]9c´ÍPÔ–ªP3xèïr?Âo$Ò•!DWl³’”r´¬„æÕ”’8¾?"tVD5 )$ö’ÄKâpîšE#qœctŽ='TÛSg¸þß H;XR˜qØÂæ ŽIŒMÜt Mj*Úþô  iÿûÿºçìÑfÓܽ%Ý>‚ÌÒpÄi:÷E¤h*(*‡¶Iiä4¥í þô„ñùYþÛ¯ÿrh {~~:ñþpäçî {âS0¤Q¼8öHˆH%»¶ZÑùµ›é¬¿ù·—u³–@‚Åýøâq!”VÄÄH¥Ãx–ÈY\ŽâB¢m Onwÿh7?ÿkk­Ý ¿ÿ¯Û=)S·d60ÍÚl€ª)çˆc)è|Žr0ý>¯MdW]ÈäNHnÇütêä©ùiøÛ8ÊÞr ^Ga)R%`Í"!Wâc“ì躧k—0ÍN_¾!#ÿÒ61ˆ¹‡Ïƒd%²ƒÃM‰¬²¢``Ê1NIb³à¡Ê1WD¤TÙŠÉ9SÊiûéçXÿô/þÛó—Ç0 U½»§zóPÎ TÕe®”žfj!Ó^ü”=À’wö„4ô‚”Óç»O}£ÐÉñÛ˜¿|ëø÷ç.ÿ~øk?Ê“·r ‰ m9•²Ù°OY׎Ï'q!@˜ì Æh0;(­ÙĦjk{ÜÑšTµ…©Ûâ-3E•z:gRNeàÊ‚ÿx€=…RŒ?=ütjH:~þ:ä/ߺüûó‘ÿ8ä›dï>FËŽ3H*ÖäɧZ—­!ÂAÿ’âÏŸ~ñÝ0>¿þ~WõG]Ý=¢nïÊ–ôj*3QTk]c*Æv’»-âxBz®HùŸúõ ƒòÓSÇßö'þãù¿tþ:žøÙurL#ÆTv1ė· žô¹öehÊ•>Æ9eýë/éáþsh¸¹ëþø}çš½6w÷Ôî>C7wE.L;Ô¥wÊÙ¼ÈÅT*{Ñ$€³E#°GèÈnàš*ÿøðs¯Â8ðósŸ¾>øÃ‰¿œüÇxä'×É!Å"Â#Mg¢JÝŸ °Yóà+uk>vµÚíšÏw?mž~ÿÏg*þ Óܪb.õÆR2”F!Ûê®yHŠÂ "‹s4ìO,½GÈ@Ý‘R„}þ »?ÊgÓø*D+G‰Ù"ŠEK” !.jXWÙCŸÇ²—õ¶˜a»=Nßžq/&ÀÀÂ%+>[8Äq@Î’™‚%h•‰À ÈÛÏ?gÙ>æã×/wqèuµ{¤z;Uà5UñŸ”™œ½ù¢ä—b&2•!J`?Â'ľÊþ¯ÿþïMr]þöõÀßžöùËþ™¿v{~²9„“œò€‘"2Òd–Ëës³ñxµ[ë½5‘y·êr»ïr«ï¼N¢¦ž#œßï¸8šH¬Œ,‰sŽÈ9!äë½G'Ÿ†º¿ßîvnóù_76Ø;uMMS mSmÊ^qSÚLiª¹Ÿ Îì ÇÒDRpHÑA‚ÉY(Æ\UmÜÝ}öàeì|zúâ¹ë,{+ûnÌ߆Aöv½åà-wÉɘÊ•š<'¸±Q‹u&«~·ÿ㘹î°-êºFˆÝó*r»Í°¡Ü‹‹½„  (Gé)‹ Ì¥QC8¢èUTÁ§æáS¬qÎ[Ü7ÃØk2µ2uC¦Ù@U(c@S% ˜à  œ}Ñ#? /k¡ø¸ù4ÖŠFîö6?í˼íŽümìøÙäé³…g‹€8íA,í2²°8&¢R]0ÜÙŠ}E»c½ýü‹Î»Gꟿ=$guóp zûU5eë¹d$;Â÷øã®1ÖxØ„³8-Ò£ÿãÈv´0uÎŒqD8ü¯ÕÆ Ç£0æ$fTÙˆ"£W2Œzx:ůÖºˆf³ð}ã{üª7N6¦—Ñ÷2ÆAÆ99Às#C $°Ÿ£¸ÌÒ;‘nT¤týySÿ‡4õ®©j­ME-”TÛm‚ñ‰ƒ=pï;S—{D‘áÀSNr>p(PS®r¢Ý±H@XÀœ$§„ƒ„ÔÃ{Ü=Œ»¶Ýº·)…ÚŸºšé¤‰1g…ÙP”ž×PZ±0XØRÛ´¾Þ݆³•ӓ˧ÓÈûÓ¿þÒuümäɼ^ºR„pºô\°‰¥÷ÀÉ6ƒyÐæ+×Õ®£ë@Ji!NÍ)§§ÿ@NÒ´«ÕÜÿ\uÇCF[EçµQ(e ÏÌ¥+"6@Ú@…»ÇÇ¡¸;8>‡¼?öüt:ñ]Ç_Ç?ùQNÑJŸ=œ”=³;Dr% Æf%¤Ä/Îyõøè~üä"óÆÇØ›ä¼ab‚aº4ì*k¸Z)–Ìb4¥:¶›o›v 7ØüÇ¿|ìÞŸz~îNüÔwüe<ò“ïäéóÇ—ÄOžüö’J0P¨0äÌ IriÏ& ™#bŽâ|àÑ:u¿Ýîîí¶ýÔ„œÚbC4~ì4@DÆ(E’3Í`=«+8ƒ‰dH–ârn•NU}çj£,O]gåØùpêä©ïøÛpä§±ãçÅxÆì¦($ã’—I¥™<‹ŒY¤ Ä«¨í4µ•ÖÆàññs®›ÆÎÞ‡ýSúƒ"!b${+it‡£ç ã`ep^R̨’’Lñ^ë§T™¶Vµ"ˆÊ¢ë–sÃN9¿g;î]/6b³Cf†NF†¥w̧NîHý!Û]j«Zkm"¨«–ÍÝ]®b|âàŽÜ¹“ ©›G¸$dF g €(Š ç€œ‚yxtŸvwC`Þùà7Ù‡ŠC0ƒd­HƒK¹þ˵Iåà@éßV‚lDR]µ~Ó6ƒÎÑòá›ÍÇ®çñã¯Çg~öü4îåÙåNÜË'~JcͲ^X_þ-1ཉ—(d½S+­Þ±>šq9 J"àÌ9#J‚Ë>‡ì¢§Á[9Ù‘ÇÜ÷[¾ÛnÔÝnC›MSmÚºn6U­‰)Ö0•N1j(­„³*ÍÑh:ëQ6ù*&Ö &-I)J”S7$ñ.&k=÷ƒ—Þzé­åÎZ9ú‘OÞ¢ó–Oq”SrÅø°G”ˆ85ñ© ðlถ!Fé\ʇë¶Nÿïÿü¥Ww÷jÛ²¥™™Å;'ÃÐóáxâãð,'{1v°y/IüD–¹&à !à C1‹JŒR° Ræ(!E¸ì•‹^úÑÊC¿U»Ýx·Ùµtw_ùÛ,¨EDgΊJ]¤Rß"JëL \)µRÑE9>¹< Ž»Áò±ä0 ümùÛÐóÞ[9D'] °\J”âJ×2&æÎsÞ÷¢›JþŸ_ƒz¼ßÒ¦ma´˜$’è8ÿþï"9ƒH)Tµ¢º5íÖ䦭2£JÂFD”¨©Ï¯0k¥Yik­qôè.õåS?ð±ïå©ïùyøÛØñ“äGé²…åˆ iæY6 "”¼<2{„ìÄ+Î<Žwú¾·Õn×Ö›mÍT×IÐäœ ‹˜Ì¬Ê‰êt°Ñ:+ UF ñâlàîàs×Y9õ‡žCÇÏc'Ï®ç½ïä9 Ò%‹ñìÎ Rt¨h‘B„`@’@yn˜)K”0Õ[ƒ£ÞZyè·|wܪݶ­¶»ºn65´11çZ ZD+"fV šüÎrr– Èd"‚ÎÚ¨¤*DJ!Êxôi=÷½•Ó0Êaòqìdïzy¶G>„QŽi.Ø¢@b<§²p–t„ÏYÆ,rŠ$­%®PiQV)…Íã£kîv}&ÚdP3.µz!µ¾Ó™êMø ÚµœŽ|ì;î/1&Ò†Tó?}èþ¾¦f£É‚°ÈgøÔ[Þ{Þ÷½\/]°³—Ì $-|"š*ý_>õùÓïj»m`Œ.ÝUC”_îïCþ£;ñÑvÒ‡cò2ä$žŠI*Å,ð’²Gˆ^Bt2Œwêán[oïÆf³­EWMb®SNH©ÌYƒˆæúˆ¢a¥4kRI+ŠZ‘‡·AO.½ån(ú°Nü4ìùÙyï8Æw¹Ç˜DØ) ÀDæÛ98˜AãÅ‚úêñû råÜȼÍW€äuÉà Lk$@* %#I`O•2)VîÃ@'·å;»UwýNî7-6MK›¦¦¶i¨i*U×umc4q9wBjj|=%Õ„EJê )e‰!K‘CHâ\dë¬Ü;+}°Ò;/]°ÜE‡!Z’“.[±&)[ßJ¤Pþ1bsECô|ôÛ.‘¦€”FÇ–Úº"­X˜Ct2ÚAŽCÇÏý‰÷ö(ÇÐó˜„l%Lçl–­,ö”"u,Ä"’³â$s¢#|v2§í §aGw› oÛÚljÓ¶uUÕi£aŒ‚"E ©ƒm9¬‰³„8øëJdÖ[+'kùdÙ;+G7ò7o¥ONú0r@K3z%J72¤„£Ï\ ZEIÉË0nhS7Ъ²’Ib`Ä(\öeW•¢¶1´ÙUªiµi[ÝTµ!cZMù7É)ÃÙ,Áv6ð`­tãȧqà£Rnà½åFéÙÁ²GˆRò/%XC!AÃ‰Ê ^eqœÊ¢(¹8Šõ;êÆA†ÝmZÚ´jÛºª›ªªê ¦ÒTë©:PÖª˜%F Iº“sA¬ó2X'½ø8Ž|²½ýÀßãK´tL;xÄ3€Ì óA¨r8/¡B9ErA $ž|öðÉqƒ<Œ[ºkw¼k[Ú¶µikjÚJו!S£ µ"mMÕÝf!‘ä9/d$Dq>Êh ÎIïF>ÙQ:7ðÑròB/§leÌKÊ$"Mj—Go^2lé#KE™õ´ÖÜ$'ãhÕÝn0›vS5mE¦2¤´  !A²çšŸüȇ“ãn b"¥!cÔÙAîÈ{ÛÉ!tÒ¥^î1äN,<2·ÓXËÓ”ç(äoß "Ó‡ær(ÀËTÖ¼62ÓÜbmIsm–|NÙdNH%Ãg‡19éÓHǰ¡ßÊ]ÕñnØÐ¶niS7Ô–&*hªŠêª‚ц´Ö¤5A)u.kPÊŸˆäÌȹt²‹)JˆI\Lb£/ úÑK¼ôÑÉôÉÃe'CvbÙcd$qRg^,.e4CÆl¤‹5Œslȃ¹gï7j×4ÔV†J—¿Ì>E½“Þ÷r´ƒ<ÛAN¾„ù– €ä©)Õe.õÙh¤©>Ù|2>çÈYÅ`³e›F‚•Îíp7îè®iÕ¶Þð¦nhÓ6¨LEF2zFšÄ#‹¤ÌSBŒQ\ˆ2FÏ£³Òy'ƒ·Ò'§dåà-Ÿ’ƒå+ ^.³¢(Ѱ9p¼2Á ‘cÉNœxÛl¨Ñ5)ªÑ’$Ʋ *D¤P™ÒÆuÓÕ´i47µA])2ZC‡S„YRÊH9‰Ö{ƒ““¹óƒœÂ(Çठ%Š,H˜®ašŽR- X9ŸK0pbsÍYöÒ³ÅÈ~Z´ (Ê #5[ AF„–!'¡˜A”9K„OQ¬¥zÞµ;Ú´-µuM•® ´‚„™ásƒô£å£õÜ NR(ÁÆ)ê‚æM¯USiUNtÄœd NŽÖóÉYÙ{'}<ä #‰b!£ˆ,‹Œb/£m¨­*­ ÄœÅGÏGkåÙz~vNÁsŸlžO+$RR*{8$nØg+.Zé\O÷í†îê–·MKmÝPS×TWf²sª”kŸõ–¥Ô»ÊYbÌ1Š ^lt<Îzë{éÂ(]ìäéÓ =pâÄ£D‡‚é¼Ú‹õ5 ¼8½þ·XX?Ó Y.²Ïtí”»`î@’'•ˆìÅR#­Xr‹6µ² 5ªÁÖl¨Õ5ZÓPù«¨RꪢJ)h¥IŸ¹tùefdÉÌs*F'%ñ)Á•þ b“‡Ë^lö³ÏA¼x8.eªãTâ>O\ÏÛ½¥Ë^ÁeÅh©ÀcÀƒŒÙʽ ÉKŸ‚8 ¦Î’³QžœL¥68ÅJ„+ŽÙ’OBƒV7TQ ED4˜IR"dX¦0¥=/¶uEmUÚÞVS¯ø’ ˆœ·†Ã§À>ô±4A’•aZ¿ÄaÌ^ì´4Íg¾(@‘L…F [‰2Âs‹1 èR+‡ÐÊÛÐÖ´ØVj«µ©TcªÒ^+œs Ó¢\Ê™CŽˆ)ŠK¡¸èdŒcr2òÄ3;ñ%Z‚?§°.²TâYÎK•„4U­ (gR â•/†lé.¶´Õ-6¦¥Ö´´1mÞT Í-jS‘R¥`©" ½Øuq–aÉ9K䈓„2¸èxH6Y±Ùɘ­ØìàØÁŠ…“0éÏrçÏrÇ0b„¡†’„#KJ”²§ÈA|vÔ…-ßÚUÚVªªµ® UÙý™P ±zŽî§2ú!—‰Z6ž¨ÑŠK'åR¡(r”1Ec!FéS1E8.c¯DIð ™+ ©¢>95j¥È”u0I™ár’.F9… } Ü¥ˆ1e‘i 1HY‹/gbÔ˜éÓ(w±¡{×ÐÖ4h«Vµ¦Fk*ªªŠ h¥¡M§çËŽ˜rn$KL !O2–lp<æ’Qéã›]YÿÈ#üyw\˜Ä/RYsÔ»t\ÖQÈw6|æ/žwe¼’%åÅm=mY,†“¥”‘w䥋!×TSCm¬¥V55º’ZU¨uMµ2T‘V³ð+ºx‚¥røÔ÷ƒEgDÉsDà(<'øà9Š/^"¢$)Ж¦Œô\î2‘%ž*­§¦œ¬X’¢ £W܃FiªÁLUÝ"GØ”Äå›qJ£\<äüêb©ó/ÍçpÂd#"’D$âÈ‹O­Òˆ£nòÆ´Ôêš[]«2o†ª ”:ŠR¢´´Íœ9‰çxX›£8žºUJD'é —J½S©€‰OÏFF"nhˆ†*ªD«Òé^ Á¬$çÒÒX¤|Z“¦Ji4^S£55êÜy Jñ¹ïAæÒ^5ri¤ds›¬ŒyæÕÃòìý¦)}•i¡µQ.• 4‘+IâÅqC.[t-]l¨U j]K«+´Ú°Vºœ SSjL{æDs™Ó™OŸ#±ÑŠ—ÏAœx)<ó™ã9­¹,„·ÜZO yЈˆP¨ÀˆH¨Ø#IŠjñ¹¥^·Ô¤FUQ«TªA£‹Uª"MZ¡lßÃ¥R¡ˆLz”˜%IFÌQ¢D.ÚeWœ/öe'™¸)mè‘à'0œÏ¼ŽBf9èÉAŠg)Qƒì#|²ÒÅvºÅF·Ô˜ŠkUÁ¨ªº#Ab†ç$cÊ2¦—¦òö\" £ UÕªt¤©¢væ$.' œdÌiÚ^:?–¸â ­kôIK§ ÍiÖ¢GŽ“Œ9‹KYzÎpœa埥"Þ”¢ƒÌ†½TäÙbLµôº¦F×hT%®¨V]!=e[hÊ´ðt*¾´Âˆ\ÖÂlöâs€Íž½xvbÅÁ²bÖÔ¯d)s‚—òw3 ™ó»hQå÷¢ˆ—j—˜nõꯚž¯^Ü7¨A0Ш Pà‚!ƒ Õ¨¨¢Š*Ò0ª"ƒ‚ÌiR4ƒMÞ*æÂ‡({X³ÄÉ£ˆ9!J’8U¬L’¤€OÞ_œ.{Y£˜½¦e^Z΢_C—¢6¤i£4*R¨•Bu^¦)›šgd9"p†—4E!å×_Ÿ ]Îí|˜³Ì#¡‚F…©>j4ÐdP¡¦†*TªFM5j]QMiRÅc&5õ¡VgcÇÂHœ%JF’$3¸FdxŽ˜¤‹1/M(½L%,Ñù2‰s/çzâ ¡žv›Ëf $)5u2AŠöÓB}<§°^‚Ôëy]rE‚A=ÍŸžL‡¦b+e¨øØªÔ 8mLœ Dòtòž%rá-L)¶2_3°–ùÈ/"³—¼(Ð0(¿¥'˜&ojâ?ƒ1Ɉϱ5  i”6ž„²1eJ‰¬pÆùœrŒS”$ÈÓ&ˆy+éÚ«_ò½5Éá…O3ý«'9,jo`ÈP5EÀE_¦³Ê5/Ý/,ÅðNNŠÌ±\<§vù¼^p+ ¹&k'mšgÔ 4 4š%Ïg2ÊL3«a&E hh\NƒÉ9:æ"#ÂÈ(°XœŠ²!$Méª8ÍD~†K£ô6ˆ”¤¨™dzr¨†*\O†v’%*LúAd‘ —<í¤,'Î˾¶R宬2NmP¢ .`2}Óì&•Ùæs«Ý tÖk=¹DxqµAf©+‡†/Wï¢ËjúÆêbå&'ÐF7ZOà~éi¼çÓ‰zF’49ÅiŽ¿§¬Jžd’¹e¾×ÈÈ<¸¢‰Æ%By)ìK/ªÜ¯1 QyN¡B3A„žþŸ”›ôÙd©R‘ rö fá˜÷QO®Ô¹*ǶæEòËŽ«ÙH.·¶-=Á¥û:'¨'^ê³o4ÍÄ45YæÃ³é˜9Y~ÿ­Ë9}m4pŽ…ô$’Åš h5f!TÔ­·`çI•f…ã)•W”0½R‡5¿/SC3¨ÕYÕó‰P=]«ò'çÏú¬ çÖ¦4}ûù€åYÕEaüKñ8^\Ïõn“[J0ÏíË9žÁ¤Fu†Çy>ͤÜE6_ÎéÌ_¹_Ò óÚZ<ó,ÓܾVâå/ù^+ŸµÙ,õ‰&Ç‚&ï^OéÐz–2gÏxÖ¡—'vçrà2éÈ,#iÝìt¥s%˜\7LXÜ.e¸Ø‰‹ó©&9nPCæø„Ìd J l.}qï&Ne^Çp™Ëyk‰ä3/³ yÙ¹žñ —è£<ÏÓ'/#z 3-¯›žîé) £¦œÆtrýfçdÖÜË•¹hÂìØ‡åbÓ.›u–`±ŽtßµÃëYKúa>$K!_{Ô×€e~¬@‹çÍäßÎß[öÔ¬ûr–e†YLc>+;û ó Ç8–¹öoN".ÆóåéE_ä·¾ŸV¯ Ýzþè À#7¯Y¼œ/L V¼2yá…]ŒØ\g>—†àu~û%˜Ì›–¼/ÿ^Ê ¡(ê<ò™æ$iB~Á+&Pž£¤—y¹@ø:ýöšï%ŸK^/sJgeŸ˜ò™ê|}€Yöæ5´ùñ¼.³æsé¥_ãw½†3ß.y]êØü\‹L\d¥F…¥^Î.Ƶ­ùe4|ËÌÏœþù–óýµg»Ž¨®ùÒF¼¶êa™I~g7Mã]ŽÄà~ùìË-«—DSymv=—£_Òò*_{ýò —µÂ—×lïRþ/`Q¯9¿a¦w¯íÜå—òHòØ/¶ë"gsZq óµ¹ /6J½…,÷ÃtH€×áêÚ˜\”µ0¬ÓeÒ׿3S”ËÞ!¹r{ÍØ, å:ô~ËÍt]°¯ÞõBú­ï=öÛ`òÒ›[~nÌ$çÿ—¼¼ÜLð1À›i™"š•dÍÿ ¯Uóõ^¢à¥AX*ÁÒH]KÝ’õü^“‹²¿|Ï:¹ÐKÙ[ÊÕ5Çe)ƒëÔé[À÷–>™ÅsÞé°_Œ×mÊ ¹¦#ë¿tþÜåñ5‡ãÚX®ãr-f—wyžù]ëÖò¹¥ ¯×>¢ëkzo|ÀkÛxÍ&^®Ë\£àµ}›ù_nnYÛµkKÙ[¯»ý0€ÌûSè˜Ì“¦ñZPÖžÇ-Ðyi¯_”kô"ÃkèÚßòB·o¦kÞÆšÖJtÍ˼¥hË9]ÎÉ:ÅuÍÛ_G„·h×zÝàÚ¼¼Åë’ßk·KÐXŽãš²¤kó´Vœõíµõ¬™ò•ߺ&kY½6¯oѵˆb &ל—õ{—ßu p¯ÉÃð®ÉÈìç9Xþp[n9^× Ó˄υ®ñ±Ç<Îkò3Ó% |IËù»å°­åøGä½Ï-o=ÖµmÓ7Þ·Öß50^³oï]“%à/mÀL™Ù?®ÉZHÖŠ¸V€µ7xMxÞšÜ%½åÜšø5²/ÿÞ£[Få€Ì´4Ì×~c9Æk`ºN^Ð÷æiÉ×zÜ·"9à5¿Ëß¹&ë±|„—¿uË1X{ÊׯsM!®E´×<ãõëKGæ-ž×2¼½%ÿ?ù^»[ºtÍ`T6Þî5°¬õj¦k \—ç[r½þìš®éì[:¸Ìåw|”Þzï5{xKG¯eW>2Î%¬Áâ–£¼¶yË1@Þbð‡é·× ¶žœ[)„k¯Ýšèžõß[¾6NoyÜ?J×"›ëZð€ÛÇú}Àm¥[ó°µÔµ¢\óv?ÂÛ5^oy“×€îÖû×´Žö–Ï­ îúýËç—ô–<]‹6ÖéÓ÷dïøÝ’‰kº6Ï{sÿžCqÍH­õkù=Ë1,{-×kÞç×Öã¿Åï-PXßnËÆ5¾¯½þ­Adyy çÛåü»k€¾å(¯¯Ç:ëðâïoß >ˆÀo×½ÌkÆx ëô˵¨cÎï® pÝã_§g¾Çðü=tÍ@, ðZÁ® Ö:¾±añÚ[ü,çl r?2׌Ü-åøˆ![ózÍ@¯poñ ¼L'¬£ŽkQ6p÷·æô¨,Ǽ–‰åïÞrÐÞr2påñú;Ö´æçZ¤ ¼ŒLn½÷-ºÖ×ä‹×ß3°3ÿמ‹¯kÏÿvà­kwMg?¢×"¬·ªåãåg|_ô±¤¿DfúíöÄ\…ktÍ®y^Oö-!xkÂ×ϯïÿÙôž¯Çù^ªx=_ï-@.éšÁXÒzò=zïÚ½e¼Þ£[¼¾5†[×òš7 \7lËç„×|åùkÀ½ö¢¯ñ»6¦ïEM·t W/yY>¾–šZƒÉú¹[²~ ˆ¯Ù€õ8Öß1¿ÿ=}½&ÓyíϤ÷ü#öퟷäþ¨/¿ã‡£5ƒ9]“™n Ê[ô½ÆçZôZ”ríµ÷žÿƒòg ê[@ñ£sµß­hé{ø_Ø5^ÖÅ{t˃|ë~„ïõ¼½7™×k¼æÕë·Ö ¾‡>*×<ßÌûµq|Ä »öø]›Ï¦<ççßûðòW:Ž·äÿ£Ï³MoÉÕ«÷þhôq¹ÿúí¥à¾•ø^…ŠÐ½§ˆ× ʵ…µÿ ¯äU´t͸²Æ´¤këO×REï…þ·¢·ujåÚk×~W^»Åÿ÷Êà5Eÿè5¼åÕ/¯çxߺE×äqÍë­ÈãMïð·ës÷–<|Ä‘»F·ÆðVjè­{Mïa¾ÿgÚª·dû?ƒÞ’«ïu’×óml¯®ÇŸ3ý§‚È’~{ óí[iœk´~í½ö=ƒùÞwüÝô£ðÆœÍtË{ùˆ@~`àÆûÞ‘kÏ¿õú-úè5\óøÊ(ÿv4fº5§×^»F×Àm~üÝÀ±¦NÙ5þ>* ñꯥßšû€áú÷gºed?J‰<þôÖ¸~$Å{MÎþûýÃ@dIoxÛï õ{Þ3$3½é)ý™(ýWÑ;d~îG®ïG<øWsôÛÛÂÿVõ£ôŸß­,ï´ù¹™Ó7”?CÞÞÄèðr}aI·œˆ[cú!Cõ™žŸÿÞôç[¯ÿ#èÏ”­™~Èÿ^ú/"3ýöc ò}D^uëú?‰®ÌÛßc _´¿wnüý½À±¦¼þ™×ðÊœˆüåò¶âÿ¯ðèÿ²¹nÎ?ð÷ÉЋëðÒùï°sßKé5¹Eÿ¥@ä½!LoMü›ÈÿÉ€ñzcÎÞ¥¿rnþ¾®Ñ?â:þÈþÑòöƒ:4ÓÕ(é¿þ.úG_‹[ôgèÆÕ±ý“þIÿ¤Ò?éŸt“þ7 S<€@5IEND®B`‚libgroboutils-java-5.orig/website/import/favicon.ico0000644000175000017500000000157607562361473022775 0ustar drazzibdrazzibh( HH                    %'$      %: Rdjc P:$    -T"FE‡½a«ÒjµØ_©ÒB‚¼!CS)  'V4iªyÄà‰Óès¿ßiµÜzÆãØë~Çâ0b¤ H  >!DzÄáÍæ4p¼,— –8­F’Ô¡âïTÌa& ! T@€º™ÝíGÊ ƒ p;–,^¹G”ÕàïX£Ðg('bR›Ë˜Üì/e¶ mmI‹»}Êä‰Õé¡ßîJŽÂ[# &aQšË—Ûí0f¶ i Z%E‰5j¯6q¼5n¸8‰B    S>|¸—ÜíHÊ  ^ a w=3i¯/z6  =AŽxÃà‚Íæ3nº)ˆA ^¨Ô|Åà.V‘4  &V4iª{Åà‡Òço¼Þf³Ú|ÈãŽÖéVÈ%h)   ,U$IFˆ½`©Ðg±ÕY¡Ì:r­(o8     $; Qcg]H/        #%"                    libgroboutils-java-5.orig/website/import/under_construction.html0000644000175000017500000000130307521071712025442 0ustar drazzibdrazzib GroboUtils Home Page

    This Site Is Being Updated!

    Please check back in a few minutes.

    If this page persists for more than an hour, contact the site administrator to get him/her to see what the problem is.

    Thanks for your patience and interest in GroboUtils.

    GroboUtils At Sourceforge

    Sourceforge Logo libgroboutils-java-5.orig/website/import/javadoc/0000755000175000017500000000000011271425773022246 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/import/javadoc/contents.txt0000644000175000017500000000076607737325200024651 0ustar drazzibdrazzibIf you downloaded the source from on-line, this folder will be empty. You can populate it by downloading the following files from https://sourceforge.net/project/showfiles.php?group_id=22594 GroboTesting-2-doc.zip GroboTesting-1-doc.zip GroboTesting-1.0.0a-doc.zip GroboTesting-0.9.1-doc.zip GroboTesting-0.9.2-doc.zip GroboTesting-doc-0.9.0.zip GroboUtils-1.0.0a-doc.zip GroboUtils-doc-0.9.0.zip GroboUtils-doc-0.9.1a.zip GroboUtils-doc-0.9.1b.zip GroboUtils-doc-0.9.1c.zip GroboUtils-doc-0.9.1d.ziplibgroboutils-java-5.orig/website/xdocs/0000755000175000017500000000000011271425773020445 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/xdocs/license.xml0000644000175000017500000000332707655132720022614 0ustar drazzibdrazzib License Details $Date: 2003/05/04 06:40:16 $

    GroboUtils is now distributed under the MIT license:

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Originally, GroboUtils was released under the LGPL. However, due to hard-to-read language included in the LGPL, and many people's concerns over the possible viral nature of the LGPL (and the Free Software Foundation's comments that covering Java code under the LGPL is the same as putting it under the GPL), the author moved the license over to the MIT license on February 10, 2003.

    libgroboutils-java-5.orig/website/xdocs/style/0000755000175000017500000000000011271425773021605 5ustar drazzibdrazziblibgroboutils-java-5.orig/website/xdocs/style/style.xsl0000644000175000017500000003131010007541200023447 0ustar drazzibdrazzib WARNING: DO NOT EDIT THIS FILE This file was auto-generated. Please look at the .xml version of this file and edit that one instead. GroboUtils - <xsl:value-of select="head/name/text()" />
    GroboUtils

    About GroboUtils

    Sourceforge
    Project

    For Developers

    Sub-Projects




    SourceForge Logo
    This space graciously provided by the SourceForge project
    Copyright &copy; 2002-2003 GroboUtils Project.
    All rights reserved.

    SubprojectPackageOverview
    /index.html

    v

    • :

    Status:

  • :
  • :

    • -.zip - JAR, documentation, and source code.
    • -.tar.gz - JAR, documentation, and source code in a tar-ball.
    • --doc.zip - documentation.
    • --src.zip - source code.
    • -.jar - Library (compiled) jar file.
    /.html (Last updated on ) Invalid article-link: file '.xml' does not exist in the directory '../../..//xdocs'
    libgroboutils-java-5.orig/website/xdocs/downloads.xml0000644000175000017500000002074310007541137023154 0ustar drazzibdrazzib Downloads $Date: 2004/02/02 21:34:23 $

    Along with the following downloads, you can retrieve the current HEAD developed code from CVS by following the directions here.

    This page contains only the more recent versions of GroboUtils. To see the older versions, please visit the older downloads page. You can see all the downloads from the Sourceforge File List page.

    Starting with v2, the GroboUtils project is under the MIT license.

    Here are the latest change and release notes.

    GroboUtils
    • v4

      This version has been compiled and tested on these platforms:

      1. Red Hat Linux 9: Sun JDK 1.3.1, Sun JDK 1.4.2
      I've had problems with Sun JDK 1.2 on Windows; there are JIT errors which interfere with Ant's operation. I've seen this with JDK 1.2.2_07 to 1.2.2_010.

      • Complete package: contains the complete binary release, documentation, and all project source. Does not contain the 3rd party packages, or the JavaDoc from prevous releases (these can be separately downloaded).
      • Complete source: contains the complete source, that could be downloaded from the release's CVS state. Does not contain the 3rd party packages, or the JavaDoc from previous releases (these can be searately downloaded).
      • - a stand-alone distribution for the code coverage part, version 1.0.0. Note that this version is different than the one in the core distribution. This archive contains a getting started guide, complete Ant task documentation, the JAR files, and two complete examples (they require junit.jar in the Ant classpath).
      • - API and package documentation
      • - complete JAR file of project classes
      • - all third-party dependency JAR files
      • - the sub-projects' JAR files. Instead of being listed one-by-one, these are now only directly downloadable as a single zip file containing all the jar files. This also now includes all the unit test jar files for the projects, as well.
    • v3

      This version has been compiled and tested on these platforms:

      1. Windows 2000: Sun JDK 1.3.1, Sun JDK 1.4.1
      2. Windows XP: Sun JDK 1.3.1, Sun JDK 1.4.2
      3. Red Hat Linux 9: Sun JDK 1.3.1, Sun JDK 1.4.2
      4. Solaris 8: Sun JDK 1.2.2, Sun JDK 1.3.1, Sun JDK 1.4.2
      I've had problems with Sun JDK 1.2 on Windows; there are JIT errors which interfere with Ant's operation. I've seen this with JDK 1.2.2_07 to 1.2.2_010.

      • Complete package: contains the complete binary release, documentation, and all project source. Does not contain the 3rd party packages, or the JavaDoc from prevous releases (these can be separately downloaded).
      • Complete source: contains the complete source, that could be downloaded from the release's CVS state. Does not contain the 3rd party packages, or the JavaDoc from previous releases (these can be searately downloaded).
      • - a stand-alone distribution for the code coverage part, version 1.0.0RC4. Note that this version is different than the one in the core distribution. This archive contains a getting started guide, complete Ant task documentation, the JAR files, and two complete examples (they require junit.jar in the Ant classpath).
      • - API and package documentation
      • - complete JAR file of project classes
      • - all third-party dependency JAR files
      • - the sub-projects' JAR files. Instead of being listed one-by-one, these are now only directly downloadable as a single zip file containing all the jar files. This also now includes all the unit test jar files for the projects, as well.
    • v2
      • Complete package: contains the complete binary release, documentation, and all project source. Does not contain the 3rd party packages, or the JavaDoc from prevous releases (these can be separately downloaded).
      • Complete source: contains the complete source, that could be downloaded from the release's CVS state. Does not contain the 3rd party packages, or the JavaDoc from previous releases (these can be searately downloaded).
      • - API and package documentation
      • - complete JAR file of project classes
      • - all third-party dependency JAR files
      • - the sub-projects' JAR files. Instead of being listed one-by-one, these are now only directly downloadable as a single zip file containing all the jar files. This also now includes all the unit test jar files for the projects, as well.
    libgroboutils-java-5.orig/website/xdocs/articles.xml0000644000175000017500000000561510024735106022771 0ustar drazzibdrazzib Articles and Guides $Date: 2004/03/14 01:49:58 $

    This is a list of the articles published throughout the website, placed in a single location to ease navigation.

    • JUnit Extensions
    • Util-Classes
    • AutoDoc
    • Util-XML
    • GroboCodeCoverage

    The following is a list of external articles about GroboUtils:

    libgroboutils-java-5.orig/website/xdocs/allprojects.xsl0000644000175000017500000000270607562005172023517 0ustar drazzibdrazzib GroboUtils

    GroboUtils is a large package of various Java utilities. It attempts to have both JDK 1.1 and 1.2 compatiblity for most of the packages.

    Below is a partial catalog of what is contained:

    libgroboutils-java-5.orig/website/xdocs/dependencies.xml0000644000175000017500000000655507737325200023624 0ustar drazzibdrazzib Third Party Library Dependencies $Date: 2003/10/03 16:57:36 $

    GroboUtils has dependencies upon the following library files. The library files should have been included in the distribution.

      Java-based build tool. From the Apache Jakarta project, covered under the Apache license. Java class file parser. From the Apache Jakarta project, covered under the Apache license. The binary release for 5.1 was compiled on JDK 1.4, and included some JDK 1.4-specific API (inadvertantly: StringBuffer.append( StringBuffer )). The one used by GroboUtils is a custom-built version, pulled from the Apache CVS server. Framework for creating mock objects with the JDK 1.3 proxies. It is covered under an MIT-like license. Java unit test framework. Covered under the IBM public license. Logging framework. From the Apache Jakarta project, covered under the Apache license. Mock Object testing framework. Covered under the Apache license. Used for documentation generation through Ant. Covered under the Apache license. Used as the XML parser when running Ant and other XML-related packages. Covered by the Apache license. Used for compatibility with old parsers. This may be removed in favor of the JAXP interface. Covered by the IBM Public License, version 0.5.

    libgroboutils-java-5.orig/website/xdocs/contacts.xml0000644000175000017500000000155607655132720023012 0ustar drazzibdrazzib Contacts $Date: 2003/05/04 06:40:16 $

    The following is a list of all the current contributors:

      Project Lead

    The GroboUtils Project Home houses several forums and mailing lists to help you get involved with the project.

    Want to get involved in the project? There are many places that could use improvement. If you think you've got the talents for something that looks like a hole in the project, submit your name, SourceForge user name, and qualifications to the project lead.

    libgroboutils-java-5.orig/website/xdocs/patmyback.xml0000644000175000017500000000644010024463151023131 0ustar drazzibdrazzib What Users Are Saying about GroboUtils $Date: 2004/03/11 23:34:59 $
    JUnit Extensions

    Matt,
    
    I wanted to thank you for helping me several weeks ago when I was trying to
    figure out the JUnit tests.  So I wrote an article about GroboUtils for
    Java.net - I'm a freelance writer for O'Reilly & Associates.
    
    Your code is great stuff--I hope that you get some good feedback and more
    community interest because of this.
    
    Best wishes,
    --
    N. Alex  Rupp
    

    Magnificent.
    
    Your mttr works great, and the new docs are fantastic.
    
    I'll spread the word about your code--you could become a JUnit committer
    with work like this, you know.  Do you know James Strachan?  I bet he'd like
    to know about this : )
    
    Best wishes, Matt.
    --Norm Rupp
    

    Matt,
    
    Thanks for that, I just worked out the naming trick for interface tests
    myself, was already to tell you about it, but you've beaten me to it :).
    I've got things working now, still scratching the surface, so I might be in
    touch again if thats OK. Its a wonderful thing you've done contributing
    these tools - I really appreciate it.
    
    All best
    
    Andrew Premdas
    

    Yeah, the testing part worries me.  Concurrency can be a real bitch.
    

    From Unit, System, and Integration Testing by N. Alex Rupp.

    I'm returning to Matt Albrecht's GroboUtils project. Matt's JUnit extensions
    show a level of insight into testing that I've not found anywhere else.
    

    It looks like the GroboUtils JUnit extensions have been integrated into the Shocks testing framework. Check out the CVS archive. The article discussing this can be found here.


    Code Coverage

    Is there any known issues w/ the code coverage tools where the symptom is that
    the unit test just freezes up? If I am running w/ coverage on then the engine
    tests just freeze after running. This does not happen if I am running w/o
    coverage. 
    
    Also, what is the implication of it not finding grobocoverage.properties?
    

    Author's reply: this bug has been fixed in the current release.

    From A code coverage story

    First of all, GroboUtils comes in a dozen different downloads--what's up with
    that!?! Nowhere I could find a clear statement of which of all the .jar files
    are needed for setting up a code coverage report in my Ant script. To be
    fair, the same goes with most other code coverage tools. Second, ... Well,
    I really don't know what was the actual problem with the unsuccessful
    attempts to integrate JCoverage, GroboUtils and Hansel. I just know that it
    didn't work and the documentation wasn't helping. I managed to generate a lot
    of data files, the Ant script's output indicated that something was indeed
    happening, but finally, no report, nothing. Damn!
    

    libgroboutils-java-5.orig/website/xdocs/documents.xml0000644000175000017500000000271410040560332023154 0ustar drazzibdrazzib Javadoc $Date: 2004/04/18 20:11:06 $

    All the documentation listed here is available from the downloads section.

    You may browse the Java-Doc online from the below listed releases (in order of release, by date):

    Due to webspace constraints (and lack of interest), the following releases have their documentation only available through downloads:
    • GroboUtils v1.0.0a
    • GroboTesting v0.9.1a
    • GroboTesting v0.9.0a
    • GroboUtils v0.9.1c
    • GroboUtils v0.9.1b
    • GroboUtils v0.9.1a
    • GroboUtils v0.9.0

    libgroboutils-java-5.orig/website/xdocs/building.xml0000644000175000017500000001056607671417056023000 0ustar drazzibdrazzib Building The Projects $Date: 2003/06/10 18:06:38 $ Matt Albrecht

    The Ant Project keeps the projects working smoothly together. The build process uses the recommended-but-hated form of XML entities for including shared Ant XML fragments in each project. Future versions of Ant may include the <include> and <import> tags, which would simplify the current system. However, the build process works just fine without it, for the moment.

    You can download the source from the downloads page.

    If you are interested in building the projects from scratch, here's the recommended process:

    1. Ensure you have JDK 1.2, JDK 1.3, and JDK 1.4 installed on your system. The complete build process will require all of these to be installed, but it is not needed for most circumstances. Also, to completely test the projects you will need to be connected to the internet while running the build, but again this is not needed for most circumstances, but is required for actual releases.
    2. Download the latest CVS tree (see the Sourceforge project CVS page for details on how to do this). The module to download is 'projects'. The CVS tree will contain all the necessary non-JDK files needed for building.
    3. Currently, only Windows, Unix-like variants, and Cygwin are supported build platforms. Windows users should use 'make.bat' from the base directory, while Cygwin and Unix-like users should use 'make.sh'. The remainder of this guide is oriented towards Bash shell users on Unix platforms, but other platforms and shells should be very similar. Alternatively, you can use the 'makeall.sh' script to build the entire project, which does about the following:
    4.       $ cd 'projects' home
            $ export JAVA_HOME=JDK 1.4 home
            $ ./make.sh clean
            $ export JAVA_HOME=JDK 1.2 home
            $ ./make.sh main
            $ export JAVA_HOME=JDK 1.3 home
            $ ./make.sh main
            $ export JAVA_HOME=JDK 1.4 home
            $ ./make.sh deploy
          
    5. By this time, you have just spent about 30 minutes to 5 hours building and testing all the sub-projects on all supported JDK versions. The final deployment output is sitting in the '_projects' sub-project 'deploy' directory. Each sub-project will have its individual deployment file set in its own 'deploy' directory.

    Why Does CVS Contain Everything?

    I have put everything in CVS that the build depends upon, except for the OS and JDKs. I, the build manager for GroboUtils had (and still has) responsiblities involving both source control repository (SCR) maintenance and build maintenance. If the developers have fewer dependencies that they have to locally manage, then they have fewer risks to cause the build to fail when everything works fine for them. Not only that, but by putting all dependencies in the SCR, it reduces the problem of the build manager dealing with "source rot" while trying to rediscover the exact library files that the source works with.

    I've known some people who do go so far as to archive the OS and JDKs in the SCR, and rebuild from scratch the build machine every time. Now it's true that this allows the project to be able to completely restore a build based on just the SCR, and the build managers are less dependent on the IT group to correctly rebuild the machine in the case of critical failures, I feel that you still need the hardware the build was compiled on. If you don't have an OS for your hardware, then you're just as screwed as if you don't have the same hardware.

    But this project, like most Java and open-source projects, are in a different boat. We want to be compiled on lots of hardware, OSs, and JDKs.

    So what is this rambling about? It means that the SCR respository has been optimized to reduce third-party dependencies for the user, while opening the platforms available for compatibility testing.

    libgroboutils-java-5.orig/website/xdocs/olddownloads.xml0000644000175000017500000002155607737323760023676 0ustar drazzibdrazzib Old Downloads $Date: 2003/10/03 16:46:40 $

    This document contains a listing of older versions of GroboUtils. To see the more recent releases, visit the downloads page. You can see all the downloads from the Sourceforge File List page.

    Starting with v2, the GroboUtils project is under the MIT license.

    All releases up to and including v1 has been released under GNU Lesser General Public License (LGPL). Please note that since Java is not Package Distributed, but rather class bytecode distributed, I consider each class file to be its own library, covered under the LGPL. Therefore, you may repackage the class files anyway you desire (as long as the distribution follows the LGPL).

    GroboUtils
    • v1
      • Complete package: contains the complete binary release, documentation, and all project source. Does not contain the 3rd party packages, or the JavaDoc from prevous releases (these can be separately downloaded).
      • Complete source: contains the complete source, that could be downloaded from the release's CVS state. Does not contain the 3rd party packages, or the JavaDoc from previous releases (these can be searately downloaded).
      • - API and package documentation
      • - complete JAR file of project classes
      • - complete project website (including previous releases' JavaDoc)
      • - all third-party dependency JAR files
      • Each sub-project's JAR file:
    • v1.0.0a
      • Complete package: contains the complete binary release, documentation, and all project source.
      • Complete source: contains the complete source, that could be downloaded from the release's CVS state.
      • - API and package documentation
      • - complete JAR file of project classes
      • Each sub-project's JAR file:
    • v0.9.1d
      • - pre-alpha early release 0.9.1d. Contains the JAR, source, and documentation.
      • - pre-alpha early release 0.9.1d Java Documentation.
      • - pre-alpha early release 0.9.1d source code.
      • - pre-alpha early release 0.9.1d library (compiled) jar file.
    • v0.9.1c
      • - pre-alpha early release 0.9.1c
      • - pre-alpha early release 0.9.1c documentation.
    • v0.9.1b
      • - pre-alpha early release 0.9.1b
      • - pre-alpha early release 0.9.1b documentation.
    • v0.9.1a
      • - pre-alpha early release 0.9.1a
      • - pre-alpha early release 0.9.1a documentation.
    • v0.9.0
      • - pre-alpha release 0.9.0
      • - pre-alpha release 0.9.0 documentation.
    GroboTesting

    (now merged into GroboUtils)

    • Starting with this version, each major package is broken into its own JAR file. The main "core" JAR is still distributed.
    • v0.9.0
      • - JAR, documentation, and source code.
      • - documentation
      • - source code
      • - Library (compiled) jar file
    libgroboutils-java-5.orig/website/xdocs/oldprojects.xml0000644000175000017500000000175107655132720023521 0ustar drazzibdrazzib Old Projects $Date: 2003/05/04 06:40:16 $ Matt Albrecht

    Old Projects

    GroboUtils

    GroboUtils is a collection of Java utilities which I have found useful over my varied personal projects.

    They have been released under GNU Lesser General Public License (LGPL). For futher details, see the license page.

    GroboTesting

    GroboTesting is a set of Java-based testing utilities.

    These are currently under the GNU Lesser General Public License (LGPL) license.

    Tesseract

    A Z-Machine game.

    libgroboutils-java-5.orig/website/xdocs/index.xml0000644000175000017500000000260210020013341022245 0ustar drazzibdrazzib GroboUtils Home Page $Date: 2004/02/27 22:18:35 $
    Overview

    GroboUtils aims to expand the testing possibilities of Java. It contains many sub-projects which experiment with different aspects of testing through Java.

    The popular tools included with GroboUtils include multi-threaded tests, hierarchial unit tests, and a code coverage tool.

    This toolset is released under the MIT license.


    Latest Versions

    GroboUtils: v4

    Visit the downloads section to get the latest version. Here are the change and release notes


    Publicity

    libgroboutils-java-5.orig/website/xdocs/samples.xml0000644000175000017500000000030107655132720022623 0ustar drazzibdrazzib Samples $Date: 2003/05/04 06:40:16 $

    Therea are no samples yet.

    libgroboutils-java-5.orig/util-classes/0000755000175000017500000000000011271425773020273 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/deployed.ant-inc.xml0000644000175000017500000000057007707060301024143 0ustar drazzibdrazzib libgroboutils-java-5.orig/util-classes/build.xml0000644000175000017500000001714607707060301022114 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; libgroboutils-java-5.orig/util-classes/log4j.properties0000644000175000017500000000050507521071672023426 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.util.classes=DEBUG libgroboutils-java-5.orig/util-classes/sources/0000755000175000017500000000000010011472771021745 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ait/0000755000175000017500000000000011271425773022533 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ait/about.txt0000644000175000017500000000021007521071672024375 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/util-classes/sources/dev/0000755000175000017500000000000011271425773022534 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/0000755000175000017500000000000010011472767023316 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/0000755000175000017500000000000010011472767025641 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472767030032 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/0000755000175000017500000000000010011472770031001 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/0000755000175000017500000000000010011472767032444 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/0000755000175000017500000000000011271425773032776 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/0000755000175000017500000000000011271425773033626 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/UrlClassLoader.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/U0000644000175000017500000003411007655644604033763 0ustar drazzibdrazzib/* * @(#)UrlClassLoader.java * * Copyright (C) 2000,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk0; import java.io.File; import java.io.IOException; import java.io.FileInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.net.URL; import java.util.Hashtable; import java.util.Enumeration; import java.util.zip.ZipInputStream; import java.util.zip.ZipEntry; import net.sourceforge.groboutils.util.classes.v1.IUrlClassLoader; /** * Class responsible for loading classes in a JDK 1.0+ version compatible * way. Need to determine speed vs. size for caching Jar files that are * loaded over the internet. For now, we cache stuff, in the hope that * the flush() will be called. *

    * If the URL is null, or if the bytecode for a class name is not found, * then this will attempt to load the class from the system classloader. *

    * NOTE: As of version 1.0.0, there is no longer a dependency upon * net.sourceforge.groboutils.util.io.v1 * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:00 $ * @since November 17, 2000 (GroboUtils Alpha 0.9.0) */ public class UrlClassLoader implements IUrlClassLoader, BytecodeSource { //---------------------------- // Public data //---------------------------- // Private data private ArrayClassLoader m_acl = new ArrayClassLoader(); private Hashtable m_urlSources = new Hashtable(); private static final String[] JAR_EXTENTIONS = { ".jar", ".zip", ".war", ".sar", ".ear" }; private abstract class BytecodeSourceCache implements BytecodeSource { private Hashtable m_classes = new Hashtable(); public BytecodeSourceCache() { // do nothing } public byte[] getBytecode( String className ) { byte buff[] = (byte[])this.m_classes.get( className ); if (buff == null) { try { buff = readBytecode( className ); if (buff != null) { this.m_classes.put( className, buff ); } } catch (IOException ioe) { ioe.printStackTrace(); buff = null; } catch (SecurityException se) { se.printStackTrace(); buff = null; } } return buff; } protected abstract byte[] readBytecode( String className ) throws IOException; } /** * Loads classes from a given zip/jar file */ private class JarBytecodeSource extends BytecodeSourceCache { private byte[] m_zipfile; public JarBytecodeSource( String s_url ) throws IOException { // due to an error in the JDK 1.1 implementation of the // file: protocol, we must verify the URL ourself InputStream is = null; try { if (s_url.startsWith( "file:" )) { // this is also a bit of an optimization is = new FileInputStream( s_url.substring( "file:".length() ) ); } else { URL url = new URL( s_url ); is = url.openStream(); } this.m_zipfile = readByteStream( is ); } finally { if (is != null) { is.close(); } } } protected byte[] readBytecode( String className ) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream( this.m_zipfile ); ZipInputStream zis = new ZipInputStream( bais ); String classFile = className2jarFileName( className ); byte buff[] = findZipEntry( classFile, zis ); zis.close(); bais.close(); return buff; } } private class UrlBytecodeSource extends BytecodeSourceCache { private String m_url; public UrlBytecodeSource( String url ) { this.m_url = url; } protected byte[] readBytecode( String className ) throws IOException { URL url = new URL( joinClassToUrl( className, this.m_url ) ); byte[] buff = null; IOException ex = null; // there may be time-out issues for (int i = 0; i < 3 && buff == null; ++i) { InputStream is = null; try { is = url.openStream(); buff = readByteStream( is ); } catch (IOException ioe) { ex = ioe; } finally { is.close(); } } if (buff == null) { throw ex; } return buff; } } //---------------------------- // constructors /** * Default constructor */ public UrlClassLoader() { this.m_acl.setBytecodeSource( this ); } //---------------------------- // Public methods /** * Load the given class from the given URL. If the URL is null, * then it loads the class from the default class loader. * * @param className the exact class name to load. * @param url the URL from which the class is loaded. If this is * null, then this loads the class from the default class * loader. * @return the loaded Class instance, or null if the class could * not be found. */ public Class loadClass( String className, String url ) { url = convertUrl( url ); // check if this is a JAR type reference BytecodeSource bs = getBytecodeSource( url ); if (bs != null) { byte bytecode[] = bs.getBytecode( className ); if (bytecode != null && bytecode.length > 0) { // load the class from bytecode this.m_acl.addClass( className, bytecode ); } // else - use the system class loader // ***** SHOULD WE RETURN NULL???? **** } Class c = null; try { c = this.m_acl.loadClass( className ); } catch (ClassNotFoundException cnfe) { c = null; } return c; } /** * Call to flush any cache stored in the interface. This allows for * a class loader to cache results, and free up memory when it is * not needed. */ public void flush() { this.m_acl = new ArrayClassLoader(); this.m_acl.setBytecodeSource( this ); this.m_urlSources = new Hashtable(); } public byte[] getBytecode( String classname ) { Enumeration enum = this.m_urlSources.elements(); while (enum.hasMoreElements()) { BytecodeSource bs = (BytecodeSource)enum.nextElement(); byte buff[] = bs.getBytecode( classname ); if (buff != null) { return buff; } } return null; } //---------------------------- // Protected methods /** * */ protected BytecodeSource getBytecodeSource( String url ) { if (url == null) { return null; } BytecodeSource bs = (BytecodeSource)this.m_urlSources.get( url ); if (bs == null) { // there may be time-out issues for (int i = 0; i < 3 && bs == null; ++i) { if (isJarURL( url )) { try { bs = new JarBytecodeSource( url ); } catch (IOException ioe) { ioe.printStackTrace(); } } else { bs = new UrlBytecodeSource( url ); } } if (bs != null) { this.m_urlSources.put( url, bs ); } } return bs; } /** * Converts the given string to a fully qualified URL. If no * scheme is given, then it is converted to a File scheme. */ protected String convertUrl( String url ) { if (url == null) { return null; } //System.out.println("Converting from URL "+url); int pos = url.indexOf(':'); String scheme = null; if (pos >= 0) { scheme = url.substring( 0, pos ); } if (scheme == null || scheme.length() <= 0) { url = "file:" + getAbsoluteFilename( new File( url ) ); } else { // check if the url is an existing file, since // a colon could be a drive or volume reference. File f = new File( url ); if (f.exists()) { // make this a file url = "file:" + getAbsoluteFilename( f ); } // else assume that the given url is correct } //System.out.println(" - to URL "+url); return url; } /** * @return true if the URL references a Jar-like file. */ protected boolean isJarURL( String url ) { int pos = url.lastIndexOf( '.' ); if (pos < 0) return false; String ext = url.substring( pos ); for (int i = JAR_EXTENTIONS.length; --i >= 0;) { if (JAR_EXTENTIONS[i].equalsIgnoreCase( ext )) { return true; } } return false; } /** * Finds the entry of the given filename in the given input stream, * and returns the entry as a byte array. If the entry wasn't found, * then null is returned. */ protected byte[] findZipEntry( String filename, ZipInputStream zis ) { try { ZipEntry ze = zis.getNextEntry(); while (ze != null) { // case must match! if (filename.equals( ze.getName() )) { // size may be huge, but actually class files // have a maximum size int size = (int)ze.getSize(); byte b[]; if (size < 0) { b = readByteStream( zis ); } else { b = new byte[ size ]; zis.read( b, 0, size ); } return b; } ze = zis.getNextEntry(); } // the entry wasn't found return null; } catch (IOException ioe) { ioe.printStackTrace(); return null; } } /** * Converts a class name to a file name. */ protected String className2jarFileName( String className ) { return className.replace( '.', '/' ) + ".class"; } /** * Joins a classname to a URL. */ protected String joinClassToUrl( String className, String url ) { StringBuffer sb = new StringBuffer( url ); sb.append('/'); sb.append( className2jarFileName( className ) ); return new String( sb ); } /** * */ protected String getAbsoluteFilename( File f ) { return f.getAbsolutePath().toString(); } /** * A re-implementation of * net.groboclown.util.io.v1.ReadByteStream, to reduce * the amount of inter-package dependencies. */ protected byte[] readByteStream( InputStream is ) throws IOException { int totSize = 0; byte[] ret = new byte[ 0 ]; byte[] buff = new byte[ 4096 ]; int size = is.read( buff, 0, 4096 ); while (size > 0) { byte[] tmp = new byte[ size + totSize ]; System.arraycopy( ret, 0, tmp, 0, totSize ); System.arraycopy( buff, 0, tmp, totSize, size ); ret = tmp; totSize += size; size = is.read( buff, 0, 4096 ); } return ret; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/ArrayClassLoader.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/A0000644000175000017500000001265307622026464033737 0ustar drazzibdrazzib/* * @(#)ArrayClassLoader.java 1.0.0 11/17/2000 - 12:01:17 * * Copyright (C) 2000,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk0; import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; /** * Load classes by byte Arrays. JDK 1.0+ compatible. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since November 17, 2000 (GroboUtils Alpha 0.9.0) */ public class ArrayClassLoader extends ClassLoader { //---------------------------- // Public data //---------------------------- // Private data /** * list of all classes */ private Hashtable m_classList = new Hashtable(); private Hashtable m_classCache = new Hashtable(); /** * The original bytecode source, for linking. */ private BytecodeSource m_bytecodeSource = null; //---------------------------- // constructors /** * Default constructor */ public ArrayClassLoader() { // do nothing } //---------------------------- // Public methods /** * Sets the reference to the original bytecode loader. By default, * the value is null. If the value is null, then * there is the possibility for a link error. */ public void setBytecodeSource( BytecodeSource bs ) { this.m_bytecodeSource = bs; } /** * Add a new class to the internal list. */ public void addClass( String name, byte[] bytecode ) { if (name == null || bytecode == null) { throw new IllegalArgumentException("no null args"); } this.m_classList.put( name, bytecode ); } // inherited from ClassLoader /** * @exception ClassNotFoundException thrown if the given class name * could not be found, or if there was a problem loading the * bytecode for the class. */ public Class loadClass( String name, boolean resolve ) throws ClassNotFoundException { Class c; if (name == null) { throw new IllegalArgumentException("classname is null"); } c = (Class)this.m_classCache.get( name ); if (c == null) { try { c = findSystemClass( name ); } catch (Exception ex) { byte bytecode[] = getBytecode( name ); if (bytecode == null) { System.out.println(this.getClass().getName()+"::loadClass( '"+name+ "' ): bytecode for class was never defined."); throw new ClassNotFoundException( name ); } else { try { c = defineClass( name, bytecode, 0, bytecode.length ); this.m_classCache.put( name, c ); } catch (Exception ex2) { // something wrong with the class format throw new ClassNotFoundException( "Bad class format for class "+name ); } } } } if (resolve) { resolveClass( c ); } return c; } //---------------------------- // Protected methods /** * Retrieves the internal bytecode for the given class. If not known, * then will attempt to pass it to the bytecode source. * * @param className a non-null class name. */ protected byte[] getBytecode( String className ) { byte bytecode[] = (byte[])this.m_classList.get( className ); if (bytecode == null) { if (this.m_bytecodeSource != null) { bytecode = this.m_bytecodeSource.getBytecode( className ); if (bytecode != null) { addClass( className, bytecode ); } } } return bytecode; } //---------------------------- // Private methods } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/BytecodeSource.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk0/B0000644000175000017500000000377207622026465033743 0ustar drazzibdrazzib/* * @(#)BytecodeSource.java 1.0.0 11/17/2000 - 12:01:17 * * Copyright (C) 2000,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk0; import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; /** * Load classes by byte Arrays. JDK 1.0+ compatible. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:37 $ * @since November 17, 2000 (GroboUtils Alpha 0.9.0) */ public interface BytecodeSource { /** * Loads the bytecode for the given classname. * * @param classname the name of the class to find. * @return null if there was an error finding the * class, or the bytecode for the given class. */ public byte[] getBytecode( String classname ); } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/ClassUtil.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/ClassU0000644000175000017500000002765307622026464034127 0ustar drazzibdrazzib/* * @(#)ClassUtil.java 0.9.0 11/13/2000 - 14:06:34 * * Copyright (C) 2000,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import java.util.Hashtable; /** * Utility class for loading classes and creating instances. It decides * which JDK version to use as the loader. Class instances are put * into a Hashtable, based on URL and classname. When the Java-Doc defines * a jarName, as in {@link #getClass( String, String )}, the * jarName may be a filename loadable from the {@link java.io.File} * class, or a proper URL loadable from the {@link java.net.URL} class. * If the jarName does not have a protocol, then it is assumed to * be a file, otherwise, it is used as a URL. *

    * Note that this class is not thread safe. It is assumed that applications * will use the ClassUtil only during initialization times, since dynamic * class loading can be very expensive. If you need thread safety, then you * will need to ensure that either all class loading is done in a single thread, * or that your application properly synchronizes the method calls. *

    * Update v0.9.1: the constructor will now check for jdk2 first like before, * but now if it is not found, it will try to use jdk0 compatibility - before, * it would just fail out. This allows the libraries to be repackaged to * contain only the jdk0 classes if so desired. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since November 13, 2000 (GroboUtils Alpha 0.9.0) */ public class ClassUtil { //---------------------------- // Public data //---------------------------- // Private data /** * Subclasses must instantiate themselves in this variable in their * static initialization block, and overload the {@link #getInstance()} * static method. */ protected static ClassUtil s_instance = new ClassUtil(); private IUrlClassLoader classLoader = null; private Hashtable classHash = new Hashtable(); //---------------------------- // constructors /** * Default constructor - made protected so * users won't instantiate the utility */ protected ClassUtil() { // detect which JDK we're using, and from that use the correct // IUrlClassLoader instance. if (isJdk2Compatible()) { this.classLoader = (IUrlClassLoader)createObject( getClassPackage( ClassUtil.class ) + ".jdk2.UrlClassLoader" ); } if (this.classLoader == null) { this.classLoader = (IUrlClassLoader)createObject( getClassPackage( ClassUtil.class ) + ".jdk0.UrlClassLoader" ); if (this.classLoader == null) { throw new IllegalStateException( "There was an error loading a class loader." ); } } } //---------------------------- // Public Static methods /** * Retrieve the shared instance of the utility class. * * @return the utility instance */ public static ClassUtil getInstance() { // Due to threading issues, the instance is created // in the static initialization block. return s_instance; } //---------------------------- // Public methods /** * Call this to flush out the cache. The cache may be huge, depending * on the Jar files loaded, as well as the Class instances. This * should be called whenever a mass class instantiation process is * finished. */ public void flush() { this.classHash = new Hashtable(); this.classLoader.flush(); } /** * Either finds or loads from cache the given class, using the * default class loader. * * @param name the name of the class to load. * @return the discovered Class, or null if it could not be found. * @see #getClass( String, String ) */ public Class getClass( String name ) { return getClass( name, null ); } /** * Either finds or loads from cache the given class. * * @param name the name of the class to load. * @param jarName the URL to load the class from - it may be null. * @return the discovered Class, or null if it could not be found. * @see #getClass( String ) */ public Class getClass( String name, String jarName ) { String hashName = getClassHashName( name, jarName ); Class c = (Class)classHash.get( hashName ); if (c == null) { c = loadClass( name, jarName ); if (c != null) { classHash.put( hashName, c ); } } return c; } /** * Creates a new instance of the class with the given className * using the default constructor. If there was an error during the * creation, such as the class was not found, the class does not have * a default constructor, or the constructor threw an exception, then * null is returned. * * @param className the name of the class to create an instance. * @return the new instance, or null if there was a problem. * @see #getClass( String ) * @see #createObject( String, String ) */ public Object createObject( String className ) { return createObject( className, null ); } /** * Creates a new instance of the class with the given className * using the default constructor, from the given URL. If there was an * error during the creation, such as the class was not found, the class * does not have a default constructor, or the constructor threw an * exception, then null is returned. * * @param className the name of the class to create an instance. * @param jarName the URL to load the class from - it may be null. * @return the new instance, or null if there was a problem. * @see #getClass( String, String ) * @see #createObject( String ) */ public Object createObject( String className, String jarName ) { return createObject( getClass( className, jarName ) ); } /** * Creates an Object from the given Class, using its default constructor. * All creation exceptions are swallowed. If the object could not * be created, then null is returned. * * @param c the Class object from which a new instance will be created * using its default constructor. * @return the instantiated object, or null if c is * null, or if there was an error during initialization. */ public Object createObject( Class c ) { if (c == null) return null; Object obj = null; try { obj = c.newInstance(); } catch (InstantiationException ie) { System.out.println("Could not instantiate "+c.getName()+ ": "+ie.getMessage()); obj = null; } catch (IllegalAccessException iae) { System.out.println("Could not instantiate "+c.getName()+ ": "+iae.getMessage()); obj = null; } catch (NoSuchMethodError nsme) { System.out.println("Could not instantiate "+c.getName()+ ": "+nsme.getMessage()); obj = null; } return obj; } /** * Checks if the current JVM version is 1.2 compatible. We check by * seeing if java.net.URLClassLoader exists. * * @return true if {@link java.net.URLClassLoader} exists * in the classpath, or false otherwise. */ public boolean isJdk2Compatible() { return (getClass( "java.net.URLClassLoader" ) != null); } /** * Discovers the package name for the given class. The package name * will not have a final '.'. * * @param c the class to find the package name. * @return the package name, or null if c is * null. */ public String getClassPackage( Class c ) { if (c == null) { return null; } String fullname = c.getName(); int pos = fullname.lastIndexOf( '.' ); if (pos < 0) { // no package return ""; } // else, extract the pacakge name. return fullname.substring( 0, pos ); } //---------------------------- // Protected methods /** * Creates the name of the class for the hashtable lookup, which is * a junction of the jar name and the class name. It allows for multiple * classes with the same name. * * @param name the class name * @param jarName the jar name - may be null. * @return the name for the hashtable lookup. */ protected String getClassHashName( String name, String jarName ) { if (jarName == null) { jarName = ""; } StringBuffer sb = new StringBuffer( jarName ); sb.append( ';' ); sb.append( name ); return new String( sb ); } /** * Attempts to load the class from the current classpath if baseJar * is null, or from the appropriate class loader if it is not * null. If the class is not found, then this returns * null. This never throws an exception. * * @param className name of the class to load * @param baseJar the URL file to load the class from - may be * null. * @return the Class instance, or null if it was not found. */ protected Class loadClass( String className, String baseJar ) { Class c; try { if (baseJar == null || baseJar.length() <= 0) { try { c = Class.forName( className ); } catch (ClassNotFoundException cnfe) { // System.out.println("Class "+className+" not found"); c = null; } } else { c = this.classLoader.loadClass( className, baseJar ); } } catch (Throwable t) { // probably a NoClassDefFoundError c = null; } return c; } //---------------------------- // Private methods } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/package.htmllibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/packag0000644000175000017500000000031307521071672034142 0ustar drazzibdrazzibnet.groboclown.util.classes.v1 Helps control class loading, so that it will work with the most efficient Jar / URL class loading based on your JVM. libgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk2/0000755000175000017500000000000011271425773033630 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk2/UrlClassLoader.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/jdk2/U0000644000175000017500000001175007655644605033773 0ustar drazzibdrazzib/* * @(#)UrlClassLoader.java * * Copyright (C) 2000,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk2; import java.net.URL; import java.net.URLClassLoader; import java.io.File; import java.io.IOException; import java.util.Hashtable; import net.sourceforge.groboutils.util.classes.v1.IUrlClassLoader; /** * A JDK 1.2+ URL Class Loader implementation. *

    * New in version 1.0.0: This will attempt to load from the thread's * context loader if the URL is bad. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since November 17, 2000 (GroboUtils Alpha 0.9.0) */ public class UrlClassLoader implements IUrlClassLoader { //---------------------------- // Public data //---------------------------- // Private data private Hashtable m_urlLoaders = new Hashtable(); //---------------------------- // constructors /** * Default constructor */ public UrlClassLoader() { // do nothing } //---------------------------- // Public methods /** * Load the given class from the given URL. If the URL is null, * then it is up to the classloader to figure out where to load it from. * This should, in general, load the class from the default class loader. * * @param className the exact class name to load. * @param url the URL from which the class is loaded. If this is * null, then the returned class is implementation specific. * @return the loaded Class instance, or null if the class could * not be found or if the given URL is not valid. */ public Class loadClass( String className, String url ) { URL murl = convertUrl( url ); ClassLoader cl = getClassLoader( murl ); Class c = null; // Try 5 times to get around time-out issues. for (int i = 0; i < 5 && c == null; ++i) { try { c = cl.loadClass( className ); } catch (ClassNotFoundException cnfe) { // ignore cnfe.printStackTrace(); } } return c; } /** * Call to flush any cache stored in the interface. This allows for * a class loader to cache results, and free up memory when it is * not needed. */ public void flush() { this.m_urlLoaders = new Hashtable(); } //---------------------------- // Protected methods /** * Converts the given string to a fully qualified URL. If no * scheme is given, then it is converted to a File scheme. */ protected URL convertUrl( String url ) { if (url == null) { return null; } try { return new URL( url ); } catch (IOException ioe) { // assume that the string is intended to be a file name. try { return new URL( "file:" + url ); } catch (IOException e) { return null; } } } /** * */ protected ClassLoader getClassLoader( URL url ) { ClassLoader cl; if (url == null) { cl = Thread.currentThread().getContextClassLoader(); } else { cl = (URLClassLoader)this.m_urlLoaders.get( url ); if (cl == null) { cl = new URLClassLoader( new URL[] { url } ); this.m_urlLoaders.put( url, cl ); } } return cl; } //---------------------------- // Private methods } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/SPILoader.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/SPILoa0000644000175000017500000002012007656462705034013 0ustar drazzibdrazzib/* * @(#)SPILoader.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import java.util.Properties; import java.util.Enumeration; import java.util.NoSuchElementException; import java.net.URL; import java.io.IOException; import java.io.InputStream; import org.apache.log4j.Logger; /** * Loads Service Provider Interface (SPI) classes from the given classloader * (if any). This will search for files in the form * /META-INF/services/classname. The discovered file will be * parsed using java.util.Properties parsing method, but only the * keys will be recognized (note that if a line contains no ':' or '=', then * the line will be recognized as a key with an empty-string value). The found * keys will be used as class names, constructed, and returned, using the * ClassLoadHelper class in this package. *

    * This is intended to follow the SPI interface spec, partially described in * the JDK 1.4 documentation in the package docs for java.awt.im.spi. *

    * Note that by using a Properties instance, this class is limited to only * one instance of a class type per META-INF service file. This is assumed to * be an adequate restriction, since in most circumstances, there should only * be one instance of a service provider loaded per need. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since June 28, 2002 * @version $Date: 2003/05/08 14:12:21 $ */ public class SPILoader { private static final Logger LOG = Logger.getLogger( SPILoader.class.getName() ); /** * List of all resource URLs to the class's SPI files. */ private Enumeration spiUrls; /** * Current SPI url's property (classname) keys. */ private Enumeration propKeys = null; private String nextKey = null; private Class base; private ClassLoadHelper clh; /** * Use the context (thread) classloader or the system class loader. * * @param spiBase the base class that all loaded SPI classes must * implement. This is also used to define the name of the files * to load from the META-INF directory. * @exception IOException if there is an I/O problem loading the * initial set of resources. */ public SPILoader( Class spiBase ) throws IOException { this( spiBase, null ); } /** * Create a new SPILoader, loading the service files from the given * class loader classpath. If cl is null, then the * context (thread) class loader or system class loader will be used * instead. * * @param spiBase the base class that all loaded SPI classes must * implement. This is also used to define the name of the files * to load from the META-INF directory. * @param cl classloader to load files from. * @exception IOException if there is an I/O problem loading the * initial set of resources. */ public SPILoader( Class spiBase, ClassLoader cl ) throws IOException { if (spiBase == null) { throw new IllegalArgumentException("spiBase cannot be null."); } if (cl == null) { this.clh = new ClassLoadHelper( spiBase ); } else { this.clh = new ClassLoadHelper( cl ); } String metaName = "/META-INF/services/" + spiBase.getName(); this.spiUrls = this.clh.getResources( metaName ); if (this.spiUrls == null) { throw new IOException("No URLs were discovered."); } this.base = spiBase; } /** * Discovers if there is another provider class instance to load. * * @return true if there is another provider, otherwise * false. */ public boolean hasNext() throws IOException { while (this.nextKey == null) { if (this.propKeys == null || !this.propKeys.hasMoreElements()) { if (!this.spiUrls.hasMoreElements()) { LOG.debug("No more URLs to process"); return false; } URL url = (URL)this.spiUrls.nextElement(); LOG.debug( "Processing next URL: "+url ); Properties props = new Properties(); LOG.debug( "Opening URL stream" ); InputStream is = url.openStream(); try { props.load( is ); } finally { is.close(); } this.propKeys = props.keys(); LOG.debug( "URL contains "+props.size()+" class names" ); } else { this.nextKey = (String)this.propKeys.nextElement(); LOG.debug( "Next classname is "+this.nextKey ); } } return true; } /** * Returns a new instance of the next class name. If the defined * next class is invalid, then an IOException is thrown. The returned * object is guaranteed to be non-null and an instance of the constructor * baseClass. * * @return the next provider in the list of discovered SPI providers. * @exception IOException if there was an I/O error, or if the referenced * resource defines an invalid class to load. * @exception NoSuchElementException if the enumeration is already at * the end of the list. */ public Object nextProvier() throws IOException { // ensure we have a next key to go to hasNext(); if (this.nextKey == null) { // end of list throw new NoSuchElementException( "end of list" ); } String cn = this.nextKey; // ensure we advance to the next key next iteration. this.nextKey = null; Object o; try { o = this.clh.createObject( cn ); } catch (IllegalStateException ise) { LOG.info( "create object for type "+cn+" threw exception.", ise ); throw new IOException( ise.getMessage() ); } if (o == null) { LOG.info( "create object for type "+cn+" returned null." ); throw new IOException( "Could not create an instance of type "+ cn ); } if (!this.base.isInstance( o )) { throw new IOException( "SPI defined class "+cn+ ", but expected class of type "+this.base.getName() ); } return o; } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/SingletonStore.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/Single0000644000175000017500000000640307622026464034144 0ustar drazzibdrazzib/* * @(#)SingletonStore.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; /** * Aids pluggable factories and related classes by being a central repository * for storing a singleton, and creating means to load and change the singleton. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since March 30, 2002 */ public class SingletonStore extends AbstractSingleStore { private Class defaultImplementation; private String sysPropertyKey; /** * Constructor specifying all the parameters for using a singleton in this * framework. * * @param instanceOf singletons must be of this class. * @param defaultImpl the class which will be used if no valid * implementation class can be found. * @param sysPropertyKey the system property key to reference for the name * of the implementation class. */ public SingletonStore( Class instanceOf, Class defaultImpl, String sysPropertyKey ) { super( instanceOf ); this.defaultImplementation = defaultImpl; this.sysPropertyKey = sysPropertyKey; } /** * Sets the inner singleton to the default, which pulls from the system * property key. */ public void setDefaultSingleton() { setSingletonFromProperty( this.sysPropertyKey ); } /** * Set the singleton to the class specified in the given system * property; if the class is invalid, then the default singleton class will * be used instead. * * @param key the System property to reference for the classname to * instantiate. It is passed to ClassLoadHelper * @exception IllegalArgumentException if key is null. * @see ClassLoadHelper#createObjectFromProperty( String, Class, boolean ) */ public void setSingletonFromProperty( String key ) { setSingleton( createFromProperty( key, this.defaultImplementation ) ); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/AbstractMultipleStore.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/Abstra0000644000175000017500000001553707622026464034147 0ustar drazzibdrazzib/* * @(#)AbstractMultipleStore.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import java.util.Vector; import java.util.Enumeration; import org.apache.log4j.Logger; /** * Similar in concept to the AbstractSingleStore, except this houses * multiple instances of 'singletons'. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since June 28, 2002 */ public abstract class AbstractMultipleStore { private static final Logger LOG = Logger.getLogger( AbstractMultipleStore.class.getName() ); private Class instanceOf; private Vector store = new Vector(); private AllowMultiplesAction action; /** * It stores each class already stored. * This should in reality be a HashSet, but Hashtable may be a bit too * much for our purposes. */ private Vector usedClasses = new Vector(); public static abstract class AllowMultiplesAction { // don't allow outside replacements AllowMultiplesAction() {} protected abstract boolean addedMultiple( Object singleton, Class baseClass ); public abstract String toString(); } public static final AllowMultiplesAction NO_MULTIPLES_ERROR = new AllowMultiplesAction() { protected boolean addedMultiple(Object singleton, Class baseClass) { throw new IllegalArgumentException( "Passed-in singleton "+ singleton+" has class "+baseClass.getName()+ " which has already been added to the store" ); } public String toString() { return "[No multiple entries with same class allowed "+ "without error]"; } }; public static final AllowMultiplesAction NO_MULTIPLES_SILENT = new AllowMultiplesAction() { protected boolean addedMultiple(Object singleton, Class baseClass) { // don't allow it return false; } public String toString() { return "[No multiple entries with same class allowed]"; } }; public static final AllowMultiplesAction MULTIPLES_OK = new AllowMultiplesAction() { protected boolean addedMultiple(Object singleton, Class baseClass) { // allow it return true; } public String toString() { return "[Multiple entries with same class allowed]"; } }; /** * Constructor specifying all the parameters for using a singleton in this * framework. * * @param instanceOf singletons must be of this class. * @param ama true if this store should allow * multiple instances of the exact same class, or false * if it should prevent multiple instances sharing the exact * same class. This helps to enforce the idea of 'singleton'. */ public AbstractMultipleStore( Class instanceOf, AllowMultiplesAction ama ) { this.instanceOf = instanceOf; this.usedClasses = new Vector(); this.action = ama; } /** * Returns the current inner singletons. If it has never been set, then * the default will be used instead. * * @return the inner singleton instances. * @exception IllegalStateException if no singleton was created. */ public Enumeration getSingletons() { Enumeration enum; synchronized( this ) { if (this.store.size() <= 0) { addDefaultSingletons(); if (this.store.size() <= 0) { LOG.warn( "No singleton created." ); } } enum = this.store.elements(); } return enum; } /** * Sets the singleton. It must be of the correct class, and non-null. * * @param singleton the singleton to set. * @exception IllegalArgumentException if singleton is * null, or is not of the correct type. */ public synchronized void addSingleton( Object singleton ) { if (singleton == null) { throw new IllegalArgumentException("no null arguments"); } if (this.instanceOf != null && !this.instanceOf.isInstance( singleton )) { throw new IllegalArgumentException( "Passed-in singleton "+ singleton+" is not assignable to class "+ this.instanceOf.getName()+", but is of class "+ singleton.getClass().getName() ); } Class c = singleton.getClass(); // optimization of following logic: /* if (!this.usedClasses.contains( c ) || this.action.addedMultiple( singleton, this.instanceOf )) { this.store.addElement( singleton ); this.usedClasses.addElement( c ); } */ if (this.usedClasses.contains( c )) { if (this.action.addedMultiple( singleton, this.instanceOf )) { this.store.addElement( singleton ); } } else { this.store.addElement( singleton ); this.usedClasses.addElement( c ); } } /** * Adds the default inner singletons, which is an implementation * specific method. */ protected abstract void addDefaultSingletons(); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/SPISingletonStore.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/SPISin0000644000175000017500000000715607622026464034036 0ustar drazzibdrazzib/* * @(#)SPISingletonStore.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import java.io.IOException; import org.apache.log4j.Logger; /** * Aids pluggable factories and related classes by being a central repository * for storing SPI singletons, and creating means to load and change the * singletons. *

    * This uses the same pattern as the SingletonStore class, but this * one allows for multiple singleton instances, and loads them from the * SPILoader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since June 28, 2002 * @see SingletonStore */ public class SPISingletonStore extends AbstractMultipleStore { private static final Logger LOG = Logger.getLogger( SPISingletonStore.class.getName() ); private Class baseClass; /** * Constructor specifying all the parameters for using a singleton in this * framework. * * @param instanceOf singletons must be of this class. This is also used * to load the SPI classes. * @param ama true if this store should allow * multiple instances of the exact same class, or false * if it should prevent multiple instances sharing the exact * same class. This helps to enforce the idea of 'singleton'. */ public SPISingletonStore( Class instanceOf, AllowMultiplesAction ama ) { super( instanceOf, ama ); if (instanceOf == null) { throw new IllegalArgumentException("no null arguments"); } this.baseClass = instanceOf; } /** * Adds the default inner singletons, which is an implementation * specific method. */ protected void addDefaultSingletons() { try { addSPI( null ); } catch (IOException ioe) { LOG.warn( "adding SPI caused IOException", ioe ); throw new IllegalStateException( ioe.toString() ); } } /** * Add a set of SPIs from the given class loader. */ public void addSPI( ClassLoader cl ) throws IOException { SPILoader spil = new SPILoader( this.baseClass, cl ); while (spil.hasNext()) { addSingleton( spil.nextProvier() ); } } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/ClassLoadHelper.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/ClassL0000644000175000017500000007005507622026464034110 0ustar drazzibdrazzib/* * @(#)ClassLoadHelper.java * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; import java.io.InputStream; import java.io.IOException; import java.net.URL; import java.lang.reflect.Method; import org.apache.log4j.Logger; /** * Utility class for loading classes and creating instances. Much of the * basic operation have been ripped from * net.groboutils.util.classes.v1.ClassUtil in the GroboUtils package. * If the helper's class loader is null, then it will use the Thread's * context ClassLoader. *

    * Note that resource loading is very tricky. Finding the right classloader * and right methods to invoke is JDK dependent. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since March 16, 2002 */ public class ClassLoadHelper { private static final Logger LOG = Logger.getLogger( SPILoader.class.getName() ); private static Method M_GET_CONTEXT_CLASSLOADER = discoverContextClassloaderMethod(); private static Method M_GET_RESOURCES = discoverGetResourcesMethod(); private static Method M_GET_SYSTEM_RESOURCES = discoverGetSystemResourcesMethod(); private ClassLoader classLoader = null; /** * Default constructor - will use the Thread's context class loader for * each class discovery. */ public ClassLoadHelper() { this( (ClassLoader)null ); } /** * Use the given class's classloader. * * @param clazz the class to pull the classloader from. * @exception NullPointerException if clazz is null. */ public ClassLoadHelper( Class clazz ) { this( clazz.getClassLoader() ); } /** * Loads the helper with the given class loader. If the given class loader * is null, then it will use the Thread's context class loader. * * @param cl the classloader to pull all requested classes from, or * it will use the thread's context class loader if cl is * null. * @see java.lang.Thread#getContextClassLoader() */ public ClassLoadHelper( ClassLoader cl ) { this.classLoader = cl; } //---------------------------- // Public methods /** * Loads the requested class from the helper's classloader, and returns * the Class instance, or null if the class could not be * found. * * @param name the name of the class to load. * @return the discovered Class, or null if it could not be found. */ public Class getClass( String name ) { return getClass( name, true ); } /** * Loads the requested class from the helper's classloader, and returns * the Class instance, or null if the class could not be * found. * * @param name the name of the class to load. * @param swallowExceptions true if this method is to return * @return the discovered Class, or null if it could not be found * and swallowExceptions is true. * @exception IllegalStateException if there was an error during * initialization and swallowExceptions is false. */ public Class getClass( String name, boolean swallowExceptions ) { Class c = null; if (name != null) { Throwable error = null; try { c = loadClass( name ); } catch (ClassNotFoundException cnfe) { error = cnfe; } catch (LinkageError le) { error = le; } catch (IllegalArgumentException iae) { error = iae; } if (error != null) { LOG.info( "getClass( "+name+" ) threw exception", error ); if (!swallowExceptions) { throw new IllegalStateException( error.toString() ); } } } else { c = null; } return c; } /** * Creates a new instance of the class with the given className * using the default constructor. If there was an error during the * creation, such as the class was not found, the class does not have * a default constructor, or the constructor threw an exception, then * null is returned. * * @param className the name of the class to create an instance. * @return the new instance, or null if there was a problem. * @see #getClass( String ) * @see #createObject( String, boolean ) * @see #createObject( Class ) * @see #createObject( Class, boolean ) */ public Object createObject( String className ) { return createObject( getClass( className ), true ); } /** * Creates a new instance of the class with the given className * using the default constructor. If there was an error during the * creation, such as the class was not found, the class does not have * a default constructor, or the constructor threw an exception, then an * IllegalStateException will be thrown only if swallowExceptions * is false; otherwise, null will be returned. * * @param className the name of the class to create an instance. * @param swallowExceptions true if this method is to return * null on any exceptions, or false if it should * throw an IllegalStateException on any error. * @return the new instance. * @exception IllegalStateException if there was an error during * initialization and swallowExceptions is false. * @see #getClass( String ) * @see #createObject( String ) * @see #createObject( Class ) * @see #createObject( Class, boolean ) */ public Object createObject( String className, boolean swallowExceptions ) { return createObject( getClass( className, swallowExceptions ), swallowExceptions ); } /** * Creates an Object from the given Class, using its default constructor. * All creation exceptions are swallowed. If the object could not * be created, then null is returned. * * @param c the Class object from which a new instance will be created * using its default constructor. * @return the instantiated object, or null if c is * null, or if there was an error during initialization. */ public Object createObject( Class c ) { return createObject( c, true ); } /** * Creates an Object from the given Class, using its default constructor. * If there was an error during the * creation, such as the class was not found, the class does not have * a default constructor, or the constructor threw an exception, then an * IllegalStateException will be thrown only if swallowExceptions * is false; otherwise, null will be returned. * * @param c the Class object from which a new instance will be created * using its default constructor. * @param swallowExceptions true if this method is to return * null on any exceptions, or false if it should * throw an IllegalStateException on any error. * @return the instantiated object, or null if c is * null, or if there was an error during initialization and * swallowExceptions is true. * @exception IllegalStateException if there was an error during * initialization and swallowExceptions is false. */ public Object createObject( Class c, boolean swallowExceptions ) { if (c == null) { return null; } Throwable error = null; Object obj = null; try { obj = c.newInstance(); } catch (InstantiationException ie) { error = ie; } catch (IllegalAccessException iae) { error = iae; } catch (NoSuchMethodError nsme) { error = nsme; } if (error != null) { LOG.info( "createObject( "+c+" ) threw exception", error ); if (!swallowExceptions) { // Note about error.getMessage(): JDK 1.1 may have a 'null' // error message thrown above. Some test cases have // encountered this. throw new IllegalStateException( "Could not instantiate " + c.getName() + ": " + error.toString() ); } } // else return obj; } /** * Loads an object using the {@link #createObject( String, boolean )} * method above, using the given System property's value as the * class name. If the System property is not defined, then it resorts to * the default class. * * @param propertyClassName the System Property name, whose value will be * used as a fully-qualified Class name to load and instantiate and * return. * @param defaultClass if the System Property propertyClassName * is not defined, then this will be the class to instantiate and * return. * @param swallowExceptions true if this method is to return * null on any exceptions, or false if it should * throw an IllegalStateException on any error. * @return the instantiated class. * @exception IllegalStateException if there was an error during * initialization and swallowExceptions is false. */ public Object createObjectFromProperty( String propertyClassName, Class defaultClass, boolean swallowExceptions ) { return createObjectFromProperty( propertyClassName, defaultClass, null, swallowExceptions ); } /** * Loads an object using the {@link #createObject( String, boolean )} * method above, using the given Hashtable's property's value as the * class name. If the Hashtable property is not defined, then it resorts to * the default class. If the Hashtable is null, then the * System property will be used instead. * * @param propertyClassName the System Property name, whose value will be * used as a fully-qualified Class name to load and instantiate and * return. * @param defaultClass if the System Property propertyClassName * is not defined, then this will be the class to instantiate and * return. * @param properties a Hashtable of String -> String mappings. * @param swallowExceptions true if this method is to return * null on any exceptions, or false if it should * throw an IllegalStateException on any error. * @return the instantiated class. * @exception IllegalStateException if there was an error during * initialization and swallowExceptions is false. */ public Object createObjectFromProperty( String propertyClassName, Class defaultClass, Hashtable properties, boolean swallowExceptions ) { Object o = null; String cname = null; if (properties == null) { cname = System.getProperty( propertyClassName ); } else { cname = (String)properties.get( propertyClassName ); } if (cname == null) { o = createObject( defaultClass, swallowExceptions ); } else { o = createObject( cname, swallowExceptions ); } return o; } /** * Loads a resource with the given name, using the correct ClassLoader. * Does not swallow exceptions. See the JDK documentation on resources * (they are pretty much files that are in the classpath of the * classloader). Yes, this can be used successfully to get a class file * (well, JDK 1.1 throws a SecurityException if this is attempted). * * @param name absolute referece to the expected resource. * @return the resource as an InputStream, which may possibly be * null. * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public InputStream getResourceAsStream( String name ) throws IOException { ClassLoader cl = getClassLoader(); InputStream is = null; if (cl == null) { name = getAbsoluteResourceName( name ); is = this.getClass().getResourceAsStream( name ); } else { is = cl.getResourceAsStream( name ); } return is; } /** * Loads a resource with the given name, using the correct ClassLoader. * Does not swallow exceptions. See the JDK documentation on resources * (they are pretty much files that are in the classpath of the * classloader). Yes, this can be used successfully to get a class file * (well, JDK 1.1 throws a SecurityException if this is attempted). * * @param name absolute referece to the expected resource. * @return the resource name as an URL, which may possibly be * null. * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public URL getResource( String name ) throws IOException { return getResource( name, getClassLoader() ); } /** * Loads a resource with the given name, using the given ClassLoader. * Does not swallow exceptions. See the JDK documentation on resources * (they are pretty much files that are in the classpath of the * classloader). Yes, this can be used successfully to get a class file * (well, JDK 1.1 throws a SecurityException if this is attempted). * * @param name absolute referece to the expected resource. * @param cl the classloader to load the reference from. * @return the resource name as an URL, which may possibly be * null. * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public URL getResource( String name, ClassLoader cl ) throws IOException { LOG.debug("Enter getResource( "+name+" )"); URL url = null; if (cl != null) { // JDK 1.2+ can be awfully fickle. Allow for an alternative // if this fails, through the use of the next IF statement. url = cl.getResource( name ); } if (url == null) { name = getAbsoluteResourceName( name ); url = this.getClass().getResource( name ); } LOG.debug("Exit getResource( "+name+" ) = '"+url+"'"); return url; } /** * Loads a resource with the given name, using the correct ClassLoader. * Does not swallow exceptions. See the JDK documentation on resources * (they are pretty much files that are in the classpath of the * classloader). Yes, this can be used successfully to get a class file * (well, JDK 1.1 throws a SecurityException if this is attempted). * * @param name absolute referece to the expected resource. * @return the resource name as an URL, which may possibly be * null. * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public URL getSystemResource( String name ) throws IOException { LOG.debug("Enter getSystemResource( "+name+" )"); URL url = ClassLoader.getSystemResource( name ); LOG.debug("Exit getSystemResource( "+name+" ) = '"+url+"'"); return url; } /** * Loads a resource with the given name, using the correct ClassLoader. * Does not swallow exceptions. See the JDK documentation on resources * (they are pretty much files that are in the classpath of the * classloader). Yes, this can be used successfully to get a class file * (well, JDK 1.1 throws a SecurityException if this is attempted). * * @param name absolute referece to the expected resource. * @return the list of resource URLs, which may NOT be null * (implementation ensures it is not null). * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResources( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public Enumeration getResources( String name ) throws IOException { return getResources( name, getClassLoader() ); } /** * Loads a resource with the given name, using the correct ClassLoader. * Does not swallow exceptions. See the JDK documentation on resources * (they are pretty much files that are in the classpath of the * classloader). Yes, this can be used successfully to get a class file * (well, JDK 1.1 throws a SecurityException if this is attempted). * * @param name absolute referece to the expected resource. * @param cl the classloader to load the references from. * @return a non-null list of resource URLs for the resource name. * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResources( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public Enumeration getResources( String name, ClassLoader cl ) throws IOException { Enumeration enum = null; if (M_GET_RESOURCES != null && cl != null) { try { LOG.debug("Getting resources for "+name); enum = (Enumeration)M_GET_RESOURCES.invoke( cl, new Object[] { name } ); //LOG.debug("Found resources "+enum); } catch (java.lang.reflect.InvocationTargetException ite) { Throwable t = ite.getTargetException(); if (t instanceof IOException) { throw (IOException)t; } // else LOG.info( "getResources( "+name+" ) threw exception.", t ); enum = null; } catch (Exception e) { LOG.info( "invoke on getResources( "+name+ " ) threw exception.", e ); enum = null; } } // Yes, for invalid resources this will be incredibly inefficient. // However, we want to be as robust as possible for those resource // names that ARE valid. JDK 1.2+ can be sooo fickle. if (enum == null || !enum.hasMoreElements()) { LOG.debug("Resource enum is null or contains nothing."); // Try system resources next enum = getSystemResources( name ); if (enum == null || !enum.hasMoreElements()) { // Try a single resource last Vector v = new Vector(); URL url = getResource( name, cl ); if (url != null) { LOG.debug( "classloader getResource returned "+url ); v.addElement( url ); } // else give up enum = v.elements(); } } return enum; } /** * Get the resource associated with the given name from the System * classloader. This will never return null. * * @param name absolute referece to the expected resource. * @return a non-null list of URLs matching the resource. * @exception IOException if an I/O error occurs. * @see java.lang.ClassLoader#getResource( String ) * @see java.lang.ClassLoader#getResources( String ) * @see java.lang.ClassLoader#getResourceAsStream( String ) */ public Enumeration getSystemResources( String name ) throws IOException { Enumeration enum = null; if (M_GET_SYSTEM_RESOURCES != null) { try { LOG.debug("Getting system resources for "+name); // static method enum = (Enumeration)M_GET_SYSTEM_RESOURCES.invoke( null, new Object[] { name } ); //LOG.debug("Found system resources "+enum); } catch (java.lang.reflect.InvocationTargetException ite) { Throwable t = ite.getTargetException(); if (t instanceof IOException) { throw (IOException)t; } // else LOG.info( "getSystemResources( "+name+ " ) threw exception.", t ); enum = null; } catch (Exception e) { LOG.info( "invoke on getResources( "+name+ " ) threw exception.", e ); enum = null; } } // Yes, for invalid resources this will be incredibly inefficient. // However, we want to be as robust as possible for those resource // names that ARE valid. if (enum == null || !enum.hasMoreElements()) { LOG.debug("Resource enum is null or contains nothing."); Vector v = new Vector(); URL url = getSystemResource( name ); if (url != null) { LOG.debug( "classloader getSystemResource returned "+url ); v.addElement( url ); } // else give up enum = v.elements(); } return enum; } //---------------------------- // Protected methods /** * Gets the correct class loader. May return null. * * @return the ClassLoader */ protected ClassLoader getClassLoader() { ClassLoader cl = this.classLoader; if (cl == null) { cl = getThreadClassLoader( Thread.currentThread() ); if (cl == null) { // JDK 1.1 may return NULL here. cl = this.getClass().getClassLoader(); } } return cl; } /** * Loads a class with the given name, using the correct ClassLoader. * Does not swallow exceptions. * * @exception ClassNotFoundException if the class name is not known by the * class loader. * @exception LinkageError if there was a basic class loader error. * @exception IllegalArgumentException if the class doesn't smell right to * JDK 1.1. */ protected Class loadClass( String name ) throws ClassNotFoundException, LinkageError, IllegalArgumentException { ClassLoader cl = getClassLoader(); Class c = null; if (name != null) { if (cl == null) { c = Class.forName( name ); } else { c = cl.loadClass( name ); } } return c; } /** * Use reflection to get the thread (context) class loader. */ protected static ClassLoader getThreadClassLoader( Thread t ) { ClassLoader cl = null; if (M_GET_CONTEXT_CLASSLOADER != null) { try { cl = (ClassLoader)M_GET_CONTEXT_CLASSLOADER.invoke(t, null); } catch (Exception e) { cl = null; } } return cl; } /** * */ protected static Method discoverContextClassloaderMethod() { Method m; try { Class c = Thread.class; m = c.getDeclaredMethod( "getContextClassLoader", new Class[0] ); } catch (Exception e) { // discovery method: exception is expected where this is not // supoorted. // LOG.info( "discoverContextClassloaderMethod() threw exception.", // e ); m = null; } return m; } /** * */ protected static Method discoverGetResourcesMethod() { Method m; try { Class c = ClassLoader.class; m = c.getDeclaredMethod( "getResources", new Class[] { String.class } ); } catch (Exception e) { // discovery method: exception is expected where this is not // supoorted. // LOG.info( "discoverGetResourcesMethod() threw exception.", // e ); m = null; } return m; } /** * */ protected static Method discoverGetSystemResourcesMethod() { Method m; try { Class c = ClassLoader.class; m = c.getDeclaredMethod( "getSystemResources", new Class[] { String.class } ); } catch (Exception e) { // discovery method: exception is expected where this is not // supoorted. // LOG.info( "discoverGetSystemResourcesMethod() threw exception.", // e ); m = null; } return m; } /** * */ protected String getAbsoluteResourceName( String name ) { // Using 'Class' getResourceAsStream, which is relative to its // package, whereas the ClassLoader is an absolute name. So, // ensure that the name is absolute to be compatible. if (name != null && name.length() > 0 && name.charAt( 0 ) != '/') { name = '/' + name; } return name; } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/IUrlClassLoader.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/IUrlCl0000644000175000017500000000534507622026464034061 0ustar drazzibdrazzib/* * @(#)IUrlClassLoader.java 1.0.0 11/17/2000 - 11:38:45 * * Copyright (C) 2000,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; /** * An interface for loading a specific class from a given URL (which is * probably a Jar file). Classes returned shouldn't be cached. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since November 17, 2000 (GroboUtils Alpha 0.9.0) */ public interface IUrlClassLoader { //---------------------------- // Public data //---------------------------- // Public abstract methods /** * Load the given class from the given URL. If the URL is null, * then it is up to the classloader to figure out where to load it from. * This should, in general, load the class from the default class loader. * * @param className the exact class name to load. * @param url the URL from which the class is loaded. If this is * null, then the returned class is implementation specific. * @return the loaded Class instance, or null if the class could * not be found. */ public Class loadClass( String className, String url ); /** * Call to flush any cache stored in the interface. This allows for * a class loader to cache results, and free up memory when it is * not needed. */ public void flush(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/AbstractSingleStore.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/classes/v1/Abstra0000644000175000017500000001127407622026464034141 0ustar drazzibdrazzib/* * @(#)AbstractSingleStore.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; /** * Aids pluggable factories and related classes by being a central repository * for storing a singleton, and creating means to load and change the singleton. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:36 $ * @since March 30, 2002 */ public abstract class AbstractSingleStore { private Class instanceOf; private Object singleton; /** * Constructor specifying all the parameters for using a singleton in this * framework. * * @param instanceOf singletons must be of this class. */ public AbstractSingleStore( Class instanceOf ) { this.instanceOf = instanceOf; } /** * Returns the current inner singleton. If it has never been set, then * the default will be used instead. * * @return the inner singleton instance. * @exception IllegalStateException if no singleton was created. */ public Object getSingleton() { synchronized( this ) { if (this.singleton == null) { setDefaultSingleton(); if (this.singleton == null) { throw new IllegalStateException( "No singleton created." ); } } } return this.singleton; } /** * Sets the singleton. It must be of the correct class, and non-null. * * @param singleton the singleton to set. * @exception IllegalArgumentException if singleton is * null, or is not of the correct type. */ public synchronized void setSingleton( Object singleton ) { if (singleton == null) { throw new IllegalArgumentException("no null arguments"); } if (this.instanceOf != null && !this.instanceOf.isInstance( singleton )) { throw new IllegalArgumentException( "Passed-in singleton "+ singleton+" is not assignable to class "+ this.instanceOf.getName()+", but is of class "+ singleton.getClass().getName() ); } this.singleton = singleton; } /** * Sets the inner singleton to the default, which is an implementation * specific method. */ protected abstract void setDefaultSingleton(); /** * Helper method to load an object from the class specified in the given * system property; if the class is invalid, then the given default * class will be used instead. No cast testing is performed. * * @param key the System property to reference for the classname to * instantiate. It is passed to ClassLoadHelper. * @param defaultClass class to instantiate if the class defined in the * system property is invalid. * @return the generated object. * @exception IllegalArgumentException if key is null. * @see ClassLoadHelper#createObjectFromProperty( String, Class, boolean ) */ protected static Object createFromProperty( String key, Class defaultClass ) { if (key == null) { throw new IllegalArgumentException("no null args"); } ClassLoadHelper clh = new ClassLoadHelper(); return clh.createObjectFromProperty( key, defaultClass, false ); } } libgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/0000755000175000017500000000000010011472770032770 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/0000755000175000017500000000000011271425773033330 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/ChainableExceptionHelper.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/Chai0000644000175000017500000002127207655644605034133 0ustar drazzibdrazzib/* * @(#)ChainableExceptionHelper.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.PrintStream; import java.io.PrintWriter; import java.io.Serializable; /** * Helper class to support easy-to-implement chainable exceptions. In * most situations, it is close to impossible to create a generic chainable * exception due to inheritance restrictions on the Java exception hierarchy * (this shows a Java weakness - exception categories should be interfaces, * not specific classes). *

    * This will attempt to use the owning source's initCause() and * getCause() methods, provided the owning source provides those * methods. Only the superclass's implementation that provides these methods * yet does not implement IChainableException will be used * (to prevent a possible recursion nightmare). *

    * In order to prevent endless recursion, this class will not look at the * JDK 1.4 implementation of the source exception. This used to work with * JDK 1.4.0, but JDK 1.4.2 seems to have broken the original implementation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since July 7, 2002 */ public class ChainableExceptionHelper implements Serializable { private Throwable source; /** * The chained-to cause for this exception. Note that if the source cause * is set and allows the cause to be set, then this cause will be null. * If the source cannot store the cause, then this cause will be set to * the correct cause, which may be null. */ private Throwable cause; /** * Flag to indicate if the cause was ever set. Needed, since the set cause * may be null. */ private boolean causeSet = false; /** * Sets the owning throwable. The initCause() method can still be * called after this constructor is used. */ public ChainableExceptionHelper( Throwable source ) { if (source == null) { throw new IllegalArgumentException("no null arguments"); } this.source = source; } public ChainableExceptionHelper( Throwable source, Throwable cause ) { this( source ); initCause( cause ); } /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Returns the cause of this throwable or null if the cause is * nonexistent or unknown. (The cause is the throwable that caused this * throwable to get thrown.) *

    * This implementation returns the cause that was supplied via one of the * constructors requiring a Throwable, or that was set after * creation with the initCause( Throwable ) method. While it is * typically unnecessary to override this method, a subclass can override * it to return a cause set by some other means. This is appropriate for a * "legacy chained throwable" that predates the addition of chained * exceptions to Throwable. Note that it is not necessary to * override any of the PrintStackTrace methods, all of which * invoke the getCause method to determine the cause of a throwable. *

    * * @return the cause of this throwable or null if the cause is * nonexistent or unknown. */ public Throwable getCause() { Throwable t = null; if (this.causeSet) { // may still be null t = this.cause; } return t; } /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Initializes the cause of this throwable to the specified value. * (The cause is the throwable that caused this throwable to get thrown.) *

    * This method can be called at most once. It is generally called from * within the constructor, or immediately after creating the throwable. * If this throwable was created with Throwable(Throwable) or * Throwable(String,Throwable), this method cannot be called even once. *

    * * @param cause the cause (which is saved for later retrieval by the * getCause() method). (A null value is permitted, and indicates * that the cause is nonexistent or unknown.) * @param source the exception that will be the underlying exception * @return a reference to this Throwable instance. * @exception IllegalArgumentException if cause is this throwable. * (A throwable cannot be its own cause.) * @exception IllegalStateException if this throwable was created with * Throwable(Throwable) or Throwable(String,Throwable), or this * method has already been called on this throwable. */ public synchronized Throwable initCause( Throwable cause ) { if (this.causeSet) { throw new IllegalStateException("Already set cause"); } if (cause == this.source) { throw new IllegalArgumentException( "exception cannot cause itself." ); } this.causeSet = true; this.cause = cause; return this.source; } /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintStream ps ) { this.source.printStackTrace( ps ); if (shouldDisplayCause()) { ps.println( getUnderlyingExceptionSeparator() ); Throwable t = getCause(); if (t == null) { ps.println( getUnknownExceptionString() ); } else { t.printStackTrace( ps ); } } } /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintWriter pw ) { this.source.printStackTrace( pw ); if (shouldDisplayCause()) { pw.println( getUnderlyingExceptionSeparator() ); Throwable t = getCause(); if (t == null) { pw.println( getUnknownExceptionString() ); } else { t.printStackTrace( pw ); } } } protected String getUnderlyingExceptionSeparator() { return "-------- Underlying exception --------"; } protected String getUnknownExceptionString() { return "Unknown or non-existent exception"; } protected boolean shouldDisplayCause() { // if the cause was never set, then don't display the cause. // if it was set (even if null), then we should display it. if (!this.causeSet) { return false; } // we need to do it. return true; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/ChainableException.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/Chai0000644000175000017500000001355307734122337034125 0ustar drazzibdrazzib/* * @(#)ChainableException.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.PrintStream; import java.io.PrintWriter; /** * General chainable exception, for pseudo-JDK 1.4 support. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/09/23 19:54:07 $ * @since July 7, 2002 */ public class ChainableException extends Exception implements IChainableException { /** * @serial */ private ChainableExceptionHelper ceh; public ChainableException() { super(); this.ceh = new ChainableExceptionHelper( this ); } public ChainableException( String message ) { super( message ); this.ceh = new ChainableExceptionHelper( this ); } public ChainableException( Throwable cause ) { super(); this.ceh = new ChainableExceptionHelper( this, cause ); } public ChainableException( Throwable cause, String message ) { this( message, cause ); } public ChainableException( String message, Throwable cause ) { super( message ); this.ceh = new ChainableExceptionHelper( this, cause ); } /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Returns the cause of this throwable or null if the cause is * nonexistent or unknown. (The cause is the throwable that caused this * throwable to get thrown.) *

    * This implementation returns the cause that was supplied via one of the * constructors requiring a Throwable, or that was set after * creation with the initCause( Throwable ) method. While it is * typically unnecessary to override this method, a subclass can override * it to return a cause set by some other means. This is appropriate for a * "legacy chained throwable" that predates the addition of chained * exceptions to Throwable. Note that it is not necessary to * override any of the PrintStackTrace methods, all of which * invoke the getCause method to determine the cause of a throwable. *

    * * @return the cause of this throwable or null if the cause is * nonexistent or unknown. */ public synchronized Throwable getCause() { return this.ceh.getCause(); } /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Initializes the cause of this throwable to the specified value. * (The cause is the throwable that caused this throwable to get thrown.) *

    * This method can be called at most once. It is generally called from * within the constructor, or immediately after creating the throwable. * If this throwable was created with Throwable(Throwable) or * Throwable(String,Throwable), this method cannot be called even once. *

    * * @param cause the cause (which is saved for later retrieval by the * getCause() method). (A null value is permitted, and indicates * that the cause is nonexistent or unknown.) * @return a reference to this Throwable instance. * @exception IllegalArgumentException if cause is this throwable. * (A throwable cannot be its own cause.) * @exception IllegalStateException if this throwable was created with * Throwable(Throwable) or Throwable(String,Throwable), or this * method has already been called on this throwable. */ public synchronized Throwable initCause( Throwable cause ) { return this.ceh.initCause( cause ); } /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintStream ps ) { this.ceh.printStackTrace( ps ); } /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintWriter pw ) { this.ceh.printStackTrace( pw ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/ThrowableParser.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/Thro0000644000175000017500000001464707734122337034202 0ustar drazzibdrazzib/* * @(#)ThrowableParser.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.StringWriter; import java.io.PrintWriter; import java.io.BufferedReader; import java.io.StringReader; import java.util.Vector; import java.lang.reflect.Method; //import org.apache.log4j.Logger; /** * Parses a Throwable's stack trace into its components. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/09/23 19:54:07 $ */ public class ThrowableParser { //private static final Logger LOG = Logger.getLogger( // ThrowableParser.class.getName() ); // JDK 1.1+ private BufferedReader traceReader; // JDK 1.4+ private Object[] traceList; private int traceIndex; private static final String JDK14_GST_METHOD = "getStackTrace"; private static final Class[] JDK14_GST_METHOD_ARGS = new Class[0]; private static final String JDK14_GC_METHOD = "getCause"; private static final Class[] JDK14_GC_METHOD_ARGS = new Class[0]; /** * Only piecemeal iterates through the stack-trace. Supports the JDK 1.4 * StackTraceElement class. */ public ThrowableParser( Throwable t ) { if (t == null) { throw new IllegalArgumentException("no null arguments"); } parseThrowable( t ); } /** * @return null if there are no more lines, or the next line * in the list. */ public synchronized StackTraceLineParser next() { if (this.traceList != null) { return next14(); } // else return next11(); } //------------------------------------------------------------------------- /** * */ protected StackTraceLineParser next11() { //LOG.debug( "finding next stack trace line for JDK 1.1+" ); while (true) { String line; try { line = this.traceReader.readLine(); //LOG.debug("trace line = '"+line+"'"); } catch (java.io.IOException ioe) { throw new IllegalStateException("Never supposed to happen: "+ ioe ); } if (line == null) { //LOG.debug("end-of-stack trace."); return null; } try { StackTraceLineParser stlp = new StackTraceLineParser( line ); // found a valid line return stlp; } catch (Exception e) { // not a valid line. Continue. //LOG.debug(" - not a valid line",e); } } } /** * */ protected StackTraceLineParser next14() { //LOG.debug( "finding next stack trace line for JDK 1.4+" ); if (this.traceIndex >= this.traceList.length) { return null; } // this will throw an exception if the parser does not know this // type. That's fine. That will show a bug in this implementation. StackTraceLineParser stlp = new StackTraceLineParser( this.traceList[ this.traceIndex ] ); ++this.traceIndex; return stlp; } protected void parseThrowable( Throwable t ) { try { // Construct the trace from the complete trace chain. Vector trace = new Vector(); while (t != null) { Class c = t.getClass(); Method m = c.getDeclaredMethod( JDK14_GST_METHOD, JDK14_GST_METHOD_ARGS ); Object[] o = (Object[])m.invoke( t, null ); if (o != null) { for (int i = 0; i < o.length; ++i) { trace.addElement( o[i] ); } } // find cause of t m = c.getDeclaredMethod( JDK14_GC_METHOD, JDK14_GC_METHOD_ARGS ); t = (Throwable)m.invoke( t, null ); } Object[] o = new Object[ trace.size() ]; trace.copyInto( o ); this.traceList = o; this.traceIndex = 0; //LOG.info("Parsing: using JDK 1.4 method."); } catch (ThreadDeath td) { // don't ever gulp these throw td; } catch (Throwable th) { // use JDK 1.1+ compatible method parseThrowableBuffer( t ); } } protected void parseThrowableBuffer( Throwable t ) { //LOG.info("Parsing: reverted to JDK 1.1 compatible method."); StringWriter sw = new StringWriter(); t.printStackTrace( new PrintWriter( sw ) ); StringReader sr = new StringReader( sw.toString() ); this.traceReader = new BufferedReader( sr ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/StackTraceLineParser.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/Stac0000644000175000017500000002405207736117714034154 0ustar drazzibdrazzib/* * @(#)StackTraceLineParser.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.lang.reflect.Method; //import org.apache.log4j.Logger; /** * Encompasses the line on which a Stack Trace occurs. Should not call * this "StackTraceElement", since that's a JDK 1.4 class in the java.lang * package. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/09/29 21:10:36 $ */ public class StackTraceLineParser { //private static final Logger LOG = Logger.getLogger( // StackTraceLineParser.class.getName() ); private String className; private String methodName; private int lineNumber; private static final String JDK14_STE_CLASS = "java.lang.StackTraceElement"; private static final String JDK14_STE_GCN = "getClassName"; private static final Class[] JDK14_STE_GCN_ARGS = new Class[0]; private static final String JDK14_STE_GLN = "getLineNumber"; private static final Class[] JDK14_STE_GLN_ARGS = new Class[0]; private static final String JDK14_STE_GMN = "getMethodName"; private static final Class[] JDK14_STE_GMN_ARGS = new Class[0]; private static final String ST_START = "at "; // Check if we are running in IBM's visual age. // - it has a different stack trace private static boolean IN_VISUAL_AGE = false; static { try { Class dummy = Class.forName("com.ibm.uvm.tools.DebugSupport"); IN_VISUAL_AGE = true; //LOG.info("Using VisualAge style stack traces."); } catch (Throwable e) { // ignore. We're not in visual age. //LOG.info("Using standard JDK style stack traces."); } } public StackTraceLineParser( String className, String methodName ) { this( className, methodName, -1 ); } public StackTraceLineParser( String className, String methodName, int lineNumber ) { if (className == null || methodName == null) { throw new IllegalArgumentException("no null arguments"); } if (lineNumber < 0) { lineNumber = -1; } this.lineNumber = lineNumber; this.className = className; this.methodName = methodName; } /** * Parses a JDK 1.4 StackTraceElement or a stack trace line. * * @exception IllegalArgumentException if this is not a recognizable stack * trace line, or is null, or is not a StackTraceElement. */ public StackTraceLineParser( Object obj ) { if (obj == null) { throw new IllegalArgumentException("no null arguments"); } if (obj instanceof String) { parseLine( (String)obj ); } else { parseElement( obj ); } } public String getClassName() { return this.className; } public String getMethodName() { return this.methodName; } public int getLineNumber() { return this.lineNumber; } public String toString() { return getClassName() + '#' + getMethodName() + " (line " + getLineNumber() + ')'; } //------------------------------------------------------------------------- // Protected methods protected void parseLine( String line ) { String nl = line.trim(); //LOG.debug("parsing trace line '"+line+"'."); int startPos = 0; if (!IN_VISUAL_AGE) { if (nl.startsWith(ST_START)) { startPos += ST_START.length(); } else { //LOG.debug("trace line does not start with '"+ST_START+"'."); notValidStackTraceLine( line ); } } int endNamePos = nl.lastIndexOf('('); if (endNamePos < startPos) { //LOG.debug("no '(' in trace line."); notValidStackTraceLine( line ); } int lastDot = nl.lastIndexOf('.', endNamePos ); if (lastDot < startPos) { //LOG.debug("No '.' in trace line before last '(', which is at "+ // endNamePos+"."); notValidStackTraceLine( line ); } this.methodName = findMethodName( nl, startPos, lastDot, endNamePos ); this.className = findClassName( nl, startPos, lastDot, endNamePos ); this.lineNumber = findLineNumber( nl, startPos, lastDot, endNamePos ); } /** * */ protected String findMethodName( String line, int startPos, int lastDot, int endNamePos ) { String name = line.substring( lastDot+1, endNamePos ).trim(); //LOG.debug("Parsed method name out to '"+name+"'."); return name; } /** * */ protected String findClassName( String line, int startPos, int lastDot, int endNamePos ) { String name = line.substring( startPos, lastDot ).trim(); //LOG.debug("Parsed class name out to '"+name+"'."); return name; } /** * */ protected int findLineNumber( String line, int startPos, int lastDot, int endNamePos ) { int ln = -1; if (!IN_VISUAL_AGE) { int lineNumberStart = line.indexOf( ':', endNamePos ); if (lineNumberStart > 0) { //LOG.debug("line number is at position "+lineNumberStart+"."); int lineNumberEnd = line.indexOf( ')', lineNumberStart ); if (lineNumberEnd > 0) { //LOG.debug("final ')', after line number, is at "+ // lineNumberEnd+"."); try { String lineNumber = line.substring( lineNumberStart+1, lineNumberEnd ); //LOG.debug("line number text is "+lineNumber+"."); ln = Integer.parseInt( lineNumber ); } catch (NumberFormatException e) { //LOG.debug("line number text is not a number."); ln = -1; } } else { //LOG.debug("stack trace text does not have a final ')'"); } } else { //LOG.debug("stack trace text did not provide line number "+ // "information."); } } return ln; } /** * We may not be in JDK 1.4 during compilation or runtime, but we * can support it through reflection anyway. */ protected void parseElement( Object el ) { Class c = el.getClass(); if (String.class.equals( c )) { // specialized method for internal usage checks. throw new IllegalStateException("Incorrect method invoked."); } if (!JDK14_STE_CLASS.equals( c.getName() )) { throw new IllegalArgumentException( "Object "+el+ " is not of type "+JDK14_STE_CLASS+ ", but rather of type "+c.getName() ); } Method gcn; Method gln; Method gmn; try { gcn = c.getDeclaredMethod( JDK14_STE_GCN, JDK14_STE_GCN_ARGS ); gln = c.getDeclaredMethod( JDK14_STE_GLN, JDK14_STE_GLN_ARGS ); gmn = c.getDeclaredMethod( JDK14_STE_GMN, JDK14_STE_GMN_ARGS ); } catch (NoSuchMethodException nsme) { throw new IllegalArgumentException( "Object "+el+ " does not support the JDK 1.4 specification of "+ JDK14_STE_CLASS ); } String cn; int ln; String mn; try { cn = (String)gcn.invoke( el, null ); ln = ((Integer)gln.invoke( el, null )).intValue(); mn = (String)gmn.invoke( el, null ); } catch (Exception e) { throw new IllegalArgumentException( "Object "+el+ " could not retrieve values for JDK 1.4 specification of "+ JDK14_STE_CLASS ); } this.className = cn; this.lineNumber = ln; this.methodName = mn; } protected void notValidStackTraceLine( String line ) { throw new IllegalArgumentException("Line ["+ line+"] is not a valid stack-trace line"); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/IChainableException.javalibgroboutils-java-5.orig/util-classes/sources/dev/net/sourceforge/groboutils/util/throwable/v1/ICha0000644000175000017500000001164307622026466034065 0ustar drazzibdrazzib/* * @(#)IChainableException.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.PrintStream; import java.io.PrintWriter; /** * Marker interface to tell the ChainableExceptionHelper not to use * this class's getCause method. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:38 $ * @since July 7, 2002 */ public interface IChainableException { // list all methods that must be re-implemented in the exception. /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Returns the cause of this throwable or null if the cause is * nonexistent or unknown. (The cause is the throwable that caused this * throwable to get thrown.) *

    * This implementation returns the cause that was supplied via one of the * constructors requiring a Throwable, or that was set after * creation with the initCause( Throwable ) method. While it is * typically unnecessary to override this method, a subclass can override * it to return a cause set by some other means. This is appropriate for a * "legacy chained throwable" that predates the addition of chained * exceptions to Throwable. Note that it is not necessary to * override any of the PrintStackTrace methods, all of which * invoke the getCause method to determine the cause of a throwable. *

    * * @return the cause of this throwable or null if the cause is * nonexistent or unknown. */ public Throwable getCause(); /** * JDK 1.4 compatible method. *

    * from the JDK 1.4 documentation: *

    * Initializes the cause of this throwable to the specified value. * (The cause is the throwable that caused this throwable to get thrown.) *

    * This method can be called at most once. It is generally called from * within the constructor, or immediately after creating the throwable. * If this throwable was created with Throwable(Throwable) or * Throwable(String,Throwable), this method cannot be called even once. *

    * * @param cause the cause (which is saved for later retrieval by the * getCause() method). (A null value is permitted, and indicates * that the cause is nonexistent or unknown.) * @return a reference to this Throwable instance. * @exception IllegalArgumentException if cause is this throwable. * (A throwable cannot be its own cause.) * @exception IllegalStateException if this throwable was created with * Throwable(Throwable) or Throwable(String,Throwable), or this * method has already been called on this throwable. */ public Throwable initCause( Throwable cause ); /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintStream ps ); /** * For non-JDK 1.4 compatible VMs, this overrides the original behavior * to describe the underlying cause. Special logic is performed to ensure * that no JDK 1.4 VM is being used when the inner exception is displayed * (in order to prevent double printing). */ public void printStackTrace( PrintWriter pw ); } libgroboutils-java-5.orig/util-classes/sources/dev/about.txt0000644000175000017500000000015207521071672024403 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/util-classes/sources/ut/0000755000175000017500000000000011271425773022406 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/0000755000175000017500000000000010011472771023163 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/0000755000175000017500000000000010011472771025506 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472771027677 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/0000755000175000017500000000000010011472772030655 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/0000755000175000017500000000000010011472771032311 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/0000755000175000017500000000000011271425773032650 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/0000755000175000017500000000000011271425773033500 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/UrlClassLoaderOnlineUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/Ur0000644000175000017500000001303607655644605034024 0ustar drazzibdrazzib/* * @(#)UrlClassLoaderOnlineUTest.java 0.9.0 23-May-2001 - 14:40 * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk0; import net.sourceforge.groboutils.util.classes.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Just like util.http.tests, this uses the Sourceforge account to ensure * that the URLs work correctly. It loads the sample applet "BeliefOfTheDay" * to make sure that this is able to load classes remotely. * As insurance, this also tests to make sure that the same applet is not * in the current classpath. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since June 28, 2002 */ public class UrlClassLoaderOnlineUTest extends TestCase { private static final Class THIS_CLASS = UrlClassLoaderOnlineUTest.class; public static final String BELIEF_CLASS = IUrlClassLoaderOnlineUTestI.BELIEF_CLASS; public static final String BELIEF_JAR = IUrlClassLoaderOnlineUTestI.BELIEF_JAR; public UrlClassLoaderOnlineUTest( String name ) { super( name ); } public static Test suite() { InterfaceTestSuite suite = IUrlClassLoaderOnlineUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return createLoader(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } protected static UrlClassLoader createLoader() { return new UrlClassLoader(); } public void testFlush1() { // override the original, because we can better test the flushing // mechanism. UrlClassLoader loader = createLoader(); // load up bytecode from a separate location Class c = loader.loadClass( BELIEF_CLASS, BELIEF_JAR ); assertNotNull( "loadClass( "+BELIEF_CLASS+ " ) returned null.", c ); assertEquals( "loadClass( "+BELIEF_CLASS+ " ) returned the wrong class.", BELIEF_CLASS, c.getName() ); // this needs to be run in the same test, to ensure we don't load the // same class if referenced from a different JAR. byte b[] = loader.getBytecode( BELIEF_CLASS ); assertNotNull( "getBytecode( "+BELIEF_CLASS+" ) returned null.", b ); assertTrue( "getBytecode( "+BELIEF_CLASS+" ) returned no data.", b.length > 0 ); loader.flush(); // make sure the bytecode was properly eliminated. b = loader.getBytecode( BELIEF_CLASS ); assertEquals( "getBytecode( "+BELIEF_CLASS+" ) did not return null.", null, b ); } public void testGetBytecode1() { UrlClassLoader loader = (UrlClassLoader)createLoader(); // load up bytecode from a separate location Class c = null; // I've had time-out issues with sourceforge. Try 3 times. for (int i = 0; i < 3 && c == null; ++i) { c = loader.loadClass( BELIEF_CLASS, BELIEF_JAR ); } assertNotNull( "loadClass( "+BELIEF_CLASS+ " ) returned null 3 times.", c ); assertEquals( "loadClass( "+BELIEF_CLASS+ " ) returned the wrong class.", BELIEF_CLASS, c.getName() ); // this needs to be run in the same test, to ensure we don't load the // same class if referenced from a different JAR. byte b[] = loader.getBytecode( BELIEF_CLASS ); assertNotNull( "getBytecode( "+BELIEF_CLASS+" ) returned null.", b ); assertTrue( "getBytecode( "+BELIEF_CLASS+" ) returned no data.", b.length > 0 ); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/ArrayClassLoaderUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/Ar0000644000175000017500000001307307622026467033773 0ustar drazzibdrazzib/* * @(#)ArrayClassLoaderUTest.java 0.9.0 23-May-2001 - 14:40 * * Copyright (C) 2001,2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk0; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Just like util.http.tests, this uses the Sourceforge account to ensure * that the URLs work correctly. It loads the sample applet "BeliefOfTheDay" * to make sure that this is able to load classes remotely. * As insurance, this also tests to make sure that the same applet is not * in the current classpath. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:39 $ * @since May 23, 2001 */ public class ArrayClassLoaderUTest extends TestCase { private static final Class THIS_CLASS = ArrayClassLoaderUTest.class; public ArrayClassLoaderUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public void testInstantiate() { new ArrayClassLoader(); } private class NullBytecodeSource implements BytecodeSource { public byte[] getBytecode( String classname ) { return null; } } public void testSetBytecodeSource() { ArrayClassLoader acl = new ArrayClassLoader(); acl.setBytecodeSource( new NullBytecodeSource() ); } public void testSetBytecodeSourceNull() { ArrayClassLoader acl = new ArrayClassLoader(); acl.setBytecodeSource( null ); // should not throw an exception } public void testAddClassNull1() { ArrayClassLoader acl = new ArrayClassLoader(); try { acl.addClass( null, null ); } catch (IllegalArgumentException iae) { return; } assertTrue( "Did not throw an IllegalArgumentException with null args.", true ); } public void testAddClassNull2() { ArrayClassLoader acl = new ArrayClassLoader(); try { acl.addClass( "SomeClass", null ); } catch (IllegalArgumentException iae) { return; } assertTrue( "Did not throw an IllegalArgumentException with null args.", true ); } public void testAddClassNull3() { ArrayClassLoader acl = new ArrayClassLoader(); try { acl.addClass( null, new byte[0] ); } catch (IllegalArgumentException iae) { return; } assertTrue( "Did not throw an IllegalArgumentException with null args.", true ); } public void testLoadClassNull1() throws ClassNotFoundException { ArrayClassLoader acl = new ArrayClassLoader(); try { acl.loadClass( null, true ); fail( "Did not throw an IllegalArgumentException with null args." ); } catch (IllegalArgumentException iae) { // check error return; } } public void testLoadClassBad1() { ArrayClassLoader acl = setupLoader(); try { acl.loadClass( BAD_CLASS, true ); fail("Did not throw an Exception with a bad class."); } catch (ClassFormatError cfe) { // check error? } catch (ClassNotFoundException cnfe) { // check error? } } protected static final String BAD_CLASS = "BadClass"; protected ArrayClassLoader setupLoader() { ArrayClassLoader acl = new ArrayClassLoader(); acl.addClass( BAD_CLASS, new byte[0] ); return acl; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/UrlClassLoaderUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk0/Ur0000644000175000017500000001574307655644605034033 0ustar drazzibdrazzib/* * @(#)UrlClassLoaderUTest.java 0.9.0 23-May-2001 - 14:40 * * Copyright (C) 2001,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk0; import net.sourceforge.groboutils.util.classes.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.InputStream; import java.io.IOException; import java.net.URL; /** * Offline version of this test. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since May 23, 2001 */ public class UrlClassLoaderUTest extends TestCase { private static final Class THIS_CLASS = UrlClassLoaderUTest.class; public UrlClassLoaderUTest( String name ) { super( name ); } public static Test suite() { InterfaceTestSuite suite = IUrlClassLoaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return createLoader(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } protected static UrlClassLoader createLoader() { return new UrlClassLoader(); } public static class MyInner { // default constructor implied } public static final String MY_INNER_RES = "UrlClassLoaderUTest$MyInner.class"; public static final String MY_INNER_CLASS = MyInner.class.getName(); public static final String MY_INNER_FULL_RES = '/' + MY_INNER_CLASS.replace( '.', '/' ) + ".class"; public static class InnerClass { public InnerClass() { // do nothing } } public void testFlush1() { // override the original, because we can better test the flushing // mechanism. UrlClassLoader loader = createLoader(); // load up bytecode from a separate location URL url = this.getClass().getResource( MY_INNER_RES ); assertNotNull( "No resource found for "+MY_INNER_RES, url ); System.out.println("Found class in URL "+url); String urlStr = url.toString(); if (urlStr.endsWith( MY_INNER_FULL_RES )) { urlStr = urlStr.substring( 0, urlStr.length() - MY_INNER_FULL_RES.length() ); } Class c = loader.loadClass( MY_INNER_CLASS, urlStr ); assertNotNull( "loadClass( "+MY_INNER_CLASS+" ) returned null.", c ); assertEquals( "loadClass( "+MY_INNER_CLASS+ " ) returned the wrong class.", MyInner.class.getName(), c.getName() ); byte b[] = loader.getBytecode( MY_INNER_CLASS ); assertGetBytecodeResult( MY_INNER_CLASS, b, url ); loader.flush(); // make sure the bytecode was properly eliminated. b = loader.getBytecode( MY_INNER_CLASS ); assertEquals( "getBytecode( "+MY_INNER_CLASS+" ) did not return null.", null, b ); } public void testGetBytecode1() { UrlClassLoader loader = (UrlClassLoader)createLoader(); // load up bytecode from a separate location URL url = this.getClass().getResource( MY_INNER_RES ); assertNotNull( "No resource for inner class "+MY_INNER_RES, url ); System.out.println("Found class in URL "+url); String urlStr = url.toString(); if (urlStr.endsWith( MY_INNER_FULL_RES )) { urlStr = urlStr.substring( 0, urlStr.length() - MY_INNER_FULL_RES.length() ); } Class c = loader.loadClass( MY_INNER_CLASS, urlStr ); assertNotNull( "loadClass( "+MY_INNER_CLASS+" ) returned null.", c ); assertEquals( "loadClass( "+MY_INNER_CLASS+ " ) returned the wrong class.", MY_INNER_CLASS, c.getName() ); byte b[] = loader.getBytecode( MY_INNER_CLASS ); assertGetBytecodeResult( MY_INNER_CLASS, b, url ); } protected void assertGetBytecodeResult( String className, byte[] result, URL sourceURL ) { if (result == null) { // JDK 1.1 won't let us load a Class file through the resource // - it will through a SecurityException. No way around this, // I guess. try { InputStream is = sourceURL.openStream(); is.close(); fail("getBytecode( "+className+" ) returned null, "+ "but no SecurityException was thrown." ); } catch (SecurityException e) { // this is fine - JDK 1.1 or whatever is behaving // (unfortunately) as expected. } catch (IOException ioe) { ioe.printStackTrace(); fail("Should not have encountered an IOException."); } } else { //assertNotNull( "getBytecode( "+className+ // " ) returned null.", result ); assertTrue( "getBytecode( "+className+" ) returned no data.", result.length > 0 ); } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/IUrlClassLoaderUTestI.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/IUrlCla0000644000175000017500000001211507622026467034070 0ustar drazzibdrazzib/* * @(#)IUrlClassLoaderUTestI.java 0.9.0 23-May-2001 - 14:40 * * Copyright (C) 2001,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.net.URL; /** * Offline tests. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:39 $ * @since May 23, 2001 (GroboUtils Alpha 0.9.0) */ public class IUrlClassLoaderUTestI extends InterfaceTestCase { private static final Class THIS_CLASS = IUrlClassLoaderUTestI.class; public IUrlClassLoaderUTestI( String name, ImplFactory f ) { super( name, IUrlClassLoader.class, f ); } public IUrlClassLoader createLoader() { return (IUrlClassLoader)createImplObject(); } public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } //------------------------------------------------------------------------- protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public void testInstantiate() { assertNotNull( "Creation should not return null.", createLoader() ); } public static class MyInner { // default constructor implied } public static final String MY_INNER_RES = "IUrlClassLoaderUTestI$MyInner.class"; public static final String MY_INNER_CLASS = MyInner.class.getName(); public static final String MY_INNER_FULL_RES = '/' + MY_INNER_CLASS.replace( '.', '/' ) + ".class"; public static class InnerClass { public InnerClass() { // do nothing } } public static final String BELIEF_CLASS = "BeliefOfTheDay"; public void testGetClass1() { IUrlClassLoader loader = createLoader(); Class c = loader.loadClass( MY_INNER_CLASS, null ); assertNotNull( "loadClass( "+MY_INNER_CLASS+ " ) returned null.", c ); assertEquals( "Did not load the class from the default classloader.", MyInner.class, c ); } public void testGetClass2() { IUrlClassLoader loader = createLoader(); Class c = loader.loadClass( BELIEF_CLASS, null ); assertEquals( "getClass( Belief ) was found in the default classloader.", null, c ); } public void testGetClass3() { IUrlClassLoader loader = createLoader(); URL url = this.getClass().getResource( MY_INNER_RES ); assertNotNull( "Did not find resource for inner class "+ MY_INNER_RES, url ); System.out.println("Found class in URL "+url); String urlStr = url.toString(); if (urlStr.endsWith( MY_INNER_FULL_RES )) { urlStr = urlStr.substring( 0, urlStr.length() - MY_INNER_FULL_RES.length() ); } Class c = loader.loadClass( MY_INNER_CLASS, urlStr ); assertNotNull( "getClass( "+MY_INNER_CLASS+" ) returned null.", c ); assertEquals( "getClass( "+MY_INNER_CLASS+" ) returned the wrong class.", MY_INNER_CLASS, c.getName() ); } public void testFlush1() { IUrlClassLoader loader = createLoader(); Class c = loader.loadClass( this.getClass().getName(), null ); loader.flush(); // Can't really test this for correctness, just for error throwing. // Testing for GC size is really inaccurate. } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/SPILoaderUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/SPILoad0000644000175000017500000001216707622026467034037 0ustar drazzibdrazzib/* * @(#)SPILoaderUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the SPILoader class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:39 $ * @since June 29, 2002 */ public class SPILoaderUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = SPILoaderUTest.class; public SPILoaderUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() throws Exception { try { new SPILoader( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // examine exception? } } public void testConstructor2() throws Exception { try { new SPILoader( null, null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // examine exception? } } public void testConstructor3() throws Exception { new SPILoader( THIS_CLASS ); } public void testConstructor4() throws Exception { new SPILoader( THIS_CLASS, null ); } public void testHasNext1() throws Exception { SPILoader spil = new SPILoader( THIS_CLASS ); assertTrue( "SPILoaderUTest should not have a prop def file, and so should "+ "not have a 'next'.", !spil.hasNext() ); } public void testHasNext2() throws Exception { // this is valid - we put this in the unit test hierarchy SPILoader spil = new SPILoader( Object.class ); assertTrue( "Object should have a prop def file in classpath with entries.", spil.hasNext() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk2/0000755000175000017500000000000011271425773033502 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk2/UrlClassLoaderJDK12UTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk2/Ur0000644000175000017500000001044307655644605034025 0ustar drazzibdrazzib/* * @(#)UrlClassLoaderJDK12UTest.java 0.9.0 23-May-2001 - 14:40 * * Copyright (C) 2001,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk2; import net.sourceforge.groboutils.util.classes.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.net.URL; /** * Just like util.http.tests, this uses the Sourceforge account to ensure * that the URLs work correctly. It loads the sample applet "BeliefOfTheDay" * to make sure that this is able to load classes remotely. * As insurance, this also tests to make sure that the same applet is not * in the current classpath. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since May 23, 2001 */ public class UrlClassLoaderJDK12UTest extends TestCase { private static final Class THIS_CLASS = UrlClassLoaderJDK12UTest.class; public UrlClassLoaderJDK12UTest( String name ) { super( name ); } public static Test suite() { InterfaceTestSuite suite = IUrlClassLoaderUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return createLoader(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } protected static UrlClassLoader createLoader() { return new UrlClassLoader(); } //--------------------------------------- // Super class has many base tests public void testConvertUrl1() { assertNull( "returned URL must be null.", createLoader().convertUrl( null ) ); } public void testConvertUrl2() { URL url = createLoader().convertUrl( "http://yo.mama" ); assertNotNull( "convertURL returned null.", url ); // JDK 1.2 adds an extra '/' to the end of the URL if (!url.toString().equals( "http://yo.mama" ) && !url.toString().equals( "http://yo.mama/" )) { fail("convertURL did not format right: it returned '"+ url.toString()+"'"); } } public void testConvertUrl3() { URL url = createLoader().convertUrl( "afile.txt" ); assertNotNull( "convertURL returned null.", url ); assertEquals( "convertURL did not format right.", url.toString(), "file:afile.txt" ); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk2/UrlClassLoaderOnlineJDK12UTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/jdk2/Ur0000644000175000017500000001032407655644605034023 0ustar drazzibdrazzib/* * @(#)UrlClassLoaderOnlineJDK12UTest.java 0.9.0 23-May-2001 - 14:40 * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1.jdk2; import net.sourceforge.groboutils.util.classes.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.net.URL; /** * Just like util.http.tests, this uses the Sourceforge account to ensure * that the URLs work correctly. It loads the sample applet "BeliefOfTheDay" * to make sure that this is able to load classes remotely. * As insurance, this also tests to make sure that the same applet is not * in the current classpath. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since June 28, 2002 */ public class UrlClassLoaderOnlineJDK12UTest extends TestCase { private static final Class THIS_CLASS = UrlClassLoaderOnlineJDK12UTest.class; public UrlClassLoaderOnlineJDK12UTest( String name ) { super( name ); } public static Test suite() { InterfaceTestSuite suite = IUrlClassLoaderOnlineUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return createLoader(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } protected static UrlClassLoader createLoader() { return new UrlClassLoader(); } //--------------------------------------- // Super class has many base tests public void testConvertUrl1() { assertNull( "returned URL must be null.", createLoader().convertUrl( null ) ); } public void testConvertUrl2() { URL url = createLoader().convertUrl( "http://yo.mama" ); assertNotNull( "convertURL returned null.", url ); assertTrue( "convertURL did not format right (received "+url+").", url.toString().equals( "http://yo.mama" ) || url.toString().equals( "http://yo.mama/" ) ); } public void testConvertUrl3() { URL url = createLoader().convertUrl( "afile.txt" ); assertNotNull( "convertURL returned null.", url ); assertEquals( "convertURL did not format right.", url.toString(), "file:afile.txt" ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/ClassLoadHelperUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/ClassLo0000644000175000017500000002565307622026466034147 0ustar drazzibdrazzib/* * @(#)ClassLoadHelperUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ClassLoadHelper class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:38 $ * @since March 1, 2002 */ public class ClassLoadHelperUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ClassLoadHelperUTest.class; public ClassLoadHelperUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new ClassLoadHelper(); } public void testConstructor2() { try { new ClassLoadHelper( (Class)null ); fail("Did not throw NullPointerException"); } catch (NullPointerException npe) { // check exception? } } public void testConstructor2a() { new ClassLoadHelper( (ClassLoader)null ); } public void testConstructor3() { new ClassLoadHelper( createClassLoader() ); } public void testGetClass1() { ClassLoadHelper clh = new ClassLoadHelper(); Class c = clh.getClass( null ); assertNull( "Null string should return null.", c ); } private static final String BAD_CLASS_NAME_1 = ""; // totally wrong class name - can never exist due to naming rules. private static final String BAD_CLASS_NAME_2 = "java.lang.2-Not A Class"; public void testGetClass2() { ClassLoadHelper clh = new ClassLoadHelper(); Class c = clh.getClass( BAD_CLASS_NAME_1 ); assertNull( "Bad class name should return null.", c ); } public void testGetClass3() { ClassLoadHelper clh = new ClassLoadHelper(); Class c = clh.getClass( BAD_CLASS_NAME_2 ); assertNull( "Bad class name should return null.", c ); } public void testGetClass4() { ClassLoadHelper clh = new ClassLoadHelper(); Class c = clh.getClass( String.class.getName() ); assertEquals( "Should have returned the String class with the same classloader "+ "as the one that loaded ourself.", String.class, c ); } public interface MyInterface {} public class MyInnerClass {} public static class MyGoodClass {} public void testCreateObjectS1() { ClassLoadHelper clh = new ClassLoadHelper(); Object o = clh.createObject( (String)null ); assertNull( "Null string should return null.", o ); } public void testCreateObjectS2() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that doesn't exist Object o = clh.createObject( BAD_CLASS_NAME_1 ); assertNull( "Bad class name should return null.", o ); } public void testCreateObjectS3() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that doesn't exist Object o = clh.createObject( BAD_CLASS_NAME_2 ); assertNull( "Bad class name should return null.", o ); } public void testCreateObjectS4() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that can't be instantiated Object o = clh.createObject( MyInterface.class.getName() ); assertNull( "Interface should return null.", o ); } public void testCreateObjectS5() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that can't be instantiated from this context Object o = clh.createObject( MyInnerClass.class.getName() ); assertNull( "Inner class should return null.", o ); } public void testCreateObjectS6() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that can't be instantiated due to no default constructor Object o = clh.createObject( this.getClass().getName() ); assertNull( "No-default constructor class should return null.", o ); } public void testCreateObjectS7() { ClassLoadHelper clh = new ClassLoadHelper(); Object o = clh.createObject( MyGoodClass.class.getName() ); assertNotNull( "Good class should not return null.", o ); assertEquals( "Good class should be of the correct class.", MyGoodClass.class, o.getClass() ); } public void testCreateObjectSZ1() { ClassLoadHelper clh = new ClassLoadHelper(); // does not throw exception Object o = clh.createObject( (String)null, false ); assertNull( "Null string should return null.", o ); } public void testCreateObjectSZ2() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that doesn't exist try { Object o = clh.createObject( BAD_CLASS_NAME_1, false ); fail( "Did not throw an IllegalStateException: retrieved "+o ); } catch (IllegalStateException ise) { // inspect exception? } } public void testCreateObjectSZ3() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that doesn't exist try { Object o = clh.createObject( BAD_CLASS_NAME_2, false ); fail( "Did not throw an IllegalStateException: retrieved "+o ); } catch (IllegalStateException ise) { // inspect exception? } } public void testCreateObjectSZ4() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that can't be instantiated try { Object o = clh.createObject( MyInterface.class.getName(), false ); fail( "Did not throw an IllegalStateException: retrieved "+o ); } catch (IllegalStateException ise) { // inspect exception? } } public void testCreateObjectSZ5() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that can't be instantiated from this context try { Object o = clh.createObject( MyInnerClass.class.getName(), false ); fail( "Did not throw an IllegalStateException: retrieved "+o ); } catch (IllegalStateException ise) { // inspect exception? } } public void testCreateObjectSZ6() { ClassLoadHelper clh = new ClassLoadHelper(); // Class that can't be instantiated due to no default constructor try { Object o = clh.createObject( this.getClass().getName(), false ); fail( "Did not throw an IllegalStateException." ); } catch (IllegalStateException ise) { // inspect exception? } } public void testCreateObjectSZ7() { ClassLoadHelper clh = new ClassLoadHelper(); Object o = clh.createObject( MyGoodClass.class.getName(), false ); assertNotNull( "Good class should not return null.", o ); assertEquals( "Good class should be of the correct class.", MyGoodClass.class, o.getClass() ); } //------------------------------------------------------------------------- // Helpers protected ClassLoader createClassLoader() { return new ClassLoader() { public Class loadClass( String s, boolean f ) { return null; } }; } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/ClassUtilOnlineUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/ClassUt0000644000175000017500000000742407622026466034161 0ustar drazzibdrazzib/* * @(#)ClassUtilOnlineUTest.java 0.9.0 17-APR-2001 - 14:40 * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests only the ClassUtil tests that are online. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:38 $ * @since June 28, 2002 */ public class ClassUtilOnlineUTest extends TestCase { private static final Class THIS_CLASS = ClassUtilOnlineUTest.class; public ClassUtilOnlineUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } private static final String BELIEF_CLASS = "BeliefOfTheDay"; private static final String BELIEF_JAR = "http://groboutils.sourceforge.net/Belief.jar"; public static class InnerClass { public InnerClass() { // do nothing } } public void testGetClass1() { ClassUtil util = startTest(); Class c = util.getClass( BELIEF_CLASS, BELIEF_JAR ); assertNotNull( "getClass( "+BELIEF_CLASS+" ) returned null.", c ); assertEquals( "getClass( "+BELIEF_CLASS+" ) returned the wrong class.", BELIEF_CLASS, c.getName() ); } public void testCreateObject1() { ClassUtil util = startTest(); Object o = util.createObject( BELIEF_CLASS, BELIEF_JAR ); assertEquals( "createObject( "+BELIEF_CLASS+", "+BELIEF_JAR+ " ) did not instantiate the remote class.", BELIEF_CLASS, o.getClass().getName() ); } //--------------------------------- // we must assert that the ClassUtil is fresh to avoid incorrect // behavior. protected ClassUtil startTest() { ClassUtil util = ClassUtil.getInstance(); util.flush(); return util; } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/ClassUtilUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/ClassUt0000644000175000017500000001777307622026466034171 0ustar drazzibdrazzib/* * @(#)ClassUtilUTest.java 0.9.0 17-APR-2001 - 14:40 * * Copyright (C) 2001,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * This is the off-line version of the ClassUtil unit tests. * As insurance, this tests to make sure that the online test version applet is * not in the current classpath. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:38 $ * @since April 17, 2001 (GroboUtils Alpha 0.9.0) */ public class ClassUtilUTest extends TestCase { private static final Class THIS_CLASS = ClassUtilUTest.class; public ClassUtilUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public void testInstantiate1() { assertNotNull( "Singleton method returned null.", ClassUtil.getInstance() ); } private static final String BELIEF_CLASS = "BeliefOfTheDay"; public static class InnerClass { public InnerClass() { // do nothing } } public void testGetClass1() { ClassUtil util = startTest(); Class c = util.getClass( THIS_CLASS.getName() ); assertNotNull( "getClass( "+THIS_CLASS.getName()+" ) returned null.", c ); assertEquals( "Did not load the class from the default classloader.", THIS_CLASS, c ); } public void testGetClass2() { ClassUtil util = startTest(); Class c = util.getClass( BELIEF_CLASS ); assertEquals( "getClass( Belief ) was found in the default classloader.", null, c ); } public void testGetClass3() { ClassUtil util = startTest(); Class c = util.getClass( THIS_CLASS.getName(), null ); assertNotNull( "getClass( "+THIS_CLASS.getName()+" ) returned null.", c ); assertEquals( "Did not load the class from the default classloader.", THIS_CLASS, c ); } public void testGetClass4() { ClassUtil util = startTest(); Class c = util.getClass( BELIEF_CLASS, null ); assertEquals( "getClass( Belief ) was found in the default classloader.", null, c ); } public void testFlush1() { ClassUtil util = startTest(); // there really isn't a way to test that this works correctly, // other than monitoring the GC and memory. } public void testCreateObject1() { ClassUtil util = startTest(); Object o = util.createObject( InnerClass.class.getName() ); assertNotNull( "getClass( "+InnerClass.class.getName()+ " ) returned null.", o ); assertEquals( "Did not load the class from the default classloader.", InnerClass.class, o.getClass() ); } public void testCreateObject2() { ClassUtil util = startTest(); // since this class does not have a default constructor, // this must fail Object o = util.createObject( THIS_CLASS.getName() ); assertEquals( "Incorrectly loaded the class which doesn't have a "+ "default constructor.", null, o ); } public void testCreateObject3() { ClassUtil util = startTest(); // since ClassUtil cannot have a public constructor, this must fail // due to lack-of permissions Object o = util.createObject( ClassUtil.class.getName() ); if (o != null) { System.out.println("Warning - your JVM allowed the creation of "+ "an object which has a 'protected' level default constructor."); } /* see above warning assertEquals( "createObject( ClassUtil ) did not fail due to invalid access "+ "permissions.", null, o ); */ } public void testCreateObject4() { ClassUtil util = startTest(); Object o = util.createObject( BELIEF_CLASS ); assertEquals( "createObject( "+BELIEF_CLASS+" ) incorrectly found a class.", null, o ); } public void testCreateObject5() { ClassUtil util = startTest(); Object o = util.createObject( InnerClass.class.getName(), null ); assertNotNull( "getClass( "+InnerClass.class.getName()+ " ) returned null.", o ); assertEquals( "Did not load the class from the default classloader.", InnerClass.class, o.getClass() ); } public void testCreateObject6() { ClassUtil util = startTest(); // since this class does not have a default constructor, // this must fail Object o = util.createObject( THIS_CLASS.getName(), null ); assertEquals( "Incorrectly loaded the class which doesn't have a "+ "default constructor.", null, o ); } public void testCreateObject7() { ClassUtil util = startTest(); assertEquals( "Did not return a null instance with a null class.", null, util.createObject( (Class)null ) ); } public void testCreateObject8() { ClassUtil util = startTest(); Object o = util.createObject( InnerClass.class ); assertNotNull( "Returned null from creating a proper class.", o ); assertEquals( "Did not create a proper class.", InnerClass.class, o.getClass() ); } public void tsetIsJdk2Compatible1() { ClassUtil util = startTest(); // don't know how to test this other than what ClassUtil does. util.isJdk2Compatible(); } //--------------------------------- // we must assert that the ClassUtil is fresh to avoid incorrect // behavior. protected ClassUtil startTest() { ClassUtil util = ClassUtil.getInstance(); util.flush(); return util; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/SingletonStoreUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/Singlet0000644000175000017500000001603007622026467034202 0ustar drazzibdrazzib/* * @(#)SingletonStoreUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the SingletonStore class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:39 $ * @since March 1, 2002 */ public class SingletonStoreUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = SingletonStoreUTest.class; public SingletonStoreUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new SingletonStore( null, null, null ); } public void testConstructor2() { new SingletonStore( this.getClass(), null, null ); } public void testConstructor3() { new SingletonStore( null, this.getClass(), null ); } public void testConstructor4() { new SingletonStore( null, null, "a" ); } public void testConstructor5() { new SingletonStore( this.getClass(), this.getClass(), null ); } public void testConstructor6() { new SingletonStore( this.getClass(), null, "a" ); } public void testConstructor7() { new SingletonStore( null, this.getClass(), "a" ); } public void testConstructor8() { new SingletonStore( this.getClass(), this.getClass(), "a" ); } public void testSetSingleton1() { SingletonStore ss = new SingletonStore( null, null, null ); Object o = "a"; ss.setSingleton( o ); assertEquals( "did not return the same set singleton", o, ss.getSingleton() ); } public void testSetSingleton2() { SingletonStore ss = new SingletonStore( String.class, null, null ); Object o = "a"; ss.setSingleton( o ); assertEquals( "did not return the same set singleton", o, ss.getSingleton() ); } public void testSetSingleton3() { SingletonStore ss = new SingletonStore( String.class, null, null ); try { ss.setSingleton( null ); } catch (IllegalArgumentException iae) { // test exception? } } public void testSetSingleton4() { SingletonStore ss = new SingletonStore( String.class, null, null ); Object o = new Object(); try { ss.setSingleton( o ); } catch (IllegalArgumentException iae) { // test exception? } } public void testGetSingleton1() { SingletonStore ss = new SingletonStore( null, null, null ); try { ss.getSingleton(); } catch (IllegalArgumentException iae) { // test exception? } } public void testGetSingleton2() { // create a non-existent property name. String propertyName = "-"; while (System.getProperty( propertyName ) != null) { propertyName += "-"; } SingletonStore ss = new SingletonStore( null, null, propertyName ); try { ss.getSingleton(); } catch (IllegalArgumentException iae) { // test exception? } } public void testGetSingleton3() { // create a non-existent property name. String propertyName = "-"; while (System.getProperty( propertyName ) != null) { propertyName += "-"; } SingletonStore ss = new SingletonStore( null, Object.class, propertyName ); Object o = ss.getSingleton(); assertEquals( "Did not create a singleton of the correct type.", Object.class, o.getClass() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/IUrlClassLoaderOnlineUTestI.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/classes/v1/IUrlCla0000644000175000017500000001116607655644605034103 0ustar drazzibdrazzib/* * @(#)IUrlClassLoaderOnlineUTestI.java * * Copyright (C) 2001,2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.classes.v1; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Just like util.http.tests, this uses the Sourceforge account to ensure * that the URLs work correctly. It loads the sample applet "BeliefOfTheDay" * to make sure that this is able to load classes remotely. * As insurance, this also tests to make sure that the same applet is not * in the current classpath. *

    * The system must have access to the internet to correctly run this test. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:01 $ * @since May 23, 2001 (GroboUtils Alpha 0.9.0) */ public class IUrlClassLoaderOnlineUTestI extends InterfaceTestCase { private static final Class THIS_CLASS = IUrlClassLoaderOnlineUTestI.class; public IUrlClassLoaderOnlineUTestI( String name, ImplFactory f ) { super( name, IUrlClassLoader.class, f ); } public IUrlClassLoader createLoader() { return (IUrlClassLoader)createImplObject(); } public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } //------------------------------------------------------------------------- protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public void testInstantiate() { assertNotNull( "Creation should not return null.", createLoader() ); } public static final String BELIEF_CLASS = "BeliefOfTheDay"; public static final String BELIEF_JAR = "http://groboutils.sourceforge.net/Belief.jar"; public static class InnerClass { public InnerClass() { // do nothing } } public void testGetClass1() { IUrlClassLoader loader = createLoader(); Class c = loader.loadClass( this.getClass().getName(), null ); assertNotNull( "loadClass( "+this.getClass().getName()+ " ) returned null.", c ); assertEquals( "Did not load the class from the default classloader.", this.THIS_CLASS, c ); c = loader.loadClass( BELIEF_CLASS, null ); assertEquals( "getClass( Belief ) was found in the default classloader.", null, c ); } public void testGetClass2() { IUrlClassLoader loader = createLoader(); Class c = loader.loadClass( BELIEF_CLASS, BELIEF_JAR ); assertNotNull( "getClass( "+BELIEF_CLASS+" ) returned null.", c ); assertEquals( "getClass( "+BELIEF_CLASS+" ) returned the wrong class.", BELIEF_CLASS, c.getName() ); } public void testFlush() { IUrlClassLoader loader = createLoader(); Class c = loader.loadClass( this.getClass().getName(), null ); loader.flush(); // Can't really test this for correctness, just for error throwing. // Testing for GC size is really inaccurate. } } libgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/0000755000175000017500000000000010011472772032644 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/0000755000175000017500000000000011271425773033202 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/ChainableExceptionUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/Chain0000644000175000017500000001226007655644606034161 0ustar drazzibdrazzib/* * @(#)ChainableExceptionUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; import java.io.ByteArrayOutputStream; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ChainableException class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:02 $ * @since March 17, 2002 */ public class ChainableExceptionUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ChainableExceptionUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public ChainableExceptionUTest( String name ) { super( name ); DOC.getLog().info( "ChainableExceptionUTest() constructor"); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testAllTestsCoveredByInterfaceTests() { // do nothing } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static class CEFactory implements IChainableExceptionUTestI.IChainableExceptionFactory { public IChainableException createException() { return new ChainableException(); } public IChainableException createException( String message ) { return new ChainableException( message ); } public IChainableException createException( Throwable cause ) { return new ChainableException( cause ); } public IChainableException createException( String message, Throwable cause ) { return new ChainableException( message, cause ); } public IChainableException createException( Throwable cause, String message ) { return new ChainableException( cause, message ); } } public static Test suite() { InterfaceTestSuite suite = IChainableExceptionUTestI.suite(); // all tests are covered by the interface tests, so don't need this // line. But will add it for insurance in case tests are needed later. suite.addTestSuite( THIS_CLASS ); DOC.getLog().info( "Adding factory to suite." ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { DOC.getLog().info( "Creating factory implementation object." ); return new CEFactory(); //return null; } } ); DOC.getLog().info( "Returning suite." ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/StackTraceLineParserUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/Stack0000644000175000017500000001567007622026473034202 0ustar drazzibdrazzib/* * @(#)StackTraceLineParserUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the StackTraceLineParser class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:43 $ * @since March 17, 2002 */ public class StackTraceLineParserUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = StackTraceLineParserUTest.class; public StackTraceLineParserUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new StackTraceLineParser( null, null ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException e) { // parse exception? } } public void testConstructor2() { try { new StackTraceLineParser( "me", null ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException e) { // parse exception? } } public void testConstructor3() { try { new StackTraceLineParser( null, "you" ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException e) { // parse exception? } } public void testConstructor4() { try { new StackTraceLineParser( null, null, 1 ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException e) { // parse exception? } } public void testConstructor5() { try { new StackTraceLineParser( "me", null, 1 ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException e) { // parse exception? } } public void testConstructor6() { try { new StackTraceLineParser( null, "you", 1 ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException e) { // parse exception? } } public void testInit1() { StackTraceLineParser stlp = new StackTraceLineParser( "me", "you" ); assertEquals( "Did not save class name right.", "me", stlp.getClassName() ); assertEquals( "Did not save method name right.", "you", stlp.getMethodName() ); assertEquals( "Did not save default line number right.", -1, stlp.getLineNumber() ); } public void testInit2() { StackTraceLineParser stlp = new StackTraceLineParser( "me", "you", -100 ); assertEquals( "Did not save class name right.", "me", stlp.getClassName() ); assertEquals( "Did not save method name right.", "you", stlp.getMethodName() ); assertEquals( "Did not set out-of-range line number right.", -1, stlp.getLineNumber() ); } public void testInit3() { StackTraceLineParser stlp = new StackTraceLineParser( "me", "you", 100 ); assertEquals( "Did not save class name right.", "me", stlp.getClassName() ); assertEquals( "Did not save method name right.", "you", stlp.getMethodName() ); assertEquals( "Did not save line number right.", 100, stlp.getLineNumber() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/ThrowableParserUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/Throw0000644000175000017500000001216507622026473034234 0ustar drazzibdrazzib/* * @(#)ThrowableParserUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.log4j.Logger; /** * Tests the ThrowableParser class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:43 $ * @since March 17, 2002 */ public class ThrowableParserUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ThrowableParserUTest.class; private static final Logger LOG = Logger.getLogger( THIS_CLASS ); public ThrowableParserUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new ThrowableParser( null ); fail("did not throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor2() { new ThrowableParser( new Throwable() ); } /** * More of a UIT than a UT... */ public void testTrace1() { Throwable t = new Throwable(); t.fillInStackTrace(); ThrowableParser tp = new ThrowableParser( t ); boolean foundMe = false; while (true) { StackTraceLineParser stlp = tp.next(); if (stlp == null) break; LOG.info( "Stack trace: "+stlp ); if (stlp.getClassName().equals( this.getClass().getName() )) { LOG.debug( "foundMe == true" ); foundMe = true; } else { LOG.debug( "stack class name '"+stlp.getClassName()+ "' did not match this class name '"+ this.getClass().getName() + "'." ); } } LOG.debug( "foundMe == "+foundMe ); assertTrue( "Did not find this class in the stack trace.", foundMe ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/IChainableExceptionUTestI.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/IChai0000644000175000017500000002245007655644606034116 0ustar drazzibdrazzib/* * @(#)IChainableExceptionUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; import java.io.ByteArrayOutputStream; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.junit.v1.iftc.*; /** * Tests the IChainableException interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/06 05:35:02 $ * @since March 17, 2002 */ public class IChainableExceptionUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Due to the way exceptions work, most of the logic is involved in the // constructor. Hence, we'll use an alternative pattern to the standard // ImplFactory, where it will return a factory (below) that will create // exceptions using the correct constructor. public static interface IChainableExceptionFactory { public IChainableException createException(); public IChainableException createException( String message ); public IChainableException createException( Throwable cause ); public IChainableException createException( String message, Throwable cause ); public IChainableException createException( Throwable cause, String message ); } //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IChainableExceptionUTestI.class; public IChainableExceptionUTestI( String name, ImplFactory f ) { super( name, IChainableExceptionFactory.class, f ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } private IChainableExceptionFactory createChainableExceptionFactory() { return (IChainableExceptionFactory)createImplObject(); } protected IChainableException createException() { IChainableException ce = createChainableExceptionFactory(). createException(); assertIsRealChainableException( ce ); return ce; } protected IChainableException createException( String message ) { IChainableException ce = createChainableExceptionFactory(). createException( message ); assertIsRealChainableException( ce ); return ce; } protected IChainableException createException( Throwable cause ) { IChainableException ce = createChainableExceptionFactory(). createException( cause ); assertIsRealChainableException( ce ); return ce; } protected IChainableException createException( String message, Throwable cause ) { IChainableException ce = createChainableExceptionFactory(). createException( message, cause ); assertIsRealChainableException( ce ); return ce; } protected IChainableException createException( Throwable cause, String message ) { IChainableException ce = createChainableExceptionFactory(). createException( cause, message ); assertIsRealChainableException( ce ); return ce; } //------------------------------------------------------------------------- // Tests public void testEmptyConstructor1() { IChainableException ce = createException(); assertNull( "Cause is not null.", ce.getCause() ); } public void testEmptyConstructor2() { IChainableException ce = createException(); Throwable t = new Throwable(); ce.initCause( t ); assertEquals( "Cause is not right.", t, ce.getCause() ); } public void testEmptyConstructor3() { IChainableException ce = createException(); try { ce.initCause( (Throwable)ce ); fail( "Did not throw IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // check exception } } public void testCauseConstructor1() { Throwable t = null; IChainableException ce = createException( t ); assertNull( "Cause is not null.", ce.getCause() ); } public void testCauseConstructor2() { Throwable t = new Throwable(); IChainableException ce = createException( t ); assertEquals( "Cause is not right.", t, ce.getCause() ); } public void testCauseConstructor3() { Throwable t = new Throwable(); IChainableException ce = createException( t ); try { ce.initCause( t ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ise) { // check exception } } public void testCauseConstructor4() { IChainableException ce = createException( (Throwable)null ); try { ce.initCause( null ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ise) { // check exception } } public void testCauseConstructor5() { IChainableException ce = createException( (Throwable)null ); try { ce.initCause( new Throwable() ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ise) { // check exception } } public void testCauseConstructor6() { IChainableException ce = createException( new Throwable() ); try { ce.initCause( null ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException ise) { // check exception } } public void testCauseConstructor7() { IChainableException ce = createException( new Throwable() ); try { // order is important here - already set the throwable, so that // will be thrown first. ce.initCause( (Throwable)ce ); fail( "Did not throw IllegalStateException." ); } catch (IllegalStateException iae) { // check exception } } //------------------------------------------------------------------------- // Helpers private void assertIsRealChainableException( IChainableException ce ) { assertNotNull( ce ); assertTrue( "Class under test ("+ce.getClass()+") is not an exception.", ce instanceof Throwable ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/ChainableExceptionHelperUTest.javalibgroboutils-java-5.orig/util-classes/sources/ut/net/sourceforge/groboutils/util/throwable/v1/Chain0000644000175000017500000003464707622026472034163 0ustar drazzibdrazzib/* * @(#)ChainableExceptionHelperUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.throwable.v1; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; import java.io.ByteArrayOutputStream; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the ChainableExceptionHelper class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:42 $ * @since March 17, 2002 */ public class ChainableExceptionHelperUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ChainableExceptionHelperUTest.class; public ChainableExceptionHelperUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1a() { Throwable source = new Throwable(); new ChainableExceptionHelper( source ); } public void testConstructor1b() { try { new ChainableExceptionHelper( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // test exception? } } public void testConstructor2a() { Throwable source = new Throwable(); Throwable cause = new Throwable(); new ChainableExceptionHelper( source, null ); } public void testConstructor2b() { Throwable source = new Throwable(); Throwable cause = new Throwable(); new ChainableExceptionHelper( source, cause ); } public void testConstructor2c() { Throwable source = new Throwable(); Throwable cause = new Throwable(); try { new ChainableExceptionHelper( null, null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // test exception? } } public void testConstructor2d() { Throwable source = new Throwable(); Throwable cause = new Throwable(); try { new ChainableExceptionHelper( null, cause ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // test exception? } } public void testConstructor2e() { Throwable source = new Throwable(); Throwable cause = new Throwable(); try { new ChainableExceptionHelper( source, source ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { // test exception? } } public void testGetCause1() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); assertNull( "Does not have a null cause.", ceh.getCause() ); } public void testGetCause2() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, null ); assertNull( "Does not have a null cause.", ceh.getCause() ); } public void testGetCause3() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, cause ); assertEquals( "Does not have right cause.", ceh.getCause(), cause ); } public void testInitCause1() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); assertEquals( "Did not return right exception.", ceh.initCause( cause ), source ); } public void testInitCause2() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); assertEquals( "Did not return right exception.", ceh.initCause( null ), source ); } public void testInitCause3() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, cause ); try { ceh.initCause( cause ); fail("Did not throw IllegalStateException"); } catch (IllegalStateException ise) { // test exception? } } public void testInitGetCause1() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ceh.initCause( cause ); assertEquals( "Did not return right cause.", ceh.getCause(), cause ); } public void testInitGetCause2() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ceh.initCause( null ); assertNull( "Did not return right cause.", ceh.getCause() ); } public void testInitGetCause3() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, cause ); assertEquals( "Did not return right cause.", ceh.getCause(), cause ); } public void testInitGetCause4() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, null ); assertNull( "Did not return right cause.", ceh.getCause() ); } public void testPrintStackTrace1() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); StringWriter sw = new StringWriter(); ceh.printStackTrace( new PrintWriter( sw, true ) ); // check sw result. assertTrue( "Not a valid length", sw.toString().length() > 0 ); } public void testPrintStackTrace2() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ceh.printStackTrace( new PrintStream( baos, true ) ); // check sw result. assertTrue( "Not a valid length", baos.toString().length() > 0 ); } public void testPrintStackTrace3() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ceh.initCause( cause ); StringWriter sw = new StringWriter(); ceh.printStackTrace( new PrintWriter( sw, true ) ); // check sw result. assertTrue( "Not a valid length", sw.toString().length() > 0 ); } public void testPrintStackTrace4() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ceh.initCause( cause ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ceh.printStackTrace( new PrintStream( baos, true ) ); // check sw result. assertTrue( "Not a valid length", baos.toString().length() > 0 ); } public void testInitGetCause5() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ceh.initCause( null ); StringWriter sw = new StringWriter(); ceh.printStackTrace( new PrintWriter( sw, true ) ); // check sw result. assertTrue( "Not a valid length", sw.toString().length() > 0 ); } public void testInitGetCause6() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source ); ceh.initCause( null ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ceh.printStackTrace( new PrintStream( baos, true ) ); // check sw result. assertTrue( "Not a valid length", baos.toString().length() > 0 ); } public void testInitGetCause7() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, cause ); StringWriter sw = new StringWriter(); ceh.printStackTrace( new PrintWriter( sw, true ) ); // check sw result. assertTrue( "Not a valid length", sw.toString().length() > 0 ); } public void testInitGetCause8() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, cause ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ceh.printStackTrace( new PrintStream( baos, true ) ); // check sw result. assertTrue( "Not a valid length", baos.toString().length() > 0 ); } public void testInitGetCause9() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, null ); StringWriter sw = new StringWriter(); ceh.printStackTrace( new PrintWriter( sw, true ) ); // check sw result. assertTrue( "Not a valid length", sw.toString().length() > 0 ); } public void testInitGetCause10() { Throwable source = new Throwable(); Throwable cause = new Throwable(); ChainableExceptionHelper ceh = new ChainableExceptionHelper( source, null ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ceh.printStackTrace( new PrintStream( baos, true ) ); // check sw result. assertTrue( "Not a valid length", baos.toString().length() > 0 ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/util-classes/sources/ut/META-INF/0000755000175000017500000000000010011472771023535 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/META-INF/services/0000755000175000017500000000000011271425773025371 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/ut/META-INF/services/java.lang.Object0000644000175000017500000000012307521071673030355 0ustar drazzibdrazzib# Sample used by the SPILoader unit test # java.lang.Object java.util.Hashtable libgroboutils-java-5.orig/util-classes/sources/ut/about.txt0000644000175000017500000000012207521071673024253 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/util-classes/sources/iut/0000755000175000017500000000000011271425773022557 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/iut/about.txt0000644000175000017500000000021107521071673024423 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/util-classes/sources/eut/0000755000175000017500000000000011271425773022553 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/sources/eut/about.txt0000644000175000017500000000015307521071673024424 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/util-classes/CHANGES.TXT0000644000175000017500000000517407734122146021750 0ustar drazzibdrazzib v1.0.0 * Updated build to reflect new version, and moved out of alpha/RC into real release. * Added new documentation. * Removed some Log4j references, in order to remove dependencies. v1.0.0rc1 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Created two primary javac structures - one for jdk 1.1, and one for jdk1.2+. * Integrated the GroboUtils 'util.classes' hierarchy into this hierarchy. * Removed GroboUtils 'FileClass' utility. Instead, use 'java.util.Properties' to load the file, and for each key in the file, load it as a class through the ClassUtil or ClassLoadHelper classes. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/util-classes/xdocs/0000755000175000017500000000000011271425773021413 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-classes/xdocs/summary.xml0000644000175000017500000000274307706770543023646 0ustar drazzibdrazzib util-classes Class Helpers net.sourceforge.groboutils.util.classes.v1 Utilities that allow for easy access to Classes and instantiating them. Includes helper utilities for the Service Provider Interface (SPI), as presented in JDK 1.3. This package is JDK 1.1 compatible, but will use JDK 1.2+ methods when allowed. 17-Jul-2003: Documentation still needs a bit of work, but this has been moved up to RC1. util-classes Throwable Helpers net.sourceforge.groboutils.util.throwable.v1 Utilities that aid in creating exceptions with causes (a la JDK 1.4), and for parsing exceptions. This package is JDK 1.1 compatible, but will use the JDK 1.4-introduced exception methods when allowed. 17-Jul-2003: May remove this project in favor of Jakarta Commons Lang 1.0. libgroboutils-java-5.orig/util-classes/xdocs/about.xml0000644000175000017500000000104307734122347023245 0ustar drazzibdrazzib About $Date: 2003/09/23 19:54:15 $ Matt Albrecht Utilities that allow for easy access to Classes and instantiating them. Includes helper utilities for the Service Provider Interface (SPI), as presented in JDK 1.3. This package is JDK 1.1 compatible, but will use JDK 1.2+ methods when allowed. See the design document for more details on the contents. libgroboutils-java-5.orig/util-classes/xdocs/requirements.xml0000644000175000017500000000250407656462767024701 0ustar drazzibdrazzib Requirements $Date: 2003/05/08 14:13:11 $ Matt Albrecht The Util-Classes project must:

    • Provide an API to ease the burden of classloading implementation differences between JDKs.
    • Ease the effort involved in creating an SPI-like implementation. SPI (Service Provider Interface) was first (as far as I can tell) described in the JDK 1.3 documentation discussing the JFC input method engine in the JDK 1.3 documentation overview of the Input Method Framework, and a description of the technology was put in the JavaDoc. Another implementation is needed since the Sun implementation of loading SPI classes was privately used.
    • Helpers for creating chainable exceptions. JDK 1.4 introduces this capability for all exceptions, but for JDK 1.1 compatible code this is not acceptible.
    • Helpers for creating and maintaining singleton instances of classes.
    libgroboutils-java-5.orig/util-classes/xdocs/design.xml0000644000175000017500000000613707734122350023407 0ustar drazzibdrazzib Designof Util-Classes $Date: 2003/09/23 19:54:16 $ Matt Albrecht

    For more details, see the using document/

    Chainable Exceptions

    Chainable exceptions are implemented by using a helper class to contain the logic behind the standard exception methods. This allows for creating a new exception or extending one with the chainable property fairly easy.

    Service Provider Interface Loading

    The SPI framework is used by applications to, at run-time, discover implementation classes of a service. These implementation classes implement a service class or interface, and are dynamically loaded and instantiated to fulfill a role that the application requires.

    The SPILoader class knows how to parse a class loader for references to files under META-INF/services/classname. Multiple of these files may be defined per JAR file or directory in the classpath, so the SPILoader iterates through all references of this file.

    Each service file is a text file describing the class names that provide an implementation of the service class. Each service class must be on its own line (whitespace is ignored), and must be declared with the fully-qualified class name that implements the service. Empty lines and lines beginning with a hash mark ("#") are ignored.

    Throwable Parsing

    The Throwable Parsing classes are a wrapper around the stack trace listing methods introduced to the java.lang.Throwable class in JDK 1.4. The GroboUtil classes will either use the JDK 1.4 methods (if running in JDK 1.4), or revert to parsing the output from printStackTrace().

    Class Load Helper

    The Class Load Helper class is a collection of utilities that contain logic to aid the developer in writing dynamic class loading code. There exist many neuances behind the particulars for this, especially when dealing with different JDK versions, and this class attempts to isolate the developer from many of these headaches.

    Singleton Stores

    There comes a time when applications need the use of a singleton. The problem with static access to a singleton (or worse - a class with static methods) is that it can be difficult to extend the functionality of said singletons, or to swap them out with different ones. Such a situation may be where one process discovers an optimization that could be used, and so the singleton could be swapped out with another to allow for faster run times. Another situation may be where old software references a utility, but new or different functionality may be required by add-on software; in order for the old software to gain this new functionality (say, additional logging), the original singleton will need to be swapped with the new one.

    In order to support this kind of behavior, the Singleton Stores classes were created.

    libgroboutils-java-5.orig/util-classes/xdocs/index.xml0000644000175000017500000000135207707060301023234 0ustar drazzibdrazzib Class Utilities $Date: 2003/07/21 21:53:05 $
  • About Util-Classes
  • Requirements
  • Design
  • Using SPI
  • Using Chainable Exceptions
  • Using Throwable Parser
  • Using ClassLoadHelper
  • Using Stores
  • libgroboutils-java-5.orig/util-classes/xdocs/using.xml0000644000175000017500000007465707736117715023312 0ustar drazzibdrazzib Using Util-Classes $Date: 2003/09/29 21:10:37 $ Matt Albrecht
    Contents
    1. Service Provider Interface Loading
    2. Chainable Exceptions
    3. Throwable Parsing
    4. Class Load Helper
    5. Singleton Stores
    6. Multiple Stores
    Service Provider Interface Loading

    Back to top

    The SPILoader class knows how to parse a class loader for references to files under META-INF/services/classname. Multiple of these files may be defined per JAR file or directory in the classpath, so the SPILoader

    The SPILoader class is used by the net.sourceforge.groboutils.autodoc.v1.AutoDoc class, so I'll review how that class uses the SPILoader to gain pluggable runtime loading of services.

    AutoDoc does not directly reference the SPILoader, but rather uses the class SPISingletonStore to load and handle singleton instances. This SPISingletonStore, in turn, uses the SPILoader to collect the singletons. The singleton store uses the SPI loader with this bit of code (this.baseClass refers to the class that all service class implementations must, well, implement):

     97:    
     98:    
     99:    /**
    100:     * Add a set of SPIs from the given class loader.
    101:     */
    102:    public void addSPI( ClassLoader cl )
    103:            throws IOException
    104:    {
    105:        SPILoader spil = new SPILoader( this.baseClass, cl );
    106:        
    107:        while (spil.hasNext())
    108:        {
    109:            addSingleton( spil.nextProvier() );
    110:        }
    111:    }
    112:}
    
    Thus, the SPILoader can be used like an enumeration or iterator.

    The SPILoader finds the files in the META-INF/services directory that has the same name as the service class. It loads each file found, parses it, and loads the corresponding class. If the class is assignable to the service class, then it is instantiated with the default constructor, and returned.

    Each service file is a text file describing the class names that provide an implementation of the service class. Each service class must be on its own line (whitespace is ignored), and must be declared with the fully-qualified class name that implements the service. Empty lines and lines beginning with a hash mark ("#") are ignored.

    Yes, there can be multiple service files for a particular service class! How? By having each file in a different JAR file which is in the classpath. So, if someone adds multiple JAR files, each containing its own service file (and, thus, their own service class implementations), then all will be returned. Note, however, that JDK 1.1 does not implement this behavior (it wasn't introduced until JDK 1.2).

    Chainable Exceptions

    Back to top

    The Chainable Exception classes allow for a non-JDK 1.4+ application to implement chainable exceptions. Chainable exceptions are exceptions which "recast" another exception. For example, a common chore in the Apache Ant tasks goes something like this:

       1:    try {
       2:        f = new FileWriter( myFile );
       3:    } catch (IOException ioe) {
       4:        throw new BuildException( ioe );
       5:    }
    
    Note that the developer wraps the IOException inside the BuildException, recasting the exception to a different type. The BuildException class contains logic to store the embedded exception and display the embedded exception's stack trace on calls to BuildException.printStackTrace().

    The Chainable Exception classes has two methodologies available: extend the ChainableException class, or use the ChainableExceptionHelper class to make any exception chainable.

    Extending the ChainableException class is much like extending an Exception:

       1:public class MyException extends ChainableException {
       2:    public MyException() {
       3:        super();
       4:    }
       5:    
       6:    
       7:    public MyException( String message ) {
       8:        super( message );
       9:    }
      10:    
      11:    
      12:    public MyException( Throwable cause ) {
      13:        super( cause );
      14:    }
      15:    
      16:    
      17:    public MyException( Throwable cause, String message ) {
      18:        super( message, cause );
      19:    }
      20:    
      21:    
      22:    public MyException( String message, Throwable cause ) {
      23:    
       1:public class MyException extends ChainableException {
       2:    public MyException() {
       3:        super();
       4:    }
       5:    
       6:    
       7:    public MyException( String message ) {
       8:        super( message );
       9:    }
      10:    
      11:    
      12:    public MyException( Throwable cause ) {
      13:        super( cause );
      14:    }
      15:    
      16:    
      17:    public MyException( Throwable cause, String message ) {
      18:        super( message, cause );
      19:    }
      20:    
      21:    
      22:    public MyException( String message, Throwable cause ) {
      23:        super( message, cause );
      24:    }
      25:}
      26:
    
    super( message, cause ); 24: } 25:} 26:

    To make your own exception chainable, you simply need to follow the design of the ChainableException class. Below is a simple, non-javadoc way to make your own:

       1:import java.io.PrintStream;
       2:import java.io.PrintWriter;
       3:import net.sourceforge.groboutils.util.throwable.v1.IChainableException;
       4:import net.sourceforge.groboutils.util.throwable.v1.ChainableExceptionHelper;
       5:
       6:public class MyChainableException extends Exception
       7:        implements IChainableException
       8:{
       9:    /** @serial */
      10:    private ChainableExceptionHelper ceh;
      11:    
      12:    public MyChainableException() {
      13:        super();
      14:        this.ceh = new ChainableExceptionHelper( this );
      15:    }
      16:    
      17:    public MyChainableException( String message ) {
      18:        super( message );
      19:        this.ceh = new ChainableExceptionHelper( this );
      20:    }
      21:    
      22:    public MyChainableException( Throwable cause ) {
      23:        super();
      24:        this.ceh = new ChainableExceptionHelper( this, cause );
      25:    }
      26:    
      27:    public MyChainableException( Throwable cause, String message ) {
      28:        this( message, cause );
      29:    }
      30:    
      31:    public MyChainableException( String message, Throwable cause ) {
      32:        super( message );
      33:        this.ceh = new ChainableExceptionHelper( this, cause );
      34:    }
      35:    
      36:    public synchronized Throwable getCause() {
      37:        return this.ceh.getCause();
      38:    }
      39:    
      40:    public synchronized Throwable initCause( Throwable cause ) {
      41:        return this.ceh.initCause( cause );
      42:    }
      43:    
      44:    public void printStackTrace( PrintStream ps ) {
      45:        this.ceh.printStackTrace( ps );
      46:    }
      47:    
      48:    public void printStackTrace( PrintWriter pw ) {
      49:        this.ceh.printStackTrace( pw );
      50:    }
      51:}
    
    The claass implements IChainableException (to broadcast its JDK 1.4+ compatible chainable methods), and delegates method calls to the ChainableExceptionHelper class.

    Throwable Parsing

    Back to top

    By using the net.sourceforge.groboutils.util.throwable.v1.ThrowableParser class, you can discover the details of the stack history of a Throwable in any JDK.

    For instance, if you need to know which method of a specific class invoked the current method, you could perform:

     8:String classToLookFor = c.getName(); 
     9:Throwable t = new Throwable();
    10:t.fillInStackTrace();
    11:ThrowableParser tp = new ThrowableParser( t );
    12:StackTraceLineParser stlp = tp.next();
    13:String method = null;
    14:int lineNumber = -1;
    15:while (method == null && stlp != null) {
    16:    if (classToLookFor.equals( stlp.getClassName() )) {
    17:        method = stlp.getMethodName();
    18:        lineNumber = stlp.getLineNumber();
    19:    }
    20:}
    21:
    22:if (method != null) {
    23:    System.out.println( "This method was called by class "+
    24:        classToLookFor+" in method "+method+" on line "+
    25:        lineNumber+"." );
    26:} else {
    27:    System.out.println( "Class "+classToLookFor+
    28:        " didn't call this method." );
    29:}
    

    Class Load Helper

    Back to top

    The class net.sourceforge.groboutils.util.classes.v1.ClassLoadHelper aids the developer by providing convienent methods that can:

    • return a class object without worrying about trapping the various exceptions;
    • create a new object from the default constructor without trapping the various exceptions;
    • create an object based on a property in a java.util.Hashtable that declares the class to instantiate; and
    • easily load resources, including multiple resources of the same name.
    The design wraps many JDK 1.2 and above calls into JDK 1.1-safe invocations.

    Singleton Stores

    Back to top

    The singleton pattern can be extremely powerful, conserving memory requirements and hiding implementation details behind a factory-like mechanism.

    However, most implementations do not allow for robust access. There exist some needs to swap out one singleton for another. Let's say, for example, that an application has a utility class for loading class files from a URL and dynamically loading them in the VM. If this application was written with JDK 1.1, it had to manually download the class files (possibly JAR files), load them into a specialized class loader, then return the new class. However, when JDK 1.2 was released, those users could take advantage of the URLClassLoader class. The utility could be rewritten to use a factory/proxy pattern, but that could break backwards compatibility. Instead, the application could swap out the singleton with a JDK 1.1 or JDK 1.2 implementation.

    The GroboUtils Singleton Store class (net.sourceforge.groboutils.util.classes.v1.SingletonStore) allows for a class to contain a static reference to the Store, then allow access to replace the Singleton in the store with another instance. The SPISingletonStore does just this.

    Multiple Stores

    Back to top

    The GroboUtils Multiple Store class (net.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore), just like the Singleton Stores, allow for a central location to manage the singleton, but the Multiple Store class allows for several such instances to be stored, and new instances to be added as needed.

    libgroboutils-java-5.orig/util-xml/0000755000175000017500000000000011271425773017436 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/deployed.ant-inc.xml0000644000175000017500000000026607761176055023326 0ustar drazzibdrazzib libgroboutils-java-5.orig/util-xml/build.xml0000644000175000017500000001065507760223217021263 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; libgroboutils-java-5.orig/util-xml/TODO.txt0000644000175000017500000000006107707060301020730 0ustar drazzibdrazzibTODO for XML (in approximate order of priority): libgroboutils-java-5.orig/util-xml/log4j.properties0000644000175000017500000000050107521071704022561 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.util.xml=DEBUG libgroboutils-java-5.orig/util-xml/sources/0000755000175000017500000000000010011473011021074 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ait/0000755000175000017500000000000011271425773021676 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ait/about.txt0000644000175000017500000000021007521071704023534 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/util-xml/sources/dev/0000755000175000017500000000000011271425773021677 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/0000755000175000017500000000000010011473010022437 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/sourceforge/0000755000175000017500000000000010011473010024762 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011473010027153 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/sourceforge/groboutils/util/0000755000175000017500000000000010011473010030130 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/sourceforge/groboutils/util/xml/0000755000175000017500000000000010011473010030730 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/sourceforge/groboutils/util/xml/v1/0000755000175000017500000000000011271425773031304 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/dev/net/sourceforge/groboutils/util/xml/v1/XMLUtil.java0000644000175000017500000002156007760223217033446 0ustar drazzibdrazzib/* * @(#)XmlUtil.java * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.xml.v1; /** * A Utility to aid in various XML activities. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since May 21, 2001 * @version $Date: 2003/11/23 21:28:47 $ */ public class XMLUtil { protected static XMLUtil s_instance = new XMLUtil(); // * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | // * [#xE000-#xFFFD] | [#x10000-#x10FFFF] //private static final char LOWER_RANGE_1 = 0x20; //private static final char UPPER_RANGE_1 = 0xD7FF; //private static final char LOWER_RANGE_2 = 0xE000; //private static final char UPPER_RANGE_2 = 0xFFFD; private static final char LOWER_RANGE = 0x20; private static final char UPPER_RANGE = 0x7f; // java doesn't support this range // private static final char LOWER_RANGE_3 = 0x10000; // private static final char UPPER_RANGE_3 = 0x10FFFF; private static final char VALID_CHAR_1 = 0x9; private static final char VALID_CHAR_2 = 0xA; private static final char VALID_CHAR_3 = 0xD; private static final char[] IN_RANGE_INVALID = { '<', '>', '"', '\'', '&' }; //private static final String IN_RANGE_INVALID_STR = // new String( IN_RANGE_INVALID ); private static final String IN_RANGE_VALID[] = { "<", ">", """, "'", "&" }; protected XMLUtil() { // do nothing } public static XMLUtil getInstance() { return s_instance; } //------------------------------------------ /** * Convert a standard Java String into an XML string. It transforms * out-of-range characters (<, >, &, ", ', and non-standard * character values) into XML formatted values. Since it does correctly * escape the quote characters, this may be used for both attribute values * as well as standard text. * * @param javaStr the Java string to be transformed into XML text. If * the string is null, then null is returned. * @return the XML version of javaStr. * @see #utf2xml( String, StringBuffer ) */ public String utf2xml( String javaStr ) { if (javaStr == null) { return null; } StringBuffer sb = new StringBuffer(); utf2xml( javaStr, sb ); return sb.toString(); } /** * Convert a standard Java String into an XML string. It transforms * out-of-range characters (<, >, &, ", ', and non-standard * character values) into XML formatted values. Since it does correctly * escape the quote characters, this may be used for both attribute values * as well as standard text. *

    * From * the XML recommendation: *

         * [Definition: A parsed entity contains text, a sequence of characters,
         * which may represent markup or character data.]
         * [Definition: A character is an atomic unit of text as specified by
         * ISO/IEC 10646 [ISO/IEC 10646] (see also [ISO/IEC 10646-2000]).
         * Legal characters are tab, carriage return, line feed, and the legal
         * characters of Unicode and ISO/IEC 10646. The versions of these standards
         * cited in A.1 Normative References were current at the time this document
         * was prepared. New characters may be added to these standards by
         * amendments or new editions. Consequently, XML processors must accept
         * any character in the range specified for Char. The use of
         * "compatibility characters", as defined in section 6.8 of
         * [Unicode] (see also D21 in section 3.6 of [Unicode3]), is discouraged.]
         *
         * Character Range
         *  [2]    Char    ::=    #x9 | #xA | #xD | [#x20-#xD7FF] |
         *                        [#xE000-#xFFFD] | [#x10000-#x10FFFF]
         *         // any Unicode character, excluding the surrogate blocks,
         *            FFFE, and FFFF. //
         *
         * The mechanism for encoding character code points into bit patterns may
         * vary from entity to entity. All XML processors must accept the UTF-8
         * and UTF-16 encodings of 10646; the mechanisms for signaling which of
         * the two is in use, or for bringing other encodings into play, are
         * discussed later, in 4.3.3 Character Encoding in Entities.
         *
         * ...
         *
         * The ampersand character (&) and the left angle bracket (<)
         * may appear in their literal form only when used as markup delimiters, or
         * within a comment, a processing instruction, or a CDATA section. If they
         * are needed elsewhere, they must be escaped using either numeric
         * character references or the strings "&amp;" and "&lt;"
         * respectively. The right angle bracket (>) may be represented using the
         * string "&gt;", and must, for compatibility, be escaped using
         * "&gt;" or a character reference when it appears in the string
         * "]]>" in content, when that string is not marking the end of a CDATA
         * section.
         * To allow attribute values to contain both single and double quotes, the
         * apostrophe or single-quote character (') may be represented as
         * "&apos;", and the double-quote character (") as "&quot;".
         * 
    * * @param javaStr the Java string to be transformed into XML text. If * it is null, then the text "null" is appended to the * @param output the StringBuffer to send the transformed XML into. */ public void utf2xml( String javaStr, StringBuffer output ) { if (output == null) { throw new IllegalArgumentException("No null StringBuffer"); } if (javaStr == null) { // original: // javaStr = "null"; // the string "null" does not have any out-of-range characters, // so to optimize... output.append("null"); return; } int len = javaStr.length(); // Ensure that the output string buffer has enough space. // The given huristic seems to work well. output.ensureCapacity( output.length() + (len * 2) ); // for efficiency, directly access the array. char buf[] = javaStr.toCharArray(); for ( int pos = 0; pos < len; ++pos) { char c = buf[pos]; // test for out-of-range for escaping using &# if ( // * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | // * [#xE000-#xFFFD] | [#x10000-#x10FFFF] (c < LOWER_RANGE && c != VALID_CHAR_1 && c != VALID_CHAR_2 && c != VALID_CHAR_3) || (c > UPPER_RANGE) ) { output.append( "&#" ); output.append( Integer.toString( c ) ); output.append( ';' ); } else { // should we escape the character with an &XXX; ? boolean notfound = true; for (int p2 = IN_RANGE_INVALID.length; --p2 >= 0;) { if (IN_RANGE_INVALID[p2] == c) { notfound = false; output.append( IN_RANGE_VALID[ p2 ] ); break; } } if (notfound) { // append the character as-is output.append( c ); } } } } } libgroboutils-java-5.orig/util-xml/sources/dev/about.txt0000644000175000017500000000015207521071704023542 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/util-xml/sources/ut/0000755000175000017500000000000011271425773021551 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ut/net/0000755000175000017500000000000010011473011022312 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/0000755000175000017500000000000010011473011024635 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011473011027026 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/groboutils/util/0000755000175000017500000000000010011473011030003 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/groboutils/util/xml/0000755000175000017500000000000010011473011030603 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/groboutils/util/xml/v1/0000755000175000017500000000000011271425773031156 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/groboutils/util/xml/v1/XMLUtilUTest.javalibgroboutils-java-5.orig/util-xml/sources/ut/net/sourceforge/groboutils/util/xml/v1/XMLUtilUTest.ja0000644000175000017500000001655507760503500033762 0ustar drazzibdrazzib/* * @(#)XMLUtilUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.xml.v1; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the XMLUtil class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/11/24 22:33:36 $ * @since 06-Mar-2002 */ public class XMLUtilUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = XMLUtilUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public XMLUtilUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // Tests public void testConstruction() { assertNotNull( "getInstance() must never return null.", XMLUtil.getInstance() ); } public void testUTFConvert1() { // can work with nulls assertNull( "Null conversion didn't work right.", XMLUtil.getInstance().utf2xml( null ) ); } public void testUTFConvert2() { // test non-escaped characters String noescapes = "abcdefghijklmnopqrstuvwxyz "+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ "+ "()=+-_!@#$%^*{}[]\\|;:/?.,\n\t\r"; String val = XMLUtil.getInstance().utf2xml( noescapes ); DOC.getLog().debug( "expected '"+noescapes+"'" ); DOC.getLog().debug( "received '"+val+"'" ); assertEquals( noescapes, val ); } public void testUTFConvert2a() { // we've changed the non-escaped character translation such that // it's compatible with UTF-8 encoding. Probably shouldn't have, // but here we are. String noescapes = "" + ((char)0xD7FF) + ((char)0xE000) + ((char)0xFFFD); String real = "퟿�"; String val = XMLUtil.getInstance().utf2xml( noescapes ); DOC.getLog().debug( "expected '"+noescapes+"'" ); DOC.getLog().debug( "received '"+val+"'" ); assertEquals( real, val ); } public void testUTFConvert3() { assertEquals( "<", XMLUtil.getInstance().utf2xml( "<" ) ); } public void testUTFConvert4() { assertEquals( ">", XMLUtil.getInstance().utf2xml( ">" ) ); } public void testUTFConvert5() { assertEquals( "&", XMLUtil.getInstance().utf2xml( "&" ) ); } public void testUTFConvert6() { assertEquals( """, XMLUtil.getInstance().utf2xml( "\"" ) ); } public void testUTFConvert7() { assertEquals( "'", XMLUtil.getInstance().utf2xml( "'" ) ); } public void testUTFConvert8() { assertEquals( "", XMLUtil.getInstance().utf2xml( ""+((char)2) ) ); } public void testUTFConvert9() { assertEquals( "a<b", XMLUtil.getInstance().utf2xml( "ab" ) ); } public void testUTFConvert11() { assertEquals( "&a<", XMLUtil.getInstance().utf2xml( "&a<" ) ); } public void testUTFConvert12() { assertEquals( "a"b>c", XMLUtil.getInstance().utf2xml( "a\"b>c" ) ); } public void testUTFConvert13() { assertEquals( "'abc>d", XMLUtil.getInstance().utf2xml( "'abc>d" ) ); } public void testUTFConvert14() { assertEquals( "aaabcfed asdf;lkj qwepiouf &amp;f3df", XMLUtil.getInstance().utf2xml( "aaa"+((char)2)+ 'b' + ((char)3) + "cfed asdf;lkj qwepiouf &f3df") ); } public void testUTFAppend1() { try { XMLUtil.getInstance().utf2xml( null, null ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test text? } } public void testUTFAppend2() { try { XMLUtil.getInstance().utf2xml( "abc", null ); fail( "did not throw an IllegalArgumentException." ); } catch (IllegalArgumentException iae) { // test text? } } public void testUTFAppend3() { // can work with nulls StringBuffer sb = new StringBuffer(); XMLUtil.getInstance().utf2xml( null, sb ); assertEquals( "Null conversion did not work.", "null", sb.toString() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/util-xml/sources/ut/about.txt0000644000175000017500000000012207521071704023411 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/util-xml/sources/iut/0000755000175000017500000000000011271425773021722 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/iut/about.txt0000644000175000017500000000021107521071704023561 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/util-xml/sources/eut/0000755000175000017500000000000011271425773021716 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/sources/eut/about.txt0000644000175000017500000000015307521071704023562 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/util-xml/CHANGES.TXT0000644000175000017500000000470407760223217021111 0ustar drazzibdrazzib v1.1.0 * Altered the encoding such that it more correctly complies with UTF-8 encoding scheme. v1.0.1 * Updated build to reflect new version. * Moved out of RC to formal version. * Task 79419: updated documentation. v1.0.0 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Created two primary javac structures - one for jdk 1.1, and one for jdk1.2+. * Integrated the GroboUtils 'util.xml' hierarchy into this hierarchy. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/util-xml/xdocs/0000755000175000017500000000000011271425773020556 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-xml/xdocs/summary.xml0000644000175000017500000000115707655132720022777 0ustar drazzibdrazzib util-xml net.sourceforge.groboutils.util.xml.v1 Utilities for converting standard text into XML-escaped strings, without the need for DOM heavyweight libraries. 20-Dec-2002: Entered version 1.0.0rc1. Need to complete documentation. libgroboutils-java-5.orig/util-xml/xdocs/about.xml0000644000175000017500000000117207655132720022411 0ustar drazzibdrazzib About Util-XML $Date: 2003/05/04 06:40:16 $ Matt Albrecht

    This sub-project simply contains a single utility for converting standard text into XML-escaped strings, without the need for DOM heavyweight libraries.

    Since XML documents are easier to create in code than they are to parse, some applications don't want to carry around the memory intensive version of their XML document in a DOM model; all they want is to output it immediately to a file.

    libgroboutils-java-5.orig/util-xml/xdocs/requirements.xml0000644000175000017500000000067207706770543024036 0ustar drazzibdrazzib Requirements $Date: 2003/07/21 13:57:55 $ Matt Albrecht

    There is only one requirement for this package at this time:

    • Provide a set of light-weight utility methods to escape Java strings for correct insertion into XML documents.

    libgroboutils-java-5.orig/util-xml/xdocs/design.xml0000644000175000017500000000114207706770543022555 0ustar drazzibdrazzib Design $Date: 2003/07/21 13:57:55 $ Matt Albrecht

    The design is intended to be as simple as possible. Provide methods that know how to properly escape Java strings for proper insertion into XML documents.

    In order to better support any need for subclassing, the methods are not made static. Rather, a static factory method is provided which can be overridden by subclasses to provide a new singleton instance of the class.

    libgroboutils-java-5.orig/util-xml/xdocs/index.xml0000644000175000017500000000067607655132720022416 0ustar drazzibdrazzib Welcome $Date: 2003/05/04 06:40:16 $
  • About Util-XML
  • Requirements
  • Design
  • Using
  • libgroboutils-java-5.orig/util-xml/xdocs/using.xml0000644000175000017500000000446207707060301022422 0ustar drazzibdrazzib Using Util-XML $Date: 2003/07/21 21:53:05 $ Matt Albrecht All you need to use the XML utility is to:
    1. Add this line to the top of your Java source:
      1:import net.sourceforge.groboutils.util.xml.v1.XMLUtil;
      
    2. To convert a string to an XML-formatted string (suitable for including in attributes and in-line text):
      3:String mystring = XMLUtil.getInstance().utf2xml("Some' < \" < Text &.");
      4:StringBuffer sb = new Stringbuffer();
          
      The resulting string will be correctly escaped for XML.
    3. If you want to append XML-formatted text to a string buffer, you can use:
      4:StringBuffer sb = new Stringbuffer();
      5:XMLUtil.getInstance().utf2xml( mytext, sb );
          
      This may be a bit faster, since it doesn't need to perform a toString() on an internal StringBuffer then append that to another StringBuffer.
    libgroboutils-java-5.orig/make.sh0000644000175000017500000000213107760503337017132 0ustar drazzibdrazzib#! /bin/bash _HERE=`dirname $0` pushd $_HERE > /dev/null || exit 1 _HERE=$(pwd) popd > /dev/null echo "_HERE=$_HERE" _LIBS="$_HERE/_shared/3rdparty" ORIG_ANT_HOME="$_LIBS/ant/1.6beta" echo "ORIG_ANT_HOME=$ORIG_ANT_HOME" # Setup our required ant directory + required classpath ANT_HOME="$_LIBS/ant/.tmp" echo "ANT_HOME=$ANT_HOME" ANT_LIB=$ANT_HOME/lib if [ -d $ANT_HOME ]; then rm -rf $ANT_HOME fi mkdir $ANT_HOME || exit 1 cp -R $ORIG_ANT_HOME/* $ANT_HOME/. cp $_LIBS/bcel/5.1/bcel-5.1.jar $ANT_LIB/. cp $_LIBS/junit/3.8.1/junit.jar $ANT_LIB/. # For the Xalan stuff, we need to ensure that the right one is used. cp $_LIBS/xalan/2.5.1/xalan.jar $ANT_LIB/. cp $_LIBS/xerces/2.4.0/xercesImpl.jar $ANT_LIB/. cp $_LIBS/xerces/2.4.0/xml-apis.jar $ANT_LIB/. cp $_LIBS/xerces/2.4.0/xercesImpl.jar $ANT_LIB/. BOOTPATH="$ANT_LIB/xalan.jar:$ANT_LIB/xml-apis.jar:$ANT_LIB/xercesImpl.jar" case "`uname`" in CYGWIN*) BOOTPATH=`cygpath --windows --path "$BOOTPATH"` ;; esac ANT_OPTS="$ANT_OPTS -Xbootclasspath/p:$BOOTPATH" export ANT_OPTS echo ANT_OPTS=$ANT_OPTS $ANT_HOME/bin/ant $* X=$? rm -rf $ANT_HOME exit $X libgroboutils-java-5.orig/make.bat0000644000175000017500000000202207760503337017265 0ustar drazzibdrazzib@echo off setlocal rem Load arguments in a compatible way set ARGS= :startArgs if "%1" == "" goto endArgs set ARGS=%ARGS% %1 shift goto startArgs :endArgs set _HERE=. set _LIBS=%_HERE%\_shared\3rdparty set ORIG_ANT_HOME=%_LIBS%\ant\1.6beta rem Setup new ANT for a new classpath set ANT_HOME=%_LIBS%\ant\.tmp set ANT_LIB=%ANT_HOME%\lib if EXIST %ANT_HOME% del /S/Q %ANT_HOME% mkdir %ANT_HOME% xcopy %ORIG_ANT_HOME%\* %ANT_HOME%\. /S/E/Q copy %_LIBS%\bcel\5.1\bcel-5.1.jar %ANT_LIB%\. copy %_LIBS%\junit\3.8.1\junit.jar %ANT_LIB%\. rem For Xalan, we need to ensure the right one is used. copy %_LIBS%\xalan\2.5.1\xalan.jar %ANT_LIB%\. copy %_LIBS%\xerces\2.4.0\xml-apis.jar %ANT_LIB%\. copy %_LIBS%\xerces\2.4.0\xercesImpl.jar %ANT_LIB%\. set BOOTPATH=%ANT_LIB%\xalan.jar;%ANT_LIB%\xml-apis.jar;%ANT_LIB%\xercesImpl.jar if "%ANT_OPTS%" == "" goto setOpts set ANT_OPTS=%ANT_OPTS% -Xbootclasspath/p:%BOOTPATH% goto start :setOpts set ANT_OPTS=-Xbootclasspath/p:%BOOTPATH% goto start :start call %ANT_HOME%\bin\ant.bat %ARGS% endlocal libgroboutils-java-5.orig/makeall.sh0000644000175000017500000000574710120234531017620 0ustar drazzibdrazzib#!/bin/bash echo "Started build: `date`" _ARGS="$*" # Modify these settings for your personal environment, # although it is recommended that you use these paths. _MEM_SIZE=128m #JDK_11=/usr/java/jdk1.1 #JDK_12=/usr/java/jdk1.2 JDK_13=/usr/java/jdk1.3 JDK_14=/usr/java/jdk1.4 #JDK_11_maxmem=-mx$_MEM_SIZE #JDK_12_maxmem=-Xmx$_MEM_SIZE JDK_13_maxmem=-Xmx$_MEM_SIZE JDK_14_maxmem=-Xmx$_MEM_SIZE # Set to JDK 1.4 so that all projects will be cleaned up export JAVA_HOME=$JDK_14 export ANT_OPTS=$JDK_14_maxmem ./make.sh clean $_ARGS || exit 1 # Sun doesn't support 1.1 on Linux, so this is an optional step # but cygwin can also be used! #if [ -f $JDK_11/bin/java -o -f $JDK_11/bin/java.exe ]; then # echo "=======================================================================" # echo "=======================================================================" # echo "===== JDK 1.1 =====" # echo "=======================================================================" # echo "=======================================================================" # export JAVA_HOME=$JDK_11 # export ANT_OPTS=$JDK_11_maxmem # ./make.sh main || exit 1 #else # echo "---- Skipping JDK 1.1 ----" #fi if [ -f $JDK_12/bin/java -o -f $JDK_12/bin/java.exe ]; then if [ $(uname) != Linux ]; then # The Linux version of JDK 1.2 doesn't work with the thread queue # correctly. echo "=======================================================================" echo "=======================================================================" echo "===== JDK 1.2 =====" echo "=======================================================================" echo "=======================================================================" export JAVA_HOME=$JDK_12 export ANT_OPTS=$JDK_12_maxmem ./make.sh main $_ARGS || exit 1 fi fi if [ -f $JDK_13/bin/java -o -f $JDK_13/bin/java.exe ]; then echo "=======================================================================" echo "=======================================================================" echo "===== JDK 1.3 =====" echo "=======================================================================" echo "=======================================================================" export JAVA_HOME=$JDK_13 export ANT_OPTS=$JDK_13_maxmem ./make.sh main $_ARGS || exit 1 fi echo "=======================================================================" echo "=======================================================================" echo "===== JDK 1.4 =====" echo "=======================================================================" echo "=======================================================================" # Website construction with JDK 1.4 requires correct bootclasspath setup # to use the GroboUtils' included Xalan and Xerces processors, not the # included JDK 1.4 ones. The "make.sh" script does this correctly. export JAVA_HOME=$JDK_14 export ANT_OPTS=$JDK_14_maxmem ./make.sh deploy $_ARGS || exit 1 echo "Completed build: `date`" libgroboutils-java-5.orig/CHANGES.TXT0000644000175000017500000000411010007773744017330 0ustar drazzibdrazzib(see changes in each sub-project for their specific changes) v4 * Incremental release with some bug fixes and major changes to CodeCoverage. * Added a single, fully assembled CHANGES.TXT to the release and website. * Added the "Bugs" links on the left-side nav bar of the web site. v3 * Upgraded Xerces to 2.4.0 * Upgraded Xalan to 2.5.1 * Upgraded log4j to 1.2.8 * Upgraded Ant to 1.6beta * Task 81897: 3rd party zip file now contains licenses. * Task 81768: removed non-used 3rd party libraries. * Task 81828: website now has a convienience article link page. * Task 81905: Add elements to web pages. * Removed cruft sub-projects from source (jplugin, gui, eventbus, xml-xdstate, and xml-resource). v2 * Upgraded website and version number. * Moved license from LGPL to MIT. See "COPYING.txt" for details. * On the website, added forums to the left-nav, and added summary description on the index pages. * Removed from the build the obsolete sub-projects. * CodeCoverage is now in a proper release state. * The build now generates code coverage numbers for all sub-projects. v1 * Upgraded website and version number. * Changed build process such that each sub-project registers itself with a summary, so that website building can dynamically access all actively built subsystems, without additional user intervention. * Changed formatting structure for sub-project documentation. * Removed obsolete codecoverage v1. * Updated total package such that the 3rd party libraries are a separate download from the source, and the website javadoc for old versions are downloadable separately, too. * Changed final packaging of jar files such that only a single copy of each file is put in the jar files. v1.0.0a * Migrated each Java project within GroboUtils into a single project, covered by a single build. * Upgraded dependent 3rd party packages to their latest version. * Changed base core jar file clean-up so that it removes any version of the core file, not just the current version. libgroboutils-java-5.orig/util-datastruct/0000755000175000017500000000000011271425773021014 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/deployed.ant-inc.xml0000644000175000017500000000034007663521305024666 0ustar drazzibdrazzib libgroboutils-java-5.orig/util-datastruct/build.xml0000644000175000017500000001105307663521305022633 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.pmti; &inc._shared.deployed.testing-tp; &inc._shared.deployed.testing-autodoc; &inc._shared.deployed.util-classes; &inc._shared.deployed.util-xml; libgroboutils-java-5.orig/util-datastruct/TODO.txt0000644000175000017500000000025607552134631022322 0ustar drazzibdrazzibTODO for Datastruct (in approximate order of priority): 1. Create more tests. 2. Run code-coverage numbers. 3. Convert to Release Candidate from Alpha version.libgroboutils-java-5.orig/util-datastruct/log4j.properties0000644000175000017500000000051007521071674024145 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.util.datastruct=DEBUG libgroboutils-java-5.orig/util-datastruct/sources/0000755000175000017500000000000010011472774022471 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ait/0000755000175000017500000000000011271425773023254 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ait/about.txt0000644000175000017500000000021007521071674025120 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/util-datastruct/sources/dev/0000755000175000017500000000000011271425773023255 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/dev/net/0000755000175000017500000000000010011472773024034 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/0000755000175000017500000000000010011472773026357 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472773030550 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/0000755000175000017500000000000010011472773031525 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/0000755000175000017500000000000010011472773033703 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/libgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000755000175000017500000000000011271425773034240 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/NoRegisteredComponentException.javalibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000000371307622026473034245 0ustar drazzibdrazzib/* * @(#)NoRegisteredComponentException.java 0.9.0 04/26/2000 - 13:39:11 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; /** * Exception which is generated when a request to get a component from a * PathRegistry when the path/component has not been registered. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 26, 2000 (Alpha 0.9.0) * @version $Date: 2003/02/10 22:52:43 $ * @see PathRegistry */ public class NoRegisteredComponentException extends Exception { public NoRegisteredComponentException() { super(); } public NoRegisteredComponentException( String message ) { super( message ); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/package.htmllibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000000027407521071674034245 0ustar drazzibdrazzibnet.sourceforge.groboutils.util.datastruct.v1 Various unusual or very helpful data structures, written like the collections classes. ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/HashCache.javalibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000003001307663521305034235 0ustar drazzibdrazzib/* * @(#)HashCache.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; import java.util.Hashtable; import java.util.Enumeration; /** * Stores objects that are created via a unique key in a limited-sized * cache. The objects are retrieved and created through the key. If the * object with a requested key exists in the cache, then it is returned * and the object is marked as the latest accessed object. If a request * is made for an object whose key is not in the cache, then the object * is created, put into the cache, and returned. If the cache is full * when a new object is created, then the oldest item in the cache is * removed. *

    * This class is NOT thread safe. All thread safety issues will need to * be covered by the calling class. *

    * Future versions should use the ObjectCache to cache the node instances. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since May 23, 2003 * @version $Date: 2003/05/23 22:37:57 $ */ public class HashCache { /** * An interface which needs to be implemented and given to the * cache in order to create new instances. It also allows for * created objects to be cleaned up. */ public static interface ObjectManager { /** * Called when a new object needs to be created. * * @param key the key associated with the created object. * @return the newly created object */ public Object createObject( Object key ); /** * Called when the given object is being removed from the cache. * * @param key the key associated with the object. * @param obj the object being cleaned up. */ public void cleanUpObject( Object key, Object obj ); } /** * An inner class used for maintaining the chain of ownership. * Uses a doubly-linked list, so that each node can remove itself. */ private static class Node { public Object key; public Object value; public Node next; public Node prev; public Node( Object key, Object value ) { this.key = key; this.value = value; } /* used with the printChain method below public String toString() { return "node ["+this.value+"]"; } */ } /** * We also need to keep the object created. */ private ObjectManager mgr; /** * Maximum size of the cache. */ private int maxSize; /** * The head of our list of cached elements. */ private Node head; /** * The tail of our list of cached elements. */ private Node tail; /** * Our quick-reference to the list elements. */ private Hashtable keyToNode = new Hashtable(); /** * For metrics. */ private int overflowCount = 0; //----------------------------------------------------- // Constructors /** * Create a new HashCache. * * @param om the manager for creating and cleaning up the objects. This * cannot be null. * @param maxSize the maximum size of the cache. This must be > 1 * (this is for performance reasons). */ public HashCache( ObjectManager om, int maxSize ) { if (om == null) { throw new IllegalArgumentException("no null args"); } if (maxSize <= 1) { throw new IllegalArgumentException("size must be > 1"); } this.mgr = om; this.maxSize = maxSize; } //----------------------------------------------------- // Public methods /** * Retrieves an item from the cache with the given key. If the * object doesn't exist, then it is created, added to the cache, * and returned. If it does exist, the cached version is returned * and marked as the most recently found. If it was created, * and the cache is full, then the oldest retrieved object is * removed and cleaned up. */ public Object get( Object key ) { Node n = (Node)this.keyToNode.get( key ); if (n == null) { // must include the equals, because we're going to add // another element to the list. An "if" statement would // take roughly the same amount of time, but is less safe. while (getSize() >= getMaxSize()) { Node last = removeTail(); this.keyToNode.remove( last.key ); cleanup( last ); ++this.overflowCount; } n = createObject( key ); this.keyToNode.put( key, n ); } freshenNode( n ); return n.value; } /** * Retrieves the current number of elements in the cache. * * @return the current size of the cache. */ public int getSize() { //System.out.println("size = "+this.keyToNode.size()); return this.keyToNode.size(); } /** * Retrieves the maximum cache size. * * @return the maximum cache size. */ public int getMaxSize() { //System.out.println("maxsize = "+this.maxSize); return this.maxSize; } /** * Retrieves the metric that corresponds to the number of objects * that were removed from the cache. * * @return the overflow count. */ public int getOverflowCount() { return this.overflowCount; } /** * Resets the overflow count metric. */ public void resetOverflowCount() { this.overflowCount = 0; } /** * Cleans out the data structure, calling the clean-up on all items. * The manager and max size will not be changed, nor will the overflow * count. */ public void clear() { this.head = null; this.tail = null; Enumeration enum = this.keyToNode.keys(); while (enum.hasMoreElements()) { Object key = enum.nextElement(); Node n = (Node)this.keyToNode.remove( key ); cleanup( n ); } } //----------------------------------------------------- // Protected methods /** * Generates an Object for the cache, but does not add it to the * hashtable or lists. */ private Node createObject( Object key ) { Object o = this.mgr.createObject( key ); Node n = new Node( key, o ); return n; } /** * Call the cleanup on the given node. */ private void cleanup( Node n ) { this.mgr.cleanUpObject( n.key, n.value ); } /** * Removes the tail node. If the list is empty or has 1 element, then an * IllegalStateException is thrown. * * @return the last node in the list. */ private Node removeTail() { /* // temp test code if (this.tail == null) { throw new IllegalStateException("list is empty"); } */ Node n = this.tail; this.tail = n.prev; n.prev = null; tail.next = null; /* // temp test code if (this.tail == null) { throw new IllegalStateException("invalid tail setup: size < 1"); } if (n.next != null) { throw new IllegalStateException("next of old tail node "+n+" is not null, but "+n.next); } */ return n; } /** * Move the given node to the top of the list. This works even if the * given node is not in the list. */ private void freshenNode( Node n ) { /* // temp test code if (n == null) { throw new IllegalArgumentException("no null args"); } */ if (n == this.head) { // we're done! return; } if (this.head == null) { // n's next and prev better be null! this.head = n; this.tail = n; /* // temp test code if (n.next != null || n.prev != null) { throw new IllegalStateException("new head&tail node "+n+" next is "+n.next+", prev is "+n.prev); } */ } else { // setup tail, and next and prev of n's next and prev if (n.prev != null) { n.prev.next = n.next; } if (n.next != null) { n.next.prev = n.prev; } else if (this.tail == n) { this.tail = n.prev; // n.prev better not be null! that should have been trapped // above. /* // temp test code if (n.prev == null) { throw new IllegalStateException("new tail's previous is null!"); } */ } n.prev = null; // the head is going to be not null, due to the if block above this.head.prev = n; n.next = this.head; this.head = n; } } /* Integrety check. Uncomment when doing testing. protected void printChain() { if (this.head == null) { System.out.println("[Empty chain]"); return; } Hashtable seen = new Hashtable(); System.out.println("Chain:"); Node n = this.head; while (n != null) { seen.put( n, new Object() ); System.out.println(" "+n); Node n2 = n.next; if (n2 != null && n2.prev != n) { throw new IllegalStateException("Bad back chain! next = "+n2+ ", but its prev = "+n2.prev); } else if (n2 == null && n != this.tail) { throw new IllegalStateException("Broken Chain! next is null but tail isn't this node (it's "+this.tail+")"); } else if (n2 != null && seen.contains( n2 )) { throw new IllegalStateException("node "+n2+" in the list twice."); } if (n2 != null && n == this.tail) { throw new IllegalStateException("Tail in a loop!"); } n = n2; } System.out.println("[End chain]"); } */ } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/PathAlreadyRegisteredException.javalibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000000373407622026474034251 0ustar drazzibdrazzib/* * @(#)PathAlreadyRegisteredException.java 0.9.0 04/26/2000 - 13:39:11 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; /** * Exception which is generated when an attempt has been made to register * a new path in a PathRegistry instance when it already has been * registered. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 26, 2000 (Alpha 0.9.0) * @version $Date: 2003/02/10 22:52:44 $ * @see PathRegistry */ public class PathAlreadyRegisteredException extends Exception { public PathAlreadyRegisteredException() { super(); } public PathAlreadyRegisteredException( String message ) { super( message ); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/PathRegistry.javalibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000003663407622026474034256 0ustar drazzibdrazzib/* * @(#)PathRegistry.java 0.9.0 04/26/2000 - 13:39:11 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; import java.util.Vector; import java.util.Enumeration; /** * A path-tree registry for storing and retrieving objects. Objects can * be registered at any point along the tree, but no more than one object * may be at each node. A null entry at a point indicates * a non-registered node. *

    * Synchronization needs to be hauled-over to increase speed and minimize * read interference with writes. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 26, 2000 (0.9.0 Alpha) * @version $Date: 2003/02/10 22:52:44 $ */ public class PathRegistry { //---------------------------- // Public data //---------------------------- // Private data class TreeNode { Object value; boolean isRecursive; // true = no children, but uses children boolean isCaseSensitive; String nodeName; TreeNode nextSibling; TreeNode firstChild; } private char m_separator; private boolean m_ignoreDuplicateSeparators; private TreeNode m_root; // doesn't contain anything in value, and has no name //---------------------------- // constructors /** * Users must specify all variables without corresponding defaults. This * prevents the class from implementing defaults, which have a habit of * randomly changing. */ public PathRegistry( char separator, boolean ignoreDuplicateSeparators ) { this.m_separator = separator; this.m_ignoreDuplicateSeparators = ignoreDuplicateSeparators; // root tree node: m_root = new TreeNode(); // ALWAYS: // null nodename, not recursive, no siblings, empty fullname m_root.nodeName = null; m_root.nextSibling = null; m_root.isRecursive = false; m_root.isCaseSensitive = true; // INITIALLY: // no children m_root.firstChild = null; } //---------------------------- // Public methods /** * Register the given object at the given path. If the nodes leading * up to this end node do not exist, then they will be created. *

    * For future use, we will need to re-do synchronization, so that * we synch on the tree node parent being worked on. * * @param path the path under which the given value will be registered. * @param value the object to store under the given path. * @param isRecursive set to true to notify the tree that * this particular node also covers any sub-paths. If this is * false, then queries will only retrieve this * node if the exact path is given. * @param isCaseSensitive set to true if the given node is * to be case sensitive in searches. If the nodes leading to this * new node do not exist, then the newly created nodes will have the * same case sensitivity as this end node. * @exception IllegalArgumentException thrown if the value is * null, or the given path is not well formed. * @exception PathAlreadyRegisteredException thrown if the given path * has already been registered to another object. */ public synchronized void register( String path, Object value, boolean isRecursive, boolean isCaseSensitive ) throws PathAlreadyRegisteredException { if (path == null || value == null) { throw new IllegalArgumentException( "nulls are not allowed for insertion"); } Enumeration enum = parsePath( path ); if (!enum.hasMoreElements()) { throw new IllegalArgumentException( "path must have at least one element"); } TreeNode parent = this.m_root; String current = (String)enum.nextElement(); //System.out.println("Full path = "+path); boolean addedNode = false; while (true) { addedNode = false; //System.out.println("Path part = "+current); TreeNode nextNode = findSibling( parent, current ); if (nextNode == null) { //System.out.println(" -- needs to be added"); // add the node nextNode = new TreeNode(); nextNode.value = null; nextNode.nodeName = current; nextNode.isCaseSensitive = isCaseSensitive; nextNode.isRecursive = false; nextNode.nextSibling = null; nextNode.firstChild = null; addChildNode( parent, nextNode ); addedNode = true; } else if (nextNode.isRecursive) { //System.out.println("Node "+current+" is recursive - can't add under it"); // can't add to a recursive path throw new PathAlreadyRegisteredException( path ); } if (enum.hasMoreElements()) { current = (String)enum.nextElement(); } else { //System.out.println(" -- On the last node, and it matches node "+nextNode.nodeName ); // last node if (!addedNode) { throw new PathAlreadyRegisteredException( path ); } nextNode.value = value; nextNode.isRecursive = isRecursive; return; } parent = nextNode; } } /** * Remove the object at the given path. It only removes nodes * if the node no longer has any children. The siblings * are automatically compressed. *

    * For future use, we will need to re-do synchronization, so that * we synch on the tree node parent being worked on. * * @param path the tree path specifying which node to remove. If the * given node does not exist, or has not been registered, then a * NotRegisteredException is thrown. * @exception IllegalArgumentException thrown if the value is * null, or the given path is not well formed. * @exception NoRegisteredComponentException thrown if the given path node * has not yet been registered. */ public synchronized void remove( String path ) throws NoRegisteredComponentException { if (path.charAt( path.length()-1 ) != this.m_separator) { path += this.m_separator; } Enumeration enum = parsePath( path ); if (!enum.hasMoreElements()) { throw new IllegalArgumentException( "path must have at least one element"); } TreeNode parent = this.m_root; String current = (String)enum.nextElement(); while (true) { TreeNode nextNode = findSibling( parent, current ); if (nextNode == null) { // node doesn't exist throw new NoRegisteredComponentException( path ); } if (enum.hasMoreElements()) { current = (String)enum.nextElement(); } else { // last node if (nextNode.value == null) { // node doesn't exist throw new NoRegisteredComponentException( path ); } nextNode.value = null; if (nextNode.isRecursive || nextNode.firstChild == null) { removeChild( parent, nextNode ); } return; } parent = nextNode; } } /** * Retrieve the object stored at the given path. *

    * Need to synchronize better so that reads don't collide with writes, * but reads can be done asynchronously. * * @param path the path which specifies the object to retrieve. * @return the object which was registered at the given path, or * null if nothing is registered there. */ public synchronized Object get( String path ) { TreeNode node = findNode( path ); if (node == null) return null; return node.value; } //---------------------------- // Protected methods /** * Parses the given path into node elements. The last item in the list is * ignored, unless the path ends with the path separator character. */ protected Enumeration parsePath( String path ) { if (path == null) return null; if (path.charAt( path.length()-1 ) != this.m_separator) { path += this.m_separator; } char cpath[] = path.toCharArray(); int len = cpath.length; Vector v = new Vector( len >> 2 ); int start = 0, next, count; while (start < len) { count = 0; for (next = start; next < len && cpath[ next ] != this.m_separator; next++) { count++; } // ignore last element in list if (next < len) { v.addElement( new String( cpath, start, count ) ); } start = next+1; if (this.m_ignoreDuplicateSeparators) { for (; start < len && cpath[ start ] == this.m_separator; start++ ) { // do nothing } } } return v.elements(); } /** * Find the sibling with the given node name part. */ protected TreeNode findSibling( TreeNode parent, String namePart ) { //System.out.println("findSibling: name to find = "+namePart); if (parent == null || namePart == null) return null; TreeNode child = parent.firstChild; while (child != null) { //System.out.println(" - child name = "+child.nodeName+"; is case sensitive? "+ //child.isCaseSensitive); if (child.isCaseSensitive) { if (namePart.equals( child.nodeName )) { return child; } } else { if (namePart.equalsIgnoreCase( child.nodeName )) { return child; } } child = child.nextSibling; } return null; } /** * Find the node with the given name. */ protected TreeNode findNode( String name ) { //System.out.println("findNode( "+name+" )"); Enumeration enum = parsePath( name ); TreeNode parent = this.m_root; while (parent != null) { if (parent.isRecursive || !enum.hasMoreElements()) { //System.out.println(" -- found node"); return parent; } String partName = (String)enum.nextElement(); //System.out.println(" -- checking part "+partName); parent = findSibling( parent, partName ); //System.out.println(" -- parent = "+parent); } return null; } /** * Find the sibling with the given node name part. */ protected void removeChild( TreeNode parent, TreeNode child ) { if (parent == null || child == null) return; TreeNode sibling = parent.firstChild; if (child.isCaseSensitive) { if (child.nodeName.equals( sibling.nodeName )) { parent.firstChild = child.nextSibling; return; } } else { if (child.nodeName.equalsIgnoreCase( child.nodeName )) { parent.firstChild = child.nextSibling; return; } } while (sibling.nextSibling != null) { if (child.isCaseSensitive) { if (child.nodeName.equals( sibling.nextSibling.nodeName )) { sibling.nextSibling = child.nextSibling; return; } } else { if (child.nodeName.equalsIgnoreCase( sibling.nextSibling.nodeName )) { sibling.nextSibling = child.nextSibling; return; } } sibling = sibling.nextSibling; } // couldn't find child return; } /** * Child must already be initialized correctly. */ protected void addChildNode( TreeNode parent, TreeNode child ) throws PathAlreadyRegisteredException { if (parent == null || child == null) { throw new IllegalArgumentException( "parent or child is null" ); } TreeNode sibling = parent.firstChild; if (sibling == null) { parent.firstChild = child; return; } // loop through all siblings, checking if we can insert the child // for each member, then when the end of the list is found, we // add the child to it. while (true) { // check if we can insert new child if (sibling.isCaseSensitive || child.isCaseSensitive) { if (sibling.nodeName.equals( child.nodeName )) { throw new PathAlreadyRegisteredException(); } } if (sibling.nextSibling == null) { sibling.nextSibling = child; return; } sibling = sibling.nextSibling; } // this point should never be reached. // throw new IllegalStateException( "point never reached" ); } //---------------------------- // Private methods } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/SynchQueue.javalibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000003341107622026474034244 0ustar drazzibdrazzib/* * @(#)SynchQueue.java 0.9.0 04/26/2000 - 13:39:11 * * Copyright (C) 2000,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; /** * A Queue optimized for synchronized access. If a request is made to dequeue() * an item on an empty list, then the requesting thread waits until * an object is placed on the queue. *

    * Care has been taken to ensure proper synchronization. Synchronization * has been optimized so that adding an element to the list does not stop * access to removing an item off the list. The only conflicts occur when * the list has 1 or less items. All synchronization is performed on * internal objects, so the queue itself is still available for outside * classes to use as a synchronization key. *

    * An additional optimization can be made by pooling the ListElement objects, * although it leads to another syncrhonization collision. An alternative * would be to make a ListElement specific synch-queue which only stores * ListElement objects, and doesn't care about the stored values. To prevent * it from having a major memory footprint, it could set a cap on the number * of elements it stores. *

    * A small memory leak is present, for performance purposes. If the * list is "emptied", then there still remains a reference to a list element * on the tail. I have optimized this by nulling out the referenced value, * but the ListElement remains. Hopefully, a single ListElement won't be * much of a memory burden. *

    *

    Changes made for 0.9.1:

    *
      *
    • The inner ListElement class has been changed to be a private * static class. This reduces a bit of a memory overhead caused by the * original implementation of having the class be non-static. *
    • Because of the ordering of the size assignment, and * that the {@link #size()} method is unsynchronized, a situation * could occur where {@link #size()} can return an invalid number * (see * bug #459457 ), such as -9. *

      * A quick analysis this may happen during the enqueue method * when an optimizer sets the tail to the new value before it * sets the size. *

      * The fix involves adding another lock in the {@link * #enqueue( Object )} * method around the new element (which will become the next tail * element), and making the {@link SynchQueue.ListElement.next} * and size values volatile (this will force their setting * to be in the same order specified in the code). *

    • Removed the double-check locking optimization due to possible * failures occuring with it. *
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 26, 2000 (0.9.0 Alpha) * @version $Date: 2003/02/10 22:52:44 $ */ public class SynchQueue { /** * Inner class to maintain the list's objects, and a next pointer. */ private static class ListElement { public Object value; public volatile ListElement next; public ListElement() {} public ListElement( Object o ) { this.value = o; } } /** * List pointers; head points to the removal point, and tail points * to the addition point. */ private ListElement head, tail; /** * Internal size of the queue. */ private volatile int size = 0; /** * Create a new Synchronized Queue with an empty list. */ public SynchQueue() { this.head = new ListElement(); this.tail = new ListElement(); this.tail.next = new ListElement(); } /** * Adds an element to the end of the queue. If the list is empty, * then the next waiting thread is woken up. If the list has one or * fewer elements, this this method will block any access to the queue, * otherwise this only blocks access to adding to the list. * * @param o the object to place at the end of the list. */ public void enqueue( Object o ) { ListElement le = new ListElement( o ); synchronized( le ) { // note: double-checked locking does not work. See // http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html // HOWEVER: // we are doing an object pointer assignment, not a new Object() // operation. // "It will work for 32-bit primitive values // "Although the double-checked locking idiom cannot be used // for references to objects, it can work for 32-bit primitive // values (e.g., int's or float's). Note that it does not work // for long's or double's, since unsynchronized reads/writes of // 64-bit primitives are not guaranteed to be atomic." // // So... will it work? Probably not, due to additional logic // besides just the assignment. synchronized( this.head ) { if (this.head.next == null) { this.head.next = le; this.head.notify(); } } synchronized( this.tail.next ) { this.size++; this.tail.next.next = le; this.tail.next = le; } } } /** * Removes and returns the first element in the list. If the list is * empty, then the thread waits until a new element is placed onto the list. * In general, this method will not be blocked by the enqueue() method. * * @see java.lang.Thread#interrupt() * @see #enqueue( Object ) * @see #dequeue( long, int ) * @see #dequeue( long ) * @return the first element on the list, or null if a time-out * occured. * @exception InterruptedException thrown if the thread, while waiting, * is interrupted. */ public Object dequeue() throws InterruptedException { return dequeue( 0, 0 ); } /** * Removes and returns the first element in the list. If the list is * empty, then the thread waits until a new element is placed onto the list. * In general, this method will not be blocked by the enqueue() method. *

    * The wait can be given a maximum time by specifying the timeout * as a non-zero value. This means that if the given * time expires, and nothing is in the queue, then null is * returned. This allows for polling-like features for the queue. * If timeout is zero, then real time is not taken into * consideration and the thread simply waits until the object is added to * the queue. If timeout is less than zero, then no waiting * is performed if the queue is empty, and null is returned * immediately. * * @param timeout the maximum time to wait in milliseconds. * @see java.lang.Thread#interrupt() * @see #enqueue( Object ) * @see #dequeue( long, int ) * @see #dequeue() * @return the first element on the list, or null if a time-out * occured. * @exception InterruptedException thrown if the thread, while waiting, * is interrupted. */ public Object dequeue( long timeout ) throws InterruptedException { return dequeue( timeout, 0 ); } /** * Removes and returns the first element in the list. If the list is * empty, then the thread waits until a new element is placed onto the list. * In general, this method will not be blocked by the enqueue() method. *

    * The wait can be given a maximum time by specifying the timeout * or nanos as non-zero values. This means that if the given * time expires, and nothing is in the queue, then null is * returned. This allows for polling-like features for the queue. * The total wait time in milliseconds = 1000000*timeout + nanos. * If the total wait is zero, then real time is not taken into * consideration and the thread simply waits until the object is added to * the queue. If timeout is less than zero, then no waiting * is performed if the queue is empty, and null is returned * immediately. * * @param timeout the maximum time to wait in milliseconds. * @param nanos additional time, in nanoseconds range 0-999999. * @see java.lang.Thread#interrupt() * @see #enqueue( Object ) * @see #dequeue() * @see #dequeue( long ) * @return the first element on the list, or null if a time-out * occured. * @exception InterruptedException thrown if the thread, while waiting, * is interrupted. */ public Object dequeue( long timeout, int nanos ) throws InterruptedException { Object o; float dTimeout = (float)(timeout + nanos); synchronized( this.head ) { // this used to be a while (head.next == null) loop, // but now it's ugly to reduce the number of "if" checks. if (this.head.next == null) { // quick check, but needs synchronization if (timeout < 0) { return null; } while (true) { this.head.wait( timeout, nanos ); // check if the element was indeed added... if (this.head.next != null) { // yep! Early out! break; } // Check if we timed-out, or if it was a flakey // notify // - include an epsilon for the floating check... if (dTimeout > 0.9f) { // time-out and a null, so crap out without doing // anything. return null; } } } // end null checking block // guaranteed to not have a null at this point o = this.head.next.value; // remove the minor memory leak this.head.next.value = null; synchronized( this.head.next ) { this.head.next = this.head.next.next; this.size--; } } return o; } /** * Retrieves the top-level object from the list without removing it. * It momentarily blocks the retrieval from the list, but does not * wait if the list is empty. Currently, there is no way to test if * a null was placed in the list, or if the list is empty. * * @return if the list is empty, then null is returned, * otherwise the contents of the top level element in the list is * returned without removing it from the list. */ public Object peek() { Object o = null; synchronized( this.head ) { if (this.head.next != null) { o = this.head.next.value; } // else o = null; } return o; } /** * Checks if the list is empty, by a simple, non-blocking check on * the head element. * * @return true if the list contains no user elements, * otherwise false if at least one user element is present * on the list. */ public boolean isEmpty() { return (this.head.next == null); } /** * @return the current size of the list. Since this method is * completely unsynchronized, the returned value may be off by 1, * due to threading issues. */ public int size() { return this.size; } /** * Removes all the current data in the queue. */ public void removeAll() { synchronized( this.head ) { synchronized( this.tail.next ) { this.head.next = null; // remove the minor memory leak this.tail.next.value = null; this.size = 0; } } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/ObjectCache.javalibgroboutils-java-5.orig/util-datastruct/sources/dev/net/sourceforge/groboutils/util/datastruct/v1/0000644000175000017500000003342507663505317034254 0ustar drazzibdrazzib/* * @(#)ObjectCache.java 0.9.0 04/11/2001 - 13:21:11 * * Copyright (C) 2001-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; /** * An object cache which allows for objects to be added and removed. * If the cache is empty when an object is requested, the object type * is created and returned. There can be a maximum size specified for * the pending object list - if an object is retrieved by the cache, * and the list is beyond its size, then the object is thrown away. * By default, the maximum size is unlimited. *

    * If the cache should not create objects, then a ObjectCreator should * not be given to the cache. *

    * Alternatively, you can specify that the cache not create objects and * instead wait for the objects to be retrieved. *

    * Care has been taken to keep this synchronized across threads. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 11, 2001 (0.9.0 Alpha) * @version $Date: 2003/05/23 20:55:43 $ */ public class ObjectCache { /** * The size to use when you want to specify an unlimited cache size. */ public static final int UNLIMITED_SIZE = -1; /** * An interface which needs to be implemented and given to the * cache in order to create new instances. */ public static interface ObjectCreator { /** * Called when a new object needs to be created. * * @return the newly created object */ public Object createObject(); } /** * A default object creator - given a Class object, it attempts * to create a new Object using the default constructor. */ public static class DefaultObjectCreator implements ObjectCreator { private Class clazz; /** * Defines the class to create an instance in the creation method; * the class must have a no-argument constructor for this * class to work. */ public DefaultObjectCreator( Class clazz ) { if (clazz == null) { throw new IllegalArgumentException( "No null args" ); } this.clazz = clazz; } public Object createObject() { try { return clazz.newInstance(); } catch (Exception e) { return null; } } } /** * We use a synch queue to optimize the store of objects */ private SynchQueue cache = new SynchQueue(); /** * We also need to keep the object created. */ private ObjectCreator creator; /** * Maximum size of the cache. */ private int maxSize = UNLIMITED_SIZE; /** * Records the number of overflows - for performance tuning. */ private int overflowCount = 0; /** * Records the number of underflows - for performance tuning. */ private int underflowCount = 0; //----------------------------------------------------- // Constructors /** * Create a new ObjectCache without an object creator. */ public ObjectCache() { // do nothing } /** * Create a new ObjectCache without an object creator, and * sets the maximum number of objects to keep waiting in the cache. */ public ObjectCache( int maxSize ) { setMaxSize( maxSize ); } /** * Create a new ObjectCache. This uses the given creator to * create new objects for the cache. */ public ObjectCache( ObjectCreator creator ) { setObjectCreator( creator ); } /** * Create a new ObjectCache. This uses the given Class to * create new objects for the cache, using its default constructor. */ public ObjectCache( Class creator ) { setClassCreator( creator ); } /** * Create a new ObjectCache. This uses the given creator to * create new objects for the cache, and sets the internal maximum * number of elements to keep waiting. */ public ObjectCache( ObjectCreator creator, int maxSize ) { setMaxSize( maxSize ); setObjectCreator( creator ); } /** * Create a new ObjectCache. This uses the given Class to * create new objects for the cache, using its default constructor, * and sets the internal maximum * number of elements to keep waiting. */ public ObjectCache( Class creator, int maxSize ) { setMaxSize( maxSize ); setClassCreator( creator ); } /** * Create a new ObjectCache. This uses the given creator to * create new objects for the cache, and sets the internal maximum * number of elements to keep waiting. * * @param fill true if the cache should be filled at * construction time, or false if it should be empty * initially. */ public ObjectCache( ObjectCreator creator, int maxSize, boolean fill ) { setMaxSize( maxSize ); setObjectCreator( creator ); if (fill) { fillCache(); } } /** * Create a new ObjectCache. This uses the given Class to * create new objects for the cache, using its default constructor, * and sets the internal maximum * number of elements to keep waiting. * * @param fill true if the cache should be filled at * construction time, or false if it should be empty * initially. */ public ObjectCache( Class creator, int maxSize, boolean fill ) { setMaxSize( maxSize ); setClassCreator( creator ); if (fill) { fillCache(); } } //----------------------------------------------------- // Public methods /** * Adds an element to the end of the queue. If the list is empty, * then the next waiting thread is woken up. If the list has one or * fewer elements, this this method will block any access to the queue, * otherwise this only blocks access to adding to the list. * * @param o the object to place at the end of the list. */ public void putBack( Object o ) { if (o == null) { // throw an exception - can't insert a null throw new IllegalArgumentException( "Null objects cannot be added into the cache" ); } if (this.maxSize > 0) { if (this.cache.size() >= this.maxSize) { // System.out.println("ObjectCache.putBack: caused overflow"); // ignore the object - we're full this.overflowCount++; return; } } this.cache.enqueue( o ); } /** * Retrieves a cached element. If the cache is empty, and no * creator is known, then null is returned. If the cache is * empty, and a creator is known, then a new object is created and * returned. *

    * Synchronized so that the time between the isEmpty check and the * pull does not have another thread pulling out an instance. Only * the get needs to be synchronized, so as to not mess with the * checks. */ public Object get() { // only synchronize the necesary code. synchronized( this ) { if (!this.cache.isEmpty()) { try { // System.out.println("ObjectCache.get(): not empty, dequeueing"); return this.cache.dequeue(); } catch (InterruptedException ie) { // should never happen - but it might! throw new IllegalStateException("encountered an interrupt: "+ie); } } } // an underflow // doesn't need to be synchronized //System.err.println("ObjectCache.get(): underflow, calling createObject"); //(new Throwable()).printStackTrace(); this.underflowCount++; return createObject(); } /** * Retrieves a cached element. If the cache is empty, then one of several * things can happen, based on the time passed in: *

      *
    • < 0: null is immediately returned. This is * the identical behavior to calling {@link #get()} with * a null creator. *
    • 0: the routine will wait indefinitely until * an object is {@link #putBack( Object )} into the cache. *
    • > 0: the routine will wait up to the given number * of milliseconds for another object to be * {@link #putBack( Object )}. If by that time the cache is still * empty, then null is returned. *
    *

    * Important parts of the code are synchronized. */ public Object get( long millisWaitTime ) throws InterruptedException { // only synchronize the necesary code. synchronized( this ) { // normal behavior if (!this.cache.isEmpty()) { try { // System.out.println("ObjectCache.get( "+millisWaitTime+" ): not empty, dequeueing"); return this.cache.dequeue(); } catch (InterruptedException ie) { // should never happen - but it might! throw new IllegalStateException("encountered an interrupt: "+ie); } } } // an underflow // doesn't need to be synchronized //System.out.println("ObjectCache.get( "+millisWaitTime+" ): underflow..."); //(new Throwable()).printStackTrace(); this.underflowCount++; return this.cache.dequeue( millisWaitTime ); } /** * Retrieves the number of "overflows" encountered. An overflow occurs * when the cache is full and a {@link #putBack( Object )} is called. */ public int getOverflows() { return this.overflowCount; } /** * Retrieves the number of "underflows" encountered. An underflow occurs * when the cache is empty and a {@link #get()} is called. */ public int getUnderflows() { return this.underflowCount; } /** * Resets the internal maximum number of objects that the cache can * hold. Note that it does not immediately clear out the extra objects - * that is naturally cleared by the {@link #putBack( Object )} ignoring * overflows. */ public void setMaxSize( int size ) { this.maxSize = size; } /** * */ public int getMaxSize() { return this.maxSize; } /** * Sets the internal cache-underflow Object creator. */ public void setObjectCreator( ObjectCreator creator ) { this.creator = creator; } /** * Creates a new DefaultObjectCreator based on the given class. */ public void setClassCreator( Class creator ) { ObjectCreator oc = null; if (creator != null) { oc = new DefaultObjectCreator( creator ); } setObjectCreator( oc ); } /** * Create a new object and put it into the cache. This follows the * rules of {@link #putBack( Object )}. */ public void addObject() { Object o = createObject(); if (o != null) { putBack( o ); } } /** * Fills the cache to its maximum. If there is no maximum or there * is no creator, then nothing is done. */ public void fillCache() { if (this.creator != null) { // even if creation doesn't work, go ahead and increment the count // - this prevents an infinite loop for (int i = this.cache.size(); i < this.maxSize; i++) { addObject(); } } } //----------------------------------------------------- // Protected methods /** * Generates an Object for the cache. May return null. */ protected Object createObject() { Object o = null; if (this.creator != null) { // System.out.println("ObjectCache.createObject(): calling creator's createObject"); o = this.creator.createObject(); } return o; } } libgroboutils-java-5.orig/util-datastruct/sources/dev/about.txt0000644000175000017500000000015207521071674025126 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/util-datastruct/sources/ut/0000755000175000017500000000000011271425773023127 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ut/net/0000755000175000017500000000000010011472774023707 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/0000755000175000017500000000000010011472774026232 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472774030423 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/0000755000175000017500000000000010011472774031400 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/0000755000175000017500000000000010011472774033556 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/0000755000175000017500000000000011271425773034112 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/HashCacheUTest.javalibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/H0000644000175000017500000001721507663505434034235 0ustar drazzibdrazzib/* * @(#)HashCacheUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; import net.sourceforge.groboutils.junit.v1.MultiThreadedTestRunner; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 17, 2001 (Alpha 0.9.0) * @version $Date: 2003/05/23 20:57:00 $ */ public class HashCacheUTest extends TestCase { private static final Class THIS_CLASS = HashCacheUTest.class; public HashCacheUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public class OMgr implements HashCache.ObjectManager { private int count = 0; private int closecount = 0; public synchronized Object createObject( Object key ) { return "["+key+"] "+(++count); } public synchronized void cleanUpObject( Object key, Object value ) { ++this.closecount; } public int getCreationCount() { return this.count; } public int getCloseCount() { return this.closecount; } } public void testConstructor1() { HashCache oc = new HashCache( new OMgr(), 10 ); assertEquals( "Size must be instantiation size.", 10, oc.getMaxSize() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflowCount() ); } public void testConstructor2() { try { new HashCache( null, 10 ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor3() { try { new HashCache( null, 0 ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor4() { try { new HashCache( new OMgr(), 1 ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception } } public void testConstructor5() { try { new HashCache( new OMgr(), -1 ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException iae) { // test exception } } public void testGet1() { OMgr om = new OMgr(); HashCache hc = new HashCache( om, 10 ); try { hc.get( null ); } catch (NullPointerException npe) { // test exception? } } public void testGet2() { OMgr om = new OMgr(); HashCache hc = new HashCache( om, 10 ); Object o = hc.get( "a" ); assertNotNull( "get returned null.", o ); assertTrue( "incorrect type returned.", o instanceof String ); assertEquals( "Incorrect value of returned object.", "[a] 1", (String)o ); assertEquals( "The mgr reported the creation.", 1, om.getCreationCount() ); Object o2 = hc.get( "a" ); assertSame( "Did not return the same object.", o, o2 ); assertEquals( "The mgr was not called for the creation.", 1, om.getCreationCount() ); } public void testGet3() { OMgr om = new OMgr(); HashCache hc = new HashCache( om, 2 ); Object o = hc.get( "a" ); Object o2 = hc.get( "b" ); Object o3 = hc.get( "c" ); assertEquals( "The mgr was not called for the creation correctly.", 3, om.getCreationCount() ); assertEquals( "The mgr was not called for the clean-up.", 1, om.getCloseCount() ); assertEquals( "The overflow count is wrong.", 1, hc.getOverflowCount() ); assertEquals( "The size is wrong.", 2, hc.getSize() ); } public void testGet4() { System.out.println("Get4:"); OMgr om = new OMgr(); HashCache hc = new HashCache( om, 10 ); int requests[] = { 0,1,2,3, 0,2, // looks like 1,3,0,2 4,5,6, 0,3,6, // looks like 1,2,4,5,0,3,6 7,8,9,10,11, 1,2, // recreated, looks like 0,3,6,7,8,9,10,11,1,2 12,13,14,15,16,17,18,19, 0 // recreated, looks like 2,12,13,14,15,16,17,18,19,0 }; for (int i = 0; i < requests.length; ++i) { hc.get( new Integer( requests[i] ) ); //hc.printChain(); } assertEquals( "The mgr was not called for the creation correctly.", 23, om.getCreationCount() ); assertEquals( "The mgr was not called for the clean-up.", 13, om.getCloseCount() ); assertEquals( "The overflow count is wrong.", 13, hc.getOverflowCount() ); assertEquals( "The size is wrong.", 10, hc.getSize() ); } public void testResetOverflowCount1() { System.out.println("Get4:"); OMgr om = new OMgr(); HashCache hc = new HashCache( om, 10 ); hc.resetOverflowCount(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/SynchQueueUTest.javalibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/S0000644000175000017500000004467310071613457034250 0ustar drazzibdrazzib/* * @(#)SynchQueueUTest.java * * Copyright (C) 2001-2004 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; import net.sourceforge.groboutils.junit.v1.MultiThreadedTestRunner; import net.sourceforge.groboutils.junit.v1.TestMonitorRunnable; import net.sourceforge.groboutils.junit.v1.TestRunnable; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * *

    Changes made for 0.9.1:

    *
      *
    • Added a new test to check the size of the queue during the * threaded part. The size should never go below 0. *
    * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 14, 2001 (Alpha 0.9.0) * @version $Date: 2004/06/08 20:55:40 $ */ public class SynchQueueUTest extends TestCase { private static final Class THIS_CLASS = SynchQueueUTest.class; private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); public SynchQueueUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public void testInstantiate1() { Object o = new SynchQueue(); assertNotNull( "New should never return null.", o ); assertTrue( "Instantiation must be of the correct class.", o instanceof SynchQueue ); assertTrue( "Queue needs to be empty immediately after instantiation.", ((SynchQueue)o).isEmpty() ); } public void testSimpleAdd1() throws InterruptedException { SynchQueue sq = new SynchQueue(); Object o1 = new Object(); sq.enqueue( o1 ); assertTrue( "Queue should not be empty.", !sq.isEmpty() ); Object o2 = sq.dequeue(); assertEquals( "What gets put in, needs to equal what gets put out.", o1, o2 ); assertTrue( "Queue should be empty after removing.", sq.isEmpty() ); } public void testAddSize1() { SynchQueue sq = new SynchQueue(); assertEquals( "Size must be 0 immediately after instantiation.", 0, sq.size() ); for (int i = 1; i <= 20; i++) { Object o = new Object(); sq.enqueue( o ); assertEquals( "Size must be "+i+" after enqueue call.", i, sq.size() ); } } public void testRemoveSize1() throws InterruptedException { SynchQueue sq = new SynchQueue(); int count = 0; for (int i = 1; i <= 20; i++) { Object o = new Object(); sq.enqueue( o ); count++; //System.out.println("Added element: size now "+count); } while( count > 0 ) { assertTrue( "Queue should not be empty.", !sq.isEmpty() ); assertEquals( "Queue size must be "+count+".", count, sq.size() ); //System.out.println("Removing element: size is now "+sq.size()+" (should be "+count+")" ); sq.dequeue(); count--; } assertTrue( "Queue should be empty after removing.", sq.isEmpty() ); assertEquals( "Size must be 0 after dequeue all.", 0, sq.size() ); } public void testUniqueRetrieval1() throws InterruptedException { SynchQueue sq = new SynchQueue(); int maxSize = 20; Object objs[] = new Object[ maxSize ]; for (int i = 0; i < maxSize; i++) { objs[i] = "element "+i; sq.enqueue( objs[i] ); } // parse forwards through the list for checking the return values // (its a queue, not a stack) //System.err.println("Starting dequeue loop:"); for (int i = 0; i < maxSize; i++) { //System.err.println("dequeueing element index "+i); assertTrue( "Queue cannot be empty at this point: should have "+(i+1)+ " elements left.", !sq.isEmpty() ); Object o = sq.dequeue(); assertNotNull( "Queue must never return null from dequeue.", o ); assertEquals( "Queue did not return the right object in the right "+ "order (element "+i+", size = "+sq.size()+")", objs[i], o ); } // yeah, we already have a test for this - but just to be careful. assertTrue( "Queue must be empty.", sq.isEmpty() ); } public void testIdenticalRetrieval1() throws InterruptedException { SynchQueue sq = new SynchQueue(); int maxSize = 20; Object obj = new Object(); for (int i = 0; i < maxSize; i++) { sq.enqueue( obj ); } // parse forwards through the list for checking the return values // (its a queue, not a stack) //System.err.println("Starting dequeue loop:"); for (int i = 0; i < maxSize; i++) { //System.err.println("dequeueing element index "+i); assertTrue( "Queue cannot be empty at this point: should have "+(i+1)+ " elements left.", !sq.isEmpty() ); Object o = sq.dequeue(); assertNotNull( "Queue must never return null from dequeue.", o ); assertEquals( "Queue did not return the right object in the right "+ "order (element "+i+", size = "+sq.size()+")", obj, o ); } // yeah, we already have a test for this - but just to be careful. assertTrue( "Queue must be empty.", sq.isEmpty() ); } public void testPeek1() throws InterruptedException { SynchQueue sq = new SynchQueue(); assertNull( "Peek must return null on an empty queue", sq.peek() ); int maxSize = 20; Object objs[] = new Object[ maxSize ]; for (int i = 0; i < maxSize; i++) { objs[i] = "element "+i; sq.enqueue( objs[i] ); } // parse forwards through the list for checking the return values // (its a queue, not a stack) //System.err.println("Starting dequeue loop:"); for (int i = 0; i < maxSize; i++) { //System.err.println("dequeueing element index "+i); assertTrue( "Queue cannot be empty at this point: should have "+(i+1)+ " elements left.", !sq.isEmpty() ); Object o1 = sq.peek(); assertNotNull( "Peek must not return null on a non-null queue",o1 ); Object o2 = sq.dequeue(); assertNotNull( "Queue must never return null from dequeue.", o2 ); assertEquals( "Peek did not return the right element in the right "+ "order (element "+i+", size = "+sq.size()+")", o2, o1 ); } // yeah, we already have a test for this - but just to be careful. assertNull( "Peek must return null on an empty queue", sq.peek() ); } public void testRemoveAll1() throws InterruptedException { SynchQueue sq = new SynchQueue(); assertNull( "Peek must return null on an empty queue", sq.peek() ); int maxSize = 20; Object objs[] = new Object[ maxSize ]; for (int i = 0; i < maxSize; i++) { objs[i] = "element "+i; sq.enqueue( objs[i] ); } assertEquals("Queue must have "+maxSize+" elements.", maxSize, sq.size() ); sq.removeAll(); assertEquals("Queue must be empty.", 0, sq.size() ); assertTrue( "Queue must be empty.", sq.isEmpty() ); // now verify that the queue still works correctly testUniqueRetrieval1(); } private class PutObjects extends TestRunnable { private SynchQueue m_sq; private Object[] m_objs; private long m_delay; public PutObjects( SynchQueue sq, Object[] list, long delayMillis ) { this.m_sq = sq; this.m_objs = list; this.m_delay = delayMillis; } public void runTest() throws Throwable { try { DOC.getLog().debug("Entering PutObjects.runTest()"); for (int i = 0; i < this.m_objs.length; i++) { // for putting into the list, we delay before inserting DOC.getLog().debug( "Enqueue delay "+this.m_delay+ " millis." ); delay( this.m_delay ); DOC.getLog().debug( new Object[] { "Enqueue object '", this.m_objs[i], "'" } ); this.m_sq.enqueue( this.m_objs[i] ); } } finally { DOC.getLog().debug("Leaving PutObjects.runTest()"); } } } private class CheckSize extends TestMonitorRunnable { private SynchQueue m_sq; private int m_maxSize; public CheckSize( SynchQueue sq, int maxSize ) { this.m_sq = sq; this.m_maxSize = maxSize; } public void runMonitor() throws Throwable { int size = this.m_sq.size(); assertTrue( "Invalid queue size "+size+ ": must be within the set [0, "+this.m_maxSize+"].", (size >= 0) && (size <= this.m_maxSize) ); } } private class GetObjects extends TestRunnable { private SynchQueue m_sq; private Object[] m_objs; private long m_delay; private long m_waitMillis; private int m_waitNanos; public GetObjects( SynchQueue sq, Object[] expectedlist, long delayMillis ) { this( sq, expectedlist, delayMillis, -1, -1 ); } public GetObjects( SynchQueue sq, Object[] expectedlist, long delayMillis, long waitTime, int nanos ) { this.m_sq = sq; this.m_objs = expectedlist; this.m_delay = delayMillis; this.m_waitMillis = waitTime; this.m_waitNanos = nanos; } public void runTest() throws Throwable { DOC.getLog().debug("Entering GetObjects.runTest()"); for (int i = 0; i < this.m_objs.length; i++) { DOC.getLog().debug("Dequeue delay "+this.m_delay+ " millis."); delay( this.m_delay ); Object o = dequeue(); assertEquals( "Retrieved element "+i+" doesn't match", this.m_objs[i], o ); } DOC.getLog().debug("Leaving GetObjects.runTest()"); } protected Object dequeue() throws Throwable { long startTime = System.currentTimeMillis(); Object ret; if (this.m_waitMillis > 0) { if (this.m_waitNanos > 0) { DOC.getLog().debug("dequeue w/ nano delay"); ret = this.m_sq.dequeue( this.m_waitMillis, this.m_waitNanos ); } else { DOC.getLog().debug("dequeue w/ millis dely ["+ this.m_waitMillis+"]"); ret = this.m_sq.dequeue( this.m_waitMillis ); } } else { DOC.getLog().debug("dequeue w/ no time-out"); ret = this.m_sq.dequeue(); } long endTime = System.currentTimeMillis(); DOC.getLog().debug( new Object[] { "returning dequeued object '", ret, "' after "+ (endTime - startTime)+" milliseconds." } ); return ret; } } public void testSimpleThreaded() throws Throwable { DOC.getLog().info( "Entering testSimpleThreaded" ); int numElements = 20; SynchQueue sq = new SynchQueue(); Object list[] = new Object[ numElements ]; for (int i = 0; i < numElements; i++) { list[i] = "element "+i; } // MCA: 26-Oct-2003: changed GetObjects delay to 20 ms due to // coverage number delays and file I/O on slower machines. TestRunnable tcs[] = { new PutObjects( sq, list, 10 ), new GetObjects( sq, list, 20 ) }; // allow for a maximum of 60 seconds for this test to run DOC.getLog().debug("Starting SimpleThreaded()"); runTestRunnables( tcs, new CheckSize( sq, numElements ), 1000 * 60 ); DOC.getLog().debug("Finished SimpleThreaded()"); } public void testSyncapatedThreaded() throws Throwable { DOC.getLog().info( "Entering testSyncapatedThreaded" ); int numElements = 20; SynchQueue sq = new SynchQueue(); Object list[] = new Object[ numElements ]; for (int i = 0; i < numElements; i++) { list[i] = "element "+i; } TestRunnable tcs[] = { new PutObjects( sq, list, 1000 ), new GetObjects( sq, list, 10 ) }; DOC.getLog().debug("Starting SyncapatedThreaded()"); runTestRunnables( tcs, new CheckSize( sq, numElements ), 1000 * 60 ); DOC.getLog().debug("Finished SyncapatedThreaded()"); } public void testDelayMillisThreaded() throws Throwable { DOC.getLog().info( "Entering testDelayMillisThreaded" ); int numElements = 1; Object list[] = new Object[ numElements ]; SynchQueue sq = new SynchQueue(); // don't wait - detect the null immediately TestRunnable tcs[] = { new GetObjects( sq, list, 0, 10, -1 ) }; DOC.getLog().debug("Starting DelayMillisThreaded()"); runTestRunnables( tcs, new CheckSize( sq, numElements ), 2000 ); DOC.getLog().debug("Finished DelayMillisThreaded()"); } public void testDelayNanosThreaded() throws Throwable { DOC.getLog().info( "Entering testDelayNanosThreaded" ); int numElements = 1; Object list[] = new Object[ numElements ]; SynchQueue sq = new SynchQueue(); // wait for 10 millis, 10 nanos, for null. CheckSize cs = new CheckSize( sq, numElements ); TestRunnable tcs[] = { new GetObjects( sq, list, 0, 10, 10 ) }; DOC.getLog().debug("Starting DelayNanosThreaded()"); runTestRunnables( tcs, new CheckSize( sq, numElements ), 2000 ); DOC.getLog().debug("Finished DelayNanosThreaded()"); } public void testPutDelayMillisThreaded() throws Throwable { DOC.getLog().info( "Entering testPutDelayMillisThreaded" ); int numElements = 20; SynchQueue sq = new SynchQueue(); Object list[] = new Object[ numElements ]; for (int i = 0; i < numElements; i++) { list[i] = "element "+i; } TestRunnable tcs[] = { new PutObjects( sq, list, 10 ), new GetObjects( sq, list, 0, 500, -1 ) }; DOC.getLog().debug("Starting PutDelayMillisThreaded()"); runTestRunnables( tcs, new CheckSize( sq, numElements ), 1000 * 60 ); DOC.getLog().debug("Finished PutDelayMillisThreaded()"); } public void testPutDelayMillisThreaded2() throws Throwable { DOC.getLog().info( "Entering testPutDelayMillisThreaded2" ); int numElements = 5; SynchQueue sq = new SynchQueue(); Object list[] = new Object[ numElements ]; Object nulllist[] = new Object[ numElements ]; for (int i = 0; i < numElements; i++) { list[i] = "element "+i; } // timing issues cause these numbers not to match up perfectly. TestRunnable tcs[] = { new PutObjects( sq, list, numElements * 500 ), new GetObjects( sq, nulllist, 0, 100, -1 ) }; DOC.getLog().debug("Starting PutDelayMillisThreaded2()"); runTestRunnables( tcs, new CheckSize( sq, numElements ), 1000 * 60 ); DOC.getLog().debug("Finished PutDelayMillisThreaded2()"); } protected void runTestRunnables( TestRunnable tr[], TestRunnable tm, long maxtime ) throws Throwable { MultiThreadedTestRunner mttr = new MultiThreadedTestRunner( tr, new TestRunnable[] { tm } ); mttr.runTestRunnables( maxtime ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/PathRegistryUTest.javalibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/P0000644000175000017500000003257707622026474034252 0ustar drazzibdrazzib/* * @(#)PathRegistryUTest.java 0.9.0 15-MAR-2001 - 18:27 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; import net.sourceforge.groboutils.junit.v1.MultiThreadedTestRunner; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 15, 2001 (Alpha 0.9.0) * @version $Date: 2003/02/10 22:52:44 $ */ public class PathRegistryUTest extends TestCase { private static final Class THIS_CLASS = PathRegistryUTest.class; public PathRegistryUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public void testInstantiate() { new PathRegistry( '.', true ); new PathRegistry( '.', false ); } public void testAddCaseSensitiveNotRecursive() throws PathAlreadyRegisteredException { PathRegistry pr = new PathRegistry( '/', true ); // now try to get something not added notRegisteredTest( pr, "root" ); Object o1 = new Object(); pr.register( "root", o1, false, true ); registeredRightTest( pr, "root", o1 ); Object o2; // now try to get the path with wrong case caseNotRegisteredTest( pr, "root", '/' ); // now try to get a sub path notRegisteredTest( pr, "root/empty" ); // now try to get something not added notRegisteredTest( pr, "unknown" ); // now try to get something not added notRegisteredTest( pr, "/unknown" ); // now add a sub-path notRegisteredTest( pr, "root/deep" ); Object o1a = new Object(); pr.register( "root/deep", o1a, false, true ); registeredRightTest( pr, "root/deep", o1a ); // now try to get the path with wrong case caseNotRegisteredTest( pr, "root/deep", '/' ); // now try to get a bad sub path notRegisteredTest( pr, "root/empty" ); notRegisteredTest( pr, "root/deep/empty" ); // now try to get something not added notRegisteredTest( pr, "unknown" ); } public void testAddTwiceException() throws PathAlreadyRegisteredException { PathRegistry pr = new PathRegistry( '/', true ); Object o1 = new Object(); notRegisteredTest( pr, "root" ); pr.register( "root", o1, false, true ); registeredRightTest( pr, "root", o1 ); // now try to register the same path again alreadyRegisteredTest( pr, "root" ); } public void testAddCaseInsensitiveNotRecursive() throws PathAlreadyRegisteredException { PathRegistry pr = new PathRegistry( '/', true ); notRegisteredTest( pr, "root" ); Object o1 = new Object(); pr.register( "root", o1, false, false ); // now try to get with variations caseRegisteredRightTest( pr, "root", o1, '/' ); // now try to get a sub path caseNotRegisteredTest( pr, "root/unknown", '/' ); } public void testAddTwiceExceptionCaseInsensitive() throws PathAlreadyRegisteredException { PathRegistry pr = new PathRegistry( '/', true ); notRegisteredTest( pr, "root" ); Object o1 = new Object(); pr.register( "root", o1, false, false ); registeredRightTest( pr, "root", o1 ); // now try to register the same path again caseAlreadyRegisteredTest( pr, "root", '/' ); } public void testAddCaseSensitiveRecursive() throws PathAlreadyRegisteredException { PathRegistry pr = new PathRegistry( '/', true ); notRegisteredTest( pr, "root" ); Object o1 = new Object(); pr.register( "root", o1, true, true ); registeredRightTest( pr, "root", o1 ); // now try to get the path with wrong case caseNotRegisteredTest( pr, "root", '/' ); // now try to get a sub path registeredRightTest( pr, "root/empty", o1 ); // now try to get something not added notRegisteredTest( pr, "unknown" ); // now try to get something not added notRegisteredTest( pr, "unknown/subpath" ); } public void testAddTwiceExceptionRecursive() throws PathAlreadyRegisteredException { PathRegistry pr = new PathRegistry( '/', true ); notRegisteredTest( pr, "root" ); Object o1 = new Object(); pr.register( "root", o1, true, true ); registeredRightTest( pr, "root", o1 ); alreadyRegisteredTest( pr, "root" ); alreadyRegisteredTest( pr, "root/empty" ); alreadyRegisteredTest( pr, "root/whatever" ); alreadyRegisteredTest( pr, "root/empty/whatever" ); } public void testRemoveCaseSensitiveNotResursive() throws PathAlreadyRegisteredException, NoRegisteredComponentException { PathRegistry pr = new PathRegistry( '/', true ); notRegisteredTest( pr, "root" ); Object o1 = new Object(); pr.register( "root", o1, true, true ); registeredRightTest( pr, "root", o1 ); cantRemoveEntryTest( pr, "unknown" ); caseCantRemoveEntryTest( pr, "root", '/' ); cantRemoveEntryTest( pr, "root/empty" ); pr.remove( "root" ); cantRemoveEntryTest( pr, "root" ); } //---------------------------------------------------------- // Protected helper methods /** * Assert that the given path has nothing registered to it. */ protected void notRegisteredTest( PathRegistry pr, String path ) { Object o = pr.get( path ); assertTrue( "Must return null on bad path and sub-path '"+path+ "', but found ["+o+"].", o == null ); } /** * Assert that the given path's case variations are not registered * (however, the original path may be registered). */ protected void caseNotRegisteredTest( PathRegistry pr, String path, char separator ) { String[] variations = getCaseVariations( path, separator ); for (int i = 0; i < variations.length; i++) { if (!path.equals( variations[i] )) { notRegisteredTest( pr, variations[i] ); } } } /** * Assert that the given path is registered to the given object. */ protected void registeredRightTest( PathRegistry pr, String path, Object expectedObj ) { Object o2 = pr.get( path ); assertNotNull( "Path must be registered.", o2 ); assertEquals( "What gets put in, needs to equal what gets put out.", expectedObj, o2 ); } /** * Assert that the given path and its case variations are registered/ */ protected void caseRegisteredRightTest( PathRegistry pr, String path, Object expectedObj, char separator ) { registeredRightTest( pr, path, expectedObj ); String[] variations = getCaseVariations( path, separator ); for (int i = 0; i < variations.length; i++) { registeredRightTest( pr, variations[i], expectedObj ); } } /** * Attempt to register an object at the given path. The test succeeds * if it is already registered, and fails if it does not throw an * exception. */ protected void alreadyRegisteredTest( PathRegistry pr, String path ) { try { pr.register( path, new Object(), false, false ); } catch (PathAlreadyRegisteredException pare) { // good check! return; } fail( "PathRegistry should have thrown an exception" ); } /** * Pass if the correct exception is thrown when trying to remove * an entry that doesn't exist. */ protected void cantRemoveEntryTest( PathRegistry pr, String path ) { try { pr.remove( path ); } catch (NoRegisteredComponentException nrce) { // good check! return; } fail( "PathRegistry should have thrown an exception" ); } protected void caseCantRemoveEntryTest( PathRegistry pr, String path, char separator ) { String[] variations = getCaseVariations( path, separator ); for (int i = 0; i < variations.length; i++) { if (!path.equals( variations[i] )) { cantRemoveEntryTest( pr, variations[i] ); } } } /** * Attempt to register the given path and its case variations. */ protected void caseAlreadyRegisteredTest( PathRegistry pr, String path, char separator ) { alreadyRegisteredTest( pr, path ); String[] variations = getCaseVariations( path, separator ); for (int i = 0; i < variations.length; i++) { alreadyRegisteredTest( pr, variations[i] ); } } private static java.util.Random s_rand = new java.util.Random(); private static synchronized int nextInt( int n ) { // almost identical to JDK 1.2's Random.nextInt( n ) if (n <= 0) throw new IllegalArgumentException("n must be > 0"); if ((n & -n) == n) // n is a power of 2 { // mask by 7fff... to force it to be positive return (int)((n * ((long)s_rand.nextInt() & 0x7fffffffL) ) >> 31); } int bits, val; do { // mask by 7fff... to force it to be positive bits = s_rand.nextInt() & 0x7fffffff; val = bits % n; } while(bits - val + (n-1) < 0); return val; } /** * Get a set of variations in case upper / lower of the given * path. */ protected String[] getCaseVariations( String orig, char separator ) { orig = orig.toLowerCase(); char buff[] = orig.toCharArray(); int len = buff.length; if (len <= 0) { return new String[0]; } if (len == 1) { return new String[] { orig, orig.toUpperCase() }; } java.util.Vector var = new java.util.Vector(); for (int i = 0; i < len; i++) { int pos1 = nextInt( len ); int pos2 = nextInt( len ); char origChar1 = buff[ pos1 ]; char origChar2 = buff[ pos2 ]; if (origChar1 != separator) buff[ pos1 ] = Character.toUpperCase( origChar1 ); String s = new String( buff ); if (!s.equals( orig )) var.addElement( s ); if (origChar2 != separator) buff[ pos2 ] = Character.toUpperCase( origChar2 ); if (!s.equals( orig )) var.addElement( s ); if (origChar1 != separator) buff[ pos1 ] = Character.toLowerCase( origChar1 ); if (!s.equals( orig )) var.addElement( s ); if (origChar2 != separator) buff[ pos2 ] = Character.toLowerCase( origChar2 ); if (!s.equals( orig )) var.addElement( s ); buff[ pos1 ] = origChar1; buff[ pos2 ] = origChar2; } String ss[] = new String[ var.size() ]; var.copyInto( ss ); return ss; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/ObjectCacheUTest.javalibgroboutils-java-5.orig/util-datastruct/sources/ut/net/sourceforge/groboutils/util/datastruct/v1/O0000644000175000017500000001715207622026474034241 0ustar drazzibdrazzib/* * @(#)ObjectCacheUTest.java 0.9.0 17-APR-2001 - 14:40 * * Copyright (C) 2001,,2003 2002 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.util.datastruct.v1; import net.sourceforge.groboutils.junit.v1.MultiThreadedTestRunner; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 17, 2001 (Alpha 0.9.0) * @version $Date: 2003/02/10 22:52:44 $ */ public class ObjectCacheUTest extends TestCase { private static final Class THIS_CLASS = ObjectCacheUTest.class; public ObjectCacheUTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } protected void setUp() throws Exception { super.setUp(); // set ourself up } protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } public class OCreator implements ObjectCache.ObjectCreator { private int count = 0; public synchronized Object createObject() { return "Object "+(++count); } public int getCreationCount() { return count; } } public void testInstantiate() { ObjectCache oc = new ObjectCache(); assertEquals( "Size must be at default of UNLIMITED.", oc.UNLIMITED_SIZE, oc.getMaxSize() ); assertEquals( "Underflows must be at zero.", 0, oc.getUnderflows() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflows() ); // this test only works because we didn't specify a creator // needs to be at end to avoid underflows assertTrue( "Cache should be empty after creation.", oc.get() == null ); oc = new ObjectCache( 10 ); assertEquals( "Size must be at specified size.", 10, oc.getMaxSize() ); assertEquals( "Underflows must be at zero.", 0, oc.getUnderflows() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflows() ); // this test only works because we didn't specify a creator // needs to be at end to avoid underflows assertTrue( "Cache should be empty after creation.", oc.get() == null ); oc = new ObjectCache( Object.class ); assertEquals( "Size must be at default of UNLIMITED.", oc.UNLIMITED_SIZE, oc.getMaxSize() ); assertEquals( "Underflows must be at zero.", 0, oc.getUnderflows() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflows() ); oc = new ObjectCache( Object.class, 10 ); assertEquals( "Size must be at specified size.", 10, oc.getMaxSize() ); assertEquals( "Underflows must be at zero.", 0, oc.getUnderflows() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflows() ); oc = new ObjectCache( new OCreator() ); assertEquals( "Size must be at default of UNLIMITED.", oc.UNLIMITED_SIZE, oc.getMaxSize() ); assertEquals( "Underflows must be at zero.", 0, oc.getUnderflows() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflows() ); oc = new ObjectCache( new OCreator(), 10 ); assertEquals( "Size must be at specified size.", 10, oc.getMaxSize() ); assertEquals( "Underflows must be at zero.", 0, oc.getUnderflows() ); assertEquals( "Overflows must be at zero.", 0, oc.getOverflows() ); } public void testSimpleAdd() throws InterruptedException { ObjectCache oc = new ObjectCache(); Object o1 = new Object(); // this test only works because we didn't specify a creator assertTrue( "Cache should be empty after creation.", oc.get() == null ); oc.putBack( o1 ); Object o2 = oc.get(); assertEquals( "What gets put in, needs to equal what gets put out.", o1, o2 ); // this test only works because we didn't specify a creator assertTrue( "Cache should be empty after removing.", oc.get() == null ); } public void testClassCreator() { ObjectCache oc = new ObjectCache( Object.class ); Object o1 = oc.get(); assertNotNull( "Cache should have created an entry.", o1 ); assertEquals( "Cache should have created an Object.", Object.class, o1.getClass() ); } public void testObjectCreator() { ObjectCache oc = new ObjectCache( new OCreator() ); Object o1 = oc.get(); assertNotNull( "Cache should have created an entry.", o1 ); assertEquals( "Cache should have created a String.", String.class, o1.getClass() ); } public void testFill() { OCreator creator = new OCreator(); ObjectCache oc = new ObjectCache( creator, 5, true ); assertEquals( "Cache did not fill itself.", 5, creator.getCreationCount() ); // empty the cache for (int i = 0; i < 5; i++) { Object o = oc.get(); assertNotNull( "Cache with creator should never return null.", o ); } // fill it up again oc.fillCache(); assertEquals( "Cache did not fill itself.", 10, creator.getCreationCount() ); } public void testPutBack() { ObjectCache oc = new ObjectCache( 1 ); Object o1 = new Object(); Object o2 = new Object(); oc.putBack( o1 ); oc.putBack( o2 ); assertEquals( "ObjectCache should have an overflow.", 1, oc.getOverflows() ); Object o3 = oc.get(); assertEquals( "Cache should have returned 1st object.", o1, o3 ); Object o4 = oc.get(); assertEquals( "Cache should have returned null.", null, o4 ); } } libgroboutils-java-5.orig/util-datastruct/sources/ut/about.txt0000644000175000017500000000012207521071674024775 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/util-datastruct/sources/iut/0000755000175000017500000000000011271425773023300 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/iut/about.txt0000644000175000017500000000021107521071674025145 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/util-datastruct/sources/eut/0000755000175000017500000000000011271425773023274 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/sources/eut/about.txt0000644000175000017500000000015307521071674025146 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/util-datastruct/CHANGES.TXT0000644000175000017500000000433307622026473022467 0ustar drazzibdrazzib v1.0.0 * Changed build to reflect new version. * Separated out the packages, and moved them into a single CVS project, to allow for a simpler piecemeal class inclusion mechanism. * Created two primary javac structures - one for jdk 1.1, and one for jdk1.2+. * Integrated the GroboUtils 'util.datastruct' hierarchy into this hierarchy. * Moved the license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/util-datastruct/xdocs/0000755000175000017500000000000011271425773022134 5ustar drazzibdrazziblibgroboutils-java-5.orig/util-datastruct/xdocs/summary.xml0000644000175000017500000000377607655132717024374 0ustar drazzibdrazzib util-datastruct net.sourceforge.groboutils.util.datastruct.v1 Contains various data structures, all JDK 1.1 compatible. PathRegistry A tree structure which allows for elements to be registered, deregistered, and accessed. Tree elements can define themselves as case sensitive or insensitive. They may also define that all sub-nodes should return the current parent node. Nodes are accessed through a single String, which is parsed internally. The path separator may be any character. SynchQueue A Queue (first-in, first-out) which allows for waiting indefinitely or for a specific period of time for a new element to be added to the Queue. Useful for passing data between threads. This has been optimized for synchronization. ObjectCache A store of reserved objects to prevent the Garbage Collector from working overtime on commonly used objects. It has options for setting the maximum and minimum sizes for the number of stored objects. 03-May-2003: Just entered RC 1. The documentation will need to be completed before this goes gold. libgroboutils-java-5.orig/util-datastruct/xdocs/about.xml0000644000175000017500000000240507655132717023775 0ustar drazzibdrazzib About $Date: 2003/05/04 06:40:15 $ Matt Albrecht Contains various data structures, all JDK 1.1 compatible.
      A Queue (first-in, first-out) which allows for waiting indefinitely or for a specific period of time for a new element to be added to the Queue. Useful for passing data between threads. This has been optimized for synchronization. A tree structure which allows for elements to be registered, deregistered, and accessed. Tree elements can define themselves as case sensitive or insensitive. They may also define that all sub-nodes should return the current parent node. Nodes are accessed through a single String, which is parsed internally. The path separator may be any character. A store of reserved objects to prevent the Garbage Collector from working overtime on commonly used objects. It has options for setting the maximum and minimum sizes for the number of stored objects.
    libgroboutils-java-5.orig/util-datastruct/xdocs/requirements.xml0000644000175000017500000000027407655132717025410 0ustar drazzibdrazzib Requirements $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/util-datastruct/xdocs/design.xml0000644000175000017500000000026607655132717024137 0ustar drazzibdrazzib Design $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/util-datastruct/xdocs/index.xml0000644000175000017500000000104107747255377023777 0ustar drazzibdrazzib Welcome $Date: 2003/10/27 17:50:55 $

    The documentation is still incomplete.

  • About Util-Datastruct
  • libgroboutils-java-5.orig/util-datastruct/xdocs/using.xml0000644000175000017500000000026507655132717024012 0ustar drazzibdrazzib Using $Date: 2003/05/04 06:40:15 $ libgroboutils-java-5.orig/tmp/0000755000175000017500000000000011271425773016463 5ustar drazzibdrazziblibgroboutils-java-5.orig/tmp/summary.xml0000644000175000017500000004227710120250325020673 0ustar drazzibdrazzib testing-junit JUnit helpers and extentions net.sourceforge.groboutils.junit.v1 JUnit extentions for easing test making. AssertConstructor Similar to the Assert class in JUnit, but allows for testing objects and classes for the existence of different constructors. AssertTestFactory Creates Test objects that execute a single assert. Used to create 'soft' (sub) tests during integration testing. SubTestTestCase Subclass of TestCase that allows for a test to dynamically register a sub-test, which will be run after the owning test finishes, and in new tests. IntegrationTestCase Subclass of TestCase designed for integration tests, which generally need 'soft' failures - a failure which does not need to stop the execution of the test. MultiThreadedTestRunner A utility class which executes a collection of small test methods in parallel. Capable of specifying a maximum run time to prevent dead-locks or infinite loops from hanging the test execution. Propigates all errors to the owning class. SysPropertiesUtil Utility that allows for easy setting and reseting of System properties. Some classes that need testing may depend upon a System property setting, and this class will help testing that. This is JDK 1.1 and above compatible. 17-Jul-2003: Updates to MultiThreadedTestRunner allow for monitors to check the status of runners without needing to quit, and added the ability to kill wild threads. The documentation for this has been updated as well. testing-junit Test Class Parsing net.sourceforge.groboutils.junit.v1.parser Extracted the functionality used by junit.framework.TestSuite to parse the Test classes, and enabled it for easy exension to support different construction mechanisms. 17-Jul-2003: This is fairly stable, but the code coverage reports show that it needs a bit more testing in some areas. testing-junit Hierarchial Unit Tests net.sourceforge.groboutils.junit.v1.iftc JUnit extention for helping in the creation of hierarchial test cases, also known as 'contract' or 'interface' test-cases. 10-Jan-2004: Found and fixed a minor bug with passing the message on an assert in IntegrationTestCase. testing-autodoc net.sourceforge.groboutils.autodoc.v1 AutoDoc allows for JUnit tests to generate documentation for themselves. Pluggable to allow user-defined extensions for each component. 19-May-2003: Need to expand testing and update documents before this can enter RC 1. pmti net.sourceforge.groboutils.pmti.v1 The Problem Management Tracker Interface. A framework for interfacing with Problem Management Trackers (a.k.a. bug trackers). Includes SPI connectors for the AutoDoc framework. 04-Oct-2003: Looking at moving the location of the tracking numbers from code to XDoclet. If so, this will be a major change and break backwards-compatibility.
    Still need example implementations for Sourceforge (web-based) and Bugzilla (database-based).
    Complete the documentation. As the system is in flux, this is an on-going task.
    testing-tp net.sourceforge.groboutils.tp.v1 Test Procedure generation classes. Includes SPI connectors for the AutoDoc framework. 23-Aug-2003: Currently examining the viability of the sub-project, as to whether it is the right application of technology. codecoverage net.sourceforge.groboutils.codecoverage.v2 There are several commercially available code coverage tools for Java, but they all require a large fee to use. This is a 100% Pure Java implementation of a Code Coverage tool. It uses Jakarta's BCEL platform to post-compile class files to add logging statements for tracking coverage. 16-Apr-2004: Final changes to the documentation before release of the next version. uicapture net.sourceforge.groboutils.uicapture.v1 A UI capture program for Java. Allows for capture and playback ability in any graphical application running on the local system. 08-Oct-2002: Able to capture and play-back UI interactions, but capturing has issues with the underlying UIs being interacted with: due to the glass pane manipulation and click pass-through implementation, UI components such as menus disappear.
    util-classes Class Helpers net.sourceforge.groboutils.util.classes.v1 Utilities that allow for easy access to Classes and instantiating them. Includes helper utilities for the Service Provider Interface (SPI), as presented in JDK 1.3. This package is JDK 1.1 compatible, but will use JDK 1.2+ methods when allowed. 17-Jul-2003: Documentation still needs a bit of work, but this has been moved up to RC1. util-classes Throwable Helpers net.sourceforge.groboutils.util.throwable.v1 Utilities that aid in creating exceptions with causes (a la JDK 1.4), and for parsing exceptions. This package is JDK 1.1 compatible, but will use the JDK 1.4-introduced exception methods when allowed. 17-Jul-2003: May remove this project in favor of Jakarta Commons Lang 1.0. util-xml net.sourceforge.groboutils.util.xml.v1 Utilities for converting standard text into XML-escaped strings, without the need for DOM heavyweight libraries. 20-Dec-2002: Entered version 1.0.0rc1. Need to complete documentation. util-io net.sourceforge.groboutils.util.io.v1 Groups of JDK 1.1 and 1.2 I/O helper classes. File Filters Helper classes for generating filters for the java.io.File class. Input Stream Generators Classes which generate new IO Stream from a given relative URL. Example implementations are provided, including File, URL, Classpath Resource, and Hashtable. Mime Encoding Streams Input and Output streams for Mime encoded text. Read Stream Utilities for reading an entire stream in different formats. WriterOutputStream The basic JDK has classes which convert from an OutputStream to a Writer, but does not provide any implementation for the reverse. This class fills that gap. PropertyDatabase Has a concept of pre-defined properties, and user-defined properties. As many "internal" properties may be added to the database, but any properties the user sets will be stored in their own property file. 03-May-2003: Need to finish up tests and documentation before entering RC 1. util-datastruct net.sourceforge.groboutils.util.datastruct.v1 Contains various data structures, all JDK 1.1 compatible. PathRegistry A tree structure which allows for elements to be registered, deregistered, and accessed. Tree elements can define themselves as case sensitive or insensitive. They may also define that all sub-nodes should return the current parent node. Nodes are accessed through a single String, which is parsed internally. The path separator may be any character. SynchQueue A Queue (first-in, first-out) which allows for waiting indefinitely or for a specific period of time for a new element to be added to the Queue. Useful for passing data between threads. This has been optimized for synchronization. ObjectCache A store of reserved objects to prevent the Garbage Collector from working overtime on commonly used objects. It has options for setting the maximum and minimum sizes for the number of stored objects. 03-May-2003: Just entered RC 1. The documentation will need to be completed before this goes gold. util-thread net.sourceforge.groboutils.util.thread.v1 Collection of utilities to help with thread and process management. BackgroundProcess Class which allows for better interaction with a spawned Process. It forks the process's output streams to other streams. IOThreadRunner A thread which pulls data from an input stream and pushes it into an output stream. LoopThread Implements safe pause, resume, and stop for threads which loop over the same function endlessly. Allows for a sleep period between loop iterations. QueueThread Thread-safe implementation of pulling objects from a SynchQueue, and passing them to a listening object. ThreadPool A pool of QueueThread instances, which handles menial tasks such as growing the thread pool if the number of waiting objects is above a threshold number, up to a maximum number of threads, finding the thread with the fewest number of waiting objects, and optimization of determining which thread to pass events to. 03-May-2003: Need to finish up tests and documentation before entering RC 1.
    libgroboutils-java-5.orig/tmp/${project}-summary.xml0000644000175000017500000000443110120250325022761 0ustar drazzibdrazzib util-thread net.sourceforge.groboutils.util.thread.v1 Collection of utilities to help with thread and process management. BackgroundProcess Class which allows for better interaction with a spawned Process. It forks the process's output streams to other streams. IOThreadRunner A thread which pulls data from an input stream and pushes it into an output stream. LoopThread Implements safe pause, resume, and stop for threads which loop over the same function endlessly. Allows for a sleep period between loop iterations. QueueThread Thread-safe implementation of pulling objects from a SynchQueue, and passing them to a listening object. ThreadPool A pool of QueueThread instances, which handles menial tasks such as growing the thread pool if the number of waiting objects is above a threshold number, up to a maximum number of threads, finding the thread with the fewest number of waiting objects, and optimization of determining which thread to pass events to. 03-May-2003: Need to finish up tests and documentation before entering RC 1. libgroboutils-java-5.orig/testing-autodoc/0000755000175000017500000000000011271425773020774 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/deployed.ant-inc.xml0000644000175000017500000000063607547162333024661 0ustar drazzibdrazzib libgroboutils-java-5.orig/testing-autodoc/build.xml0000644000175000017500000001112007737323757022623 0ustar drazzibdrazzib %ent._shared; ]> &inc._shared; &inc._shared.common-ant-replace; &inc._shared.common-ant-tasks-init; &inc._shared.common-ant-tasks-clean; &inc._shared.common-ant-tasks-javac; &inc._shared.common-ant-tasks-jar; &inc._shared.common-ant-tasks-doc; &inc._shared.common-ant-tasks-jdkdepend; &inc._shared.common-ant-tasks-test; &inc._shared.common-ant-tasks-deploy; &inc._shared.deployed.testing-junit; &inc._shared.deployed.util-classes; libgroboutils-java-5.orig/testing-autodoc/TODO.txt0000644000175000017500000000012207550512631022270 0ustar drazzibdrazzibTODO for Autodoc (in approximate order of priority): 1. Solidify test cases. libgroboutils-java-5.orig/testing-autodoc/log4j.properties0000644000175000017500000000060507521071650024124 0ustar drazzibdrazziblog4j.rootCategory=WARN, stdout # A1 is set to be a ConsoleAppender. log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.category.net.sourceforge.groboutils.testing.autodoc=DEBUG log4j.category.net.sourceforge.groboutils.util.classes=DEBUG libgroboutils-java-5.orig/testing-autodoc/sources/0000755000175000017500000000000010011472743022445 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/0000755000175000017500000000000011271425773023234 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/junit/0000755000175000017500000000000011271425773024365 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/junit/build.xml0000644000175000017500000000000007521071650026166 0ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/itf/0000755000175000017500000000000011271425773024016 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/itf/build.xml0000644000175000017500000000000007521071650025617 0ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/tp/0000755000175000017500000000000011271425773023657 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/tp/build.xml0000644000175000017500000000000007521071650025460 0ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ait/about.txt0000644000175000017500000000021007521071650025072 0ustar drazzibdrazzibApplication Integration Tests This directory contains the source and dependent files for the tests which are application-wide in scope.libgroboutils-java-5.orig/testing-autodoc/sources/dev/0000755000175000017500000000000011271425773023235 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/0000755000175000017500000000000010011472741024007 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/0000755000175000017500000000000010011472741026332 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/0000755000175000017500000000000010011472742030524 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/0000755000175000017500000000000010011472742032162 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/0000755000175000017500000000000011271425773032523 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/0000755000175000017500000000000011271425773033654 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/AutoDocJUnitListener.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/Au0000644000175000017500000001533707622026434034151 0ustar drazzibdrazzib/* * @(#)AutoDocJUnitListener.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.junit; import junit.framework.Test; import junit.framework.TestListener; import junit.framework.AssertionFailedError; import java.util.Vector; import java.util.Enumeration; import net.sourceforge.groboutils.autodoc.v1.spi.TestListenerFactory; import net.sourceforge.groboutils.util.classes.v1.SPISingletonStore; import org.apache.log4j.Logger; /** * Listens to JUnit tests, and chains the calls to other listeners. This * allows for a central repository to register a listener. This class allows * for using the SPI extention mechanism to define delegated-to listeners * if no listeners are passed to the constructor. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 4, 2002 * @version $Date: 2003/02/10 22:52:12 $ */ public class AutoDocJUnitListener implements TestListener { private static final Logger LOG = Logger.getLogger( AutoDocJUnitListener.class ); private static final SPISingletonStore s_factoryStore = new SPISingletonStore( TestListenerFactory.class, SPISingletonStore.NO_MULTIPLES_SILENT ); private Vector listeners = new Vector(); /** * Create a new listener, using the singleton store to specify all * test listener factories. */ public AutoDocJUnitListener() { this( null ); } /** * Create a new listener using the given factories to specify all * JUnit listeners. If factories is null, then * the singleton store will be used to get all factories. */ public AutoDocJUnitListener( TestListenerFactory factories[] ) { if (factories == null) { factories = getFactories(); if (factories == null) { LOG.warn( "No factories defined for "+getClass() ); factories = new TestListenerFactory[0]; } } for (int i = 0; i < factories.length; ++i) { loadListeners( factories[i] ); } } /** * Add an individual JUnit TestListener to the inner set of listeners. * * @param tl the listener to register. If tl is null, * then the request is ignored. */ public void addListener( TestListener tl ) { if (tl != null) { this.listeners.addElement( tl ); } } /** * Return a list of all known inner listeners. */ public Enumeration getListeners() { return listeners.elements(); } //------------------------------------------------------------------------- // JUnit TestListener methods /** * An error occurred. */ public void addError(Test test, Throwable t) { for (Enumeration enum = getListeners(); enum.hasMoreElements();) { TestListener tl = (TestListener)enum.nextElement(); tl.addError( test, t ); } } /** * A failure occurred. */ public void addFailure(Test test, AssertionFailedError t) { for (Enumeration enum = getListeners(); enum.hasMoreElements();) { TestListener tl = (TestListener)enum.nextElement(); tl.addFailure( test, t ); } } /** * A test ended. */ public void endTest(Test test) { for (Enumeration enum = getListeners(); enum.hasMoreElements();) { TestListener tl = (TestListener)enum.nextElement(); tl.endTest( test ); } } /** * A test started. */ public void startTest(Test test) { for (Enumeration enum = getListeners(); enum.hasMoreElements();) { TestListener tl = (TestListener)enum.nextElement(); tl.startTest( test ); } } //------------------------------------------------------------------------- // protected methods /** * Creates the listener from the factory, and adds it to the inner list. * * @param factory the factory to create the listener from. * @see #addListener( TestListener ) */ protected void loadListeners( TestListenerFactory factory ) { if (factory != null) { TestListener tl = factory.createListener(); addListener( tl ); } } //------------------------------------------------------------------------- // Static methods /** * Retrieve the AutoDocJUnitListenerFactory singleton store for setting up * the factory to be used for all unspecified constructor * invocations to AutoDocJUnitListener instances. */ public static SPISingletonStore getFactoryStore() { return s_factoryStore; } /** * Return all the currently known test listener factories, using the * singleton returned by getFactoryStore() */ protected static TestListenerFactory[] getFactories() { Vector v = new Vector(); Enumeration enum = getFactoryStore().getSingletons(); while (enum.hasMoreElements()) { v.addElement( enum.nextElement() ); } TestListenerFactory[] tlf = new TestListenerFactory[ v.size() ]; v.copyInto( tlf ); return tlf; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/AutoDocJUnitFormatter.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/Au0000644000175000017500000000616407622026434034147 0ustar drazzibdrazzib/* * @(#)AutoDocJUnitFormatter.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.junit; import org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter; import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; import net.sourceforge.groboutils.autodoc.v1.spi.TestListenerFactory; /** * Interfaces with the Ant JUnit task to add a Listener into JUnit for the * tests which report to the ITF framework. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 1, 2002 * @version $Date: 2003/02/10 22:52:12 $ */ public class AutoDocJUnitFormatter extends AutoDocJUnitListener implements JUnitResultFormatter { /** * Create a new listener, using super's method to load the default set * of delegated listeners. */ public AutoDocJUnitFormatter() { super(); } /** * Create a new listener using the given factories to specify all * sub-listeners. */ public AutoDocJUnitFormatter( TestListenerFactory factories[] ) { super( factories ); } /** * The whole testsuite started. */ public void startTestSuite(JUnitTest suite) { // ignore } /** * The whole testsuite ended. */ public void endTestSuite(JUnitTest suite) { // ignore } /** * Sets the stream the formatter is supposed to write its results to. */ public void setOutput(java.io.OutputStream out) { // ignore } /** * This is what the test has written to System.out */ public void setSystemOutput( String out ) { // ignore } /** * This is what the test has written to System.err */ public void setSystemError( String err ) { // ignore } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/package.htmllibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/junit/pa0000644000175000017500000000026007521071651034170 0ustar drazzibdrazzibnet.sourceforge.groboutils.autodoc.junit Helper classes for integrating AutoDoc into JUnit and the Ant 1.4.1 JUnit task. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDocTP.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDocT0000644000175000017500000000434507622026433034131 0ustar drazzibdrazzib/* * @(#)AutoDocTP.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; /** * Test Procedure entry point. Generates Test Procedure documentation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since March 16, 2002 */ public interface AutoDocTP { /** * Defines a step which occurs during the test setup phase. * * @param description the text describing the step. */ public void setupStep( String description ); /** * Defines a step which occurs during the test tear-down phase. * * @param description the text describing the step. */ public void teardownStep( String description ); /** * Defines a step which occurs during the test proper. * * @param description the text describing the step. */ public void step( String description ); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDoc.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDoc.0000644000175000017500000002411707622026433034062 0ustar drazzibdrazzib/* * @(#)AutoDoc.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; import net.sourceforge.groboutils.util.classes.v1.SPISingletonStore; import net.sourceforge.groboutils.autodoc.v1.defimpl.DefaultAutoDocFactory; import net.sourceforge.groboutils.autodoc.v1.defimpl.AutoDocTPSet; import net.sourceforge.groboutils.autodoc.v1.defimpl.AutoDocLogSet; import net.sourceforge.groboutils.autodoc.v1.defimpl.AutoDocITSet; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocFactory; import java.util.Vector; /** * Entry class for loading the AutoDoc pieces for a particular class. As * this class is always instantiated, it does not need an interface. This * acts as a central factory for generating all the AutoDoc instances. *

    * This default implementation uses a static factory to load each instance's * data. That factory may be set by a using class. Since initialization of * the inner data is lazy-loaded (only loaded when needed, but when needed it * is all loaded), the factory may be set at any time after construction, and * before a data access member function is called. If no factory is ever * specified, it will load the factory from the fully-qualified class name * in the value of the System property specified by the key given by * FACTORY_PROPERTY_NAME. *

    * This class follows a combination of the Abstract Factory and Proxy patterns. * AutoDoc acts as a Proxy for an Abstract Factory, allowing the particular * implemented factory to be hidden from the user. However, a "hole" is open * to each instance with the method setFactory(), allowing the owner * to setup the factory to their needs. *

    * NOTE: need to update the documentation. I've since replaced the single * factory with an SPI fleet. The proxied objects are delegators to collections * of sub-proxies, which are loaded as late as possible. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since March 16, 2002 */ public class AutoDoc { private static final SPISingletonStore s_factoryStore = new SPISingletonStore( AutoDocFactory.class, SPISingletonStore.NO_MULTIPLES_SILENT ); private volatile boolean notLoaded = true; private Vector factories = null; private final Class owner; private AutoDocLogSet log = new AutoDocLogSet(); private AutoDocITSet it = new AutoDocITSet(); private AutoDocTPSet tp = new AutoDocTPSet(); /** * Base constructor. Pass in the Class instance which will AutoDoc itself. * * @param c the class which will be AutoDoced. * @exception IllegalArgumentException if the passed-in class is * null. */ public AutoDoc( Class c ) { if (c == null) { throw new IllegalArgumentException("no null arguments"); } this.owner = c; // lazy load data. } /** * Get the log implementation. Each call will return the same object. * * @return the log for the owning class. */ public AutoDocLog getLog() { checkLoad(); return this.log; } /** * Get the Issue Tracker implementation. Each call will return the * same object. * * @return the Issue Tracker for the owning class. */ public AutoDocIT getIT() { checkLoad(); return this.it; } /** * Get the Test Procedure Marker implementation. Each call will return * the same object. */ public AutoDocTP getTP() { checkLoad(); return this.tp; } //------------------------------------------------------------------------- // Protected methods /** * Check if the data instances have been loaded. If they have not, then * load the instances, and ensure initialization is not performed again. * This lazy-loading is thread-safe. */ protected final void checkLoad() { if (this.notLoaded) { // double-check locking pattern. // since we're doing this on an atomicly volitile variable, // this is fine. If we did this on a non-atomic variable, this // might fail. synchronized( this.getClass() ) { if (this.notLoaded) { loadInstances(); this.notLoaded = false; } } } } /** * Retrieves the owning class. Will never return null. * * @return the class which is being AutoDoced. */ protected final Class getOwner() { return this.owner; } /** * Loads all class */ protected void loadInstances() { AutoDocFactory adf[] = getFactories(); for (int i = 0; i < adf.length; ++i) { loadFromFactory( adf[i] ); } cleanUpFactories(); } /** * Adds to all inner instances from the given factory. */ protected void loadFromFactory( AutoDocFactory adf ) { this.log.addLog( adf.createLog( getOwner() ) ); this.it.addIT( adf.createIT( getOwner() ) ); this.tp.addTP( adf.createTP( getOwner() ) ); } /** * Returns the factory this implementation knows. By default, this is the * static factory instance. This is only called at AutoDoc creation time. * This is not static, because subclasses may need to re-implement this * method. The factory may be changed through invocation of * setFactory( AutoDocFactory ). * * @return the inner factory, or the static singleton if it was never * assigned. */ protected AutoDocFactory[] getFactories() { AutoDocFactory adf[]; synchronized( this ) { if (this.factories == null) { this.factories = new Vector(); java.util.Enumeration enum = getFactoryStore().getSingletons(); while (enum.hasMoreElements()) { addFactory( (AutoDocFactory)enum.nextElement() ); } } adf = new AutoDocFactory[ this.factories.size() ]; this.factories.copyInto( adf ); } return adf; } /** * After loading the instances, we have no need to keep the memory * of the original factories around - they may pollute our loaded * proxied objects anyway. But since we've loaded, we don't want * to allow another load. So keep the vector, but clean it out. */ protected void cleanUpFactories() { this.factories.removeAllElements(); } /** * Sets the AutoDoc factory instance. If this method is never invoked, then * the default static store will be used instead. *

    * The standard factory/singleton pattern used in this framework normally * does not allow direct setting of the framework for an instance, but * rather for the classloader's class. Since AutoDoc (or a subclass) * is directly instantiated as a central processing point, opening a * "hole" into the class allows for an easier method to setup a particular * AutoDoc style. However, this is not the "recommended" usage, since, * in general, AutoDoc instances are instantiated independently throughout * many different classes, causing independent factory setting to be * more difficult. * * @param adf the new factory to assign. * @exception IllegalArgumentException if adf is null. * @exception IllegalStateException if the inner factory has already been * assigned. This usually indicates that all the objects have already * been loaded. */ protected void addFactory( AutoDocFactory adf ) { if (adf == null) { throw new IllegalArgumentException("no null args"); } synchronized (this) { if (!this.notLoaded) { throw new IllegalStateException("factories already loaded."); } if (this.factories == null) { // allow this - it means we will not be using the defaults. this.factories = new Vector(); } this.factories.addElement( adf ); } } //------------------------------------------------------------------------- // Static methods /** * Retrieve the AutoDocFactory singleton store for setting up the factory * to be used for all uninitialized or uncreated AutoDoc instances. */ public static SPISingletonStore getFactoryStore() { return s_factoryStore; } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/package.htmllibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/package.0000644000175000017500000000501607521071650034113 0ustar drazzibdrazzibnet.sourceforge.groboutils.autodoc.v1 Test Self-Documentation aid classes.

    Overview

    This package contains a bootstrap class (AutoDoc), and the interfaces that it delivers.

    Other classes use this package by creating an instance of the AutoDoc class on a per-class basis. This AutoDoc instance then returns to the using class-specific instances for the owning class' Self-Documentation needs.

    Generating Implementations of the AutoDoc Framework

    This framework makes it easy to create your own implementation for each part. Here's how the framework loads in the classes.

    The AutoDoc class

    The AutoDoc class loads an instance of the AutoDocFactory interface. It first checks the system property "net.sourceforge.groboutils.autodoc.AutoDocFactory.implementation". The value which this is set to will be the fully-qualified class name to create as the factory (an instance of AutoDocFactory). If that is not set, then it defaults to net.sourceforge.groboutils.autodoc.defimpl.DefaultAutoDocFactory.

    Then, AutoDoc requests for a new instance of each entry-point interface from the loaded factory.

    As an implementation creator, you could create your own AutoDocFactory instance, and set the system property to point to your own. Or, you could leave the DefaultAutoDocFactory, and depend upon it to load your specific entry-point factory.

    The DefaultAutoDocFactory loads entry-point factories in a similar fashion to how AutoDoc loads its factory: through the system properties. It uses for the implementation class name the fully-qualified class name specified in the system property of the form "factory interface fully-qualified class name.implementation

    ". If the property isn't set, it uses the default implementation.

    ToDo

    • Right now, there can be only one factory for each section system-wide. This should be modified to allow for a hierarchy much like log4j allows, where the owning class can have its own factory set, or its package, or each package component, or finally it defaults to the system-wide setting (and if that isn't defined, then the default framework setting). Alternatively, it could load a property file from each of these namespaces. I'll leave that as a AutoDoc factory specific type to be created in the future.
    ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/libgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000755000175000017500000000000011271425773034143 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/AutoDocLogSet.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000644000175000017500000001165007622026433034143 0ustar drazzibdrazzib/* * @(#)AutoDocLogSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.autodoc.v1.AutoDocLog; import java.util.Vector; import java.util.Enumeration; /** * An interface for logging. This allows for an abstraction between the * owning class and any underlying logging mechanism desired. *

    * The actual meaning of the logging levels is implementation independent. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since June 28, 2002 */ public class AutoDocLogSet implements AutoDocLog, IAutoDocSet { private Vector set = new Vector(); public void addLog( AutoDocLog log ) { this.set.addElement( log ); } public Enumeration getSetContents() { return this.set.elements(); } public void debug( Object message ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).debug( message ); } } public void debug( Object message[] ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).debug( message ); } } public void debug( Object message, Throwable error ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).debug( message, error ); } } public void debug( Object message[], Throwable error ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).debug( message, error ); } } public void info( Object message ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).info( message ); } } public void info( Object message[] ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).info( message ); } } public void info( Object message, Throwable error ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).info( message, error ); } } public void info( Object message[], Throwable error ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).info( message, error ); } } public void warn( Object message ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).warn( message ); } } public void warn( Object message[] ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).warn( message ); } } public void warn( Object message, Throwable error ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).warn( message, error ); } } public void warn( Object message[], Throwable error ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocLog)enum.nextElement()).warn( message, error ); } } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/package.htmllibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000644000175000017500000000031507521071651034137 0ustar drazzibdrazzibnet.sourceforge.groboutils.autodoc.v1.defimpl Default implementation of the net.sourceforge.groboutils.autodoc.v1 interfaces and factories. ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/IAutoDocSet.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000644000175000017500000000357007622026433034145 0ustar drazzibdrazzib/* * @(#)IAutoDocSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; import java.util.Vector; import java.util.Enumeration; /** * Defines an AutoDoc element that contains a set of delegated-to sub-elements. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since June 30, 2002 */ public interface IAutoDocSet { /** * Returns the elements in the set. */ public Enumeration getSetContents(); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/AutoDocITSet.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000644000175000017500000001115007622026433034136 0ustar drazzibdrazzib/* * @(#)AutoDocITSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.autodoc.v1.AutoDocIT; import java.util.Vector; import java.util.Enumeration; /** * Issue Tracker entry point. Allows bugs and requriements to be tracked * directly to the test that ensures that part of the bug/requirement has been * fulfilled in the current code base. *

    * The alternate forms of the base {@link #testsIssue( String, String )} are * for convenience only. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since June 28, 2002 */ public class AutoDocITSet implements AutoDocIT, IAutoDocSet { private Vector set = new Vector(); public void addIT( AutoDocIT it ) { this.set.addElement( it ); } public Enumeration getSetContents() { return this.set.elements(); } /** * Traces an issue from the owning class and declared method, to the * given ID. This is a long, as some systems may allow for * more than 2 billion issues. * * @param methodName the owning class's method to trace the issue back to. * @param issueID the id of the issue being tracked. */ public void testsIssue( String methodName, long issueID ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocIT)enum.nextElement()).testsIssue( methodName, issueID ); } } /** * Traces an issue from the owning class and declared method, to the * given ID. * * @param methodName the owning class's method to trace the issue back to. * @param issueID the id of the issue being tracked. */ public void testsIssue( String methodName, String issueID ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocIT)enum.nextElement()).testsIssue( methodName, issueID ); } } /** * Traces an issue from the owning class to the given ID. * The method will still be given to the underlying tracker, but it will * be discovered through the stack trace. Hence, this is a volitile * method for tracking; it should only be called from the owning class * which is actually testing the bug. * * @param issueID the id of the issue being tracked. */ public void testsIssue( long issueID ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocIT)enum.nextElement()).testsIssue( issueID ); } } /** * Traces an issue from the owning class to the given ID. * The method will still be given to the underlying tracker, but it will * be discovered through the stack trace. Hence, this is a volitile * method for tracking; it should only be called from the owning class * which is actually testing the bug. * * @param issueID the id of the issue being tracked. */ public void testsIssue( String issueID ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocIT)enum.nextElement()).testsIssue( issueID ); } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/DefaultAutoDocFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000644000175000017500000001451107622026433034142 0ustar drazzibdrazzib/* * @(#)DefaultAutoDocFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.util.classes.v1.SPISingletonStore; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocFactory; import net.sourceforge.groboutils.autodoc.v1.AutoDocLog; import net.sourceforge.groboutils.autodoc.v1.AutoDocIT; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocLogFactory; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocITFactory; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocTPFactory; import java.util.Vector; import java.util.Enumeration; import org.apache.log4j.Logger; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since March 16, 2002 */ public class DefaultAutoDocFactory implements AutoDocFactory { private static final Logger LOG = Logger.getLogger( DefaultAutoDocFactory.class.getName() ); private static final SPISingletonStore s_lfStore = new SPISingletonStore( AutoDocLogFactory.class, SPISingletonStore.NO_MULTIPLES_SILENT ); private static final SPISingletonStore s_itfStore = new SPISingletonStore( AutoDocITFactory.class, SPISingletonStore.NO_MULTIPLES_SILENT ); private static final SPISingletonStore s_tpfStore = new SPISingletonStore( AutoDocTPFactory.class, SPISingletonStore.NO_MULTIPLES_SILENT ); private Vector lf = null; private Vector itf = null; private Vector tpf = null; /** * Default constructor (required). */ public DefaultAutoDocFactory() { // do nothing - delay the loading of the factory until the last // moment. } /** * Creates a new Log for the class owner. * * @param owner the Class owner, as passed to the AutoDoc class. * @return the loaded AutoDocLogFactory's created instance. */ public AutoDocLog createLog( Class owner ) { if (owner == null) { throw new IllegalArgumentException("no null args"); } AutoDocLogSet set = new AutoDocLogSet(); Enumeration enum = getLogFactories(); while (enum.hasMoreElements()) { set.addLog( ((AutoDocLogFactory)enum.nextElement()). createLog( owner ) ); } return set; } /** * Creates the Issue Tracker entry point. * * @param owner the Class owner, as passed to the AutoDoc class. * @return the loaded AutoDocITFactory's created instance. */ public AutoDocIT createIT( Class owner ) { if (owner == null) { throw new IllegalArgumentException("no null args"); } AutoDocITSet set = new AutoDocITSet(); Enumeration enum = getITFactories(); while (enum.hasMoreElements()) { set.addIT( ((AutoDocITFactory)enum.nextElement()). createIT( owner ) ); } return set; } /** * Creates a Test Procedure entry point. * * @param owner the Class owner, as passed to the AutoDoc class. * @return the loaded AutoDocTPFactory's created instance. */ public AutoDocTP createTP( Class owner ) { if (owner == null) { throw new IllegalArgumentException("no null args"); } AutoDocTPSet set = new AutoDocTPSet(); Enumeration enum = getTPFactories(); while (enum.hasMoreElements()) { set.addTP( ((AutoDocTPFactory)enum.nextElement()). createTP( owner ) ); } return set; } /** * Creates the Log factory if it has not yet been created, or the already * created factory. */ protected Enumeration getLogFactories() { return getLogFactoryStore().getSingletons(); } /** * Creates the IT factory if it has not yet been created, or the already * created factory. */ protected Enumeration getITFactories() { return getITFactoryStore().getSingletons(); } /** * Creates the TP factory if it has not yet been created, or the already * created factory. */ protected Enumeration getTPFactories() { return getTPFactoryStore().getSingletons(); } //------------------------------------------------------------------------- // Static methods /** * */ public static SPISingletonStore getLogFactoryStore() { return s_lfStore; } /** * */ public static SPISingletonStore getITFactoryStore() { return s_itfStore; } /** * */ public static SPISingletonStore getTPFactoryStore() { return s_tpfStore; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/AutoDocTPSet.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/defimpl/0000644000175000017500000000622607622026433034146 0ustar drazzibdrazzib/* * @(#)AutoDocTPSet.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; import java.util.Vector; import java.util.Enumeration; /** * Test Procedure entry point. Generates Test Procedure documentation. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since June 28, 2002 */ public class AutoDocTPSet implements AutoDocTP, IAutoDocSet { private Vector set = new Vector(); public void addTP( AutoDocTP tp ) { this.set.addElement( tp ); } public Enumeration getSetContents() { return this.set.elements(); } /** * Defines a step which occurs during the test setup phase. * * @param description the text describing the step. */ public void setupStep( String description ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocTP)enum.nextElement()).setupStep( description ); } } /** * Defines a step which occurs during the test tear-down phase. * * @param description the text describing the step. */ public void teardownStep( String description ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocTP)enum.nextElement()).teardownStep( description ); } } /** * Defines a step which occurs during the test proper. * * @param description the text describing the step. */ public void step( String description ) { Enumeration enum = getSetContents(); while (enum.hasMoreElements()) { ((AutoDocTP)enum.nextElement()).step( description ); } } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/libgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000755000175000017500000000000011271425773034323 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/junit/libgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000755000175000017500000000000011271425773034323 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/junit/package.htmllibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000030407521071652034316 0ustar drazzibdrazzibnet.sourceforge.groboutils.autodoc.v1.testserver.junit Helper abstract base classes to interact between the test server framework and JUnit. ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/junit/JUnitTestInfo.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000652607622026436034334 0ustar drazzibdrazzib/* * @(#)JUnitTestInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver.junit; import net.sourceforge.groboutils.autodoc.v1.testserver.DefaultTestInfo; import junit.framework.Test; import junit.framework.TestSuite; import junit.framework.TestCase; /** * An implementation of TestInfo which is specific to JUnit. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:14 $ */ public class JUnitTestInfo extends DefaultTestInfo { /** * Constructor which defines a test-info object based on a Test instance. * * @param testObj the test for the TestInfo to describe. */ public JUnitTestInfo( Object testObj ) { if (testObj == null) { throw new IllegalArgumentException("no null arguments"); } setSuite( getSuiteName( testObj ) ); setMethod( getMethodName( testObj ) ); } /** * Discovers the name of the suite for the passed-in test object. * * @param testObj the test under inspection. * @return the name of the suite. */ protected String getSuiteName( Object testObj ) { String name; if (testObj instanceof TestSuite) { name = ((TestSuite)testObj).getName(); } else if (testObj instanceof Class) { name = ((Class)testObj).getName(); } else { name = testObj.getClass().getName(); } return name; } /** * Discovers the name of the method for the passed-in test object. * * @param testObj the test under inspection. * @return the name of the test's test method. */ protected String getMethodName( Object testObj ) { String name; if (testObj instanceof TestCase) { name = ((TestCase)testObj).getName(); } else { name = "run"; } return name; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/junit/JUnitTestListener.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000001331307671227631034330 0ustar drazzibdrazzib/* * @(#)JUnitTestListener.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver.junit; import junit.framework.Test; import junit.framework.TestListener; import junit.framework.AssertionFailedError; import org.apache.log4j.Logger; import net.sourceforge.groboutils.autodoc.v1.testserver.MonitorFinder; import net.sourceforge.groboutils.autodoc.v1.testserver.TestCorrelate; import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; import net.sourceforge.groboutils.autodoc.v1.testserver.TestInfo; /** * A helper class to interface between the test framework and JUnit's * TestListener interface. * * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/06/10 01:08:41 $ */ public abstract class JUnitTestListener extends TestCorrelate implements TestListener { private static final Logger LOG = Logger.getLogger( JUnitTestListener.class ); private MonitorFinder finder; /** * */ public JUnitTestListener( MonitorFinder finder ) { super( null, finder ); } //------------------------------------------------------------------------- // abstract methods /** * Called before the test starts, and after the test has been registered. */ protected abstract void startTest( TestData data ); /** * Called after the test ends. The implemented method must not send off * the data - that is done by the JUnitTestListener implementation. */ protected abstract void endTest( TestData data ); /** * Called when the test in the data has an unexpected exception thrown. */ protected abstract void addError( TestData data, Throwable t ); /** * Called when the test in the data has an assertion error. */ protected abstract void addFailure( TestData data, AssertionFailedError t ); //------------------------------------------------------------------------- // JUnit listener methods /** * An error occurred. */ public void addError(Test test, Throwable t) { if (test == null) { LOG.error("JUnit passed null test to method addError()",t); return; } TestData td = getTestData( createTestInfo( test ) ); // null means the test was never registered. if (td != null) { addError( td, t ); } else { LOG.warn("JUnit called 'addError' without calling 'startTest'.", t ); } } /** * A failure occurred. */ public void addFailure(Test test, AssertionFailedError t) { if (test == null) { LOG.error("JUnit passed null test to method addFailure()",t); return; } TestData td = getTestData( createTestInfo( test ) ); // null means the test was never registered. if (td != null) { addFailure( td, t ); } else { LOG.warn("JUnit called 'addFailure' without calling 'startTest'.", t ); } } /** * A test ended. */ public void endTest(Test test) { TestInfo ti = createTestInfo( test ); TestData td = getTestData( ti ); if (td != null) { endTest( td ); // end off the test info try { getFinder().getMonitor().sendTestData( ti ); } catch (IllegalStateException ise) { LOG.warn( "Warning for test ["+test+"]: "+ise.getMessage(), ise ); } } else { LOG.warn( "Received an end message for test ["+test+ "], but it was never added." ); } } /** * A test started. */ public void startTest(Test test) { TestInfo ti = createTestInfo( test ); // start the test info getFinder().getMonitor().addTestData( ti ); startTest( getTestData( ti ) ); } /** * Creates a JUnitTestInfo instance. */ protected TestInfo createTestInfo( Test test ) { TestInfo ti = new JUnitTestInfo( test ); return ti; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/DefaultTestData.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000433407622026435034326 0ustar drazzibdrazzib/* * @(#)DefaultTestData.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; /** * A simple implementation of TestData which only knows about TestInfo. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 30, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public class DefaultTestData implements TestData { private TestInfo info; /** * Default constructor, which requires a non-null TestInfo instance. */ public DefaultTestData( TestInfo info ) { if (info == null) { throw new IllegalArgumentException("no null arguments"); } this.info = info; } /** * Retrieve the test specific details this data item corresponds to. * * @return the information about the test. */ public TestInfo getTestInfo() { return this.info; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/package.htmllibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000374207521071651034326 0ustar drazzibdrazzibnet.sourceforge.groboutils.autodoc.v1.testserver Abstract framework to aid subcomponents of the AutoDoc facility to interact between the JUnit testing suite and a implementation-specific server, which receives corrolated events from the AutoDoc and JUnit systems. This framework is itself not specific to JUnit, but it was designed with the JUnit-style events in mind.

    Overview

    This framework consists of six different classes which work together to allow for proper integration between JUnit and AutoDoc, and the implementation-specific "recorder", or server as it is referenced in this framework.

    The Server interface is where the implementation-specific recorder receives data from the framework. It receives an event with framework-specific data, which has been collected over all the calls to the framework during a single JUnit test.

    The Monitor interface handles the calls from both the JUnit and AutoDoc frameworks. It acts as a singleton for each JUnit test.

    The MonitorFinder is a non-singleton which knows how to discover the pseudo-singleton Monitor, which is shared between the particular JUnit and AutoDoc framework instances.

    The unit of test events is contained in the interface TestData. This is created by a TestDataFactory, a framework implementation specific factory in charge of creating TestData instances for the implementation classes to interact through.

    The Monitor acts as a singleton for each individual test by having one TestInfo for each test, in order to uniquely identify the tests. The TestCorrelate abstract class provides functionality to create a TestInfo instance, and integrate it with the TestData through a MonitorFinder.

    ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/Server.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000401007622026435034315 0ustar drazzibdrazzib/* * @(#)Server.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; /** * An interface which corresponds to a part of the framework that knows how * to deal with the framework's TestData. It may directly deal with * the data, or pass it off to a remote server. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public interface Server { /** * Receives td from a Monitor and handles it in an implementation * specific manner. * * @param td the data to deal with. This might be null. */ public void addTestData( TestData td ); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/TestData.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000372707622026435034333 0ustar drazzibdrazzib/* * @(#)TestData.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; /** * An interface used to briefly describe a test and the gathered data associated * for the test in a particular framework. These should be created for * a framework through the {@link TestDataFactory} class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public interface TestData { /** * Retrieve the test specific details this data item corresponds to. * * @return the information about the test. */ public TestInfo getTestInfo(); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/Monitor.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000001004007622026435034315 0ustar drazzibdrazzib/* * @(#)Monitor.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import java.util.Hashtable; /** * Monitors the state of multiple tests through the creation, retrieval, and * sending to a server of the TestData for a specific test. Instances * will be in charge of pooling together events from a {@link TestCorrelate}. *

    * This class itself is not a singleton, but each framework implementation * should have only one Monitor. Hence, this is called a "pseudo-singleton". *

    * A Monitor may have multiple tests being tested at the same time. However, * each test must be uniquely identifiable through a {@link TestInfo}; if two * tests execute at the same time with the same TestInfo, the monitor * will identify them as the same test. Uniqueness is guaranteed through the * TestInfo instances. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public interface Monitor { /** * Adds a new TestData instance related to the given * TestInfo. If there already is a TestData for the * given TestInfo, then an exception is thrown. * * @param info the unique test identifier to create a new TestData * instance for. * @exception IllegalStateException if info is already * been added without having been sent. * @exception IllegalArgumentException if info is null. */ public void addTestData( TestInfo info ); /** * Retrieves the data associated with the given TestInfo, as was * created through {@link #addTestData( TestInfo )}. If the info * was never passed to the add method, then an exception is thrown. * * @param info the unique test identifier. * @return the data for the given info. * @exception IllegalStateException if info has not been added, * or has been removed through the send call. * @exception IllegalArgumentException if info is null. */ public TestData getTestData( TestInfo info ); /** * Sends the TestData associated with info to the * inner server, and removes the data from the inner cache. If the * info has not been added, then an exception is thrown. * * @param info the unique test identifier * @exception IllegalStateException if info has not been added, * or has been removed through the send call. * @exception IllegalArgumentException if info is null. */ public void sendTestData( TestInfo info ); } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/TestDataFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000424007622026435034322 0ustar drazzibdrazzib/* * @(#)TestDataFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; /** * A factory in charge of creating a specific TestData instance from * a TestInfo unique identifier. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public interface TestDataFactory { /** * Create the TestData for the specific info instance. * This should never return null. * * @param info the unique identifier for the test under inspection, which * should never be null. * @return the new data for the given info. * @exception IllegalArgumentException if info is null. */ public TestData createTestData( TestInfo info ); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/MonitorFinder.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000344507664664150034340 0ustar drazzibdrazzib/* * @(#)MonitorFinder.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; /** * Generic interface in charge of discovering a specific pseudo-singleton * type of Monitor. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/05/27 13:30:16 $ */ public interface MonitorFinder { /** * Retrieves the pseudo-singleton Monitor of the correct type. */ public Monitor getMonitor(); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/TestCorrelate.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000001135607622026435034330 0ustar drazzibdrazzib/* * @(#)TestCorrelate.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.util.throwable.v1.ThrowableParser; import net.sourceforge.groboutils.util.throwable.v1.StackTraceLineParser; import org.apache.log4j.Logger; /** * Helper method to aid in the use of Monitors and TestData. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public abstract class TestCorrelate { private static final Logger LOG = Logger.getLogger( TestCorrelate.class ); private MonitorFinder finder; private Class owner; public TestCorrelate( Class owner, MonitorFinder finder ) { if (finder == null) { throw new IllegalArgumentException("no null arguments"); } this.owner = owner; this.finder = finder; } /** * Helper method to discover the last method from the owning class in * the current stack. If the method is not in the stack, then null * is returned. This can be very slow. */ protected String findClassMethodFromStack() { Throwable t = new Throwable(); t.fillInStackTrace(); ThrowableParser tp = new ThrowableParser( t ); for (StackTraceLineParser stlp = tp.next(); stlp != null; stlp = tp.next() ) { if (stlp.getClassName().equals( getOwnerName() )) { String methodName = stlp.getMethodName(); LOG.debug( "Owning method for stack trace is '"+methodName+ "'", t ); return methodName; } } // could not be found return null; } /** * Uses the owner class and the findClassMethodFromStack * result to crate a TestInfo instance. */ protected TestInfo createTestInfoFromStack() { return new DefaultTestInfo( getOwnerName(), findClassMethodFromStack() ); } /** * Use the given method name and the known owner class to create a new * TestInfo instance. */ protected TestInfo createTestInfo( String methodName ) { return new DefaultTestInfo( getOwnerName(), methodName ); } protected MonitorFinder getFinder() { return this.finder; } /** * @param info the test info to find its corresponding TestData. * @return the TestData associated with the info, or null if * it was not found. */ protected TestData getTestData( TestInfo info ) { // this could be hacky... try { return getFinder().getMonitor().getTestData( info ); } catch (IllegalArgumentException iae) { LOG.warn( "Test "+info+" caused error w/ monitor", iae ); } catch (IllegalStateException ise) { LOG.warn( "Test "+info+" caused error w/ monitor", ise ); } return null; } protected Class getOwner() { return this.owner; } protected String getOwnerName() { Class c = getOwner(); String res; if (c == null) { res = null; } else { res = c.getName(); } return res; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/AbstractWriterServer.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000001005707622026435034325 0ustar drazzibdrazzib/* * @(#)AbstractWriterServer.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import java.io.IOException; import java.io.Writer; import org.apache.log4j.Logger; /** * An interface which corresponds to a part of the framework that knows how * to deal with the framework's TestData. It may directly deal with * the data, or pass it off to a remote server. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:13 $ * @since March 30, 2002 */ public abstract class AbstractWriterServer implements Server { private static final Logger LOG = Logger.getLogger( AbstractWriterServer.class ); /** * Receives td from a Monitor and handles it in an implementation * specific manner. * * @param td the data to deal with. */ public void addTestData( TestData td ) { if (td == null) { // allow null aruments: fail gracefully. LOG.warn("addTestData() received null TestData."); return; } // Write the result with all encountered logs. Writer w; try { w = openOutput( td ); } catch (IOException e) { LOG.error( "Problem opening output.", e ); // don't do any writing since the writer could not be opened. return; } try { writeTestData( td, w ); } catch (IOException e) { LOG.error( "Problem writing to output.", e ); } finally { // no matter what the write result may be, close the // output at the end. try { closeOutput( w ); } catch (IOException e) { LOG.error( "Problem closing output.", e ); } } } /** * Write the BugTestResult with all the result's encountered BugTestLog * events. */ protected abstract void writeTestData( TestData td, Writer w ) throws IOException; /** * Open a writer stream. This will be done once per result, so log-like * actions may need to append to the previous results. */ protected abstract Writer openOutput( TestData td ) throws IOException; /** * Close the given Writer, which was opened in the openOutput() * method. Since nearly all implementations will be the same, the * default implementation simply executes w.close(). */ protected void closeOutput( Writer w ) throws IOException { w.close(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/DefaultTestInfo.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000773307622026435034334 0ustar drazzibdrazzib/* * @(#)DefaultTestInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import junit.framework.Test; import junit.framework.TestSuite; import junit.framework.TestCase; /** * An implementation of TestInfo which is specific to JUnit. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public class DefaultTestInfo implements TestInfo { private String suite; private String method; /** * Only allowed to be implemented by subclasses. */ protected DefaultTestInfo() { // do nothing } /** * */ public DefaultTestInfo( String suite, String method ) { this.suite = suite; this.method = method; } /** * */ public String getSuite() { return this.suite; } /** * */ public String getMethod() { return this.method; } /** * This method does not care about the specific sub-type, jsut as long * as the suite and method are identical. */ public boolean equals( Object obj ) { if (obj == null) { return false; } if (this == obj) { return true; } if (obj instanceof TestInfo) { TestInfo ti = (TestInfo)obj; if (this.getSuite() == null) { if (ti.getSuite() != null) { return false; } } else if (!this.getSuite().equals( ti.getSuite() )) { return false; } if (this.getMethod() == null) { if (ti.getMethod() != null) { return false; } } else if (!this.getMethod().equals( ti.getMethod() )) { return false; } // else return true; } // else return false; } public int hashCode() { int hc = 0; String s = getSuite(); String m = getMethod(); if (s != null) { hc += s.hashCode(); } if (m != null) { hc += m.hashCode(); } return hc; } protected void setSuite( String name ) { this.suite = name; } protected void setMethod( String name ) { this.method = name; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/DefaultMonitor.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000001576607664664150034351 0ustar drazzibdrazzib/* * @(#)DefaultMonitor.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import java.util.Hashtable; import org.apache.log4j.Logger; /** * This implemenation of Monitor uses a Hashtable to store the * test data. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/05/27 13:30:16 $ */ public class DefaultMonitor implements Monitor { private static final Logger LOG = Logger.getLogger( DefaultMonitor.class ); private Hashtable testData = new Hashtable(); private TestDataFactory dataFactory; private Server server; /** * Constructor for a Monitor requiring a reference to the Server which will * receive the completed TestData structures, and a reference to * a factory for creating new TestData instances for the particular * framework this Monitor belongs to. * * @param s the server to receive completed TestData entities. * This cannot be null. * @param f the factory in charge of creating new TestData * entities. This cannot be null. * @exception IllegalArgumentException if s or f is * null. */ public DefaultMonitor( Server s, TestDataFactory f ) { if (s == null || f == null) { throw new IllegalArgumentException("no null arguments"); } this.server = s; this.dataFactory = f; } /** * Adds a new TestData instance related to the given * TestInfo. If there already is a TestData for the * given TestInfo, then an exception is thrown. * * @param info the unique test identifier to create a new TestData * instance for. * @exception IllegalStateException if info is already * been added without having been sent. * @exception IllegalArgumentException if info is null. */ public void addTestData( TestInfo info ) { assertNotNull( info ); synchronized (this.testData) { if (this.testData.containsKey( info )) { throw new IllegalStateException( "Test "+info+ " has already been registered." ); } LOG.debug("**** Monitor "+this+" adding test "+info); TestData td = createTestData( info ); this.testData.put( info, td ); } } /** * Retrieves the data associated with the given TestInfo, as was * created through {@link #addTestData( TestInfo )}. If the info * was never passed to the add method, then an exception is thrown. * * @param info the unique test identifier * @exception IllegalStateException if info has not been added, * or has been removed through the send call. * @exception IllegalArgumentException if info is null. */ public TestData getTestData( TestInfo info ) { assertNotNull( info ); synchronized (this.testData) { TestData td = (TestData)this.testData.get( info ); assertNotNull( td ); return td; } } /** * Sends the TestData associated with info to the * inner server, and removes the data from the inner cache. If the * info has not been added, then an exception is thrown. * * @param info the unique test identifier * @exception IllegalStateException if info has not been added, * or has been removed through the send call. * @exception IllegalArgumentException if info is null. */ public void sendTestData( TestInfo info ) { assertNotNull( info ); TestData td; synchronized (this.testData) { td = (TestData)this.testData.remove( info ); } LOG.debug("**** Monitor "+this+" removing test "+info); sendTestDataToServer( td ); } /** * Creates a new TestData instance for the info object through the * factory. This is guaranteed to never return null. * * @param info the unique test identifier * @exception IllegalStateException if the factory returns null. */ protected TestData createTestData( TestInfo info ) { TestData td = this.dataFactory.createTestData( info ); if (td == null) { throw new IllegalStateException("factory returned null"); } return td; } /** * Retrieves the registered TestData instance for the info. This * may return null. * * @param info the unique test identifier */ protected TestData retrieveTestData( TestInfo info ) { TestData td = (TestData)this.testData.get( info ); return td; } /** * Sends off the test data to the server. */ protected void sendTestDataToServer( TestData td ) { assertNotNull( td ); this.server.addTestData( td ); } /** * Ensures that info is not null. */ protected void assertNotNull( TestInfo info ) { if (info == null) { throw new IllegalArgumentException( "TestInfo was null" ); } } /** * Ensures that td is not null. */ protected void assertNotNull( TestData td ) { if (td == null) { throw new IllegalStateException( "Test is not registered." ); } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserver/TestInfo.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/testserv0000644000175000017500000000422707622026435034327 0ustar drazzibdrazzib/* * @(#)TestInfo.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; /** * Information about a test which can uniquely identify a specific test. * It should implement equals and hashCode. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public interface TestInfo { /** * @see Object#equals( Object ) */ public boolean equals( Object obj ); /** * @see Object#hashCode() */ public int hashCode(); /** * The name of the test suite. * * @return the test suite name */ public String getSuite(); /** * The name of the test method. * * @return the test method name. */ public String getMethod(); } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDocIT.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDocI0000644000175000017500000000676007622026433034121 0ustar drazzibdrazzib/* * @(#)AutoDocIT.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; /** * Issue Tracker entry point. Allows bugs and requriements to be tracked * directly to the test that ensures that part of the bug/requirement has been * fulfilled in the current code base. *

    * The alternate forms of the base {@link #testsIssue( String, String )} are * for convenience only. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since March 16, 2002 */ public interface AutoDocIT { /** * Traces an issue from the owning class and declared method, to the * given ID. This is a long, as some systems may allow for * more than 2 billion issues. * * @param methodName the owning class's method to trace the issue back to. * @param issueID the id of the issue being tracked. */ public void testsIssue( String methodName, long issueID ); /** * Traces an issue from the owning class and declared method, to the * given ID. * * @param methodName the owning class's method to trace the issue back to. * @param issueID the id of the issue being tracked. */ public void testsIssue( String methodName, String issueID ); /** * Traces an issue from the owning class to the given ID. * The method will still be given to the underlying tracker, but it will * be discovered through the stack trace. Hence, this is a volitile * method for tracking; it should only be called from the owning class * which is actually testing the bug. * * @param issueID the id of the issue being tracked. */ public void testsIssue( long issueID ); /** * Traces an issue from the owning class to the given ID. * The method will still be given to the underlying tracker, but it will * be discovered through the stack trace. Hence, this is a volitile * method for tracking; it should only be called from the owning class * which is actually testing the bug. * * @param issueID the id of the issue being tracked. */ public void testsIssue( String issueID ); } libgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/0000755000175000017500000000000011271425773033542 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/Log4jLogFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/Lo0000644000175000017500000000437707622026434034046 0ustar drazzibdrazzib/* * @(#)Log4jLogFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.log4j; import net.sourceforge.groboutils.autodoc.v1.AutoDocLog; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocLogFactory; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:12 $ * @since March 16, 2002 */ public class Log4jLogFactory implements AutoDocLogFactory { /** * Required default constructor. */ public Log4jLogFactory() { // do nothing } /** * Creates a new Log for the class owner. * * @param owner the Class owner, as passed to the AutoDoc class. * @return a new logger */ public AutoDocLog createLog( Class owner ) { return new Log4jLog( owner ); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/package.htmllibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/pa0000644000175000017500000000014407521071651034057 0ustar drazzibdrazzibnet.sourceforge.groboutils.autodoc.v1.log4j ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/Log4jLog.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/log4j/Lo0000644000175000017500000001333407622026434034037 0ustar drazzibdrazzib/* * @(#)Log4jLog.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.log4j; import net.sourceforge.groboutils.autodoc.v1.AutoDocLog; import org.apache.log4j.Logger; import org.apache.log4j.Priority; /** * An interface for logging. This allows for an abstraction between the * owning class and any underlying logging mechanism desired. *

    * The actual meaning of the logging levels is implementation independent. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:12 $ * @since March 16, 2002 */ public class Log4jLog implements AutoDocLog { private Logger log; /** * Standard constructor - uses the Logger based on the given class. * * @param owner the owning class to assign log responsibility to. * Must not be null. * @exception IllegalArgumentException if owner is null. */ public Log4jLog( Class owner ) { if (owner == null) { throw new IllegalArgumentException("no null arguments"); } setLog( Logger.getLogger( owner ) ); } /** * Create a log interface based on the given Apache Logger. * * @param log the underlying log instance to use for logging. Must not * be null. * @exception IllegalArgumentException if owner is null. */ public Log4jLog( Logger log ) { setLog( log ); } public void debug( Object message ) { this.log.debug( message ); } public void debug( Object message[] ) { if (this.log.isDebugEnabled()) { this.log.debug( concatMessage( message ) ); } } public void debug( Object message, Throwable error ) { this.log.debug( message, error ); } public void debug( Object message[], Throwable error ) { if (this.log.isDebugEnabled()) { this.log.debug( concatMessage( message ), error ); } } public void info( Object message ) { this.log.info( message ); } public void info( Object message[] ) { if (this.log.isInfoEnabled()) { this.log.info( concatMessage( message ) ); } } public void info( Object message, Throwable error ) { this.log.info( message, error ); } public void info( Object message[], Throwable error ) { if (this.log.isInfoEnabled()) { Object msg = concatMessage( message ); this.log.info( msg, error ); } } public void warn( Object message ) { this.log.warn( message ); } public void warn( Object message[] ) { if (this.log.isEnabledFor( Priority.WARN )) { this.log.warn( concatMessage( message ) ); } } public void warn( Object message, Throwable error ) { this.log.warn( message, error ); } public void warn( Object message[], Throwable error ) { if (this.log.isEnabledFor( Priority.WARN )) { this.log.warn( concatMessage( message ), error ); } } /** * Concatenate the given array into a single string. The returned object * will be of type java.lang.StringBuffer or * java.lang.String; use toString() on the resulting * object. * * @param o an array (possibly null) of objects (possibly null) to * concatenate their toString() results together. * @return the concatenated message. * @see java.lang.StringBuffer */ protected Object concatMessage( Object o[] ) { if (o == null) { return "null"; } if (o.length <= 0) { return ""; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < o.length; ++i) { sb.append( o[i] ); } return sb; } /** * Sets the internal log instance. * * @param log the log to set. It must not be null. * @exception IllegalArgumentException if log is null. */ protected void setLog( Logger log ) { if (log == null) { throw new IllegalArgumentException("no null arguments"); } this.log = log; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDocLog.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/AutoDocL0000644000175000017500000000464007622026433034117 0ustar drazzibdrazzib/* * @(#)AutoDocLog.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; /** * An interface for logging. This allows for an abstraction between the * owning class and any underlying logging mechanism desired. *

    * The actual meaning of the logging levels is implementation independent. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:11 $ * @since March 16, 2002 */ public interface AutoDocLog { public void debug( Object message ); public void debug( Object message[] ); public void debug( Object message, Throwable error ); public void debug( Object message[], Throwable error ); public void info( Object message ); public void info( Object message[] ); public void info( Object message, Throwable error ); public void info( Object message[], Throwable error ); public void warn( Object message ); public void warn( Object message[] ); public void warn( Object message, Throwable error ); public void warn( Object message[], Throwable error ); } libgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/0000755000175000017500000000000011271425773033316 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/Auto0000644000175000017500000000517007622026434034150 0ustar drazzibdrazzib/* * @(#)AutoDocFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.AutoDocIT; import net.sourceforge.groboutils.autodoc.v1.AutoDocLog; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:12 $ * @since March 16, 2002 */ public interface AutoDocFactory { /** * Creates a new Log for the class owner. * * @param owner the Class owner, as passed to the AutoDoc class. * @return a new logger for owner. */ public AutoDocLog createLog( Class owner ); /** * Creates the Issue Tracker entry point. * * @param owner the Class owner, as passed to the AutoDoc class. * @return a new issue tracker for owner. */ public AutoDocIT createIT( Class owner ); /** * Creates a Test Procedure entry point. * * @param owner the Class owner, as passed to the AutoDoc class. * @return a new test procedure generator for owner. */ public AutoDocTP createTP( Class owner ); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocTPFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/Auto0000644000175000017500000000356607622026435034160 0ustar drazzibdrazzib/* * @(#)AutoDocTPFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.AutoDocTP; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:13 $ * @since March 16, 2002 */ public interface AutoDocTPFactory { /** * Creates the Test Procedure entry point. */ public AutoDocTP createTP( Class owner ); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/TestListenerFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/Test0000644000175000017500000000371107622026435034157 0ustar drazzibdrazzib/* * @(#)TestListenerFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import junit.framework.TestListener; /** * A factory which can create a specific type of TestListener. Used by the * net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitListener * class to generate its delegated test listeners. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 17, 2002 * @version $Date: 2003/02/10 22:52:13 $ */ public interface TestListenerFactory { /** * Creates the factory's specific type of TestListener. */ public TestListener createListener(); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocITFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/Auto0000644000175000017500000000356507622026434034156 0ustar drazzibdrazzib/* * @(#)AutoDocITFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.AutoDocIT; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:12 $ * @since March 16, 2002 */ public interface AutoDocITFactory { /** * Creates the Issue Tracker entry point. */ public AutoDocIT createIT( Class owner ); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocLogFactory.javalibgroboutils-java-5.orig/testing-autodoc/sources/dev/net/sourceforge/groboutils/autodoc/v1/spi/Auto0000644000175000017500000000377707622026434034163 0ustar drazzibdrazzib/* * @(#)AutoDocLogFactory.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.AutoDocLog; /** * An interface which defines the kinds of classes which should be loaded * for the AutoDoc entry point. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:12 $ * @since March 16, 2002 */ public interface AutoDocLogFactory { /** * Creates a new Log for the class owner. * * @param owner the Class owner, as passed to the AutoDoc class. * @return a new logger for owner. */ public AutoDocLog createLog( Class owner ); } libgroboutils-java-5.orig/testing-autodoc/sources/dev/META-INF/0000755000175000017500000000000010011472741024361 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/dev/META-INF/services/0000755000175000017500000000000011271425773026220 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.spi.AutoDocLogFactorylibgroboutils-java-5.orig/testing-autodoc/sources/dev/META-INF/services/net.sourceforge.groboutils.a0000644000175000017500000000044707521071650033661 0ustar drazzibdrazzib# Service Provider Interface for AutoDocLogFactory # # Author: Matt Albrecht groboclown@users.sourceforge.net # Version: $Date: 2002/07/28 22:43:52 $ # Since: June 28, 2002 net.sourceforge.groboutils.autodoc.v1.log4j.Log4jLogFactory ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/dev/META-INF/services/net.sourceforge.groboutils.autodoc.v1.spi.AutoDocFactorylibgroboutils-java-5.orig/testing-autodoc/sources/dev/META-INF/services/net.sourceforge.groboutils.a0000644000175000017500000000045507521071650033660 0ustar drazzibdrazzib# Service Provider Interface for AutoDocFactory # # Author: Matt Albrecht groboclown@users.sourceforge.net # Version: $Date: 2002/07/28 22:43:52 $ # Since: June 28, 2002 net.sourceforge.groboutils.autodoc.v1.defimpl.DefaultAutoDocFactory libgroboutils-java-5.orig/testing-autodoc/sources/dev/about.txt0000644000175000017500000000015207521071650025100 0ustar drazzibdrazzibDevelopment This directory contains the non-test source code. It will be built into the 'core' jar file.libgroboutils-java-5.orig/testing-autodoc/sources/ut/0000755000175000017500000000000011271425773023107 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/0000755000175000017500000000000010011472743023663 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/0000755000175000017500000000000010011472743026206 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/0000755000175000017500000000000010011472743030377 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/0000755000175000017500000000000010011472743032035 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/0000755000175000017500000000000011271425773032375 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/0000755000175000017500000000000011271425773033526 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/AutoDocJUnitListenerJDK13UTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/Aut0000644000175000017500000001140307622026440034172 0ustar drazzibdrazzib/* * @(#)AutoDocJUnitListenerJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.junit; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; import junit.framework.TestListener; import net.sourceforge.groboutils.autodoc.v1.spi.*; /** * Tests the AutoDocJUnitListener class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 5, 2002 * @version $Date: 2003/02/10 22:52:16 $ */ public class AutoDocJUnitListenerJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocJUnitListenerJDK13UTest.class; private static final AutoDoc AD = new AutoDoc(THIS_CLASS); public AutoDocJUnitListenerJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup private MockControl testControl; private Test mockTest; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.testControl = EasyMock.controlFor( Test.class ); this.mockTest = (Test)this.testControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AutoDocJUnitListener(); } public void testConstructor1a() { new AutoDocJUnitListener( null ); } public void testConstructor1b() { new AutoDocJUnitListener( new TestListenerFactory[0] ); } public void testConstructor2() { TestListenerFactory fl[] = new TestListenerFactory[] { new TestListenerFactory() { public TestListener createListener() { return null; } } }; new AutoDocJUnitListener( fl ); } public void testConstructor3() { new AutoDocJUnitListener( null ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocJUnitListenerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new AutoDocJUnitListener(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/AutoDocJUnitFormatterJDK13UTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/Aut0000644000175000017500000001072707622026440034202 0ustar drazzibdrazzib/* * @(#)AutoDocJUnitFormatterJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.junit; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; /** * Tests the AutoDocJUnitFormatterJDK13UTest class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 8, 2002 * @version $Date: 2003/02/10 22:52:16 $ */ public class AutoDocJUnitFormatterJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocJUnitFormatterJDK13UTest.class; private static final AutoDoc AD = new AutoDoc(THIS_CLASS); public AutoDocJUnitFormatterJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AutoDocJUnitFormatter(); } public void testStartTestSuite() { createFormatter().startTestSuite( null ); } public void testEndTestSuite() { createFormatter().endTestSuite( null ); } public void testSetOutput() { createFormatter().setOutput( null ); } public void testSetSystemOutput() { createFormatter().setSystemOutput( null ); } public void testSetSystemError() { createFormatter().setSystemError( null ); } //------------------------------------------------------------------------- // Helpers protected AutoDocJUnitFormatter createFormatter() { return new AutoDocJUnitFormatter(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocJUnitListenerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new AutoDocJUnitFormatter(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/AutoDocJUnitListenerUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/junit/Aut0000644000175000017500000001755707622026440034212 0ustar drazzibdrazzib/* * @(#)AutoDocJUnitListenerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.junit; import java.util.Enumeration; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestListener; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase; import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite; import junit.framework.AssertionFailedError; /** * Tests the AutoDocJUnitListener class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 5, 2002 * @version $Date: 2003/02/10 22:52:16 $ */ public class AutoDocJUnitListenerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocJUnitListenerUTestI.class; private static final AutoDoc AD = new AutoDoc(THIS_CLASS); public AutoDocJUnitListenerUTestI( String name, ImplFactory f ) { super( name, AutoDocJUnitListener.class, f ); } //------------------------------------------------------------------------- // setup private MockControl testControl; private Test mockTest; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.testControl = EasyMock.controlFor( Test.class ); this.mockTest = (Test)this.testControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testAddFailure1() { AD.getIT().testsIssue( "testAddFailure1", 526454 ); createListener().addFailure( null, null ); } public void testAddFailure2() { AD.getIT().testsIssue( 526454 ); createListener().addFailure( null, new AssertionFailedError( "ignore error") ); } public void testAddFailure3() { this.testControl.activate(); // failures can occur without a startTest being called! createListener().addFailure( this.mockTest, new AssertionFailedError( "ignore error") ); this.testControl.verify(); } public void testAddFailure4() { this.testControl.activate(); AutoDocJUnitListener adjul = createListener(); adjul.startTest( this.mockTest ); adjul.addFailure( this.mockTest, new AssertionFailedError( "ignore error") ); adjul.endTest( this.mockTest ); this.testControl.verify(); } public void testAddError1() { AD.getIT().testsIssue( "testAddError1", 526454 ); createListener().addError( null, null ); } public void testAddError2() { AD.getIT().testsIssue( "testAddError2", 526454 ); createListener().addError( null, new Throwable( "ignore error") ); } public void testAddError3() { this.testControl.activate(); // errors can occur without a startTest being called! createListener().addError( this.mockTest, new Throwable( "ignore error") ); this.testControl.verify(); } public void testAddError4() { this.testControl.activate(); AutoDocJUnitListener adjul = createListener(); adjul.startTest( this.mockTest ); adjul.addError( this.mockTest, new Throwable( "ignore error") ); adjul.endTest( this.mockTest ); this.testControl.verify(); } public void testAddListener1() { AutoDocJUnitListener adjul = createListener(); Enumeration enum = adjul.getListeners(); int listenerCount = 0; while (enum.hasMoreElements()) { ++listenerCount; enum.nextElement(); } adjul.addListener( null ); enum = adjul.getListeners(); int count = 0; while (enum.hasMoreElements()) { ++count; enum.nextElement(); } assertEquals( "Adding a null listener changed the number of registered "+ "listeners.", count, listenerCount ); } public void testAddListener2() { TestListener tl = new TestListener() { public void addError(Test test, Throwable t) {} public void addFailure(Test test, AssertionFailedError t) {} public void endTest(Test test) {} public void startTest(Test test) {} }; AutoDocJUnitListener adjul = createListener(); Enumeration enum = adjul.getListeners(); int listenerCount = 0; while (enum.hasMoreElements()) { ++listenerCount; enum.nextElement(); } adjul.addListener( tl ); enum = adjul.getListeners(); int count = 0; while (enum.hasMoreElements()) { ++count; enum.nextElement(); } assertEquals( "Adding a real listener did not increase the number of registered "+ "listeners.", listenerCount + 1, count ); } //------------------------------------------------------------------------- // Helpers protected AutoDocJUnitListener createListener() { return (AutoDocJUnitListener)createImplObject(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/0000755000175000017500000000000011271425773034015 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/DefaultAutoDocFactoryUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/D0000644000175000017500000001310607622026437034123 0ustar drazzibdrazzib/* * @(#)DefaultAutoDocFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocLogFactory; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.spi.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.*; /** * Tests the DefaultAutoDocFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:15 $ * @since March 27, 2002 */ public class DefaultAutoDocFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultAutoDocFactoryUTest.class; public DefaultAutoDocFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testGetLogFactories1() { assertHasAtLeastOne( (new DefaultAutoDocFactory()).getLogFactories(), AutoDocLogFactory.class, true ); } public void testGetITFactories1() { assertHasAtLeastOne( (new DefaultAutoDocFactory()).getITFactories(), AutoDocITFactory.class, false ); } public void testGetTPFactories1() { assertHasAtLeastOne( (new DefaultAutoDocFactory()).getTPFactories(), AutoDocTPFactory.class, false ); } public void testGetLogFactoryStore1() { assertNotNull( "Log factory store must never be null.", DefaultAutoDocFactory.getLogFactoryStore() ); } public void testGetITFactoryStore1() { assertNotNull( "IT factory store must never be null.", DefaultAutoDocFactory.getITFactoryStore() ); } public void testGetTPFactoryStore1() { assertNotNull( "TP factory store must never be null.", DefaultAutoDocFactory.getTPFactoryStore() ); } //------------------------------------------------------------------------- // Helpers protected void assertHasAtLeastOne( Enumeration enum, Class parent, boolean mustHaveAtLeastOne ) { assertNotNull( "Enumeration cannot be null.", enum ); if (mustHaveAtLeastOne) { assertTrue( "Enumeration does not have any contents.", enum.hasMoreElements() ); } while (enum.hasMoreElements()) { Object o = enum.nextElement(); assertTrue( "Enum contains "+o.getClass().getName()+ ", but is not of type "+parent.getName()+".", parent.isInstance( o ) ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultAutoDocFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/AutoDocITSetUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/A0000644000175000017500000001551007665520154034123 0ustar drazzibdrazzib/* * @(#)AutoDocITSetUTest.java * * Copyright (C) 2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; import net.sourceforge.groboutils.autodoc.v1.spi.AutoDocLogFactory; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.spi.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.*; /** * Tests the DefaultAutoDocFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/30 00:06:04 $ * @since March 27, 2002 */ public class AutoDocITSetUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocITSetUTest.class; public AutoDocITSetUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests private static class MyAutoDocIT implements AutoDocIT { public Vector methodNames = new Vector(); public Vector longIssueID = new Vector(); public Vector strIssueID = new Vector(); public void testsIssue( String methodName, long issueID ) { this.methodNames.addElement( methodName ); this.longIssueID.addElement( new Long( issueID ) ); } public void testsIssue( String methodName, String issueID ) { this.methodNames.addElement( methodName ); this.strIssueID.addElement( issueID ); } public void testsIssue( long issueID ) { this.longIssueID.addElement( new Long( issueID ) ); } public void testsIssue( String issueID ) { this.strIssueID.addElement( issueID ); } } public void testTestsIssue1() { MyAutoDocIT mad = new MyAutoDocIT(); AutoDocITSet set = new AutoDocITSet(); set.addIT( mad ); set.testsIssue( "name", 1L ); assertEquals( "Did not add only 1 method name.", mad.methodNames.size(), 1 ); assertEquals( "Did not add only 1 long id.", mad.longIssueID.size(), 1 ); assertEquals( "Added a string id.", mad.strIssueID.size(), 0 ); } public void testTestsIssue2() { MyAutoDocIT mad = new MyAutoDocIT(); AutoDocITSet set = new AutoDocITSet(); set.addIT( mad ); set.testsIssue( "name", "1" ); assertEquals( "Did not add only 1 method name.", mad.methodNames.size(), 1 ); assertEquals( "Did not add only 1 string id.", mad.strIssueID.size(), 1 ); assertEquals( "Added a long id.", mad.longIssueID.size(), 0 ); } public void testTestsIssue3() { MyAutoDocIT mad = new MyAutoDocIT(); AutoDocITSet set = new AutoDocITSet(); set.addIT( mad ); set.testsIssue( 1L ); assertEquals( "Added a method name.", mad.methodNames.size(), 0 ); assertEquals( "Did not add only 1 long id.", mad.longIssueID.size(), 1 ); assertEquals( "Added a string id.", mad.strIssueID.size(), 0 ); } public void testTestsIssue4() { MyAutoDocIT mad = new MyAutoDocIT(); AutoDocITSet set = new AutoDocITSet(); set.addIT( mad ); set.testsIssue( "l" ); assertEquals( "Added a method name.", mad.methodNames.size(), 0 ); assertEquals( "Did not add only 1 string id.", mad.strIssueID.size(), 1 ); assertEquals( "Added a long id.", mad.longIssueID.size(), 0 ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); InterfaceTestSuite its = AutoDocITUTestI.suite(); its.addInterfaceTestSuite( IAutoDocSetUTestI.suite() ); its.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new AutoDocITSet(); } } ); suite.addTest( its ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/IAutoDocSetUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/defimpl/I0000644000175000017500000001017507665520154034135 0ustar drazzibdrazzib/* * @(#)IAutoDocSetUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.defimpl; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.Enumeration; import java.util.NoSuchElementException; /** * Tests the AutoDocIT interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/05/30 00:06:04 $ */ public class IAutoDocSetUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = IAutoDocSetUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public IAutoDocSetUTestI( String name, ImplFactory f ) { super( name, IAutoDocSet.class, f ); } public IAutoDocSet createIAutoDocSet() { return (IAutoDocSet)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetSetContents1() { IAutoDocSet ads = createIAutoDocSet(); Enumeration enum = ads.getSetContents(); assertNotNull( "Returned null enum.", enum ); while (enum.hasMoreElements()) { Object o = enum.nextElement(); assertNotNull( "Enum element is null.", o ); } try { enum.nextElement(); fail( "Did not throw NoMoreElementsException." ); } catch (NoSuchElementException ex) { // test exception } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/libgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000755000175000017500000000000011271425773034342 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/DefaultTestInfoUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001336307622026441034344 0ustar drazzibdrazzib/* * @(#)DefaultTestInfoUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the DefaultTestInfo class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class DefaultTestInfoUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultTestInfoUTest.class; public DefaultTestInfoUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { TestInfo ti = new DefaultTestInfo(); assertNull( "did not return null suite.", ti.getSuite() ); assertNull( "did not return null method.", ti.getMethod() ); } public void testConstructor2() { TestInfo ti = new DefaultTestInfo( "a", "b" ); assertEquals( "did not return correct suite.", "a", ti.getSuite() ); assertEquals( "did not return correct method.", "b", ti.getMethod() ); } public void testEquals1() { TestInfo ti1 = new DefaultTestInfo( "a", "b" ); TestInfo ti2 = new DefaultTestInfo( "a", "b" ); assertTrue( "did not think same data is equal.", ti1.equals( ti2 ) ); } public void testEquals2() { TestInfo ti1 = new DefaultTestInfo( "a", "b" ); TestInfo ti2 = new DefaultTestInfo( "a", "c" ); assertTrue( "did not think different method is not equal.", ! ti1.equals( ti2 ) ); } public void testEquals3() { TestInfo ti1 = new DefaultTestInfo( "a", "b" ); TestInfo ti2 = new DefaultTestInfo( "c", "b" ); assertTrue( "did not think different suite is not equal.", ! ti1.equals( ti2 ) ); } public void testEquals4() { TestInfo ti1 = new DefaultTestInfo( "a", "b" ); TestInfo ti2 = new DefaultTestInfo( "d", "c" ); assertTrue( "did not think different method and suite is not equal.", ! ti1.equals( ti2 ) ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = TestInfoUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultTestInfo(); } } ); suite.addFactory( new CxFactory( "B" ) { public Object createImplObject() { return new DefaultTestInfo( "a", null ); } } ); suite.addFactory( new CxFactory( "C" ) { public Object createImplObject() { return new DefaultTestInfo( null, "a" ); } } ); suite.addFactory( new CxFactory( "D" ) { public Object createImplObject() { return new DefaultTestInfo( "a", "b" ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/junit/libgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000755000175000017500000000000011271425773034342 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/junit/JUnitTestListenerUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001322207671227632034347 0ustar drazzibdrazzib/* * @(#)JUnitTestListenerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver.junit; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.TestListener; import junit.framework.AssertionFailedError; /** * Tests the JUnitTestListener class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/06/10 01:08:42 $ */ public class JUnitTestListenerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JUnitTestListenerUTestI.class; public JUnitTestListenerUTestI( String name, ImplFactory f ) { super( name, JUnitTestListener.class, f ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } protected JUnitTestListener createJUnitTestListener() { return (JUnitTestListener)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateTestInfo() { JUnitTestListener jtl = createJUnitTestListener(); TestInfo ti = jtl.createTestInfo( createTest() ); assertNotNull( "Cannot return null test info objects.", ti ); } public void testAddError1() { TestListener jtl = createJUnitTestListener(); jtl.addError( null, null ); } public void testAddError2() { JUnitTestListener jtl = createJUnitTestListener(); jtl.addError( createTest(), null ); } public void testAddError3() { JUnitTestListener jtl = createJUnitTestListener(); jtl.addError( createTest(), new Throwable() ); } public void testAddFailure1() { TestListener jtl = createJUnitTestListener(); jtl.addFailure( null, null ); } public void testAddFailure2() { JUnitTestListener jtl = createJUnitTestListener(); jtl.addFailure( createTest(), null ); } public void testAddFailure3() { JUnitTestListener jtl = createJUnitTestListener(); jtl.addFailure( createTest(), new AssertionFailedError() ); } public void testStartTest() { JUnitTestListener jtl = createJUnitTestListener(); jtl.startTest( createTest() ); } public void testEndTest1() { // this shows the fix to bug 751667 JUnitTestListener jtl = createJUnitTestListener(); // this should just generate a warning. jtl.endTest( createTest() ); } public void testEndTest2() { JUnitTestListener jtl = createJUnitTestListener(); jtl.startTest( createTest() ); jtl.endTest( createTest() ); } //------------------------------------------------------------------------- // Helpers protected Test createTest() { return new TestCase("test") {}; } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = TestCorrelateUTestI.suite(); suite.addTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/junit/JUnitTestInfoJDK13UTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001251507622026442034343 0ustar drazzibdrazzib/* * @(#)JUnitTestInfoJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver.junit; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the JUnitTestInfo class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:18 $ */ public class JUnitTestInfoJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JUnitTestInfoJDK13UTest.class; public JUnitTestInfoJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup private MockControl logControl; private AutoDocLog mockLog; private MockControl itControl; private AutoDocIT mockIT; private MockControl tpControl; private AutoDocTP mockTP; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.logControl = EasyMock.controlFor( AutoDocLog.class ); this.mockLog = (AutoDocLog)this.logControl.getMock(); this.itControl = EasyMock.controlFor( AutoDocIT.class ); this.mockIT = (AutoDocIT)this.itControl.getMock(); this.tpControl = EasyMock.controlFor( AutoDocTP.class ); this.mockTP = (AutoDocTP)this.tpControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new JUnitTestInfo( null ); fail("Did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception } } public void testConstructor2() { JUnitTestInfo ti = new JUnitTestInfo( this ); assertEquals( "Did not set suite name correctly.", getClass().getName(), ti.getSuite() ); assertEquals( "Did not set method name correctly.", getName(), ti.getMethod() ); } public void testConstructor3() { String name = "myName"; TestSuite ts = new TestSuite(); ts.setName( name ); JUnitTestInfo ti = new JUnitTestInfo( ts ); assertEquals( "Did not set suite name correctly.", name, ti.getSuite() ); assertEquals( "Did not set method name correctly.", "run", ti.getMethod() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = TestInfoUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new JUnitTestInfo( new Object() ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/junit/JUnitTestListenerUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001421707665402660034353 0ustar drazzibdrazzib/* * @(#)JUnitTestListenerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver.junit; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.testserver.*; import java.util.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.framework.AssertionFailedError; /** * Tests the JUnitTestListener class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/05/29 13:05:52 $ */ public class JUnitTestListenerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = JUnitTestListenerUTest.class; public JUnitTestListenerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testNeedMoreTests() {} //------------------------------------------------------------------------- // Helpers static class MyMonitor implements Monitor { public Vector addedInfo = new Vector(); public Vector sentInfo = new Vector(); public Vector testInfo = new Vector(); public void addTestData( TestInfo info ) { this.addedInfo.addElement( info ); this.testInfo.addElement( info ); } public TestData getTestData( TestInfo info ) { return new DefaultTestData( info ); } public void sendTestData( TestInfo info ) { if (this.addedInfo.contains( info )) { this.addedInfo.removeElement( info ); this.sentInfo.addElement( info ); } else { throw new IllegalStateException(""); } } public void clear() { this.addedInfo = new Vector(); this.sentInfo = new Vector(); this.testInfo = new Vector(); } } static class MyMonitorFinder implements MonitorFinder { public MyMonitor monitor = new MyMonitor(); public Monitor getMonitor() { return this.monitor; } } static class MyJUnitTestListener extends JUnitTestListener { public static MyMonitorFinder finder = new MyMonitorFinder(); public Vector start = new Vector(); public Vector end = new Vector(); public Vector error = new Vector(); public Vector thr = new Vector(); public Vector failure = new Vector(); public MyJUnitTestListener() { super( finder ); } protected void startTest( TestData data ) { this.start.addElement( data ); } protected void endTest( TestData data ) { this.end.addElement( data ); } protected void addError( TestData data, Throwable t ) { this.error.addElement( data ); this.thr.addElement( t ); } protected void addFailure( TestData data, AssertionFailedError t ) { this.failure.addElement( data ); this.thr.addElement( t ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static TestSuite suite() { InterfaceTestSuite suite = JUnitTestListenerUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { MyJUnitTestListener.finder.monitor.clear(); return new MyJUnitTestListener(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/ServerUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001124107622026441034335 0ustar drazzibdrazzib/* * @(#)ServerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the Server interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class ServerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = ServerUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public ServerUTestI( String name, ImplFactory f ) { super( name, Server.class, f ); } public Server createServer() { return (Server)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testAddTestData1() { Server s = createServer(); // must run w/o exception. s.addTestData( null ); } public void testAddTestData2() { TestData td = new TestData() { public TestInfo getTestInfo() { return null; } }; Server s = createServer(); // must run w/o exception. s.addTestData( td ); } public void testAddTestData3() { final TestInfo ti = new DefaultTestInfo( "a", "b" ); TestData td = new TestData() { public TestInfo getTestInfo() { return ti; } }; Server s = createServer(); // must run w/o exception. s.addTestData( td ); } public void testAddTestData4() { final TestInfo ti = new DefaultTestInfo(); TestData td = new TestData() { public TestInfo getTestInfo() { return ti; } }; Server s = createServer(); // must run w/o exception. s.addTestData( td ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/AbstractWriterServerUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001705007622026441034341 0ustar drazzibdrazzib/* * @(#)AbstractWriterServerUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; import java.io.Writer; import java.io.StringWriter; import java.io.IOException; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; /** * Tests the AbstractWriterServer abstract class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 8, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class AbstractWriterServerUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractWriterServerUTestI.class; public AbstractWriterServerUTestI( String name, ImplFactory f ) { super( name, AbstractWriterServer.class, f ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } public AbstractWriterServer createAbstractWriterServer() { return (AbstractWriterServer)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testWriteTestData1() throws Exception { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); // should fail gracefully aws.writeTestData( null, sw ); } public void testWriteTestData2() throws Exception { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); TestData td = new TestData() { public TestInfo getTestInfo() { return null; } }; // should fail gracefully aws.writeTestData( td, sw ); } public void testWriteTestData3() throws Exception { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); final TestInfo ti = new DefaultTestInfo( "a", "b" ); TestData td = new TestData() { public TestInfo getTestInfo() { return ti; } }; // should work w/o error aws.writeTestData( td, sw ); } public void testWriteTestData4() throws Exception { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); final TestInfo ti = new DefaultTestInfo(); TestData td = new TestData() { public TestInfo getTestInfo() { return ti; } }; // should fail gracefully, if it does fail. aws.writeTestData( td, sw ); } protected void _innerOpenOutput( AbstractWriterServer aws, TestData td ) { try { Writer w = aws.openOutput( td ); assertNotNull( "If no exception was thrown, then openOutput must never "+ "return null.", w ); aws.closeOutput( w ); } catch (IOException ioe) { // this exception is fine. } } public void testOpenOutput1() { AbstractWriterServer aws = createAbstractWriterServer(); try { _innerOpenOutput( aws, null ); } catch (NullPointerException e) { // this is ok } catch (IllegalArgumentException e) { // this is ok } } public void testOpenOutput2() { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); TestData td = new TestData() { public TestInfo getTestInfo() { return null; } }; try { _innerOpenOutput( aws, td ); } catch (NullPointerException e) { // this is ok } catch (IllegalArgumentException e) { // this is ok } } public void testOpenOutput3() { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); final TestInfo ti = new DefaultTestInfo(); TestData td = new TestData() { public TestInfo getTestInfo() { return ti; } }; _innerOpenOutput( aws, td ); } public void testOpenOutput4() { AbstractWriterServer aws = createAbstractWriterServer(); StringWriter sw = new StringWriter(); final TestInfo ti = new DefaultTestInfo( "a", "b" ); TestData td = new TestData() { public TestInfo getTestInfo() { return ti; } }; _innerOpenOutput( aws, td ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); suite.addInterfaceTestSuite( ServerUTestI.suite() ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/TestDataFactoryUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001025007622026442034335 0ustar drazzibdrazzib/* * @(#)TestDataFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the TestDataFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:18 $ */ public class TestDataFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestDataFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public TestDataFactoryUTestI( String name, ImplFactory f ) { super( name, TestDataFactory.class, f ); } public TestDataFactory createTestDataFactory() { return (TestDataFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateTestData1() { TestDataFactory tdf = createTestDataFactory(); try { tdf.createTestData( null ); fail("did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // examine exception? } } public void testCreateTestData2() { DefaultTestInfo dti = new DefaultTestInfo(); TestDataFactory tdf = createTestDataFactory(); TestData td = tdf.createTestData( dti ); assertNotNull( "factory "+tdf+" returned null.", td ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/DefaultMonitorUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001335107671227631034351 0ustar drazzibdrazzib/* * @(#)DefaultMonitorUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the DefaultMonitor class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/06/10 01:08:41 $ */ public class DefaultMonitorUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultMonitorUTest.class; public DefaultMonitorUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultMonitor( null, null ); fail("Did not throw an IllegalArgumentException"); } catch (IllegalArgumentException ise) { // test error? } } public void testConstructor2() { Server s = new MyServer(); try { new DefaultMonitor( s, null ); fail("Did not throw an IllegalArgumentException"); } catch (IllegalArgumentException ise) { // test error? } } public void testConstructor3() { TestDataFactory tdf = new MyTDFactory(); try { new DefaultMonitor( null, tdf ); fail("Did not throw an IllegalArgumentException"); } catch (IllegalArgumentException ise) { // test error? } } public void testRemoveInfoOnSend1() { DefaultMonitor dm = new DefaultMonitor( new MyServer(), new MyTDFactory() ); TestInfo ti = new DefaultTestInfo( "A", "b" ); dm.addTestData( ti ); dm.sendTestData( ti ); try { dm.getTestData( ti ); fail( "Did not throw an IllegalStateException." ); } catch (IllegalStateException ise) { // test exception } } //------------------------------------------------------------------------- // Helpers protected static class MyServer implements Server { public void addTestData( TestData td ) { // do nothing } } protected static class MyTestData implements TestData { TestInfo info; public MyTestData( TestInfo ti ) { this.info = ti; } public TestInfo getTestInfo() { return this.info; } } protected static class MyTDFactory implements TestDataFactory { public TestData createTestData( TestInfo info ) { return new MyTestData( info ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = MonitorUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { Server s = new MyServer(); TestDataFactory tdf = new MyTDFactory(); return new DefaultMonitor( s, tdf ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/MonitorFinderUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000000735207622026441034345 0ustar drazzibdrazzib/* * @(#)MonitorFinderUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the MonitorFinder interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class MonitorFinderUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MonitorFinderUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public MonitorFinderUTestI( String name, ImplFactory f ) { super( name, MonitorFinder.class, f ); } public MonitorFinder createMonitorFinder() { return (MonitorFinder)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetMonitor1() { MonitorFinder mf = createMonitorFinder(); Monitor m = mf.getMonitor(); assertNotNull( "monitor can't be null.", m ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/DefaultTestDataUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001014107622026441034333 0ustar drazzibdrazzib/* * @(#)DefaultTestDataUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the DefaultTestData class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 8, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class DefaultTestDataUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = DefaultTestDataUTest.class; public DefaultTestDataUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new DefaultTestData( null ); fail("did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor2() { TestInfo ti = new DefaultTestInfo(); TestData td = new DefaultTestData( ti ); assertEquals( "returned test info did not match constructor's test info.", ti, td.getTestInfo() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = TestDataUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new DefaultTestData( new DefaultTestInfo() ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/TestInfoUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001117707622026442034346 0ustar drazzibdrazzib/* * @(#)TestInfoUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the TestInfo interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:18 $ */ public class TestInfoUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestInfoUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public TestInfoUTestI( String name, ImplFactory f ) { super( name, TestInfo.class, f ); } public TestInfo createTestInfo() { return (TestInfo)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testEquals1() { assertTrue( "thinks null equals itself.", ! createTestInfo().equals( null ) ); } public void testEquals2() { assertTrue( "thinks an Object equals itself.", ! createTestInfo().equals( new Object() ) ); } private static class MyTestInfo implements TestInfo { public String getSuite() { return "MyTestInfo.suite"; } public String getMethod() { return "MyTestIfno.method"; } } public void testEquals3() { assertTrue( "thinks a non-same class equals itself.", ! createTestInfo().equals( new MyTestInfo() ) ); } public void testEquals4() { TestInfo ti = createTestInfo(); assertTrue( "does not think that the TestInfo equals itself.", ti.equals( ti ) ); } public void testGetSuite1() { // may return null createTestInfo().getSuite(); } public void testGetMethod1() { // may return null createTestInfo().getMethod(); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/TestDataUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000000714107622026442034342 0ustar drazzibdrazzib/* * @(#)TestDataUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the TestData interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:18 $ */ public class TestDataUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestDataUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public TestDataUTestI( String name, ImplFactory f ) { super( name, TestData.class, f ); } public TestData createTestData() { return (TestData)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testGetTestInfo() { TestData td = createTestData(); assertNotNull( "getTestInfo returned null.", td.getTestInfo() ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/MonitorUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001476307622026441034351 0ustar drazzibdrazzib/* * @(#)MonitorUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the Monitor interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class MonitorUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = MonitorUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public MonitorUTestI( String name, ImplFactory f ) { super( name, Monitor.class, f ); } public Monitor createMonitor() { return (Monitor)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testAddTestData1() { Monitor m = createMonitor(); try { m.addTestData( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception? } } public void testAddTestData2() { Monitor m = createMonitor(); TestInfo ti = new DefaultTestInfo( "a", "b" ); m.addTestData( ti ); } public void testAddTestData3() { Monitor m = createMonitor(); TestInfo ti = new DefaultTestInfo( "a", "b" ); m.addTestData( ti ); try { m.addTestData( ti ); fail("Did not throw an IllegalStateException"); } catch (IllegalStateException e) { // check exception? } } public void testGetTestData1() { Monitor m = createMonitor(); try { m.getTestData( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception? } } public void testGetTestData2() { Monitor m = createMonitor(); TestInfo ti = new DefaultTestInfo( "a", "b" ); try { m.getTestData( ti ); fail("Did not throw IllegalStateException"); } catch (IllegalStateException e) { // check exception? } } public void testGetTestData3() { Monitor m = createMonitor(); TestInfo ti = new DefaultTestInfo( "a", "b" ); m.addTestData( ti ); TestData td = m.getTestData( ti ); assertNotNull( "returned null on valid test info.", td ); assertTrue( "A new get did not return the exact same object.", td == m.getTestData( ti ) ); } public void testSendTestData1() { Monitor m = createMonitor(); try { m.sendTestData( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception? } } public void testSendTestData2() { Monitor m = createMonitor(); TestInfo ti = new DefaultTestInfo( "a", "b" ); try { m.sendTestData( ti ); fail("Did not throw IllegalStateException"); } catch (IllegalStateException e) { // check exception? } } public void testSendTestData3() { Monitor m = createMonitor(); TestInfo ti = new DefaultTestInfo( "a", "b" ); m.addTestData( ti ); m.sendTestData( ti ); try { m.getTestData( ti ); fail("Did not throw IllegalStateException"); } catch (IllegalStateException ise) { // test exception? } } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/TestCorrelateUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001103207622026442034334 0ustar drazzibdrazzib/* * @(#)TestCorrelateUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the TestCorrelate interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:18 $ */ public class TestCorrelateUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestCorrelateUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public TestCorrelateUTestI( String name, ImplFactory f ) { super( name, TestCorrelate.class, f ); } public TestCorrelate createTestCorrelate() { return (TestCorrelate)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testFindMethodFromStack1() { TestCorrelate tc = createTestCorrelate(); String s = tc.findClassMethodFromStack(); } public void testCreateTestInfoFromStack1() { TestCorrelate tc = createTestCorrelate(); TestInfo ti = tc.createTestInfoFromStack(); assertNotNull( "Must never return null test info.", ti ); } public void testCreateTestInfo1() { TestCorrelate tc = createTestCorrelate(); TestInfo ti = tc.createTestInfo( "method" ); assertNotNull( "Must never return null test info.", ti ); assertEquals( "Did not set right method name.", "method", ti.getMethod() ); } public void testGetFinder1() { TestCorrelate tc = createTestCorrelate(); MonitorFinder mf = tc.getFinder(); assertNotNull( "Must never return null monitor finder.", mf ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserver/AbstractWriterServerUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/testserve0000644000175000017500000001044707622026441034344 0ustar drazzibdrazzib/* * @(#)AbstractWriterServerUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.testserver; import net.sourceforge.groboutils.autodoc.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.AutoDoc; import java.io.*; /** * Tests the AbstractWriterServer abstract class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 8, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class AbstractWriterServerUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AbstractWriterServerUTest.class; public AbstractWriterServerUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static class MyAbstractWriterServer extends AbstractWriterServer { protected void writeTestData( TestData td, Writer w ) throws IOException { assertNotNull( "writer is null.", w ); // if test data is null, we are to fail gracefully. } protected Writer openOutput( TestData td ) throws IOException { if (td == null) { throw new NullPointerException("testData is null"); } return new StringWriter(); } } public static TestSuite suite() { InterfaceTestSuite suite = AbstractWriterServerUTestI.suite(); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new MyAbstractWriterServer(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocLogUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocLo0000644000175000017500000002506307622026436034155 0ustar drazzibdrazzib/* * @(#)AutoDocLogUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocLog interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:14 $ * @since March 27, 2002 */ public class AutoDocLogUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocLogUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocLogUTestI( String name, ImplFactory f ) { super( name, AutoDocLog.class, f ); } public AutoDocLog createAutoDocLog() { return (AutoDocLog)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testDebug1() { createAutoDocLog().debug( (Object)null ); } public void testDebug2() { createAutoDocLog().debug( "test message" ); } public void testDebug3() { createAutoDocLog().debug( (Object[])null ); } public void testDebug4() { createAutoDocLog().debug( new Object[2] ); } public void testDebug4a() { createAutoDocLog().debug( new Object[0] ); } public void testDebug5() { createAutoDocLog().debug( new Object[] { "a", null, new Integer(1) } ); } public void testDebug5a() { createAutoDocLog().debug( new Object[] { "a", "b", new Integer(1) } ); } public void testDebug6() { createAutoDocLog().debug( (Object)null, null ); } public void testDebug7() { createAutoDocLog().debug( (Object)null, new Throwable("ignore") ); } public void testDebug8() { createAutoDocLog().debug( new Object(), null ); } public void testDebug9() { createAutoDocLog().debug( new Object(), new Throwable("ignore") ); } public void testDebug10() { createAutoDocLog().debug( (Object[])null, null ); } public void testDebug11() { createAutoDocLog().debug( new Object[2], null ); } public void testDebug12() { createAutoDocLog().debug( new Object[0], null ); } public void testDebug13() { createAutoDocLog().debug( new Object[] { "a", null, "b" }, null ); } public void testDebug13a() { createAutoDocLog().debug( new Object[] { "a", "b" }, null ); } public void testDebug14() { createAutoDocLog().debug( (Object[])null, new Throwable("ignore") ); } public void testDebug15() { createAutoDocLog().debug( new Object[2], new Throwable("ignore") ); } public void testDebug16() { createAutoDocLog().debug( new Object[0], new Throwable("ignore") ); } public void testDebug17() { createAutoDocLog().debug( new Object[] { "a", null, "b" }, new Throwable("ignore") ); } public void testDebug18() { createAutoDocLog().debug( new Object[] { "a", "b" }, new Throwable("ignore") ); } //------------------------------------------------------------------------- public void testInfo1() { createAutoDocLog().info( (Object)null ); } public void testInfo2() { createAutoDocLog().info( "test message" ); } public void testInfo3() { createAutoDocLog().info( (Object[])null ); } public void testInfo4() { createAutoDocLog().info( new Object[2] ); } public void testInfo5() { createAutoDocLog().info( new Object[0] ); } public void testInfo6() { createAutoDocLog().info( new Object[] { "a", null, new Integer(1) } ); } public void testInfo7() { createAutoDocLog().info( new Object[] { "a", "b", new Integer(1) } ); } public void testInfo8() { createAutoDocLog().info( (Object)null, null ); } public void testInfo9() { createAutoDocLog().info( (Object)null, new Throwable("ignore") ); } public void testInfo10() { createAutoDocLog().info( new Object(), null ); } public void testInfo11() { createAutoDocLog().info( new Object(), new Throwable("ignore") ); } public void testInfo12() { createAutoDocLog().info( (Object[])null, null ); } public void testInfo13() { createAutoDocLog().info( new Object[2], null ); } public void testInfo14() { createAutoDocLog().info( new Object[0], null ); } public void testInfo15() { createAutoDocLog().info( new Object[] { "a", null, "b" }, null ); } public void testInfo16() { createAutoDocLog().info( new Object[] { "a", "b" }, null ); } public void testInfo17() { createAutoDocLog().info( (Object[])null, new Throwable("ignore") ); } public void testInfo18() { createAutoDocLog().info( new Object[2], new Throwable("ignore") ); } public void testInfo19() { createAutoDocLog().info( new Object[0], new Throwable("ignore") ); } public void testInfo20() { createAutoDocLog().info( new Object[] { "a", null, "b" }, new Throwable("ignore") ); } public void testInfo21() { createAutoDocLog().info( new Object[] { "a", "b" }, new Throwable("ignore") ); } //------------------------------------------------------------------------- public void testWarn1() { createAutoDocLog().warn( (Object)null ); } public void testWarn2() { createAutoDocLog().warn( "test message" ); } public void testWarn3() { createAutoDocLog().warn( (Object[])null ); } public void testWarn4() { createAutoDocLog().warn( new Object[2] ); } public void testWarn5() { createAutoDocLog().warn( new Object[0] ); } public void testWarn6() { createAutoDocLog().warn( new Object[] { "a", null, new Integer(1) } ); } public void testWarn7() { createAutoDocLog().warn( new Object[] { "a", "b", new Integer(1) } ); } public void testWarn8() { createAutoDocLog().warn( (Object)null, null ); } public void testWarn9() { createAutoDocLog().warn( (Object)null, new Throwable("ignore") ); } public void testWarn10() { createAutoDocLog().warn( new Object(), null ); } public void testWarn11() { createAutoDocLog().warn( new Object(), new Throwable("ignore") ); } public void testWarn12() { createAutoDocLog().warn( (Object[])null, null ); } public void testWarn13() { createAutoDocLog().warn( new Object[2], null ); } public void testWarn14() { createAutoDocLog().warn( new Object[0], null ); } public void testWarn15() { createAutoDocLog().warn( new Object[] { "a", null, "b" }, null ); } public void testWarn16() { createAutoDocLog().warn( new Object[] { "a", "b" }, null ); } public void testWarn17() { createAutoDocLog().warn( (Object[])null, new Throwable("ignore") ); } public void testWarn18() { createAutoDocLog().warn( new Object[2], new Throwable("ignore") ); } public void testWarn19() { createAutoDocLog().warn( new Object[0], new Throwable("ignore") ); } public void testWarn20() { createAutoDocLog().warn( new Object[] { "a", null, "b" }, new Throwable("ignore") ); } public void testWarn21() { createAutoDocLog().warn( new Object[] { "a", "b" }, new Throwable("ignore") ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/MockAutoDoc.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/MockAutoD0000644000175000017500000000555107622026437034153 0ustar drazzibdrazzib/* * @(#)MockAutoDoc.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Part of the GroboUtils package at: * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; import org.apache.log4j.Logger; import junit.framework.Assert; import net.sourceforge.groboutils.autodoc.v1.spi.*; /** * Entry class for loading the AutoDoc pieces for a particular class. As * this class is always instantiated, it does not need an interface. This * acts as a central factory for generating all the AutoDoc instances. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:15 $ * @since March 23, 2002 */ public class MockAutoDoc extends AutoDoc { private static final Logger LOG = Logger.getLogger( MockAutoDoc.class ); private AutoDocFactory factory; private int getFactoryCallCount = 0; public MockAutoDoc( Class c, AutoDocFactory f ) { super( c ); mockSetupFactory( f ); } /** * Returns the factory this implementation knows. */ protected AutoDocFactory getFactory() { ++this.getFactoryCallCount; return this.factory; } /** * */ public void mockSetupFactory( AutoDocFactory f ) { this.factory = f; } /** * */ public int mockGetFactoryCallCount() { return this.getFactoryCallCount; } /** * */ public void mockVerify() { Assert.assertEquals( "Did not match the expected getFactory() call count.", 1, mockGetFactoryCallCount() ); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocTPUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocTP0000644000175000017500000001154507622026437034127 0ustar drazzibdrazzib/* * @(#)AutoDocTPUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocTP interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:15 $ */ public class AutoDocTPUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocTPUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocTPUTestI( String name, ImplFactory f ) { super( name, AutoDocTP.class, f ); } public AutoDocTP createAutoDocTP() { return (AutoDocTP)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testSetupStep1() { AutoDocTP tp = createAutoDocTP(); tp.setupStep( null ); } public void testSetupStep2() { AutoDocTP tp = createAutoDocTP(); tp.setupStep( "" ); } public void testSetupStep3() { AutoDocTP tp = createAutoDocTP(); tp.setupStep( "asf" ); } public void testSetupStep4() { AutoDocTP tp = createAutoDocTP(); tp.setupStep( " " ); } public void testTeardownStep1() { AutoDocTP tp = createAutoDocTP(); tp.teardownStep( null ); } public void testTeardownStep2() { AutoDocTP tp = createAutoDocTP(); tp.teardownStep( "" ); } public void testTeardownStep3() { AutoDocTP tp = createAutoDocTP(); tp.teardownStep( " " ); } public void testTeardownStep4() { AutoDocTP tp = createAutoDocTP(); tp.teardownStep( "asdf asdf" ); } public void testStep1() { AutoDocTP tp = createAutoDocTP(); tp.step( null ); } public void testStep2() { AutoDocTP tp = createAutoDocTP(); tp.step( "" ); } public void testStep3() { AutoDocTP tp = createAutoDocTP(); tp.step( " " ); } public void testStep4() { AutoDocTP tp = createAutoDocTP(); tp.step( "asdf asdf" ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/log4j/0000755000175000017500000000000011271425773033414 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/log4j/Log4jLogUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/log4j/Log0000644000175000017500000001430707664664403034073 0ustar drazzibdrazzib/* * @(#)Log4jLogUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.log4j; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the Log4jLog class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/05/27 13:32:51 $ * @since March 28, 2002 */ public class Log4jLogUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = Log4jLogUTest.class; public Log4jLogUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { try { new Log4jLog( (Class)null ); fail("did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor2() { new Log4jLog( this.getClass() ); } public void testConstructor3() { try { new Log4jLog( (org.apache.log4j.Logger)null ); fail("did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } } public void testConstructor4() { new Log4jLog( org.apache.log4j.Logger.getLogger( this.getClass() ) ); } public void testConcatMessage1() { Log4jLog log = new Log4jLog( this.getClass() ); Object sb = log.concatMessage( null ); assertNotNull( "concatMessage must not return null.", sb ); assertEquals( "did not concat objects correctly.", "null", sb.toString() ); } public void testConcatMessage2() { Log4jLog log = new Log4jLog( this.getClass() ); Object sb = log.concatMessage( new Object[0] ); assertNotNull( "concatMessage must not return null.", sb ); assertEquals( "did not concat objects correctly.", "", sb.toString() ); } public void testConcatMessage3() { Log4jLog log = new Log4jLog( this.getClass() ); Object sb = log.concatMessage( new Object[1] ); assertNotNull( "concatMessage must not return null.", sb ); assertEquals( "did not concat objects correctly.", "null", sb.toString() ); } public void testConcatMessage4() { Log4jLog log = new Log4jLog( this.getClass() ); Object sb = log.concatMessage( new Object[] { "a", "b" } ); assertNotNull( "concatMessage must not return null.", sb ); assertEquals( "did not concat objects correctly.", "ab", sb.toString() ); } public void testConcatMessage5() { Log4jLog log = new Log4jLog( this.getClass() ); StringBuffer sb = (StringBuffer)log.concatMessage( new Object[] { "a", null, "b" } ); assertNotNull( "concatMessage must not return null.", sb ); assertEquals( "did not concat objects correctly.", "anullb", sb.toString() ); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocLogUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new Log4jLog( Test.class ); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/log4j/Log4jLogFactoryUTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/log4j/Log0000644000175000017500000000732107622026440034054 0ustar drazzibdrazzib/* * @(#)Log4jLogFactoryUTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.log4j; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.spi.*; import net.sourceforge.groboutils.autodoc.v1.defimpl.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the Log4jLogFactory class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:16 $ * @since March 27, 2002 */ public class Log4jLogFactoryUTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = Log4jLogFactoryUTest.class; public Log4jLogFactoryUTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new Log4jLogFactory(); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { InterfaceTestSuite suite = AutoDocLogFactoryUTestI.suite(); suite.addTestSuite( THIS_CLASS ); suite.addFactory( new CxFactory( "A" ) { public Object createImplObject() { return new Log4jLogFactory(); } } ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocJDK13UTest.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocJD0000644000175000017500000002340707622026436034100 0ustar drazzibdrazzib/* * @(#)AutoDocJDK13UTest.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.spi.*; import net.sourceforge.groboutils.autodoc.v1.defimpl.*; import java.util.*; /** * Tests the AutoDoc class. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:14 $ * @since March 21, 2002 */ public class AutoDocJDK13UTest extends TestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocJDK13UTest.class; public AutoDocJDK13UTest( String name ) { super( name ); } //------------------------------------------------------------------------- // setup private MockControl factoryControl; private AutoDocFactory mockFactory; private MockControl logControl; private AutoDocLog mockLog; private MockControl itControl; private AutoDocIT mockIT; private MockControl tpControl; private AutoDocTP mockTP; /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up this.factoryControl = EasyMock.controlFor( AutoDocFactory.class ); this.mockFactory = (AutoDocFactory)this.factoryControl.getMock(); this.logControl = EasyMock.controlFor( AutoDocLog.class ); this.mockLog = (AutoDocLog)this.logControl.getMock(); this.itControl = EasyMock.controlFor( AutoDocIT.class ); this.mockIT = (AutoDocIT)this.itControl.getMock(); this.tpControl = EasyMock.controlFor( AutoDocTP.class ); this.mockTP = (AutoDocTP)this.tpControl.getMock(); } //------------------------------------------------------------------------- // Tests public void testConstructor1() { new AutoDoc( this.getClass() ); } public void testConstructor2() { try { new AutoDoc( null ); fail("AutoDoc constructor did not throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // test exception? } } /* public void testFactoryUse1() { this.mockFactory.createLog( this.getClass() ); this.factoryControl.setReturnValue( this.mockLog, 1 ); this.mockFactory.createIT( this.getClass() ); this.factoryControl.setReturnValue( this.mockIT, 1 ); this.mockFactory.createTP( this.getClass() ); this.factoryControl.setReturnValue( this.mockTP, 1 ); this.factoryControl.activate(); this.logControl.activate(); this.itControl.activate(); this.tpControl.activate(); MockAutoDoc mad = new MockAutoDoc( this.getClass(), this.mockFactory ); assertIsOrContains( "Did not use specified log factory.", this.mockLog, mad.getLog() ); assertIsOrContains( "Did not use specified log factory.", this.mockLog, mad.getLog() ); assertIsOrContains( "Did not use specified it factory.", this.mockIT, mad.getIT() ); assertIsOrContains( "Did not use specified it factory.", this.mockIT, mad.getIT() ); assertIsOrContains( "Did not use specified tp factory.", this.mockTP, mad.getTP() ); assertIsOrContains( "Did not use specified tp factory.", this.mockTP, mad.getTP() ); this.factoryControl.verify(); this.logControl.verify(); this.itControl.verify(); this.tpControl.verify(); mad.mockVerify(); } */ public void testFactoryStore1() { assertNotNull( "SingletonStore cannot be null.", AutoDoc.getFactoryStore() ); } public void testGetFactory1() { Enumeration origEnum = AutoDoc.getFactoryStore().getSingletons(); assertNotNull( "Static set of factories returned null.", origEnum ); AutoDoc ad = new AutoDoc( THIS_CLASS ); AutoDocFactory[] adf = ad.getFactories(); assertNotNull( "AutoDoc instance returned null factory.", adf ); int foundCount = 0; while (origEnum.hasMoreElements()) { AutoDocFactory orig = (AutoDocFactory)origEnum.nextElement(); assertNotNull( "Static set of factories contains null.", orig ); boolean found = false; for (int i = 0; i < adf.length; ++i) { if (orig == adf[i]) { ++foundCount; // null it out so we don't accidentily count it again adf[i] = null; found = true; break; } } assertTrue( "Did not find static factory "+orig+" in AutoDoc instance.", found ); } assertEquals( "Static set of factories contained fewer elements than "+ "AutDoc instance.", foundCount, adf.length ); } public void testAddFactory1() { AutoDoc ad = new AutoDoc( THIS_CLASS ); ad.addFactory( this.mockFactory ); AutoDocFactory[] adf = ad.getFactories(); assertNotNull( "AutoDoc instance returned null factory.", adf ); boolean found = false; for (int i = 0; i < adf.length; ++i) { if (adf[i] == this.mockFactory) { found = true; break; } } assertTrue( "Default autodoc must contain the exact factory added.", found ); } public void testOwner1() { AutoDoc ad = new AutoDoc( THIS_CLASS ); assertEquals( "Did not store class correctly.", THIS_CLASS, ad.getOwner() ); } //------------------------------------------------------------------------- // Helpers protected void assertIsOrContains( String msg, Object orig, Object ret ) { String rmsg = msg+": original=<"+orig+">, found=<"+ret+">"; if (orig == null) { assertNull( rmsg, ret ); } if (orig == ret || orig.equals( ret )) { return; } if (ret instanceof IAutoDocSet) { Enumeration enum = ((IAutoDocSet)ret).getSetContents(); while (enum.hasMoreElements()) { Object next = enum.nextElement(); if (orig == next || orig.equals( next )) { // found it - assert passed. return; } } // was not found fail( rmsg ); } else { fail( rmsg ); } } //------------------------------------------------------------------------- // Standard JUnit declarations public static Test suite() { TestSuite suite = new TestSuite( THIS_CLASS ); // Test the implementation's interface conformity. /* suite.addTest( IxUTestI.suite( new ImplementationCreator[] { new ImplementationCreator() { public Object createImplementedObject() { // XXXXXXXXXXXXXXXXXXXXXXXX } }, } ) ); */ return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocITUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/AutoDocIT0000644000175000017500000001424207622026436034114 0ustar drazzibdrazzib/* * @(#)AutoDocITUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocIT interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:14 $ */ public class AutoDocITUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocITUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocITUTestI( String name, ImplFactory f ) { super( name, AutoDocIT.class, f ); } public AutoDocIT createAutoDocIT() { return (AutoDocIT)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testTestsIssueSL1() { AutoDocIT it = createAutoDocIT(); it.testsIssue( null, 0L ); } public void testTestsIssueSL2() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "", -1L ); } public void testTestsIssueSL3() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "blah", 1000L ); } public void testTestsIssueSL4() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "blah", Long.MIN_VALUE ); } public void testTestsIssueSL5() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "blah", Long.MAX_VALUE ); } public void testTestsIssueSS1() { AutoDocIT it = createAutoDocIT(); it.testsIssue( null, null ); } public void testTestsIssueSS2() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "a", null ); } public void testTestsIssueSS3() { AutoDocIT it = createAutoDocIT(); it.testsIssue( null, "a" ); } public void testTestsIssueSS4() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "", "" ); } public void testTestsIssueSS5() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "blah", "asdf" ); } public void testTestsIssueL1() { AutoDocIT it = createAutoDocIT(); it.testsIssue( -1L ); } public void testTestsIssueL2() { AutoDocIT it = createAutoDocIT(); it.testsIssue( 0L ); } public void testTestsIssueL3() { AutoDocIT it = createAutoDocIT(); it.testsIssue( Long.MAX_VALUE ); } public void testTestsIssueL4() { AutoDocIT it = createAutoDocIT(); it.testsIssue( Long.MIN_VALUE ); } public void testTestsIssueL5() { AutoDocIT it = createAutoDocIT(); it.testsIssue( 10000L ); } public void testTestsIssueS1() { AutoDocIT it = createAutoDocIT(); it.testsIssue( null ); } public void testTestsIssueS2() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "" ); } public void testTestsIssueS3() { AutoDocIT it = createAutoDocIT(); it.testsIssue( " " ); } public void testTestsIssueS4() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "asdf" ); } public void testMultiTests() { AutoDocIT it = createAutoDocIT(); it.testsIssue( "asdf" ); it.testsIssue( null ); it.testsIssue( "blah", "asdf" ); it.testsIssue( -1L ); it.testsIssue( "blah", 1000L ); it.testsIssue( "asdf" ); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/0000755000175000017500000000000011271425773033170 5ustar drazzibdrazzib././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocTPFactoryUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoD0000644000175000017500000001174507622026441034131 0ustar drazzibdrazzib/* * @(#)AutoDocTPFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.defimpl.*; import java.util.Enumeration; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocTPFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class AutoDocTPFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocTPFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocTPFactoryUTestI( String name, ImplFactory f ) { super( name, AutoDocTPFactory.class, f ); } public AutoDocTPFactory createAutoDocTPFactory() { return (AutoDocTPFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateTP1() { AutoDocTPFactory adtpf = createAutoDocTPFactory(); try { adtpf.createTP( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // check exception? } } public void testCreateTP2() { AutoDocTPFactory adtpf = createAutoDocTPFactory(); assertNotNull( "AutoDocTPFactory returned null.", adtpf.createTP( THIS_CLASS ) ); } public void testHasEmptyConstructor1() throws Exception { Class c = createAutoDocTPFactory().getClass(); assertNotNull( "Must have a no-arg constructor.", c.getConstructor( new Class[0] ) ); } public void testHasSPI1() { AutoDocTPFactory adtpf = createAutoDocTPFactory(); Enumeration enum = DefaultAutoDocFactory.getTPFactoryStore(). getSingletons(); while (enum.hasMoreElements()) { if (enum.nextElement().getClass().equals( adtpf.getClass() )) { // we're ok - found the class in the SPI set. return; } } fail("Did not find "+adtpf.getClass()+" in the SPI set."); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocLogFactoryUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoD0000644000175000017500000001202707622026441034123 0ustar drazzibdrazzib/* * @(#)AutoDocLogFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.defimpl.*; import java.util.Enumeration; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocLogFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:17 $ * @since March 27, 2002 */ public class AutoDocLogFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocLogFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocLogFactoryUTestI( String name, ImplFactory f ) { super( name, AutoDocLogFactory.class, f ); } public AutoDocLogFactory createAutoDocLogFactory() { return (AutoDocLogFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreate1() { AutoDocLogFactory adlf = createAutoDocLogFactory(); try { adlf.createLog( null ); fail("Did not throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testCreate2() { AutoDocLogFactory adlf = createAutoDocLogFactory(); AutoDocLog adl = adlf.createLog( getClass() ); assertNotNull( "Must never return null.", adl ); } public void testHasEmptyConstructor1() throws Exception { Class c = createAutoDocLogFactory().getClass(); assertNotNull( "Must have a no-arg constructor.", c.getConstructor( new Class[0] ) ); } public void testHasSPI1() { AutoDocLogFactory adlf = createAutoDocLogFactory(); Enumeration enum = DefaultAutoDocFactory.getLogFactoryStore(). getSingletons(); while (enum.hasMoreElements()) { if (enum.nextElement().getClass().equals( adlf.getClass() )) { // we're ok - found the class in the SPI set. return; } } fail("Did not find "+adlf.getClass()+" in the SPI set."); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocFactoryUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoD0000644000175000017500000001404407622026441034124 0ustar drazzibdrazzib/* * @(#)AutoDocFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.*; import java.util.Enumeration; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @version $Date: 2003/02/10 22:52:17 $ * @since March 1, 2002 */ public class AutoDocFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocFactoryUTestI( String name, ImplFactory f ) { super( name, AutoDocFactory.class, f ); } public AutoDocFactory createAutoDocFactory() { return (AutoDocFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateLog1() { AutoDocFactory adf = createAutoDocFactory(); try { adf.createLog( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testCreateLog2() { AutoDocFactory adf = createAutoDocFactory(); AutoDocLog adl = adf.createLog( getClass() ); assertNotNull( "Must never return null.", adl ); } public void testCreateIT1() { AutoDocFactory adf = createAutoDocFactory(); try { adf.createIT( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testCreateIT2() { AutoDocFactory adf = createAutoDocFactory(); AutoDocIT ad = adf.createIT( getClass() ); assertNotNull( "Must never return null.", ad ); } public void testCreateTP1() { AutoDocFactory adf = createAutoDocFactory(); try { adf.createTP( null ); fail("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testCreateTP2() { AutoDocFactory adf = createAutoDocFactory(); AutoDocTP ad = adf.createTP( getClass() ); assertNotNull( "Must never return null.", ad ); } public void testHasEmptyConstructor1() throws Exception { Class c = createAutoDocFactory().getClass(); assertNotNull( "Must have a no-arg constructor.", c.getConstructor( new Class[0] ) ); } public void testHasSPI1() { AutoDocFactory adf = createAutoDocFactory(); Enumeration enum = AutoDoc.getFactoryStore(). getSingletons(); while (enum.hasMoreElements()) { if (enum.nextElement().getClass().equals( adf.getClass() )) { // we're ok - found the class in the SPI set. return; } } fail("Did not find "+adf.getClass()+" in the SPI set."); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/TestListenerFactoryUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/TestL0000644000175000017500000001167007622026441034145 0ustar drazzibdrazzib/* * @(#)TestListenerFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import java.util.Enumeration; import org.easymock.EasyMock; import org.easymock.MockControl; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.junit.*; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.AssertionFailedError; import net.sourceforge.groboutils.util.classes.v1.SPISingletonStore; /** * Tests the TestListenerFactoryUTestI interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since April 8, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class TestListenerFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = TestListenerFactoryUTestI.class; private static final AutoDoc AD = new AutoDoc(THIS_CLASS); public TestListenerFactoryUTestI( String name, ImplFactory f ) { super( name, TestListenerFactory.class, f ); } //------------------------------------------------------------------------- // setup /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } public TestListenerFactory createTestListenerFactory() { return (TestListenerFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreateListener1() { TestListenerFactory tlf = createTestListenerFactory(); assertNotNull( "listener factory "+tlf+" returned null listener.", tlf.createListener() ); } public void testHasEmptyConstructor1() throws Exception { Class c = createTestListenerFactory().getClass(); assertNotNull( "Must have a no-arg constructor.", c.getConstructor( new Class[0] ) ); } public void testHasSPI1() { TestListenerFactory tlf = createTestListenerFactory(); Enumeration enum = AutoDocJUnitListener.getFactoryStore(). getSingletons(); while (enum.hasMoreElements()) { if (enum.nextElement().getClass().equals( tlf.getClass() )) { // we're ok - found the class in the SPI set. return; } } fail("Did not find class "+tlf.getClass()+" in the SPI set."); } //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoDocITFactoryUTestI.javalibgroboutils-java-5.orig/testing-autodoc/sources/ut/net/sourceforge/groboutils/autodoc/v1/spi/AutoD0000644000175000017500000001201707622026441034122 0ustar drazzibdrazzib/* * @(#)AutoDocITFactoryUTestI.java * * Copyright (C) 2002-2003 Matt Albrecht * groboclown@users.sourceforge.net * http://groboutils.sourceforge.net * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package net.sourceforge.groboutils.autodoc.v1.spi; import net.sourceforge.groboutils.autodoc.v1.*; import net.sourceforge.groboutils.autodoc.v1.defimpl.*; import java.util.Enumeration; //import net.sourceforge.groboutils.testing.junitlog.v1.*; import org.easymock.EasyMock; import org.easymock.MockControl; import net.sourceforge.groboutils.junit.v1.iftc.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Tests the AutoDocITFactory interface. * * @author Matt Albrecht groboclown@users.sourceforge.net * @since March 27, 2002 * @version $Date: 2003/02/10 22:52:17 $ */ public class AutoDocITFactoryUTestI extends InterfaceTestCase { //------------------------------------------------------------------------- // Standard JUnit Class-specific declarations private static final Class THIS_CLASS = AutoDocITFactoryUTestI.class; // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor(); public AutoDocITFactoryUTestI( String name, ImplFactory f ) { super( name, AutoDocITFactory.class, f ); } public AutoDocITFactory createAutoDocITFactory() { return (AutoDocITFactory)createImplObject(); } //------------------------------------------------------------------------- // Tests public void testCreate1() { AutoDocITFactory aditf = createAutoDocITFactory(); try { aditf.createIT( null ); fail("Did not throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { // test exception? } } public void testCreate2() { AutoDocITFactory aditf = createAutoDocITFactory(); AutoDocIT adl = aditf.createIT( THIS_CLASS ); assertNotNull( "Must never return null.", adl ); } public void testHasEmptyConstructor1() throws Exception { Class c = createAutoDocITFactory().getClass(); assertNotNull( "Must have a no-arg constructor.", c.getConstructor( new Class[0] ) ); } public void testHasSPI1() { AutoDocITFactory aditf = createAutoDocITFactory(); Enumeration enum = DefaultAutoDocFactory.getITFactoryStore(). getSingletons(); while (enum.hasMoreElements()) { if (enum.nextElement().getClass().equals( aditf.getClass() )) { // we're ok - found the class in the SPI set. return; } } fail("Did not find "+aditf.getClass()+" in the SPI set."); } //------------------------------------------------------------------------- // Standard JUnit declarations public static InterfaceTestSuite suite() { InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); return suite; } public static void main( String[] args ) { String[] name = { THIS_CLASS.getName() }; // junit.textui.TestRunner.main( name ); // junit.swingui.TestRunner.main( name ); junit.textui.TestRunner.main( name ); } /** * * @exception Exception thrown under any exceptional condition. */ protected void setUp() throws Exception { super.setUp(); // set ourself up } /** * * @exception Exception thrown under any exceptional condition. */ protected void tearDown() throws Exception { // tear ourself down super.tearDown(); } } libgroboutils-java-5.orig/testing-autodoc/sources/ut/about.txt0000644000175000017500000000012207521071652024751 0ustar drazzibdrazzibUnit Tests This directory contains the source and dependent files for unit tests.libgroboutils-java-5.orig/testing-autodoc/sources/iut/0000755000175000017500000000000011271425773023260 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/iut/about.txt0000644000175000017500000000021107521071652025121 0ustar drazzibdrazzibUnit Integration Tests This directory contains the source and dependent files for tests which assert units interacting with one another.libgroboutils-java-5.orig/testing-autodoc/sources/eut/0000755000175000017500000000000011271425773023254 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/sources/eut/about.txt0000644000175000017500000000015307521071652025122 0ustar drazzibdrazzibEnemy Unit Tests This directory contains the source and dependent files for testing external dependencies.libgroboutils-java-5.orig/testing-autodoc/CHANGES.TXT0000644000175000017500000000534107622026432022442 0ustar drazzibdrazzib v1.0.0 * Changed build to reflect new version. * Refactored the interface test suite to be a bit easier to implement, and to use factories instead of set objects. Also, interface tests do not *have* to extend InterfaceTestCase now, but it helps. * Refactored the junitlog into the autodoc framework. * Moved the bugrepository framework into the PTMI framework. * Removed UI Capture and code coverage from the facilities - since these require JDK 1.4, they will be put into their own package. * Changed APIs to be JDK 1.1 compatible. Some tests still require at least JDK 1.3, due to the usage of EasyMock. * Added a Bash/Borne-shell script for the make (only tested on bash). * Added xml-apis.jar for the Xalan support on pre-JDK 1.4 systems. * Moved the Model-Based Testing Framework API into the testing-mbtf sub-project. * Moved license from LGPL to MIT. v0.9.2: * Correction on 0.9.1 changelist: Xalan version is actually 2.3.1 * Added package bugrepository to interface with junitlog package for bug traceability and report generation. * Fixed bug #526454. * Fixed bug #526478. * Fixed bug #526497. * Fixed bug #526511. * Corrected minor JavaDoc tag problems. * Fixed bug #526636. * Fixed bug #526710. * Expanded the documentation. * Added TimedProcess to utils. * StepTracker now calls TimedProcess when enabling events. This allows for preventing the hang-up that seems to occur at the end of a long coverage run. * Added new tests to ui capture. * Started redesign efforts for auto-documentation. This will be moved into its own project within GroboUtils to allow for JDK 1.2+ support. This will be moved out of GroboTesting as of v0.9.3. v0.9.1: * Moved from Xalan-J 2.2-D14 to release 2.2 * Added Ant testing framework * Migrated JUnit package from GroboUtils * Migrated ThreadSafety package from Groboutils (was under junit\jndi) * Added CodeCoverage package * Added RemoteAnt package * Created a more robust documentation structure. * Added dependency on the Jakarta BCEL library. * Added jdi package to contain multi-package dependencies on progamatic control over the JDI. * Moved files into new source structure, to break apart tests from code. * Added JUnit logging facility to help with self-documenting tests creating documents. * Added JUnit InterfaceTest extentions for testing Interfaces. * Moved MultiThreadedTestCase to MultiThreadedTestRunner in order to follow a better JUnit extention pattern (utility instance vs. TestCase subclassing). v0.9.0: * Initial release. * Only included alpha version of UICoverage. libgroboutils-java-5.orig/testing-autodoc/xdocs/0000755000175000017500000000000011271425773022114 5ustar drazzibdrazziblibgroboutils-java-5.orig/testing-autodoc/xdocs/summary.xml0000644000175000017500000000127007662237455024342 0ustar drazzibdrazzib testing-autodoc net.sourceforge.groboutils.autodoc.v1 AutoDoc allows for JUnit tests to generate documentation for themselves. Pluggable to allow user-defined extensions for each component. 19-May-2003: Need to expand testing and update documents before this can enter RC 1. libgroboutils-java-5.orig/testing-autodoc/xdocs/about.xml0000644000175000017500000000216007655132715023751 0ustar drazzibdrazzib About AutoDoc $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    The AutoDoc collection allows tests to be self-documenting. The framework is a pluggable system to allow any type of implementation of the core functionality.

    The current API set allows for:

      Access to logging APIs similar to the Java logging interface or the Jakarta Log4j project. (problem management tracking interface) Allows for tests to mark themselves as testing a specific bug. The generated files (or plugins) can then be used to connect to the bug tracker and record if the test fails or passes. This allows for better traceability of what bugs were fixed, if the fix works, and what remains to be tested. (test plans) Allows for tests to generate a test plan based on the code that executes.

    libgroboutils-java-5.orig/testing-autodoc/xdocs/art_selfdoc.xml0000644000175000017500000001252407655132715025131 0ustar drazzibdrazzib Source Code and Self-Documentation $Date: 2003/05/04 06:40:13 $ Matt Albrecht

    The XP movement posits that documentation on the system design is the source code of the system. Keeping external documentation and the system which it documents synchronized requires far too much discipline than most programmers have.

    So why not put the documentation in the code? That's what JavaDoc is for - to document the structure of the system as it currently exists.

    But why stop there? There are usually many components in a project which are found necessary (such as a bug tracker), yet are disjoint from the source code. Many times, these artifacts are dependent upon dynamic analysis of the system, rather than upon static analysis such as JavaDoc and Lint. The perfect candidates to receive the attention are tests. They should generate dynamic analysis of the system every time a formal build is performed, such as pass/fail statistics.

    Issue Traceability

    JUnit tests have been a boon to Java; it is a testing framework that has been nearly universally accepted in project lifecycles. When combined with the XP model of debugging (when a bug is discovered you write a test to simulate the bug, then fix the bug), we have a method for asserting that all bugs marked as "fixed" are indeed fixed, since the JUnit tests pass.

    The XP way of thinking states that the code is the system design documentation. Right now, it views unit tests as documenting how a unit can be used properly and improperly.

    Also, bug tracking software has become a cheap and easy product to add to any development cycle, partially due to the Open Source movement. Even though there are many differences between the various products, the fundamentals are the same:

    1. bugs are entered into the system
    2. new bugs are assigned a unique identifier
    3. each bug may be given categorization meta-data
    4. each bug allows for user comments to be added

    The Next Good Thing

    What happens when we combine these together? We can directly relate a bug to the test case which tests the bug. The tests now automatically document the bugs based on the results of the testcases which test it. If a bug is marked as "fixed", but its corresponding test case fails, then we can have the system reopen the bug. If the test case is no longer valid (that is, its tested unit disappears), then the bug is no longer valid.

    If one is so inclined, the tests can now document the work done on the code. When a requirement is created, the code does not exist to fulfil that requirement, so it is a bug in the current system. So enter the bug into the bug tracking software. When the developer completes the work for that requirement, then the developer should also have tests which test the work. These initial tests then also should be marked as testing that the requirement has been fulfilled.

    So now each bug has four general categories: no tests exist for the bug; the bug has one test (or more), but not all of the tests pass; all of the bug's tests pass; and the bug is validated or closed. We can't let the software automatically mark the passed-test bugs as closed, since the tests may not be robust enough, but we can have the software reopen issues if a once working bug's tests suddenly begin to fail.

    The tests-to-bug relationship can be many-to-many, but ideally it should be one or more tests to one bug.

    Caveats

    These advantages don't come for free. Proper organization of the issues as well as code may seem difficult to maintain.

    The bug tracking interface used to report on a test-run should be configured to reference only a single release. Also, the source code should be properly branched between releases if their bugs are different, and each release should be updated with the correct bug information.

    Just like refactoring your code to make tests easier to write, your bug list should be maintained to match what's really going on in the source. If you find the maintenance of multiple software versions with bug-tracking IDs too difficult, it may be time to rethink the current SCM methodology, and move to a more scalable solution.

    Test Case Step Documentation

    While nothing can replace a solid test plan for a project, the documentation of the individual test cases can be tedious. If the goal is to have automated tests for each test case, then, like most software documentation, it becomes too easy to have the automated tests become out-of-sync with the test documents.

    Let's use the same techniques listed above for documenting our test cases. Since the documentation would be generated with the test execution, the documentation can create a test report, listing each step executed, the date of execution, the duration of the run, the test results, and archives of the test artifacts.

    While the test code would declare the process for the test, the execution of the test would generate the test case run results.

    libgroboutils-java-5.orig/testing-autodoc/xdocs/requirements.xml0000644000175000017500000000224607662237455025374 0ustar drazzibdrazzib AutoDoc Requirements $Date: 2003/05/19 20:31:41 $ Matt Albrecht

    The following is a list of requirements for AutoDoc:

      The framework must provide the means by which issues and tests can be correlated. Automated Tests must be able to create their documentation (from the general AutoDoc requirement). To this end, the tests must define their relationship to issues in the testing code. Reports must be generated to show the pass/fail status of bugs. These reports must be in a "universal" document form, independent of the report's view. That is, the reports define the Model. The framework must provide the means to report the pass/fail status of bugs to a PMT (Problem Management Tool).

    libgroboutils-java-5.orig/testing-autodoc/xdocs/design.xml0000644000175000017500000000032607662237455024117 0ustar drazzibdrazzib Design $Date: 2003/05/19 20:31:41 $

    Still in progress

    libgroboutils-java-5.orig/testing-autodoc/xdocs/index.xml0000644000175000017500000000221007662237455023747 0ustar drazzibdrazzib GroboTesting AutoDoc $Date: 2003/05/19 20:31:41 $
  • About GroboTesting AutoDoc
  • Requirements
  • Design
  • Using
  • Articles
  • Self-Documenting Tests
  • Tracks requirement and bug pass/fail status through tests. AutoDoc Extentions Adds issue traceability integration with problem management trackers. Framework for dealing with test procedure reports.
    libgroboutils-java-5.orig/testing-autodoc/xdocs/using.xml0000644000175000017500000001040007664664404023765 0ustar drazzibdrazzib Using AutoDoc $Date: 2003/05/27 13:32:52 $ Matt Albrecht
    Adding AutoDoc To Your Tests

    To get started with using AutoDoc, first declare an instance of the AutoDoc facade in your test:

    1:import net.sourceforge.groboutils.autodoc.v1.AutoDoc;
    2:public class MyUTest extends TestCase
    3:{
    4:    private static final Class THIS_CLASS = MyUTest.class;
    5:    private static final AutoDoc DOC = new AutoDoc( THIS_CLASS );
    
    This will create a new AutoDoc instance that has associations with its generated documentation to this class, much like standard logging frameworks.

    Then, whenever you need a bit of documentation in your test, you can reference this DOC instance.

    To add logging, use something like:

    1:            DOC.getLog().info("===== Adding test for "+testname);
    
    The different levels of logging are debug, info, and warn. Each may take, as arguments: (Object), (Object[]), (Object, Throwable), and (Object[], Throwable).

    To reference a bug or problem tracker ticket, use:

    1:        DOC.getIT().testsIssue( 526454 );
    
    It takes as arguments a method name (String) followed by the ticket ID (String or long), or the ticket ID by itself. If the ticket ID is given alone, then the method name is dynamically discovered using stack trace evaluation.