You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(151) |
Sep
(21) |
Oct
(6) |
Nov
(70) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(47) |
Feb
(66) |
Mar
(23) |
Apr
(115) |
May
(24) |
Jun
(53) |
Jul
(10) |
Aug
(279) |
Sep
(84) |
Oct
(149) |
Nov
(138) |
Dec
(52) |
2003 |
Jan
(22) |
Feb
(20) |
Mar
(29) |
Apr
(106) |
May
(170) |
Jun
(122) |
Jul
(70) |
Aug
(64) |
Sep
(27) |
Oct
(71) |
Nov
(49) |
Dec
(9) |
2004 |
Jan
(7) |
Feb
(38) |
Mar
(3) |
Apr
(9) |
May
(22) |
Jun
(4) |
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
(15) |
Dec
(2) |
2005 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(28) |
Jun
(3) |
Jul
(11) |
Aug
(5) |
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2006 |
Jan
(8) |
Feb
(3) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Scott L. <sl...@sl...> - 2002-04-17 12:25:17
|
On Wed, Apr 17, 2002 at 11:46:28AM +0100, Jeff Martin wrote: > Thanks for this, but I'm not sure it's really the approach we want to be > taking. I'd prefer to keep things a bit cleaner even if that means > having lots of methods with just notImplemented(); in them. I have to disagree - I don't think that's the clean approach. I don't like the idea of humans creating anything repetitive, anything that a computer could create. There's more possibility for error that way. Or even copying/pasting repetitive, automatically generated code. That code just serves to obscure where the real work is being done. > You might be interested in > http://www.xpdeveloper.com/cgi-bin/wiki.cgi?MockMaker which takes your > approach a bit further. > > There is also some work being done on use java.lang.reflect.Proxy to > provide a default mock implementation. But I'm not aware of the details > of this yet. Those are both interesting. I'll look more at them. Thanks. -- Scott Lamb |
From: Jeff M. <je...@mk...> - 2002-04-17 11:51:05
|
On Wed, 2002-04-17 at 11:19, Oskar Hannesson wrote: > Hi. > I could not live with out the unit tests ... they make you feel so safe := ) >=20 > I ran my modified Unit test against your code and found three things > missing. > * Missing set-up method for getTableName() > * Missing set-up method for getColumnClassName() > * The getColumnLabel(...) should return the same value as > getColumName(...) (At least my Oracle JDBC drivers does so) >=20 > Also I saw that you used myNames.remove(0) when you retrieve the column > Name. > Shouldn't it be implemented like this : > public String getColumnName(int aColumnIndex) throws SQLException { > return (String)myNames.get(aColumnIndex-1); > } > In stead of: > public String getColumnName(int aColumnIndex) throws SQLException { > return (String)myNames.remove(0); > } The idea behind this this is to setup a list of the columns that are needed in the order they are required. So regardless of the number that's passed in you get the column name out that you setup in the test. What we should also have is a list of the expected indexes. private ExpectationList myColumnIndices =3D new ExpectationList("ColumnIndices"); ... public void addExpectedColumnIndices(int aColumnIndex) throws SQLException = { myColumnIndices.addExpected(aColumnIndex); } public String getColumnName(int aColumnIndex) throws SQLException { myColumnIndices.addActual(aColumnIndex); return (String)myNames.remove(0); } This way you separating out the two things your testing. 1. That your requesting the right columns in the right order=20 e.g 1,2,3,4 not 1,1,1,1,3,4 2. That the code that handles the column name behaves correctly given a know list of columns names. I'll put you path in with the above changes unless anyone yells at me first ;o) >=20 > Anyway I applied the above changes to MockResultSetMetaData and attached = it > to this mail plus the Unit test. > I put the unittest under the package "com.mockobjects.sql.test" >=20 > Regards. > Oskar H. >=20 > PS! Here is a diff -u of the code >=20 > --- > C:\tmp\mockobjects\mockobjects-java\src\jdk\common\com\mockobjects\sql\Mo= ckR > esultSetMetaData.java Tue Apr 16 17:04:02 2002 > +++ > C:\projects\MockObjects2\src\jdk\common\com\mockobjects\sql\MockResultSet= Met > aData.java Wed Apr 17 09:38:49 2002 > @@ -9,6 +9,8 @@ > implements ResultSetMetaData { >=20 > private Vector myNames =3D new Vector(); > + private Vector myTableNames =3D new Vector(); > + private Vector myColumnClassNames =3D new Vector(); >=20 > /** > * @see ResultSetMetaData#getColumnCount() > @@ -76,9 +78,8 @@ > /** > * @see ResultSetMetaData#getColumnLabel(int) > */ > - public String getColumnLabel(int arg0) throws SQLException { > - notImplemented(); > - return null; > + public String getColumnLabel(int aColumnIndex) throws SQLException { > + return getColumnName(aColumnIndex); > } >=20 > public void addColumnNames(String[] allNames) { > @@ -97,7 +98,7 @@ > * @see ResultSetMetaData#getColumnName(int) > */ > public String getColumnName(int aColumnIndex) throws SQLException { > - return (String)myNames.remove(0); > + return (String)myNames.get(aColumnIndex-1); > } >=20 > /** > @@ -127,9 +128,16 @@ > /** > * @see ResultSetMetaData#getTableName(int) > */ > - public String getTableName(int arg0) throws SQLException { > - notImplemented(); > - return null; > + public String getTableName(int aColumnIndex) throws SQLException { > + return (String)myTableNames.get(aColumnIndex-1); > + } > + > + public void addTableNames(String[] allNames) { > + if (myTableNames !=3D null) { > + for (int i =3D 0; i < allNames.length; i++) { > + myTableNames.add(allNames[i]); > + } > + } > } >=20 > /** > @@ -183,8 +191,15 @@ > /** > * @see ResultSetMetaData#getColumnClassName(int) > */ > - public String getColumnClassName(int arg0) throws SQLException { > - notImplemented(); > - return null; > + public String getColumnClassName(int aColumnIndex) throws SQLExcepti= on > { > + return (String)myColumnClassNames.get(aColumnIndex-1); > + } > + > + public void addColumnClassNames(String[] allNames) { > + if (myColumnClassNames !=3D null) { > + for (int i =3D 0; i < allNames.length; i++) { > + myColumnClassNames.add(allNames[i]); > + } > + } > } > } >=20 >=20 > ------------------- THE DIFF END ---------------------------- >=20 > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > Christian Trutz > Sent: 16. apr=EDl 2002 16:58 > To: Mockobjects > Subject: Re: [MO-java-dev] MockConnection >=20 >=20 > Hi Oskar, >=20 > some unit tests for MockResultSetMetaData would be very nice ;-) >=20 > Christian >=20 > -----Urspr=FCngliche Nachricht----- > Von: moc...@li... > [mailto:moc...@li...]Im Auftrag von > Oskar Hannesson > Gesendet: Dienstag, 16. April 2002 18:34 > An: 'Jeff Martin'; 'MockObjects' > Betreff: [MO-java-dev] MockConnection >=20 >=20 > Hi there! > It is nice to see the MockResultSetMetaData class finally make its way in= to > CVS , even though I posted similar code (+ unit test) some six months ago= :-( > When I started using Mockobjects last year I ran in to problems having > multiple Statements pr. connection. > The current version of MockConnection supports only one Statement pr. > connection so I modified it and posted it to this group. > The code never made it to the CVS so I ask: > Is someone currently working on this problem or should I try to re-commit= my > implementation and hope for a better response ? >=20 > I found some 8 months old code in CVS > (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to= be > addressing some this problem. > Is this perhaps an upcoming version of the sql package? >=20 > Regards > Oskar Hannesson > deCODE Genetics > Addr: Sturlugata 8 , 101 Reykjavik, Iceland > Tel: (354) 570-1900 > Fax: (354) 570-1903 > Web: www.decode.com >=20 > PS! > I really hate relying on my own private version of MockObjects. >=20 >=20 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev >=20 >=20 >=20 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev --=20 |
From: Jeff M. <je...@mk...> - 2002-04-17 10:50:25
|
Thanks for this, but I'm not sure it's really the approach we want to be taking. I'd prefer to keep things a bit cleaner even if that means having lots of methods with just notImplemented(); in them. You might be interested in http://www.xpdeveloper.com/cgi-bin/wiki.cgi?MockMaker which takes your approach a bit further. There is also some work being done on use java.lang.reflect.Proxy to provide a default mock implementation. But I'm not aware of the details of this yet. On Mon, 2002-04-15 at 23:14, Scott Lamb wrote: > I couldn't get mockobjects to compile under J2SE 1.4, so I looked in the > com.mockobjects.sql.* classes and found that there's a lot of code that > just does "throw new UnsupportedOperationException();". J2SE 1.4 has > many more methods that require this repetitive code. > > Instead of adding new skeletons, I removed them all and added a new > class InterfaceImplementor, based on some code by Dustin Sallings. It > creates these skeleton methods automatically. > > This InterfaceImplementor is pretty untested - I tried to be more strict > about catching errors than Dustin's code, so the result is different > enough to have its own bugs. I might try writing tests for it later. But > it works well enough that everything compiles and the current unit tests > - which sort of check its output - pass. > > Now the com.mockobjects.sql.* classes are more terse and work with J2SE > 1.4. They will compile against extended JDBC interfaces in the future. > Hopefully InterfaceImplementor can be used for other classes as well. > > The diffstat: > > build.xml | 21 > src/core/com/mockobjects/util/InterfaceImplementor.java | 361 ++++++++++ > src/core/com/mockobjects/util/InterfaceImplementorTask.java | 113 +++ > src/jdk/common/com/mockobjects/sql/MockConnection.java | 80 -- > src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java | 42 - > src/jdk/common/com/mockobjects/sql/MockResultSet.java | 2 > src/jdk/common/com/mockobjects/sql/MockStatement.java | 99 -- > 7 files changed, 499 insertions(+), 219 deletions(-) > > -- > Scott Lamb > ---- > > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/build.xml mockobjects-java.impl/build.xml > --- mockobjects-java/build.xml Mon Apr 15 16:14:01 2002 > +++ mockobjects-java.impl/build.xml Mon Apr 15 16:54:39 2002 > @@ -292,11 +292,31 @@ > description="Compile all the java files for included libraries"> > <mkdir dir="${jdk.classes}" /> > > + <taskdef name="implement" > + classname="com.mockobjects.util.InterfaceImplementorTask" > + classpath="${core.classes}"/> > + > + <implement outputPath="${out.src.dir}"> > + <class name="com.mockobjects.sql.MockConnectionStub" > + interfaces="java.sql.Connection" > + superclass="com.mockobjects.MockObject"/> > + <class name="com.mockobjects.sql.MockStatementStub" > + interfaces="java.sql.Statement" > + superclass="com.mockobjects.MockObject"/> > + <class name="com.mockobjects.sql.MockPreparedStatementStub" > + interfaces="java.sql.Statement java.sql.PreparedStatement" > + superclass="com.mockobjects.MockObject"/> > + <class name="com.mockobjects.sql.MockResultSetStub" > + interfaces="java.sql.ResultSet" > + superclass="com.mockobjects.MockObject"/> > + </implement> > + > <javac destdir="${jdk.classes}" debug="${debug}" > deprecation="${deprecation}" verbose="false" > optimize="${optimize}"> > <src path="${src.jdk.dir}/${jdk.version}" /> > <src path="${src.jdk.dir}/common" /> > + <src path="${out.src.dir}"/> > > <classpath> > <path refid="lib.classpath" /> > @@ -304,6 +324,7 @@ > <pathelement path="${core.classes}" /> > </classpath> > </javac> > + > </target> > > <target name="compile-j2ee" depends="compile-jdk" if="j2ee.version" > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/src/core/com/mockobjects/util/InterfaceImplementor.java mockobjects-java.impl/src/core/com/mockobjects/util/InterfaceImplementor.java > --- mockobjects-java/src/core/com/mockobjects/util/InterfaceImplementor.java Wed Dec 31 18:00:00 1969 > +++ mockobjects-java.impl/src/core/com/mockobjects/util/InterfaceImplementor.java Mon Apr 15 16:50:55 2002 > @@ -0,0 +1,361 @@ > +/* > + * $Id$ > + * > + * Copyright (c) 2000 Dustin Sallings <du...@sp...> > + */ > + > +package com.mockobjects.util; > + > +import java.lang.reflect.Member; > +import java.lang.reflect.Constructor; > +import java.lang.reflect.Method; > +import java.lang.reflect.Modifier; > +import java.io.File; > +import java.io.Writer; > +import java.io.OutputStreamWriter; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.Iterator; > +import java.util.Map; > +import java.util.Set; > +import java.util.HashMap; > +import java.util.HashSet; > + > +/** > + * Creates skeleton code from interfaces. > + * <p>Mock objects contain a large number of methods which do nothing more than > + * throw UnsupportedOperationException, since mock objects only provide > + * functionality necessary for tests.</p> > + * <p>This class makes it unnecessary to manually maintain those blocks of > + * code. Instead, classes are autogenerated which contain these dummy > + * implementations. The real, manually maintained classes can inherit these or > + * vice versa.</p> > + * > + * @author Dustin Sallings <du...@sp...> > + * @version $Revision$ $Date$ > + **/ > +public class InterfaceImplementor { > + > + private String myPackageName; > + private String myClassName; > + > + /** > + * The signature of a method. > + * <p>According to the Java language specification, "The signature of a > + * method consists of the name of the method and the number and types of > + * formal parameters to the method. A class may not declare two methods > + * with the same signature, or a compile-time error occurs."</p> > + **/ > + private class Signature { > + String myName; > + Class[] myParameterTypes; > + > + /** Creates a signature to match a given method. **/ > + Signature(Method m) { > + myName = m.getName(); > + myParameterTypes = m.getParameterTypes(); > + } > + > + public boolean equals(Object oObject) { > + if (!(oObject instanceof Signature)) { > + return false; > + } > + Signature o = (Signature)oObject; > + if (!myName.equals(o.myName)) { > + return false; > + } > + if (myParameterTypes.length != o.myParameterTypes.length) { > + return false; > + } > + for (int i = 0; i < myParameterTypes.length; i ++) { > + if (!myParameterTypes[i].equals(o.myParameterTypes[i])) { > + return false; > + } > + } > + return true; > + } > + > + public int hashCode() { > + return myName.hashCode(); > + } > + } > + > + /** A set of Class objects for each implemented interface. **/ > + private Set myImplementedInterfaces = new HashSet(); > + > + /** The superclass (may or may not be present). **/ > + private Class mySuperclass; > + > + /** The constructors to inherit. **/ > + private Constructor[] myConstructors; > + > + /** A map of Signature to Method for each implemented method. **/ > + private Map myImplementedMethods = new HashMap(); > + > + /** > + * Adds an interface to the list of interfaces to be implemented. > + * @param interfaceClass The interface to implement. > + * @throws IllegalArgumentException When the class is null or > + * not an interface. > + * @throws RuntimeException If the signature conflicts with another > + * interface. > + **/ > + public void addInterface(Class aInterfaceClass) { > + if (aInterfaceClass == null) { > + throw new IllegalArgumentException( > + "aInterfaceClass must be non-null"); > + } > + > + if (!aInterfaceClass.isInterface()) { > + throw new IllegalArgumentException( > + "aInterfaceClass does not refer to an interface"); > + } > + > + if (mySuperclass != null) { > + throw new IllegalStateException( > + "no interfaces may be added after superclass is set"); > + } > + > + myImplementedInterfaces.add(aInterfaceClass); > + > + Method[] methods = aInterfaceClass.getDeclaredMethods(); > + for (int i = 0; i < methods.length; i ++) { > + Method old = (Method)myImplementedMethods.put( > + new Signature(methods[i]), > + methods[i] > + ); > + if (old != null && !areSame(old, methods[i])) { > + throw new RuntimeException("Invalid duplicated signature"); > + } > + } > + } > + > + /** > + * Sets superclass. > + * Checks for signature conflicts. Non-abstract methods in this list are > + * removed from the list to be implemented. Constructors are implemented > + * for each. > + **/ > + public void setSuperclass(Class aSuperclass) { > + if (mySuperclass != null) { > + throw new IllegalStateException( > + "The superclass may only be set once."); > + } > + mySuperclass = aSuperclass; > + myConstructors = mySuperclass.getConstructors(); > + > + // Go through methods > + Method[] methods = mySuperclass.getDeclaredMethods(); > + for (int i = 0; i < methods.length; i ++) { > + Method oldMethod = (Method)myImplementedMethods.put( > + new Signature(methods[i]), methods[i]); > + if (oldMethod != null && !areSame(oldMethod, methods[i])) { > + throw new RuntimeException("Invalid duplicated signature"); > + } > + if ((methods[i].getModifiers() & Modifier.ABSTRACT) == 0) { > + myImplementedMethods.remove(new Signature(methods[i])); > + } > + } > + } > + > + /** > + * Checks if two methods are the same. > + * This does what Method.equals() does except that it does not ensure > + * they came from the same class, and it does not check modifiers. > + **/ > + private static boolean areSame(Method a, Method b) { > + if (!a.getName().equals(b.getName())) { > + return false; > + } > + > + if (!a.getReturnType().equals(b.getReturnType())) { > + return false; > + } > + > + // Order of exceptions in getExceptionTypes() is not specified, so > + // put these into a set for comparison. > + Set aSet = new HashSet(); > + Set bSet = new HashSet(); > + Class[] aExceptions = a.getExceptionTypes(); > + for (int i = 0; i < aExceptions.length; i ++) { > + aSet.add(aExceptions[i]); > + } > + Class[] bExceptions = b.getExceptionTypes(); > + for (int i = 0; i < bExceptions.length; i ++) { > + bSet.add(bExceptions[i]); > + } > + return aSet.equals(bSet); > + } > + > + /** Gets the name of the package containing the class to generate. **/ > + public String getPackageName() { > + return myPackageName; > + } > + > + /** > + * Gets the suggested path for the package relative to a base directory. > + * @param baseDir The root of the package tree in the filesystem. > + **/ > + public File getPackageDir(File aRootDir) { > + if (myPackageName == null) { > + return aRootDir; > + } else { > + return new File(aRootDir, > + myPackageName.replace('.', File.separatorChar)); > + } > + } > + > + /** Gets the name of the class to generate. **/ > + public String getClassName() { > + return myClassName; > + } > + > + /** > + * Sets the name of the class to generate. > + * @param fullName The name of the class, with package specified if > + * the class is within a package. > + **/ > + public void setClassName(String aFullName) { > + int lastDot = aFullName.lastIndexOf("."); > + if (lastDot == -1) { > + myClassName = aFullName; > + } else { > + myPackageName = aFullName.substring(0, lastDot); > + myClassName = aFullName.substring(lastDot+1); > + } > + } > + > + /** > + * Gets the name of the type as it would appear in source code. > + * (Different from Class.toString() in the array case, especially > + * multi-dimensional arrays.) > + **/ > + private static String decodeType(Class aType) { > + String rv = null; > + if (aType.isArray()) { > + rv = decodeType(aType.getComponentType()) + "[]"; > + } else { > + rv = aType.getName(); > + } > + return rv; > + } > + > + /** > + * Implements a single method or constructor. > + * Methods will throw an UnsupportedOperationException. > + * Constructors will call superconstructors. > + * @throws IOException if unable to write to the Writer > + **/ > + private void implement(Member aMember, Writer aWriter) > + throws IOException { > + > + if (!(aMember instanceof Method || aMember instanceof Constructor)) { > + throw new IllegalArgumentException( > + "Can only implement methods and constructors"); > + } > + > + aWriter.write(" "); > + int modifiers = aMember.getModifiers(); > + modifiers &= ~Modifier.ABSTRACT; > + aWriter.write(Modifier.toString(modifiers)); > + aWriter.write(" "); > + > + Class[] parameters; > + Class[] exceptions; > + if (aMember instanceof Method) { > + aWriter.write(decodeType(((Method)aMember).getReturnType())); > + aWriter.write(" "); > + aWriter.write(aMember.getName()); > + parameters = ((Method)aMember).getParameterTypes(); > + exceptions = ((Method)aMember).getExceptionTypes(); > + } else { > + parameters = ((Constructor)aMember).getParameterTypes(); > + exceptions = ((Constructor)aMember).getExceptionTypes(); > + aWriter.write(myClassName); > + } > + aWriter.write("("); > + for (int i = 0; i < parameters.length; i ++) { > + if (i != 0) { > + aWriter.write(", "); > + } > + aWriter.write(decodeType(parameters[i]) + " a" + String.valueOf(i)); > + } > + aWriter.write(")"); > + if (exceptions.length > 0) { > + aWriter.write(" throws "); > + } > + for (int i = 0; i < exceptions.length; i ++) { > + if (i != 0) { > + aWriter.write(", "); > + } > + aWriter.write(decodeType(exceptions[i])); > + } > + aWriter.write(" {\n"); > + if (aMember instanceof Method) { > + aWriter.write("\tthrow new UnsupportedOperationException();\n"); > + } else { > + aWriter.write("\tsuper("); > + for (int i = 0; i < parameters.length; i ++) { > + if (i != 0) { > + aWriter.write(", "); > + } > + aWriter.write("a" + String.valueOf(i)); > + } > + aWriter.write(");\n"); > + } > + aWriter.write(" }\n"); > + } > + > + /** > + * Implements the entire class. > + * @throws IllegalStateException if no interfaces have been selected > + * @throws IOException if unable to write to the Writer > + **/ > + public void implement(Writer aWriter) throws IOException { > + if (myImplementedInterfaces.size() == 0) { > + throw new IllegalStateException("Implementing no interfaces!"); > + } > + > + aWriter.write( > + "// AUTOMATICALLY GENERATED. DO NOT EDIT.\n" > + + "// Generated by com.mockobjects.util.InterfaceImplementor\n" > + + "// (version $Revision$ $Date$)\n\n"); > + > + if (myPackageName != null) { > + aWriter.write("package " + myPackageName + ";\n\n"); > + } > + > + aWriter.write("public class " + myClassName); > + if (mySuperclass != null) { > + aWriter.write(" extends " + mySuperclass.getName()); > + } > + aWriter.write(" implements "); > + Iterator it = myImplementedInterfaces.iterator(); > + int i = 0; > + while (it.hasNext()) { > + if (i ++ > 0) { > + aWriter.write(", "); > + } > + Class c = (Class)it.next(); > + aWriter.write(c.getName()); > + } > + aWriter.write(" {\n"); > + > + if (myConstructors != null) { > + for (i = 0; i < myConstructors.length; i ++) { > + aWriter.write("\n"); > + implement(myConstructors[i], aWriter); > + } > + } > + > + it = myImplementedMethods.values().iterator(); > + while (it.hasNext()) { > + aWriter.write("\n"); > + implement((Method)it.next(), aWriter); > + } > + > + aWriter.write("\n}\n"); > + aWriter.flush(); > + } > + > +} > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/src/core/com/mockobjects/util/InterfaceImplementorTask.java mockobjects-java.impl/src/core/com/mockobjects/util/InterfaceImplementorTask.java > --- mockobjects-java/src/core/com/mockobjects/util/InterfaceImplementorTask.java Wed Dec 31 18:00:00 1969 > +++ mockobjects-java.impl/src/core/com/mockobjects/util/InterfaceImplementorTask.java Mon Apr 15 16:56:36 2002 > @@ -0,0 +1,113 @@ > +/* > + * $Id$ > + * > + * Copyright (c) 2002 Scott Lamb <sl...@sl...> > + * This code is released under the MIT license; see the file LICENSE. > + */ > + > +package com.mockobjects.util; > + > +import java.io.File; > +import java.io.FileWriter; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.StringTokenizer; > +import org.apache.tools.ant.Project; > +import org.apache.tools.ant.Task; > +import org.apache.tools.ant.BuildException; > + > +/** > + * Ant task for InterfaceImplementor. > + * > + * @author Scott Lamb <sl...@sl...> > + * @version $Revision$ $Date$ > + **/ > +public class InterfaceImplementorTask extends Task { > + > + private ArrayList myClasses = new ArrayList(); > + private String myOutputPath; > + > + public class ImplClass { > + private InterfaceImplementor myIntImpl; > + private Class mySuperclass; > + > + private ImplClass() { > + myIntImpl = new InterfaceImplementor(); > + } > + > + public void setName(String aClassName) throws BuildException { > + myIntImpl.setClassName(aClassName); > + } > + > + public void setInterfaces(String aInterfaces) throws BuildException { > + StringTokenizer interfacesList = new StringTokenizer(aInterfaces); > + while (interfacesList.hasMoreElements()) { > + String interfaceName = (String)interfacesList.nextElement(); > + try { > + Class interfaceClass = Class.forName(interfaceName); > + myIntImpl.addInterface(interfaceClass); > + } catch (ClassNotFoundException e) { > + throw new BuildException("Unable to find interface " > + + interfaceName); > + } > + } > + } > + > + public void setSuperclass(String aSuperclassName) > + throws BuildException { > + try { > + mySuperclass = Class.forName(aSuperclassName); > + } catch (ClassNotFoundException e) { > + throw new BuildException("Unable to find class " > + + aSuperclassName); > + } > + } > + > + } > + > + public void setOutputPath(String aOutputPath) throws BuildException { > + this.myOutputPath = aOutputPath; > + } > + > + public ImplClass createClass() throws BuildException { > + ImplClass s = new ImplClass(); > + myClasses.add(s); > + return s; > + } > + > + public void execute() throws BuildException { > + File destDir = new File(myOutputPath); > + for (int i = 0; i < myClasses.size(); i ++) { > + ImplClass s = (ImplClass)myClasses.get(i); > + File outFile = new File(s.myIntImpl.getPackageDir(destDir), > + s.myIntImpl.getClassName() + ".java"); > + if (outFile.exists()) { > + myClasses.remove(i--); > + } > + } > + if (myClasses.size() > 0) { > + log("Generating " + myClasses.size() + " skeleton" > + + (myClasses.size() == 1 ? "" : "s") + " to " > + + destDir.getAbsolutePath()); > + } > + for (int i = 0; i < myClasses.size(); i ++) { > + try { > + ImplClass s = (ImplClass)myClasses.get(i); > + > + File dir = s.myIntImpl.getPackageDir(destDir); > + dir.mkdirs(); > + File outFile = new File(dir, > + s.myIntImpl.getClassName() + ".java"); > + log("Generating " + outFile, Project.MSG_VERBOSE); > + FileWriter out = new FileWriter(outFile); > + if (s.mySuperclass != null) { > + s.myIntImpl.setSuperclass(s.mySuperclass); > + } > + s.myIntImpl.implement(out); > + } catch (IOException e) { > + throw new BuildException("Unable to generate skeleton", e); > + } > + } > + } > +} > + > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/src/jdk/common/com/mockobjects/sql/MockConnection.java mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockConnection.java > --- mockobjects-java/src/jdk/common/com/mockobjects/sql/MockConnection.java Sat Apr 13 10:08:23 2002 > +++ mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockConnection.java Mon Apr 15 15:46:53 2002 > @@ -4,7 +4,7 @@ > import java.util.*; > import com.mockobjects.*; > > -public class MockConnection extends MockObject implements Connection { > +public class MockConnection extends MockConnectionStub { > private ExpectationCounter myCommitCalls = new ExpectationCounter("MockConnection.commit"); > private ExpectationCounter myRollbackCalls = new ExpectationCounter("MockConnection.rollback"); > private ExpectationCounter myCloseCalls = new ExpectationCounter("MockConnection.close"); > @@ -81,38 +81,6 @@ > return myStatement; > } > > - public Statement createStatement( > - int resultSetType, > - int resultSetConcurrency) > - throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public boolean getAutoCommit() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public String getCatalog() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public DatabaseMetaData getMetaData() > - throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getTransactionIsolation() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public Map getTypeMap() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public SQLWarning getWarnings() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setupIsClosedException(SQLException aIsClosedException){ > myIsClosedException = aIsClosedException; > } > @@ -128,41 +96,12 @@ > return myIsClosed; > } > > - public boolean isReadOnly() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public String nativeSQL(String sql) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public CallableStatement prepareCall(String sql) > - throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public CallableStatement prepareCall( > - String sql, > - int resultSetType, > - int resultSetConcurrency) > - throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public PreparedStatement prepareStatement(String sql) throws SQLException { > myPreparedStatementStrings.addActual(sql); > throwStatementExceptionIfAny(); > return (PreparedStatement) myPreparedStatements.remove(0); > } > > - public PreparedStatement prepareStatement( > - String sql, > - int resultSetType, > - int resultSetConcurrency) > - throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void rollback() throws SQLException { > myRollbackCalls.inc(); > } > @@ -175,23 +114,6 @@ > myAutoCommit.setActual(autoCommit); > } > > - public void setCatalog(String catalog) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setReadOnly(boolean readOnly) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setTransactionIsolation(int level) > - throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setTypeMap(Map map) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > private void throwStatementExceptionIfAny() throws SQLException { > if (null != myStatementException) { > throw myStatementException; > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java > --- mockobjects-java/src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java Sat Apr 13 10:08:23 2002 > +++ mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java Mon Apr 15 15:51:39 2002 > @@ -6,7 +6,7 @@ > import java.math.BigDecimal; > import com.mockobjects.*; > > -public class MockPreparedStatement extends MockStatement implements PreparedStatement { > +public class MockPreparedStatement extends MockStatement { > private ExpectationSet mySetParameters = new ExpectationSet("MockPreparedStatement.setParameters"); > private ExpectationCounter myClearParametersCalls = new ExpectationCounter("MockPreparedStatement.clearParameters() calls"); > > @@ -73,10 +73,6 @@ > setObject(param, new Long(aLong)); > } > > - public void addBatch() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setNull(int param, int param1) throws SQLException { > setObject(param, null); > } > @@ -93,14 +89,6 @@ > setObject(param, time); > } > > - public void setObject(int param, Object obj, int targetSqlType, int scale) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setObject(int param, Object obj, int targetSqlType) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setRef(int param, Ref ref) throws SQLException { > setObject(param, ref); > } > @@ -117,26 +105,10 @@ > setObject(param, blob); > } > > - public void setCharacterStream(int param, Reader reader, int length) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setAsciiStream(int param, java.io.InputStream inputStream, int length) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setDate(int param, Date date, Calendar calendar) throws SQLException { > setDate(param, date); > } > > - public void setBinaryStream(int param, java.io.InputStream inputStream, int length) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setUnicodeStream(int param, java.io.InputStream inputStream, int length) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setBytes(int param, byte[] values) throws SQLException { > setObject(param, values); > } > @@ -153,14 +125,6 @@ > setObject(param, new Double(aDouble)); > } > > - public ResultSetMetaData getMetaData() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setTimestamp(int param, Timestamp timestamp, Calendar calendar) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setTime(int param, Time time) throws SQLException { > setObject(param, time); > } > @@ -169,10 +133,6 @@ > setObject(param, new Boolean(aBoolean)); > } > > - public void setNull(int param, int param1, String typeName) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public void setBigDecimal(int param, BigDecimal bigDecimal) throws SQLException { > setObject(param, bigDecimal); > } > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/src/jdk/common/com/mockobjects/sql/MockResultSet.java mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockResultSet.java > --- mockobjects-java/src/jdk/common/com/mockobjects/sql/MockResultSet.java Sat Apr 13 10:08:23 2002 > +++ mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockResultSet.java Mon Apr 15 15:47:47 2002 > @@ -20,7 +20,7 @@ > * It also counts close() and next() calls > * To force throwing a SQLException on a getter, set the corresponding value to be of type SQLException. > */ > -abstract public class MockResultSet extends MockObject implements ResultSet { > +abstract public class MockResultSet extends MockResultSetStub { > private ExpectationCounter myCloseCalls = new ExpectationCounter("MockResultSet.close"); > protected ExpectationCounter myNextCalls = new ExpectationCounter("MockResultSet.next"); > > diff -Nru --exclude CVS --exclude ant.jar mockobjects-java/src/jdk/common/com/mockobjects/sql/MockStatement.java mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockStatement.java > --- mockobjects-java/src/jdk/common/com/mockobjects/sql/MockStatement.java Sat Apr 13 10:08:23 2002 > +++ mockobjects-java.impl/src/jdk/common/com/mockobjects/sql/MockStatement.java Mon Apr 15 15:44:05 2002 > @@ -4,7 +4,7 @@ > import junit.framework.*; > import com.mockobjects.*; > > -public class MockStatement extends MockObject implements Statement { > +public class MockStatement extends MockStatementStub { > protected ExpectationCounter myCloseCalls = new ExpectationCounter("MockStatement.closeCalls"); > protected ExpectationCounter myExecuteCalls = new ExpectationCounter("MockStatement.executeCalls"); > protected ExpectationValue myQueryString = new ExpectationValue("MockStatement.queryString"); > @@ -52,10 +52,6 @@ > myCloseCalls.inc(); > } > > - public boolean execute(String sql) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public ResultSet executeQuery(String sql) throws SQLException { > myQueryString.setActual(sql); > innerExecute(); > @@ -68,100 +64,7 @@ > return myUpdateCount; > } > > - public int getMaxFieldSize() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setMaxFieldSize(int max) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getMaxRows() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setMaxRows(int max) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setEscapeProcessing(boolean enable) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getQueryTimeout() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setQueryTimeout(int seconds) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void cancel() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public SQLWarning getWarnings() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void clearWarnings() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setCursorName(String name) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public ResultSet getResultSet() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > public int getUpdateCount() throws SQLException { > return myUpdateCount; > } > - > - public boolean getMoreResults() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setFetchDirection(int direction) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getFetchDirection() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void setFetchSize(int rows) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getFetchSize() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getResultSetConcurrency() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int getResultSetType() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void addBatch(String sql) throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public void clearBatch() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public int[] executeBatch() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > - public Connection getConnection() throws SQLException { > - throw new UnsupportedOperationException(); > - } > - > } -- |
From: Oskar H. <osk...@de...> - 2002-04-17 10:46:26
|
Hi again... I checked out the latest code from CVS and found that Multiple PreparedStatement pr. connection have been implemented. The code I based my changes on was an old one from August 2001. I did however run my precious unit test against it and found that this code does not handle Multiple Statements pr. connection. Maybe I post some changes to this in coming days so I can escape my own private MockObject world. Regards Oskar H. -----Original Message----- From: moc...@li... [mailto:moc...@li...]On Behalf Of Jeff Martin Sent: 16. apr=EDl 2002 17:09 To: 'MockObjects' Subject: Re: [MO-java-dev] MockConnection I don't know of any work in this area. Not sure what happened to you patches either, sorry about that. If you resubmit your code I'll try and look at it when I get a chance. On Tue, 2002-04-16 at 17:33, Oskar Hannesson wrote: > Hi there! > It is nice to see the MockResultSetMetaData class finally make its way in to > CVS , even though I posted similar code (+ unit test) some six months ago:-( > When I started using Mockobjects last year I ran in to problems having > multiple Statements pr. connection. > The current version of MockConnection supports only one Statement pr. > connection so I modified it and posted it to this group. > The code never made it to the CVS so I ask: > Is someone currently working on this problem or should I try to re-commit my > implementation and hope for a better response ? > > I found some 8 months old code in CVS > (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to be > addressing some this problem. > Is this perhaps an upcoming version of the sql package? > > Regards > Oskar Hannesson > deCODE Genetics > Addr: Sturlugata 8 , 101 Reykjavik, Iceland > Tel: (354) 570-1900 > Fax: (354) 570-1903 > Web: www.decode.com > > PS! > I really hate relying on my own private version of MockObjects. > > > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Oskar H. <osk...@de...> - 2002-04-17 10:20:54
|
Hi. I could not live with out the unit tests ... they make you feel so safe :) I ran my modified Unit test against your code and found three things missing. * Missing set-up method for getTableName() * Missing set-up method for getColumnClassName() * The getColumnLabel(...) should return the same value as getColumName(...) (At least my Oracle JDBC drivers does so) Also I saw that you used myNames.remove(0) when you retrieve the column Name. Shouldn't it be implemented like this : public String getColumnName(int aColumnIndex) throws SQLException { return (String)myNames.get(aColumnIndex-1); } In stead of: public String getColumnName(int aColumnIndex) throws SQLException { return (String)myNames.remove(0); } Anyway I applied the above changes to MockResultSetMetaData and attached it to this mail plus the Unit test. I put the unittest under the package "com.mockobjects.sql.test" Regards. Oskar H. PS! Here is a diff -u of the code --- C:\tmp\mockobjects\mockobjects-java\src\jdk\common\com\mockobjects\sql\MockR esultSetMetaData.java Tue Apr 16 17:04:02 2002 +++ C:\projects\MockObjects2\src\jdk\common\com\mockobjects\sql\MockResultSetMet aData.java Wed Apr 17 09:38:49 2002 @@ -9,6 +9,8 @@ implements ResultSetMetaData { private Vector myNames =3D new Vector(); + private Vector myTableNames =3D new Vector(); + private Vector myColumnClassNames =3D new Vector(); /** * @see ResultSetMetaData#getColumnCount() @@ -76,9 +78,8 @@ /** * @see ResultSetMetaData#getColumnLabel(int) */ - public String getColumnLabel(int arg0) throws SQLException { - notImplemented(); - return null; + public String getColumnLabel(int aColumnIndex) throws SQLException { + return getColumnName(aColumnIndex); } public void addColumnNames(String[] allNames) { @@ -97,7 +98,7 @@ * @see ResultSetMetaData#getColumnName(int) */ public String getColumnName(int aColumnIndex) throws SQLException { - return (String)myNames.remove(0); + return (String)myNames.get(aColumnIndex-1); } /** @@ -127,9 +128,16 @@ /** * @see ResultSetMetaData#getTableName(int) */ - public String getTableName(int arg0) throws SQLException { - notImplemented(); - return null; + public String getTableName(int aColumnIndex) throws SQLException { + return (String)myTableNames.get(aColumnIndex-1); + } + + public void addTableNames(String[] allNames) { + if (myTableNames !=3D null) { + for (int i =3D 0; i < allNames.length; i++) { + myTableNames.add(allNames[i]); + } + } } /** @@ -183,8 +191,15 @@ /** * @see ResultSetMetaData#getColumnClassName(int) */ - public String getColumnClassName(int arg0) throws SQLException { - notImplemented(); - return null; + public String getColumnClassName(int aColumnIndex) throws SQLException { + return (String)myColumnClassNames.get(aColumnIndex-1); + } + + public void addColumnClassNames(String[] allNames) { + if (myColumnClassNames !=3D null) { + for (int i =3D 0; i < allNames.length; i++) { + myColumnClassNames.add(allNames[i]); + } + } } } ------------------- THE DIFF END ---------------------------- -----Original Message----- From: moc...@li... [mailto:moc...@li...]On Behalf Of Christian Trutz Sent: 16. apr=EDl 2002 16:58 To: Mockobjects Subject: Re: [MO-java-dev] MockConnection Hi Oskar, some unit tests for MockResultSetMetaData would be very nice ;-) Christian -----Urspr=FCngliche Nachricht----- Von: moc...@li... [mailto:moc...@li...]Im Auftrag von Oskar Hannesson Gesendet: Dienstag, 16. April 2002 18:34 An: 'Jeff Martin'; 'MockObjects' Betreff: [MO-java-dev] MockConnection Hi there! It is nice to see the MockResultSetMetaData class finally make its way in to CVS , even though I posted similar code (+ unit test) some six months ago:-( When I started using Mockobjects last year I ran in to problems having multiple Statements pr. connection. The current version of MockConnection supports only one Statement pr. connection so I modified it and posted it to this group. The code never made it to the CVS so I ask: Is someone currently working on this problem or should I try to re-commit my implementation and hope for a better response ? I found some 8 months old code in CVS (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to be addressing some this problem. Is this perhaps an upcoming version of the sql package? Regards Oskar Hannesson deCODE Genetics Addr: Sturlugata 8 , 101 Reykjavik, Iceland Tel: (354) 570-1900 Fax: (354) 570-1903 Web: www.decode.com PS! I really hate relying on my own private version of MockObjects. =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Jeff M. <cus...@us...> - 2002-04-16 19:37:05
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory usw-pr-cvs1:/tmp/cvs-serv2442/src/jdk/common/com/mockobjects/sql Modified Files: MockResultSetMetaData.java Log Message: Allow multiple column names to be added in one statement. Christian Trutz <ch...@sm...> Index: MockResultSetMetaData.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockResultSetMetaData.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockResultSetMetaData.java 16 Apr 2002 13:30:37 -0000 1.1 +++ MockResultSetMetaData.java 16 Apr 2002 17:04:02 -0000 1.2 @@ -81,6 +81,14 @@ return null; } + public void addColumnNames(String[] allNames) { + if (allNames != null) { + for (int i = 0; i < allNames.length; i++) { + addColumnName(allNames[i]); + } + } + } + public void addColumnName(String aName){ this.myNames.add(aName); } |
From: Jeff M. <je...@mk...> - 2002-04-16 17:14:30
|
Actually the general consensus is that mocks don't need tests. The idea is to keep them really simply so there's nothing in them worth testing. That's the good thing about the expectation stuff. That's got tests and that's the bit that doe's the work. On Tue, 2002-04-16 at 17:58, Christian Trutz wrote: > Hi Oskar, >=20 > some unit tests for MockResultSetMetaData would be very nice ;-) >=20 > Christian >=20 > -----Urspr=FCngliche Nachricht----- > Von: moc...@li... > [mailto:moc...@li...]Im Auftrag von > Oskar Hannesson > Gesendet: Dienstag, 16. April 2002 18:34 > An: 'Jeff Martin'; 'MockObjects' > Betreff: [MO-java-dev] MockConnection >=20 >=20 > Hi there! > It is nice to see the MockResultSetMetaData class finally make its way in= to > CVS , even though I posted similar code (+ unit test) some six months ago= :-( > When I started using Mockobjects last year I ran in to problems having > multiple Statements pr. connection. > The current version of MockConnection supports only one Statement pr. > connection so I modified it and posted it to this group. > The code never made it to the CVS so I ask: > Is someone currently working on this problem or should I try to re-commit= my > implementation and hope for a better response ? >=20 > I found some 8 months old code in CVS > (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to= be > addressing some this problem. > Is this perhaps an upcoming version of the sql package? >=20 > Regards > Oskar Hannesson > deCODE Genetics > Addr: Sturlugata 8 , 101 Reykjavik, Iceland > Tel: (354) 570-1900 > Fax: (354) 570-1903 > Web: www.decode.com >=20 > PS! > I really hate relying on my own private version of MockObjects. >=20 >=20 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev >=20 >=20 >=20 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev --=20 |
From: Jeff M. <je...@mk...> - 2002-04-16 17:12:44
|
I don't know of any work in this area. Not sure what happened to you patches either, sorry about that. If you resubmit your code I'll try and look at it when I get a chance. On Tue, 2002-04-16 at 17:33, Oskar Hannesson wrote: > Hi there! > It is nice to see the MockResultSetMetaData class finally make its way in to > CVS , even though I posted similar code (+ unit test) some six months ago:-( > When I started using Mockobjects last year I ran in to problems having > multiple Statements pr. connection. > The current version of MockConnection supports only one Statement pr. > connection so I modified it and posted it to this group. > The code never made it to the CVS so I ask: > Is someone currently working on this problem or should I try to re-commit my > implementation and hope for a better response ? > > I found some 8 months old code in CVS > (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to be > addressing some this problem. > Is this perhaps an upcoming version of the sql package? > > Regards > Oskar Hannesson > deCODE Genetics > Addr: Sturlugata 8 , 101 Reykjavik, Iceland > Tel: (354) 570-1900 > Fax: (354) 570-1903 > Web: www.decode.com > > PS! > I really hate relying on my own private version of MockObjects. > > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Jeff M. <je...@mk...> - 2002-04-16 17:06:25
|
Ah, the apache commit mail things is much better it collects all the files together unser the same comment. This was the comment about the other change in this commit. Didn't thing changing $ to $ was worth commenting on ;o) On Tue, 2002-04-16 at 16:18, rin...@me... wrote: > Jeff, > > > Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs > > In directory usw-pr-cvs1:/tmp/cvs-serv11115/doc/xdocs > > > > Modified Files: > > coding_conventions.xml > > Log Message: > > Added basic implementation of MockResultSetMetaData.java from > > Christian Trutz > > <ch...@sm...> > > Weird message for an update of the coding conventions document... :) > > Ringo > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Christian T. <ch...@sm...> - 2002-04-16 16:56:50
|
Hi Oskar, some unit tests for MockResultSetMetaData would be very nice ;-) Christian -----Ursprüngliche Nachricht----- Von: moc...@li... [mailto:moc...@li...]Im Auftrag von Oskar Hannesson Gesendet: Dienstag, 16. April 2002 18:34 An: 'Jeff Martin'; 'MockObjects' Betreff: [MO-java-dev] MockConnection Hi there! It is nice to see the MockResultSetMetaData class finally make its way in to CVS , even though I posted similar code (+ unit test) some six months ago:-( When I started using Mockobjects last year I ran in to problems having multiple Statements pr. connection. The current version of MockConnection supports only one Statement pr. connection so I modified it and posted it to this group. The code never made it to the CVS so I ask: Is someone currently working on this problem or should I try to re-commit my implementation and hope for a better response ? I found some 8 months old code in CVS (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to be addressing some this problem. Is this perhaps an upcoming version of the sql package? Regards Oskar Hannesson deCODE Genetics Addr: Sturlugata 8 , 101 Reykjavik, Iceland Tel: (354) 570-1900 Fax: (354) 570-1903 Web: www.decode.com PS! I really hate relying on my own private version of MockObjects. _______________________________________________ Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Oskar H. <osk...@de...> - 2002-04-16 16:35:19
|
Hi there! It is nice to see the MockResultSetMetaData class finally make its way in to CVS , even though I posted similar code (+ unit test) some six months ago:-( When I started using Mockobjects last year I ran in to problems having multiple Statements pr. connection. The current version of MockConnection supports only one Statement pr. connection so I modified it and posted it to this group. The code never made it to the CVS so I ask: Is someone currently working on this problem or should I try to re-commit my implementation and hope for a better response ? I found some 8 months old code in CVS (mockobjects-java/src/extensions/com/mockobjects/eziba/sql) which seem to be addressing some this problem. Is this perhaps an upcoming version of the sql package? Regards Oskar Hannesson deCODE Genetics Addr: Sturlugata 8 , 101 Reykjavik, Iceland Tel: (354) 570-1900 Fax: (354) 570-1903 Web: www.decode.com PS! I really hate relying on my own private version of MockObjects. |
From: Christian T. <ch...@sm...> - 2002-04-16 15:44:42
|
Hi Jeff, I think the changes in MockResultSetMetaData are OK, I use now your MockResultSetMetaData ... The method: public void addColumnNames(String[] allNames) { if (allNames != null) { for (int i = 0; i < allNames.length; i++) { addColumnName(allNames[i]); } } } is also usefull because you can create a String[] with column names and transfer it to MockResultSet and MockResultSetMetaData. We should use common parameter types for this classes ... Christian |
From: <rin...@me...> - 2002-04-16 15:20:07
|
Jeff, > Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs > In directory usw-pr-cvs1:/tmp/cvs-serv11115/doc/xdocs > > Modified Files: > =09coding_conventions.xml > Log Message: > Added basic implementation of MockResultSetMetaData.java from > Christian Trutz > <ch...@sm...> Weird message for an update of the coding conventions document... :) Ringo |
From: Jeff M. <je...@mk...> - 2002-04-16 13:50:38
|
I've made a couple of changes to your code and applied it to the main tree. Instead of passing in the mock data in the constructor, I've added a method addColumnName(String aColumnName) I've also added calls to notImplemented in those methods without a full implementation. Ta On Mon, 2002-04-15 at 18:39, Christian Trutz wrote: > Hi mockobjects community, > > in one of my projects I use java.sql.ResutSetMetaData. Because I test-first > my java classes ;-) and it dosn't exists a suck mock object I write a very > rudimentary mock resultset meta data ... > > It works, and I think this is a usefull class for the com.mockobjects.sql > package ... > > > Chris > > --- CODE SNIPLET --- > > > package com.mockobjects.sql; > import com.mockobjects.*; > import java.sql.*; > import java.sql.SQLException; > > public class MockResultSetMetaData > extends MockObject > implements ResultSetMetaData { > private String[] names = null; > private Object[] values = null; > public MockResultSetMetaData(String[] names, Object[] values) { > super(); > this.names = names; > this.values = values; > } > /** > * @see ResultSetMetaData#getColumnCount() > */ > public int getColumnCount() throws SQLException { > return names.length; > } > /** > * @see ResultSetMetaData#isAutoIncrement(int) > */ > public boolean isAutoIncrement(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#isCaseSensitive(int) > */ > public boolean isCaseSensitive(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#isSearchable(int) > */ > public boolean isSearchable(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#isCurrency(int) > */ > public boolean isCurrency(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#isNullable(int) > */ > public int isNullable(int arg0) throws SQLException { > return 0; > } > /** > * @see ResultSetMetaData#isSigned(int) > */ > public boolean isSigned(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#getColumnDisplaySize(int) > */ > public int getColumnDisplaySize(int arg0) throws SQLException { > return 0; > } > /** > * @see ResultSetMetaData#getColumnLabel(int) > */ > public String getColumnLabel(int arg0) throws SQLException { > return null; > } > /** > * @see ResultSetMetaData#getColumnName(int) > */ > public String getColumnName(int arg0) throws SQLException { > return names[arg0 - 1]; > } > /** > * @see ResultSetMetaData#getSchemaName(int) > */ > public String getSchemaName(int arg0) throws SQLException { > return null; > } > /** > * @see ResultSetMetaData#getPrecision(int) > */ > public int getPrecision(int arg0) throws SQLException { > return 0; > } > /** > * @see ResultSetMetaData#getScale(int) > */ > public int getScale(int arg0) throws SQLException { > return 0; > } > /** > * @see ResultSetMetaData#getTableName(int) > */ > public String getTableName(int arg0) throws SQLException { > return null; > } > /** > * @see ResultSetMetaData#getCatalogName(int) > */ > public String getCatalogName(int arg0) throws SQLException { > return null; > } > /** > * @see ResultSetMetaData#getColumnType(int) > */ > public int getColumnType(int arg0) throws SQLException { > return 0; > } > /** > * @see ResultSetMetaData#getColumnTypeName(int) > */ > public String getColumnTypeName(int arg0) throws SQLException { > return null; > } > /** > * @see ResultSetMetaData#isReadOnly(int) > */ > public boolean isReadOnly(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#isWritable(int) > */ > public boolean isWritable(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#isDefinitelyWritable(int) > */ > public boolean isDefinitelyWritable(int arg0) throws SQLException { > return false; > } > /** > * @see ResultSetMetaData#getColumnClassName(int) > */ > public String getColumnClassName(int arg0) throws SQLException { > return null; > } > } > > > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Jeff M. <cus...@us...> - 2002-04-16 13:30:42
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory usw-pr-cvs1:/tmp/cvs-serv11115/src/jdk/common/com/mockobjects/sql Added Files: MockResultSetMetaData.java Log Message: Added basic implementation of MockResultSetMetaData.java from Christian Trutz <ch...@sm...> --- NEW FILE: MockResultSetMetaData.java --- package com.mockobjects.sql; import com.mockobjects.*; import java.sql.*; import java.sql.SQLException; import java.util.Vector; public class MockResultSetMetaData extends MockObject implements ResultSetMetaData { private Vector myNames = new Vector(); /** * @see ResultSetMetaData#getColumnCount() */ public int getColumnCount() throws SQLException { return myNames.size(); } /** * @see ResultSetMetaData#isAutoIncrement(int) */ public boolean isAutoIncrement(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isCaseSensitive(int) */ public boolean isCaseSensitive(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isSearchable(int) */ public boolean isSearchable(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isCurrency(int) */ public boolean isCurrency(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isNullable(int) */ public int isNullable(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#isSigned(int) */ public boolean isSigned(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#getColumnDisplaySize(int) */ public int getColumnDisplaySize(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getColumnLabel(int) */ public String getColumnLabel(int arg0) throws SQLException { notImplemented(); return null; } public void addColumnName(String aName){ this.myNames.add(aName); } /** * @see ResultSetMetaData#getColumnName(int) */ public String getColumnName(int aColumnIndex) throws SQLException { return (String)myNames.remove(0); } /** * @see ResultSetMetaData#getSchemaName(int) */ public String getSchemaName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#getPrecision(int) */ public int getPrecision(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getScale(int) */ public int getScale(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getTableName(int) */ public String getTableName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#getCatalogName(int) */ public String getCatalogName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#getColumnType(int) */ public int getColumnType(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getColumnTypeName(int) */ public String getColumnTypeName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#isReadOnly(int) */ public boolean isReadOnly(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isWritable(int) */ public boolean isWritable(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isDefinitelyWritable(int) */ public boolean isDefinitelyWritable(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#getColumnClassName(int) */ public String getColumnClassName(int arg0) throws SQLException { notImplemented(); return null; } } |
From: Jeff M. <cus...@us...> - 2002-04-16 13:30:41
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs In directory usw-pr-cvs1:/tmp/cvs-serv11115/doc/xdocs Modified Files: coding_conventions.xml Log Message: Added basic implementation of MockResultSetMetaData.java from Christian Trutz <ch...@sm...> Index: coding_conventions.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/xdocs/coding_conventions.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- coding_conventions.xml 15 Apr 2002 15:18:33 -0000 1.5 +++ coding_conventions.xml 16 Apr 2002 13:30:36 -0000 1.6 @@ -226,7 +226,7 @@ ]]></source> <note> - You just need to write <code>@version $Id$</code> and CVS will + You just need to write <code>@version $Id: $</code> and CVS will add the rest during commits </note> |
From: <rin...@me...> - 2002-04-16 07:15:48
|
Jeff, > > Hmm, that won't actually change anything unless you also > > disable keyword > > substitution on coding_conventions.xml. I suggest "You just > > need to write > > $Id$" instead, so the final output looks right and > you can use > > keyword substitutions elsewhere. > > You're right. I have overlooked it. I just found it weird > that in version > 1.4 of the coding conventions document the expanded version > was the same to > what you ought to write. Attached you find another patch against the coding conventions document tha= t fixes the '$Id$' keyword as per Scott's suggestion. Ringo |
From: <rin...@me...> - 2002-04-16 06:44:58
|
Scott, > Hmm, that won't actually change anything unless you also > disable keyword > substitution on coding_conventions.xml. I suggest "You just > need to write > $Id$" instead, so the final output looks right and you can use > keyword substitutions elsewhere. You're right. I have overlooked it. I just found it weird that in version 1.4 of the coding conventions document the expanded version was the same to= what you ought to write. Ringo |
From: Scott L. <sl...@sl...> - 2002-04-15 22:14:52
|
I couldn't get mockobjects to compile under J2SE 1.4, so I looked in the com.mockobjects.sql.* classes and found that there's a lot of code that just does "throw new UnsupportedOperationException();". J2SE 1.4 has many more methods that require this repetitive code. Instead of adding new skeletons, I removed them all and added a new class InterfaceImplementor, based on some code by Dustin Sallings. It creates these skeleton methods automatically. This InterfaceImplementor is pretty untested - I tried to be more strict about catching errors than Dustin's code, so the result is different enough to have its own bugs. I might try writing tests for it later. But it works well enough that everything compiles and the current unit tests - which sort of check its output - pass. Now the com.mockobjects.sql.* classes are more terse and work with J2SE 1.4. They will compile against extended JDBC interfaces in the future. Hopefully InterfaceImplementor can be used for other classes as well. The diffstat: build.xml | 21 src/core/com/mockobjects/util/InterfaceImplementor.java | 361 ++++++++++ src/core/com/mockobjects/util/InterfaceImplementorTask.java | 113 +++ src/jdk/common/com/mockobjects/sql/MockConnection.java | 80 -- src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java | 42 - src/jdk/common/com/mockobjects/sql/MockResultSet.java | 2 src/jdk/common/com/mockobjects/sql/MockStatement.java | 99 -- 7 files changed, 499 insertions(+), 219 deletions(-) -- Scott Lamb |
From: Christian T. <ch...@sm...> - 2002-04-15 17:37:53
|
Hi mockobjects community, in one of my projects I use java.sql.ResutSetMetaData. Because I test-first my java classes ;-) and it dosn't exists a suck mock object I write a very rudimentary mock resultset meta data ... It works, and I think this is a usefull class for the com.mockobjects.sql package ... Chris --- CODE SNIPLET --- package com.mockobjects.sql; import com.mockobjects.*; import java.sql.*; import java.sql.SQLException; public class MockResultSetMetaData extends MockObject implements ResultSetMetaData { private String[] names = null; private Object[] values = null; public MockResultSetMetaData(String[] names, Object[] values) { super(); this.names = names; this.values = values; } /** * @see ResultSetMetaData#getColumnCount() */ public int getColumnCount() throws SQLException { return names.length; } /** * @see ResultSetMetaData#isAutoIncrement(int) */ public boolean isAutoIncrement(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#isCaseSensitive(int) */ public boolean isCaseSensitive(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#isSearchable(int) */ public boolean isSearchable(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#isCurrency(int) */ public boolean isCurrency(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#isNullable(int) */ public int isNullable(int arg0) throws SQLException { return 0; } /** * @see ResultSetMetaData#isSigned(int) */ public boolean isSigned(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#getColumnDisplaySize(int) */ public int getColumnDisplaySize(int arg0) throws SQLException { return 0; } /** * @see ResultSetMetaData#getColumnLabel(int) */ public String getColumnLabel(int arg0) throws SQLException { return null; } /** * @see ResultSetMetaData#getColumnName(int) */ public String getColumnName(int arg0) throws SQLException { return names[arg0 - 1]; } /** * @see ResultSetMetaData#getSchemaName(int) */ public String getSchemaName(int arg0) throws SQLException { return null; } /** * @see ResultSetMetaData#getPrecision(int) */ public int getPrecision(int arg0) throws SQLException { return 0; } /** * @see ResultSetMetaData#getScale(int) */ public int getScale(int arg0) throws SQLException { return 0; } /** * @see ResultSetMetaData#getTableName(int) */ public String getTableName(int arg0) throws SQLException { return null; } /** * @see ResultSetMetaData#getCatalogName(int) */ public String getCatalogName(int arg0) throws SQLException { return null; } /** * @see ResultSetMetaData#getColumnType(int) */ public int getColumnType(int arg0) throws SQLException { return 0; } /** * @see ResultSetMetaData#getColumnTypeName(int) */ public String getColumnTypeName(int arg0) throws SQLException { return null; } /** * @see ResultSetMetaData#isReadOnly(int) */ public boolean isReadOnly(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#isWritable(int) */ public boolean isWritable(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#isDefinitelyWritable(int) */ public boolean isDefinitelyWritable(int arg0) throws SQLException { return false; } /** * @see ResultSetMetaData#getColumnClassName(int) */ public String getColumnClassName(int arg0) throws SQLException { return null; } } |
From: Jeff M. <cus...@us...> - 2002-04-15 17:08:30
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs In directory usw-pr-cvs1:/tmp/cvs-serv30602/doc/xdocs Modified Files: coding_conventions.xml Log Message: Added doc patch from Ringo (rin...@me...) Index: coding_conventions.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/xdocs/coding_conventions.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- coding_conventions.xml 22 Aug 2001 10:36:45 -0000 1.4 +++ coding_conventions.xml 15 Apr 2002 15:18:33 -0000 1.5 @@ -234,5 +234,13 @@ </s1> + <s1 title="Unit test code"> + <p> + The name of all unit test classes must end in <code>Test</code>. + These classes together with classes named <code>AllTests</code> will + get special treatment from the Ant build file. + </p> + <s1> + </body> </document> |
From: Scott L. <sl...@sl...> - 2002-04-15 15:35:43
|
On Mon, Apr 15, 2002 at 01:48:23PM +0200, rin...@me... wrote: > diff -u -r1.4 coding_conventions.xml > --- doc/xdocs/coding_conventions.xml 22 Aug 2001 10:36:45 -0000 1.4 > +++ doc/xdocs/coding_conventions.xml 15 Apr 2002 11:29:20 -0000 > @@ -226,7 +226,7 @@ > ]]></source> > > <note> > - You just need to write <code>@version $Id: coding_conventions.xml,v 1.4 2001/08/22 10:36:45 vmassol Exp $</code> and CVS will > + You just need to write <code>@version $Id$</code> and CVS will > add the rest during commits > </note> Hmm, that won't actually change anything unless you also disable keyword substitution on coding_conventions.xml. I suggest "You just need to write $Id$" instead, so the final output looks right and you can use keyword substitutions elsewhere. -- Scott Lamb |
From: <rin...@me...> - 2002-04-15 11:48:45
|
Jeff, (Resend to the list... Jeff, sorry for the duplicate) > <fileset dir=3D"${core.classes}"> > <include name=3D"**/*Test.class" /> > <include name=3D"**/AllTests.class" /> > </fileset> Ofcourse, but with "document somewhere" I didn't mean the Ant build file. Source is not always good documentation. This is a case where I think it isn't good documentation! Attached you can find a patch against the head of the coding conventions document. It adds a third top level section with some small comments on uni= t test code conventions together with a fix on how to specify a version tag i= n Java source files. Greetings, Ringo |
From: Jeff M. <je...@cu...> - 2002-04-15 10:56:26
|
<fileset dir="${core.classes}"> <include name="**/*Test.class" /> <include name="**/AllTests.class" /> </fileset> On Mon, 2002-04-15 at 07:46, rin...@me... wrote: > Jeff, > > > <rant> > > I've left the tests where they were. But none of you have come up with > > anything like a reason for no moving them in with the classes > > they test. > > (Neatness isn't a reason!) > > </rant> > > Since the test classes remain in the same package, could you document > somewhere how test classes should be named for Ant to succesfully filter > them out? > > Ringo > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- Jeff Martin Memetic Engineer http://www.custommonkey.org/ |
From: <rin...@me...> - 2002-04-15 06:47:33
|
Jeff, > <rant> > I've left the tests where they were. But none of you have come up with > anything like a reason for no moving them in with the classes > they test. > (Neatness isn't a reason!) > </rant> Since the test classes remain in the same package, could you document somewhere how test classes should be named for Ant to succesfully filter them out? Ringo |