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: Jeff M. <cus...@us...> - 2002-06-19 15:26:55
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/mail/internet In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/j2ee/common/com/mockobjects/mail/internet Modified Files: MockMimeMessageFactory.java Added Files: MockMimeMessage.java Log Message: Lots of small changes to mocks --- NEW FILE: MockMimeMessage.java --- package com.mockobjects.mail.internet; import alt.javax.mail.internet.MimeMessage; import com.mockobjects.ExpectationList; import com.mockobjects.mail.MockMessage; import javax.mail.Address; import javax.mail.Flags; import javax.mail.Folder; import javax.mail.MessagingException; import javax.mail.search.SearchTerm; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; public class MockMimeMessage extends MockMessage implements MimeMessage { private final ExpectationList myAddresses = new ExpectationList("addresses"); private final ExpectationList myRecipientTypes = new ExpectationList("recipient types"); public void setRecipient(javax.mail.Message.RecipientType type, Address address) throws MessagingException { notImplemented(); } public void setExpectedAddRecipient(javax.mail.Message.RecipientType aType, Address anAddress) { myAddresses.addExpected(anAddress); myRecipientTypes.addExpected(aType); } public void addRecipient(javax.mail.Message.RecipientType aType, Address anAddress) throws MessagingException { myAddresses.addActual(anAddress); myRecipientTypes.addActual(aType); } public void setFlag(Flags.Flag flag, boolean b) throws MessagingException { notImplemented(); } public int getMessageNumber() { notImplemented(); return 0; } public String getBody() { notImplemented(); return null; } public Folder getFolder() { notImplemented(); return null; } public void setBody(String messageText) { notImplemented(); } public boolean isExpunged() { notImplemented(); return false; } public boolean match(SearchTerm term) throws MessagingException { notImplemented(); return false; } public Address[] getAllRecipients() throws MessagingException { notImplemented(); return new Address[0]; } public void setRecipients(javax.mail.Message.RecipientType type, String s) throws MessagingException { notImplemented(); } public void addRecipients(javax.mail.Message.RecipientType type, String s) throws MessagingException { notImplemented(); } public Address[] getReplyTo() throws MessagingException { notImplemented(); return new Address[0]; } public void setReplyTo(Address[] addresses) throws MessagingException { notImplemented(); } public void setSubject(String s, String s1) throws MessagingException { notImplemented(); } public String getEncoding() throws MessagingException { notImplemented(); return null; } public String getContentID() throws MessagingException { notImplemented(); return null; } public void setContentID(String s) throws MessagingException { notImplemented(); } public String getContentMD5() throws MessagingException { notImplemented(); return null; } public void setContentMD5(String s) throws MessagingException { notImplemented(); } public void setDescription(String s, String s1) throws MessagingException { notImplemented(); } public String[] getContentLanguage() throws MessagingException { notImplemented(); return new String[0]; } public void setContentLanguage(String[] strings) throws MessagingException { notImplemented(); } public String getMessageID() throws MessagingException { notImplemented(); return null; } public InputStream getRawInputStream() throws MessagingException { notImplemented(); return null; } public void setText(String s, String s1) throws MessagingException { notImplemented(); } public void writeTo(OutputStream stream, String[] strings) throws IOException, MessagingException { notImplemented(); } public String getHeader(String s, String s1) throws MessagingException { notImplemented(); return null; } public void addHeaderLine(String s) throws MessagingException { notImplemented(); } public Enumeration getAllHeaderLines() throws MessagingException { notImplemented(); return null; } public Enumeration getMatchingHeaderLines(String[] strings) throws MessagingException { notImplemented(); return null; } public Enumeration getNonMatchingHeaderLines(String[] strings) throws MessagingException { notImplemented(); return null; } public boolean isSet(Flags.Flag flag) throws MessagingException { notImplemented(); return false; } } Index: MockMimeMessageFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/mail/internet/MockMimeMessageFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockMimeMessageFactory.java 30 Apr 2002 17:03:10 -0000 1.1 +++ MockMimeMessageFactory.java 19 Jun 2002 15:26:22 -0000 1.2 @@ -4,7 +4,7 @@ import alt.javax.mail.Session; import alt.javax.mail.internet.MimeMessageFactory; -import javax.mail.internet.MimeMessage; +import alt.javax.mail.internet.MimeMessage; public class MockMimeMessageFactory extends MockObject implements MimeMessageFactory { |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:55
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/naming/directory In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/j2ee/common/com/mockobjects/naming/directory Modified Files: MockAttributes.java Log Message: Lots of small changes to mocks Index: MockAttributes.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/naming/directory/MockAttributes.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockAttributes.java 22 Feb 2002 16:25:05 -0000 1.1 +++ MockAttributes.java 19 Jun 2002 15:26:22 -0000 1.2 @@ -7,7 +7,8 @@ import java.util.*; public class MockAttributes extends MockObject implements Attributes{ - private List myAttributes = new ArrayList(); + private ReturnObjectList myAttributesToReturn = new ReturnObjectList("attributes"); + private ExpectationList myAttributes = new ExpectationList("attributes"); public boolean isCaseIgnored(){ notImplemented(); @@ -20,11 +21,16 @@ } public void setupAddGet(Attribute attribute){ - myAttributes.add(attribute); + myAttributesToReturn.addObjectToReturn(attribute); } - public Attribute get(String name){ - return (Attribute)myAttributes.remove(0); + public void setExpectedName(String aName){ + myAttributes.addExpected(aName); + } + + public Attribute get(String aName){ + myAttributes.addActual(aName); + return (Attribute)myAttributesToReturn.nextReturnObject(); } public NamingEnumeration getAll(){ @@ -55,9 +61,5 @@ public Object clone(){ notImplemented(); return null; - } - - public String toString(){ - return myAttributes.toString(); } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:53
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/alt/javax/mail In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/j2ee/common/alt/javax/mail Modified Files: Transport.java TransportImpl.java Added Files: Message.java MessageImpl.java Log Message: Lots of small changes to mocks --- NEW FILE: Message.java --- package alt.javax.mail; import javax.mail.Address; import javax.mail.MessagingException; import javax.mail.Flags; import javax.mail.Multipart; import java.util.Date; import java.util.Enumeration; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.io.ObjectStreamException; public interface Message { javax.mail.Message getRealMessage(); Address[] getFrom() throws MessagingException; void setFrom() throws MessagingException; void setFrom(Address address) throws MessagingException; void addFrom(Address[] addresses) throws MessagingException; Address[] getRecipients(javax.mail.Message.RecipientType type) throws MessagingException; void setRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException; void addRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException; String getSubject() throws MessagingException; void setSubject(String s) throws MessagingException; Date getSentDate() throws MessagingException; void setSentDate(Date date) throws MessagingException; Date getReceivedDate() throws MessagingException; Flags getFlags() throws MessagingException; void setFlags(Flags flags, boolean b) throws MessagingException; Message reply(boolean b) throws MessagingException; void saveChanges() throws MessagingException; int getSize() throws MessagingException; int getLineCount() throws MessagingException; String getContentType() throws MessagingException; boolean isMimeType(String s) throws MessagingException; String getDisposition() throws MessagingException; void setDisposition(String s) throws MessagingException; String getDescription() throws MessagingException; void setDescription(String s) throws MessagingException; String getFileName() throws MessagingException; void setFileName(String s) throws MessagingException; InputStream getInputStream() throws IOException, MessagingException; javax.activation.DataHandler getDataHandler() throws MessagingException; Object getContent() throws IOException, MessagingException; void setDataHandler(javax.activation.DataHandler handler) throws MessagingException; void setContent(Object o, String s) throws MessagingException; void setText(String s) throws MessagingException; void setContent(Multipart multipart) throws MessagingException; void writeTo(OutputStream stream) throws IOException, MessagingException; String[] getHeader(String s) throws MessagingException; void setHeader(String s, String s1) throws MessagingException; void addHeader(String s, String s1) throws MessagingException; void removeHeader(String s) throws MessagingException; Enumeration getAllHeaders() throws MessagingException; Enumeration getMatchingHeaders(String[] strings) throws MessagingException; Enumeration getNonMatchingHeaders(String[] strings) throws MessagingException; } --- NEW FILE: MessageImpl.java --- package alt.javax.mail; import com.mockobjects.MockObject; import javax.mail.MessagingException; import javax.mail.Address; import javax.mail.Flags; import javax.mail.Multipart; import java.util.Date; import java.util.Enumeration; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; public class MessageImpl implements Message { private final javax.mail.Message message; public MessageImpl(javax.mail.Message message) { this.message = message; } public javax.mail.Message getRealMessage() { return message; } public final Address[] getFrom() throws MessagingException { return message.getFrom(); } public final void setFrom() throws MessagingException { message.setFrom(); } public final void setFrom(Address address) throws MessagingException { message.setFrom(address); } public final void addFrom(Address[] addresses) throws MessagingException { message.addFrom(addresses); } public final Address[] getRecipients(javax.mail.Message.RecipientType type) throws MessagingException { return message.getRecipients(type); } public final void setRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException { message.setRecipients(type, addresses); } public final void addRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException { message.addRecipients(type, addresses); } public final String getSubject() throws MessagingException { return message.getSubject(); } public final void setSubject(String s) throws MessagingException { message.setSubject(s); } public final Date getSentDate() throws MessagingException { return message.getSentDate(); } public final void setSentDate(Date date) throws MessagingException { message.setSentDate(date); } public final Date getReceivedDate() throws MessagingException { return message.getReceivedDate(); } public final Flags getFlags() throws MessagingException { return message.getFlags(); } public final void setFlags(Flags flags, boolean b) throws MessagingException { message.setFlags(flags, b); } public final Message reply(boolean b) throws MessagingException { return new MessageImpl(message.reply(b)); } public final void saveChanges() throws MessagingException { message.saveChanges(); } public final int getSize() throws MessagingException { return message.getSize(); } public final int getLineCount() throws MessagingException { return message.getLineCount(); } public final String getContentType() throws MessagingException { return message.getContentType(); } public final boolean isMimeType(String s) throws MessagingException { return message.isMimeType(s); } public final String getDisposition() throws MessagingException { return message.getDisposition(); } public final void setDisposition(String s) throws MessagingException { message.setDisposition(s); } public final String getDescription() throws MessagingException { return message.getDescription(); } public final void setDescription(String s) throws MessagingException { message.setDescription(s); } public final String getFileName() throws MessagingException { return message.getFileName(); } public final void setFileName(String s) throws MessagingException { message.setFileName(s); } public final InputStream getInputStream() throws IOException, MessagingException { return message.getInputStream(); } public final javax.activation.DataHandler getDataHandler() throws MessagingException { return message.getDataHandler(); } public final Object getContent() throws IOException, MessagingException { return message.getContent(); } public final void setDataHandler(javax.activation.DataHandler handler) throws MessagingException { message.setDataHandler(handler); } public final void setContent(Object o, String s) throws MessagingException { message.setContent(o, s); } public final void setText(String s) throws MessagingException { message.setText(s); } public final void setContent(Multipart multipart) throws MessagingException { message.setContent(multipart); } public final void writeTo(OutputStream stream) throws IOException, MessagingException { message.writeTo(stream); } public final String[] getHeader(String s) throws MessagingException { return message.getHeader(s); } public final void setHeader(String s, String s1) throws MessagingException { message.setHeader(s, s1); } public final void addHeader(String s, String s1) throws MessagingException { message.addHeader(s, s1); } public final void removeHeader(String s) throws MessagingException { message.removeHeader(s); } public final Enumeration getAllHeaders() throws MessagingException { return message.getAllHeaders(); } public final Enumeration getMatchingHeaders(String[] strings) throws MessagingException { return message.getAllHeaders(); } public final Enumeration getNonMatchingHeaders(String[] strings) throws MessagingException { return message.getNonMatchingHeaders(strings); } } Index: Transport.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/alt/javax/mail/Transport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Transport.java 30 Apr 2002 17:03:10 -0000 1.1 +++ Transport.java 19 Jun 2002 15:26:19 -0000 1.2 @@ -1,6 +1,6 @@ package alt.javax.mail; -import javax.mail.Message; +import alt.javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Address; import javax.mail.event.TransportListener; Index: TransportImpl.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/alt/javax/mail/TransportImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TransportImpl.java 30 Apr 2002 17:03:10 -0000 1.1 +++ TransportImpl.java 19 Jun 2002 15:26:20 -0000 1.2 @@ -1,6 +1,6 @@ package alt.javax.mail; -import javax.mail.Message; +import alt.javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Address; import javax.mail.event.TransportListener; @@ -15,17 +15,17 @@ } public void send(Message message) throws MessagingException{ - transport.send(message); + transport.send(message.getRealMessage()); } public void send(Message message, Address[] addresses) throws MessagingException{ - transport.send(message, addresses); + transport.send(message.getRealMessage(), addresses); } public void sendMessage(Message message, Address[] addresses) throws MessagingException{ - transport.sendMessage(message, addresses); + transport.sendMessage(message.getRealMessage(), addresses); } public void addTransportListener(TransportListener transportListener){ |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:51
|
Update of /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/eziba/sql In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/extensions/com/mockobjects/eziba/sql Modified Files: PreparedStatement.java Log Message: Lots of small changes to mocks Index: PreparedStatement.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/eziba/sql/PreparedStatement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PreparedStatement.java 29 Jul 2001 19:50:25 -0000 1.1 +++ PreparedStatement.java 19 Jun 2002 15:26:16 -0000 1.2 @@ -31,132 +31,110 @@ */ package com.mockobjects.eziba.sql; + +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.ByteArrayOutputStream; import java.io.Reader; import java.math.BigDecimal; import java.sql.SQLException; import java.util.Calendar; -import java.util.Vector;public class PreparedStatement - extends Statement - implements java.sql.PreparedStatement -{ +import java.util.Vector; + +public class PreparedStatement + extends Statement + implements java.sql.PreparedStatement { protected final Vector m_args = new Vector(); - protected void setArg(int p_pos,Object p_arg) - { + protected void setArg(int p_pos, Object p_arg) { p_pos--; - if (m_args.size() <= p_pos) - { + if(m_args.size() <= p_pos) { int size = m_args.size(); - m_args.setSize(p_pos+1); - for (int i = size; i < m_args.size(); ++i) - { - m_args.set(i,Connection.WILDCARD); + m_args.setSize(p_pos + 1); + for(int i = size; i < m_args.size(); ++i) { + m_args.set(i, Connection.WILDCARD); } } - m_args.set(p_pos,p_arg); + m_args.set(p_pos, p_arg); } - protected final Object [] getArguments() - { + protected final Object[] getArguments() { m_args.trimToSize(); return m_args.toArray(); } - PreparedStatement(Connection p_connection, String p_sql) - { - super(p_connection,p_sql); + PreparedStatement(Connection p_connection, String p_sql) { + super(p_connection, p_sql); } - public void addBatch() - { + public void addBatch() { throw new NotImplementedException(); } - public void clearParameters() - { + public void clearParameters() { throw new NotImplementedException(); } public boolean execute() - throws SQLException - { + throws SQLException { m_returnValue = -1; m_resultSet = null; - try - { + try { m_returnValue = executeUpdate(); return false; - } - catch (SQLException e) - { + } catch(SQLException e) { m_resultSet = executeQuery(); return true; } } - public java.sql.ResultSet getResultSet() - { + public java.sql.ResultSet getResultSet() { return m_resultSet; } - public int getUpdateCount() - { + public int getUpdateCount() { return m_returnValue; } public java.sql.ResultSet executeQuery() - throws SQLException - { - return connection.getRegisteredResult(sql,getArguments()); + throws SQLException { + return connection.getRegisteredResult(sql, getArguments()); } public int executeUpdate() - throws SQLException - { + throws SQLException { return connection.getRegisteredUpdate(sql, getArguments()); } - public void setInt(int parameterIndex, int x) - { + public void setInt(int parameterIndex, int x) { setArg(parameterIndex, new Integer(x)); } - public void setString(int parameterIndex, String x) - { + public void setString(int parameterIndex, String x) { setArg(parameterIndex, x); } - public void setBigDecimal(int parameterIndex, BigDecimal x) - { + public void setBigDecimal(int parameterIndex, BigDecimal x) { setArg(parameterIndex, x); } public void setBinaryStream(int parameterIndex, InputStream x, int length) - throws SQLException - { - try - { + throws SQLException { + try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int c = 0; - while ( ((c = x.read()) != -1) ) - { + while(((c = x.read()) != -1)) { baos.write(c); } - setArg(parameterIndex,baos.toByteArray()); - } - catch (IOException e) - { + setArg(parameterIndex, baos.toByteArray()); + } catch(IOException e) { throw new SQLException("IOException reading stream"); } } - public void setNull(int parameterIndex, int sqlType) - { - setArg(parameterIndex,null); + public void setNull(int parameterIndex, int sqlType) { + setArg(parameterIndex, null); } private int m_returnValue; @@ -167,131 +145,106 @@ - public java.sql.ResultSetMetaData getMetaData() - { + public java.sql.ResultSetMetaData getMetaData() { throw new NotImplementedException(); } - public void setArray(int i, java.sql.Array x) - { + public void setArray(int i, java.sql.Array x) { throw new NotImplementedException(); } - public void setAsciiStream(int parameterIndex, InputStream x, int length) - { + public void setAsciiStream(int parameterIndex, InputStream x, int length) { throw new NotImplementedException(); } - public void setBlob(int i, java.sql.Blob x) - { + public void setBlob(int i, java.sql.Blob x) { throw new NotImplementedException(); } - public void setBoolean(int parameterIndex, boolean x) - { + public void setBoolean(int parameterIndex, boolean x) { throw new NotImplementedException(); } - public void setByte(int parameterIndex, byte x) - { + public void setByte(int parameterIndex, byte x) { throw new NotImplementedException(); } - public void setBytes(int parameterIndex, byte[] x) - { + public void setBytes(int parameterIndex, byte[] x) { throw new NotImplementedException(); } - public void setCharacterStream(int parameterIndex, Reader reader, int length) - { + public void setCharacterStream(int parameterIndex, Reader reader, int length) { throw new NotImplementedException(); } - public void setClob(int i, java.sql.Clob x) - { + public void setClob(int i, java.sql.Clob x) { throw new NotImplementedException(); } - public void setDate(int parameterIndex, java.sql.Date x) - { + public void setDate(int parameterIndex, java.sql.Date x) { throw new NotImplementedException(); } - public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) - { + public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) { throw new NotImplementedException(); } - public void setDouble(int parameterIndex, double x) - { + public void setDouble(int parameterIndex, double x) { throw new NotImplementedException(); } - public void setFloat(int parameterIndex, float x) - { + public void setFloat(int parameterIndex, float x) { throw new NotImplementedException(); } - public void setLong(int parameterIndex, long x) - { + public void setLong(int parameterIndex, long x) { throw new NotImplementedException(); } - public void setNull(int paramIndex, int sqlType, String typeName) - { + public void setNull(int paramIndex, int sqlType, String typeName) { throw new NotImplementedException(); } - public void setObject(int parameterIndex, Object x) - { + public void setObject(int parameterIndex, Object x) { throw new NotImplementedException(); } - public void setObject(int parameterIndex, Object x, int targetSqlType) - { + public void setObject(int parameterIndex, Object x, int targetSqlType) { throw new NotImplementedException(); } - public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) - { + public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) { throw new NotImplementedException(); } - public void setRef(int i, java.sql.Ref x) - { + public void setRef(int i, java.sql.Ref x) { throw new NotImplementedException(); } - public void setShort(int parameterIndex, short x) - { + public void setShort(int parameterIndex, short x) { throw new NotImplementedException(); } - public void setTime(int parameterIndex, java.sql.Time x) - { + public void setTime(int parameterIndex, java.sql.Time x) { throw new NotImplementedException(); } - public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) - { + public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) { throw new NotImplementedException(); } - public void setTimestamp(int parameterIndex, java.sql.Timestamp x) - { + public void setTimestamp(int parameterIndex, java.sql.Timestamp x) { throw new NotImplementedException(); } - public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) - { + public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) { throw new NotImplementedException(); } /** * @deprecated */ - public void setUnicodeStream(int parameterIndex, InputStream x, int length) - { + public void setUnicodeStream(int parameterIndex, InputStream x, int length) { throw new NotImplementedException(); } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:51
|
Update of /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/apache/commons/httpclient In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/extensions/com/mockobjects/apache/commons/httpclient Modified Files: MockGetMethod.java MockHttpMethod.java Log Message: Lots of small changes to mocks Index: MockGetMethod.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/apache/commons/httpclient/MockGetMethod.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockGetMethod.java 9 May 2002 13:16:38 -0000 1.1 +++ MockGetMethod.java 19 Jun 2002 15:26:16 -0000 1.2 @@ -10,18 +10,16 @@ import com.mockobjects.util.AssertMo; import com.mockobjects.util.Verifier; -import com.mockobjects.ExpectationValue; -import com.mockobjects.Verifiable; -import com.mockobjects.ExpectationSet; -import com.mockobjects.MapEntry; +import com.mockobjects.*; public class MockGetMethod extends GetMethod implements Verifiable{ private ExpectationValue myFollowRedirects; // lazy initialise because of super constructor private ExpectationValue myPath = new ExpectationValue("path"); private ExpectationSet myPairs = new ExpectationSet("pairs"); - private int myStatusCode; + private ReturnObjectList myStatusCodes = new ReturnObjectList("status code"); private String myResponseBody; + private String myStatusText; public void setExpectedPath(String aPath){ myPath.setExpected(aPath); @@ -182,17 +180,20 @@ return null; } - public void setupGetStatusCode(int aStatusCode){ - myStatusCode = aStatusCode; + public void addGetStatusCode(int aStatusCode){ + myStatusCodes.addObjectToReturn(new Integer(aStatusCode)); } public int getStatusCode() { - return myStatusCode; + return ((Integer)myStatusCodes.nextReturnObject()).intValue(); + } + + public void setupGetStatusText(String aStatusText){ + myStatusText = aStatusText; } public String getStatusText() { - AssertMo.notImplemented(getClass().getName()); - return null; + return myStatusText; } public Header[] getResponseHeaders() { Index: MockHttpMethod.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/apache/commons/httpclient/MockHttpMethod.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockHttpMethod.java 9 May 2002 13:16:38 -0000 1.1 +++ MockHttpMethod.java 19 Jun 2002 15:26:16 -0000 1.2 @@ -1,136 +1,141 @@ package com.mockobjects.apache.commons.httpclient; -import com.mockobjects.*; -import org.apache.commons.httpclient.HttpMethod; +import com.mockobjects.MockObject; +import org.apache.commons.httpclient.*; + +import java.io.InputStream; +import java.io.IOException; public class MockHttpMethod extends MockObject implements HttpMethod { - public String getName(){ + + public String getName() { notImplemented(); return null; } - public void setPath(String path){ + public void setPath(String path) { notImplemented(); } - public String getPath(){ + public String getPath() { notImplemented(); return null; } - public void setStrictMode(boolean strictMode){ + public void setStrictMode(boolean strictMode) { notImplemented(); } - public boolean isStrictMode(){ + public boolean isStrictMode() { notImplemented(); return false; } - public void setRequestHeader(String name, String value){ + public void setRequestHeader(String name, String value) { notImplemented(); } - public void setRequestHeader(org.apache.commons.httpclient.Header header){ + public void setRequestHeader(Header header) { notImplemented(); } - public void addRequestHeader(String name, String value){ + public void addRequestHeader(String name, String value) { notImplemented(); } - public void addRequestHeader(org.apache.commons.httpclient.Header header){ + public void addRequestHeader(Header header) { notImplemented(); } - public org.apache.commons.httpclient.Header getRequestHeader(String name){ + public Header getRequestHeader(String name) { notImplemented(); return null; } - public void removeRequestHeader(String name){ + public void removeRequestHeader(String name) { notImplemented(); } - public boolean getFollowRedirects(){ + public boolean getFollowRedirects() { notImplemented(); return false; } - public void setFollowRedirects(boolean followRedirects){ + public void setFollowRedirects(boolean followRedirects) { notImplemented(); } - public void setQueryString(String queryString){ + public void setQueryString(String queryString) { notImplemented(); } - public void setQueryString(org.apache.commons.httpclient.NameValuePair[] - nameValuePair){ + public void setQueryString(NameValuePair[] + nameValuePair) { notImplemented(); } - public String getQueryString(){ + public String getQueryString() { notImplemented(); return null; } - public org.apache.commons.httpclient.Header getRequestHeaders()[]{ + public Header getRequestHeaders()[] { notImplemented(); return null; } - public boolean validate(){ + public boolean validate() { notImplemented(); return false; } - public int getStatusCode(){ + public int getStatusCode() { notImplemented(); return -1; } - public String getStatusText(){ + public String getStatusText() { notImplemented(); return null; } - public org.apache.commons.httpclient.Header getResponseHeaders()[]{ + public Header getResponseHeaders()[] { notImplemented(); return null; } - public org.apache.commons.httpclient.Header getResponseHeader(String name){ + public Header getResponseHeader(String name) { notImplemented(); return null; } - public byte getResponseBody()[]{ + public byte getResponseBody()[] { notImplemented(); return null; } - public String getResponseBodyAsString(){ + public String getResponseBodyAsString() { notImplemented(); return null; } - public java.io.InputStream getResponseBodyAsStream() throws java.io.IOException{ + public InputStream getResponseBodyAsStream() throws IOException { notImplemented(); return null; } - public boolean hasBeenUsed(){ + public boolean hasBeenUsed() { notImplemented(); return false; } - public int execute(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection connection) throws org.apache.commons.httpclient.HttpException, java.io.IOException{ + public int execute(HttpState state, HttpConnection connection) + throws HttpException, IOException { notImplemented(); return -1; } - public void recycle(){ + public void recycle() { notImplemented(); } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:30
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/com/mockobjects/sql Modified Files: MockConnection.java MockPreparedStatement.java MockResultSet.java MockSingleRowResultSet.java Log Message: Lots of small changes to mocks Index: MockConnection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockConnection.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockConnection.java 19 Jun 2002 15:26:25 -0000 1.2 @@ -1,16 +1,17 @@ package com.mockobjects.sql; -import java.sql.*; -import java.util.*; import com.mockobjects.*; +import java.sql.*; +import java.util.Map; + public class MockConnection extends MockObject implements Connection { private ExpectationCounter myCommitCalls = new ExpectationCounter("MockConnection.commit"); private ExpectationCounter myRollbackCalls = new ExpectationCounter("MockConnection.rollback"); private ExpectationCounter myCloseCalls = new ExpectationCounter("MockConnection.close"); private ExpectationCollection myPreparedStatementStrings = new ExpectationList("MockConnection.preparedStatementString"); - private ArrayList myPreparedStatements = new ArrayList(); + private ReturnObjectList myPreparedStatements = new ReturnObjectList("statements"); private SQLException myStatementException = null; private ExpectationCounter myCreateStatementCalls = new ExpectationCounter("MockConnection.createStatement"); @@ -21,10 +22,6 @@ private SQLException myIsClosedException; private SQLException myCloseException; - public MockConnection() { - super(); - } - public void setExpectedCloseCalls(int callCount) { myCloseCalls.setExpected(callCount); } @@ -46,7 +43,7 @@ } public void setupAddPreparedStatement(PreparedStatement prepared) { - myPreparedStatements.add(prepared); + myPreparedStatements.addObjectToReturn(prepared); } public void setupStatement(Statement statement) { @@ -60,12 +57,12 @@ public void clearWarnings() throws SQLException { } - public void setupCloseException(SQLException aCloseException){ + public void setupCloseException(SQLException aCloseException) { myCloseException = aCloseException; } public void close() throws SQLException { - if(myCloseException!=null){ + if(myCloseException != null) { throw myCloseException; } myCloseCalls.inc(); @@ -82,9 +79,9 @@ } public Statement createStatement( - int resultSetType, - int resultSetConcurrency) - throws SQLException { + int resultSetType, + int resultSetConcurrency) + throws SQLException { throw new UnsupportedOperationException(); } @@ -97,7 +94,7 @@ } public DatabaseMetaData getMetaData() - throws SQLException { + throws SQLException { throw new UnsupportedOperationException(); } @@ -113,16 +110,16 @@ throw new UnsupportedOperationException(); } - public void setupIsClosedException(SQLException aIsClosedException){ + public void setupIsClosedException(SQLException aIsClosedException) { myIsClosedException = aIsClosedException; } - public void setupIsClose(boolean aIsClosed){ + public void setupIsClose(boolean aIsClosed) { myIsClosed = aIsClosed; } public boolean isClosed() throws SQLException { - if(myIsClosedException!=null){ + if(myIsClosedException != null) { throw myIsClosedException; } return myIsClosed; @@ -137,29 +134,29 @@ } public CallableStatement prepareCall(String sql) - throws SQLException { + throws SQLException { throw new UnsupportedOperationException(); } public CallableStatement prepareCall( - String sql, - int resultSetType, - int resultSetConcurrency) - throws SQLException { + 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); + return (PreparedStatement) myPreparedStatements.nextReturnObject(); } public PreparedStatement prepareStatement( - String sql, - int resultSetType, - int resultSetConcurrency) - throws SQLException { + String sql, + int resultSetType, + int resultSetConcurrency) + throws SQLException { throw new UnsupportedOperationException(); } @@ -184,7 +181,7 @@ } public void setTransactionIsolation(int level) - throws SQLException { + throws SQLException { throw new UnsupportedOperationException(); } @@ -193,9 +190,8 @@ } private void throwStatementExceptionIfAny() throws SQLException { - if (null != myStatementException) { + if(null != myStatementException) { throw myStatementException; } } - -} +} \ No newline at end of file Index: MockPreparedStatement.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockPreparedStatement.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockPreparedStatement.java 19 Jun 2002 15:26:25 -0000 1.2 @@ -6,18 +6,24 @@ import java.math.BigDecimal; import com.mockobjects.*; -public class MockPreparedStatement extends MockStatement implements PreparedStatement { - private ExpectationSet mySetParameters = new ExpectationSet("MockPreparedStatement.setParameters"); - private ExpectationCounter myClearParametersCalls = new ExpectationCounter("MockPreparedStatement.clearParameters() calls"); +public class MockPreparedStatement extends MockStatement implements +PreparedStatement { + private ExpectationSet mySetParameters = + new ExpectationSet("MockPreparedStatement.setParameters"); + private ExpectationCounter myClearParametersCalls = + new ExpectationCounter("MockPreparedStatement.clearParameters() calls"); + private ExpectationSet myTargetSQLTypes = + new ExpectationSet("target sql types"); - public MockPreparedStatement() { - super(); - } public void addExpectedSetParameter(int parameterIndex, int intValue) { addExpectedSetParameter(parameterIndex, new Integer(intValue)); } + public void addExpectedTargetSQLType(int aTargetSQLType){ + myTargetSQLTypes.addExpected(new Integer(aTargetSQLType)); + } + public void addExpectedSetParameter(int parameterIndex, Object parameterValue) { mySetParameters.addExpected(new MapEntry(new Integer(parameterIndex), parameterValue)); } @@ -74,7 +80,7 @@ } public void addBatch() throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setNull(int param, int param1) throws SQLException { @@ -93,12 +99,14 @@ 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 anObject, int targetSqlType, int scale) throws SQLException { + notImplemented(); } - public void setObject(int param, Object obj, int targetSqlType) throws SQLException { - throw new UnsupportedOperationException(); + public void setObject(int param, Object anObject, int aTargetSQLType) + throws SQLException { + setObject(param, anObject); + myTargetSQLTypes.addActual(new Integer(aTargetSQLType)); } public void setRef(int param, Ref ref) throws SQLException { @@ -118,11 +126,11 @@ } public void setCharacterStream(int param, Reader reader, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setAsciiStream(int param, java.io.InputStream inputStream, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setDate(int param, Date date, Calendar calendar) throws SQLException { @@ -130,19 +138,19 @@ } public void setBinaryStream(int param, java.io.InputStream inputStream, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setUnicodeStream(int param, java.io.InputStream inputStream, int length) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setBytes(int param, byte[] values) throws SQLException { setObject(param, values); } - public void setObject(int param, Object obj) throws SQLException { - mySetParameters.addActual(new MapEntry(new Integer(param), obj)); + public void setObject(int param, Object anObject) throws SQLException { + mySetParameters.addActual(new MapEntry(new Integer(param), anObject)); } public void setByte(int param, byte aByte) throws SQLException { @@ -154,11 +162,12 @@ } public ResultSetMetaData getMetaData() throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); + return null; } public void setTimestamp(int param, Timestamp timestamp, Calendar calendar) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setTime(int param, Time time) throws SQLException { @@ -170,7 +179,7 @@ } public void setNull(int param, int param1, String typeName) throws SQLException { - throw new UnsupportedOperationException(); + notImplemented(); } public void setBigDecimal(int param, BigDecimal bigDecimal) throws SQLException { Index: MockResultSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockResultSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockResultSet.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockResultSet.java 19 Jun 2002 15:26:26 -0000 1.2 @@ -1,15 +1,15 @@ package com.mockobjects.sql; -import java.sql.*; -import java.sql.Date; -import java.util.*; -import java.math.BigDecimal; +import com.mockobjects.ExpectationCounter; +import com.mockobjects.MockObject; +import junit.framework.AssertionFailedError; + import java.io.InputStream; import java.io.Reader; - -import junit.framework.Assert; -import junit.framework.AssertionFailedError; -import com.mockobjects.*; +import java.math.BigDecimal; +import java.sql.*; +import java.util.Calendar; +import java.util.Map; /** * This is the base implementation of a mock result set. @@ -27,10 +27,6 @@ private ResultSetMetaData myMetaData; private Statement myStatement; - public MockResultSet() { - super(); - } - /** * Used as the base implementation for getting all types of object, * based on 1-based column index @@ -70,19 +66,19 @@ } public Array getArray(int i) throws SQLException { - return (Array)getObject(i); + return (Array) getObject(i); } public Array getArray(String colName) throws SQLException { - return (Array)getObject(colName); + return (Array) getObject(colName); } public InputStream getAsciiStream(int columnIndex) throws SQLException { - return (InputStream)getObject(columnIndex); + return (InputStream) getObject(columnIndex); } public InputStream getAsciiStream(String columnName) throws SQLException { - return (InputStream)getObject(columnName); + return (InputStream) getObject(columnName); } public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { @@ -90,87 +86,89 @@ } public BigDecimal getBigDecimal(int columnIndex) throws SQLException { - return (BigDecimal)getObject(columnIndex); + return (BigDecimal) getObject(columnIndex); } public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { - return (BigDecimal)getObject(columnIndex); + return (BigDecimal) getObject(columnIndex); } public BigDecimal getBigDecimal(String columnName) throws SQLException { - return (BigDecimal)getObject(columnName); + return (BigDecimal) getObject(columnName); } public InputStream getBinaryStream(int columnIndex) throws SQLException { - return (InputStream)getObject(columnIndex); + return (InputStream) getObject(columnIndex); } public InputStream getBinaryStream(String columnName) throws SQLException { - return (InputStream)getObject(columnName); + return (InputStream) getObject(columnName); } public Blob getBlob(int i) throws SQLException { - return (Blob)getObject(i); + return (Blob) getObject(i); } public Blob getBlob(String colName) throws SQLException { - return (Blob)getObject(colName); + return (Blob) getObject(colName); } public boolean getBoolean(int columnIndex) throws SQLException { - return ((Boolean)getObject(columnIndex)).booleanValue(); + return ((Boolean) getObject(columnIndex)).booleanValue(); } public boolean getBoolean(String columnName) throws SQLException { - return ((Boolean)getObject(columnName)).booleanValue(); + return ((Boolean) getObject(columnName)).booleanValue(); } public byte getByte(int columnIndex) throws SQLException { - return ((Byte)getObject(columnIndex)).byteValue(); + return ((Byte) getObject(columnIndex)).byteValue(); } public byte getByte(String columnName) throws SQLException { - return ((Byte)getObject(columnName)).byteValue(); + return ((Byte) getObject(columnName)).byteValue(); } public byte[] getBytes(int columnIndex) throws SQLException { - return (byte[])getObject(columnIndex); + return (byte[]) getObject(columnIndex); } public byte[] getBytes(String columnName) throws SQLException { - return (byte[])getObject(columnName); + return (byte[]) getObject(columnName); } public Reader getCharacterStream(int columnIndex) throws SQLException { - return (Reader)getObject(columnIndex); + return (Reader) getObject(columnIndex); } public Reader getCharacterStream(String columnName) throws SQLException { - return (Reader)getObject(columnName); + return (Reader) getObject(columnName); } public Clob getClob(int i) throws SQLException { - return (Clob)getObject(i); + return (Clob) getObject(i); } public Clob getClob(String colName) throws SQLException { - return (Clob)getObject(colName); + return (Clob) getObject(colName); } public String getCursorName() throws SQLException { - throw new AssertionFailedError("MockResultSet getCursorName not implemented"); + notImplemented(); + return null; } public int getConcurrency() throws SQLException { - throw new AssertionFailedError("MockResultSet getConcurrency not implemented"); + notImplemented(); + return 0; } public Date getDate(int columnIndex) throws SQLException { - return (Date)getObject(columnIndex); + return (Date) getObject(columnIndex); } public Date getDate(String columnName) throws SQLException { - return (Date)getObject(columnName); + return (Date) getObject(columnName); } public Date getDate(int columnIndex, Calendar cal) throws SQLException { @@ -182,27 +180,29 @@ } public double getDouble(int columnIndex) throws SQLException { - return ((Double)getObject(columnIndex)).doubleValue(); + return ((Double) getObject(columnIndex)).doubleValue(); } public double getDouble(String columnName) throws SQLException { - return ((Double)getObject(columnName)).doubleValue(); + return ((Double) getObject(columnName)).doubleValue(); } public int getFetchDirection() throws SQLException { - throw new AssertionFailedError("MockResultSet getFetchDirection not implemented"); + notImplemented(); + return 0; } public int getFetchSize() throws SQLException { - throw new AssertionFailedError("MockResultSet getFetchSize not implemented"); + notImplemented(); + return 0; } public float getFloat(int columnIndex) throws SQLException { - return ((Float)getObject(columnIndex)).floatValue(); + return ((Float) getObject(columnIndex)).floatValue(); } public float getFloat(String columnName) throws SQLException { - return ((Float)getObject(columnName)).floatValue(); + return ((Float) getObject(columnName)).floatValue(); } public int getInt(int columnIndex) throws SQLException { @@ -226,27 +226,29 @@ } public Object getObject(int i, Map map) throws SQLException { - throw new AssertionFailedError("MockResultSet getObject not implemented"); + notImplemented(); + return null; } public Object getObject(String colName, Map map) throws SQLException { - throw new AssertionFailedError("MockResultSet getObject not implemented"); + notImplemented(); + return null; } public Ref getRef(int i) throws SQLException { - return (Ref)getObject(i); + return (Ref) getObject(i); } public Ref getRef(String colName) throws SQLException { - return (Ref)getObject(colName); + return (Ref) getObject(colName); } public short getShort(String columnName) throws SQLException { - return ((Short)getObject(columnName)).shortValue(); + return ((Short) getObject(columnName)).shortValue(); } public short getShort(int columnIndex) throws SQLException { - return ((Short)getObject(columnIndex)).shortValue(); + return ((Short) getObject(columnIndex)).shortValue(); } public Statement getStatement() throws SQLException { @@ -254,19 +256,19 @@ } public String getString(int columnIndex) throws SQLException { - return (String)getObject(columnIndex); + return (String) getObject(columnIndex); } public String getString(String columnName) throws SQLException { - return (String)getObject(columnName); + return (String) getObject(columnName); } public Time getTime(int columnIndex) throws SQLException { - return (Time)getObject(columnIndex); + return (Time) getObject(columnIndex); } public Time getTime(String columnName) throws SQLException { - return (Time)getObject(columnName); + return (Time) getObject(columnName); } public Time getTime(int columnIndex, Calendar cal) throws SQLException { @@ -278,11 +280,11 @@ } public Timestamp getTimestamp(int columnIndex) throws SQLException { - return (Timestamp)getObject(columnIndex); + return (Timestamp) getObject(columnIndex); } public Timestamp getTimestamp(String columnName) throws SQLException { - return (Timestamp)getObject(columnName); + return (Timestamp) getObject(columnName); } public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { @@ -294,291 +296,307 @@ } public int getType() throws SQLException { - throw new AssertionFailedError("MockResultSet getType not implemented"); + notImplemented(); + return 0; } public InputStream getUnicodeStream(int columnIndex) throws SQLException { - return (InputStream)getObject(columnIndex); + return (InputStream) getObject(columnIndex); } public InputStream getUnicodeStream(String columnName) throws SQLException { - return (InputStream)getObject(columnName); + return (InputStream) getObject(columnName); } public SQLWarning getWarnings() throws SQLException { - throw new AssertionFailedError("MockResultSet getWarnings not implemented"); + notImplemented(); + return null; } public void clearWarnings() throws SQLException { - throw new AssertionFailedError("MockResultSet clearWarnings not implemented"); + notImplemented(); } public int findColumn(String columnName) throws SQLException { - throw new AssertionFailedError("MockResultSet findColumn not implemented"); + notImplemented(); + return 0; } public boolean isBeforeFirst() throws SQLException { - throw new AssertionFailedError("MockResultSet isBeforeFirst not implemented"); + notImplemented(); + return false; } public boolean isAfterLast() throws SQLException { - throw new AssertionFailedError("MockResultSet getFetchSize not implemented"); + notImplemented(); + return false; } public boolean isFirst() throws SQLException { - throw new AssertionFailedError("MockResultSet isFirst not implemented"); + notImplemented(); + return false; } public boolean isLast() throws SQLException { - throw new AssertionFailedError("MockResultSet isLast not implemented"); + notImplemented(); + return false; } public void beforeFirst() throws SQLException { - throw new AssertionFailedError("MockResultSet beforeFirst not implemented"); + notImplemented(); } public void afterLast() throws SQLException { - throw new AssertionFailedError("MockResultSet afterLast not implemented"); + notImplemented(); } public boolean first() throws SQLException { - throw new AssertionFailedError("MockResultSet first not implemented"); + notImplemented(); + return false; } public boolean last() throws SQLException { - throw new AssertionFailedError("MockResultSet last not implemented"); + notImplemented(); + return false; } public boolean absolute(int row) throws SQLException { - throw new AssertionFailedError("MockResultSet absolute not implemented"); + notImplemented(); + return false; } public boolean relative(int rows) throws SQLException { - throw new AssertionFailedError("MockResultSet relative not implemented"); + notImplemented(); + return false; } public boolean previous() throws SQLException { - throw new AssertionFailedError("MockResultSet previous not implemented"); + notImplemented(); + return false; } public void setFetchDirection(int direction) throws SQLException { - throw new AssertionFailedError("MockResultSet setFetchDirection not implemented"); + notImplemented(); } public void setFetchSize(int rows) throws SQLException { - throw new AssertionFailedError("MockResultSet setFetchSize not implemented"); + notImplemented(); } public boolean rowUpdated() throws SQLException { - throw new AssertionFailedError("MockResultSet rowUpdated not implemented"); + notImplemented(); + return false; } public boolean rowInserted() throws SQLException { - throw new AssertionFailedError("MockResultSet rowInserted not implemented"); + notImplemented(); + return false; } public boolean rowDeleted() throws SQLException { - throw new AssertionFailedError("MockResultSet rowDeleted not implemented"); + notImplemented(); + return false; } public void updateNull(int columnIndex) throws SQLException { - throw new AssertionFailedError("MockResultSet updateNull not implemented"); + notImplemented(); } public void updateBoolean(int columnIndex, boolean x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBoolean not implemented"); + notImplemented(); } public void updateByte(int columnIndex, byte x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateByte not implemented"); + notImplemented(); } public void updateShort(int columnIndex, short x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateShort not implemented"); + notImplemented(); } public void updateInt(int columnIndex, int x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateInt not implemented"); + notImplemented(); } public void updateLong(int columnIndex, long x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateLong not implemented"); + notImplemented(); } public void updateFloat(int columnIndex, float x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateFloat not implemented"); + notImplemented(); } public void updateDouble(int columnIndex, double x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDouble not implemented"); + notImplemented(); } public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBigDecimal not implemented"); + notImplemented(); } public void updateString(int columnIndex, String x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateString not implemented"); + notImplemented(); } public void updateBytes(int columnIndex, byte x[]) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBytes not implemented"); + notImplemented(); } public void updateDate(int columnIndex, Date x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDate not implemented"); + notImplemented(); } public void updateTime(int columnIndex, Time x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateTime not implemented"); + notImplemented(); } public void updateTimestamp(int columnIndex, Timestamp x) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateTimestamp not implemented"); + throws SQLException { + notImplemented(); } public void updateAsciiStream(int columnIndex, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateAsciiStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateBinaryStream(int columnIndex, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBinaryStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateCharacterStream(int columnIndex, - Reader x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateCharacterStream not implemented"); + Reader x, + int length) throws SQLException { + notImplemented(); } public void updateObject(int columnIndex, Object x, int scale) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + throws SQLException { + notImplemented(); } public void updateObject(int columnIndex, Object x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + notImplemented(); } public void updateNull(String columnName) throws SQLException { - throw new AssertionFailedError("MockResultSet updateNull not implemented"); + notImplemented(); } public void updateBoolean(String columnName, boolean x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBoolean not implemented"); + notImplemented(); } public void updateByte(String columnName, byte x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateByte not implemented"); + notImplemented(); } public void updateShort(String columnName, short x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateShort not implemented"); + notImplemented(); } public void updateInt(String columnName, int x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateInt not implemented"); + notImplemented(); } public void updateLong(String columnName, long x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateLong not implemented"); + notImplemented(); } public void updateFloat(String columnName, float x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateFloat not implemented"); + notImplemented(); } public void updateDouble(String columnName, double x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDouble not implemented"); + notImplemented(); } public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBigDecimal not implemented"); + notImplemented(); } public void updateString(String columnName, String x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateString not implemented"); + notImplemented(); } public void updateBytes(String columnName, byte x[]) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBytes not implemented"); + notImplemented(); } public void updateDate(String columnName, Date x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateDate not implemented"); + notImplemented(); } public void updateTime(String columnName, Time x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateTime not implemented"); + notImplemented(); } public void updateTimestamp(String columnName, Timestamp x) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateTimestamp not implemented"); + throws SQLException { + notImplemented(); } public void updateAsciiStream(String columnName, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateAsciiStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateBinaryStream(String columnName, - InputStream x, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateBinaryStream not implemented"); + InputStream x, + int length) throws SQLException { + notImplemented(); } public void updateCharacterStream(String columnName, - Reader reader, - int length) throws SQLException { - throw new AssertionFailedError("MockResultSet updateCharacterStream not implemented"); + Reader reader, + int length) throws SQLException { + notImplemented(); } public void updateObject(String columnName, Object x, int scale) - throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + throws SQLException { + notImplemented(); } public void updateObject(String columnName, Object x) throws SQLException { - throw new AssertionFailedError("MockResultSet updateObject not implemented"); + notImplemented(); } public void insertRow() throws SQLException { - throw new AssertionFailedError("MockResultSet insertRow not implemented"); + notImplemented(); } public void updateRow() throws SQLException { - throw new AssertionFailedError("MockResultSet updateRow not implemented"); + notImplemented(); } public void deleteRow() throws SQLException { - throw new AssertionFailedError("MockResultSet deleteRow not implemented"); + notImplemented(); } public void refreshRow() throws SQLException { - throw new AssertionFailedError("MockResultSet refreshRow not implemented"); + notImplemented(); } public void cancelRowUpdates() throws SQLException { - throw new AssertionFailedError("MockResultSet cancelRowUpdates not implemented"); + notImplemented(); } public void moveToInsertRow() throws SQLException { - throw new AssertionFailedError("MockResultSet moveToInsertRow not implemented"); + notImplemented(); } public void moveToCurrentRow() throws SQLException { - throw new AssertionFailedError("MockResultSet moveToCurrentRow not implemented"); + notImplemented(); } public boolean wasNull() throws SQLException { - throw new AssertionFailedError("MockResultSet wasNull not implemented"); + notImplemented(); + return false; } } Index: MockSingleRowResultSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockSingleRowResultSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockSingleRowResultSet.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockSingleRowResultSet.java 19 Jun 2002 15:26:26 -0000 1.2 @@ -16,22 +16,19 @@ private ExpectationSqlRow myRow = new ExpectationSqlRow("single row"); private int myNextCallCount = 0; - public MockSingleRowResultSet() { - super(); - } - public MockSingleRowResultSet(Object[] values) { - this(); addExpectedIndexedValues(values); } + public MockSingleRowResultSet(){ + super(); + } + public MockSingleRowResultSet(String[] names, Object[] values) { - this(); addExpectedNamedValues(names, values); } public MockSingleRowResultSet(Map map) { - this(); addExpectedNamedValues(map); } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:30
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/com/mockobjects/io Modified Files: MockFile.java Added Files: MockStreamFactory.java Log Message: Lots of small changes to mocks --- NEW FILE: MockStreamFactory.java --- package com.mockobjects.io; import alt.java.io.File; import alt.java.io.StreamFactory; import com.mockobjects.ExpectationValue; import com.mockobjects.MockObject; import java.io.FileNotFoundException; import java.io.InputStream; public class MockStreamFactory extends MockObject implements StreamFactory { private final ExpectationValue myFile = new ExpectationValue("file"); private InputStream myInputStream; public void setExpectedFile(File aFile) { myFile.setExpected(aFile); } public void setupInputStream(InputStream inputStream) { this.myInputStream = inputStream; } public InputStream createInputStream(File aFile) throws FileNotFoundException { myFile.setActual(aFile); return myInputStream; } } Index: MockFile.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockFile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockFile.java 7 May 2002 16:31:48 -0000 1.1 +++ MockFile.java 19 Jun 2002 15:26:24 -0000 1.2 @@ -15,6 +15,7 @@ private final ExpectationValue myFilenameFilter = new ExpectationValue("filename filter"); + private String myParent; private File[] myFilesToReturn; @@ -26,9 +27,12 @@ return null; } + public void setupGetParent(String aParent){ + myParent = aParent; + } + public String getParent() { - notImplemented(); - return null; + return myParent; } public File getParentFile() { |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/net In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/com/mockobjects/net Added Files: MockSocket.java MockSocketFactory.java Log Message: Lots of small changes to mocks --- NEW FILE: MockSocket.java --- package com.mockobjects.net; import alt.java.net.Socket; import com.mockobjects.ExpectationCounter; import com.mockobjects.ExpectationValue; import com.mockobjects.MockObject; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetAddress; import java.net.SocketException; public class MockSocket extends MockObject implements Socket { private final ExpectationValue mySoTimeout = new ExpectationValue("so timeout"); private InputStream myInputStream; private OutputStream myOutputStream; private final ExpectationCounter myCloseCalls = new ExpectationCounter("close calls"); public InetAddress getInetAddress() { notImplemented(); return null; } public InetAddress getLocalAddress() { notImplemented(); return null; } public int getPort() { notImplemented(); return 0; } public int getLocalPort() { notImplemented(); return 0; } public void setupGetInputStream(InputStream anInputStream) { myInputStream = anInputStream; } public InputStream getInputStream() throws IOException { return myInputStream; } public void setupGetOutputStream(OutputStream anOutputStream) { myOutputStream = anOutputStream; } public OutputStream getOutputStream() throws IOException { return myOutputStream; } public void setTcpNoDelay(boolean on) throws SocketException { notImplemented(); } public boolean getTcpNoDelay() throws SocketException { notImplemented(); return false; } public void setSoLinger(boolean on, int linger) throws SocketException { notImplemented(); } public int getSoLinger() throws SocketException { notImplemented(); return 0; } public void setExpectedSoTimeout(int aSoTimeout) { mySoTimeout.setExpected(aSoTimeout); } public void setSoTimeout(int aSoTimeout) throws SocketException { mySoTimeout.setActual(aSoTimeout); } public int getSoTimeout() throws SocketException { notImplemented(); return 0; } public void setSendBufferSize(int size) throws SocketException { notImplemented(); } public int getSendBufferSize() throws SocketException { notImplemented(); return 0; } public void setReceiveBufferSize(int size) throws SocketException { notImplemented(); } public int getReceiveBufferSize() throws SocketException { notImplemented(); return 0; } public void setKeepAlive(boolean on) throws SocketException { notImplemented(); } public boolean getKeepAlive() throws SocketException { notImplemented(); return false; } public void setExpectedCloseCalls(int aCount) { myCloseCalls.setExpected(aCount); } public void close() throws IOException { myCloseCalls.inc(); } public void shutdownInput() throws IOException { notImplemented(); } public void shutdownOutput() throws IOException { notImplemented(); } } --- NEW FILE: MockSocketFactory.java --- package com.mockobjects.net; import alt.java.net.SocketFactory; import alt.java.net.Socket; import com.mockobjects.MockObject; import com.mockobjects.ExpectationValue; public class MockSocketFactory extends MockObject implements SocketFactory{ private final ExpectationValue myHost = new ExpectationValue("host"); private final ExpectationValue myPort = new ExpectationValue("port"); private Socket mySocket; public void setupCreateSocket(Socket aSocket){ mySocket = aSocket; } public void setExpectedHost(String aHost){ myHost.setExpected(aHost); } public void setExpectedPort(String aPort){ myPort.setExpected(aPort); } public Socket createSocket(String aHost, int aPort) { myHost.setActual(aHost); myPort.setActual(aPort); return mySocket; } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/rmi In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/com/mockobjects/rmi Modified Files: MockNaming.java Log Message: Lots of small changes to mocks Index: MockNaming.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/rmi/MockNaming.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockNaming.java 30 Apr 2002 17:03:11 -0000 1.1 +++ MockNaming.java 19 Jun 2002 15:26:25 -0000 1.2 @@ -13,7 +13,7 @@ import alt.java.rmi.Naming; public class MockNaming extends MockObject implements Naming { - private final Vector myRemotes = new Vector(); + private final ReturnObjectList myRemotes = new ReturnObjectList("remotes"); private final ExpectationValue myName = new ExpectationValue("name"); public void bind(String name, Remote obj) throws AlreadyBoundException, @@ -23,7 +23,7 @@ } public void setupAddLookup(Remote aRemote){ - myRemotes.add(aRemote); + myRemotes.addObjectToReturn(aRemote); } public void setExpectedLookupName(String aName){ @@ -34,7 +34,7 @@ MalformedURLException, RemoteException { myName.setActual(name); - return (Remote)myRemotes.remove(0); + return (Remote)myRemotes.nextReturnObject(); } public void unbind(String name) throws RemoteException, @@ -54,9 +54,4 @@ return new String[0]; } - public void verify(){ - super.verify(); - AssertMo.assertEquals("Unclaimed remote objects in " + - getClass().getName(), 0, myRemotes.size()); - } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/net In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/alt/java/net Added Files: Socket.java SocketFactory.java SocketFactoryImpl.java SocketImpl.java Log Message: Lots of small changes to mocks --- NEW FILE: Socket.java --- package alt.java.net; import java.net.InetAddress; import java.net.SocketException; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; public interface Socket { InetAddress getInetAddress(); InetAddress getLocalAddress(); int getPort(); int getLocalPort(); InputStream getInputStream() throws IOException; OutputStream getOutputStream() throws IOException; void setTcpNoDelay(boolean on) throws SocketException; boolean getTcpNoDelay() throws SocketException; void setSoLinger(boolean on, int linger) throws SocketException; int getSoLinger() throws SocketException; void setSoTimeout(int timeout) throws SocketException; int getSoTimeout() throws SocketException; void setSendBufferSize(int size) throws SocketException; int getSendBufferSize() throws SocketException; void setReceiveBufferSize(int size) throws SocketException; int getReceiveBufferSize() throws SocketException; void setKeepAlive(boolean on) throws SocketException; boolean getKeepAlive() throws SocketException; void close() throws IOException; void shutdownInput() throws IOException; void shutdownOutput() throws IOException; } --- NEW FILE: SocketFactory.java --- package alt.java.net; import java.net.UnknownHostException; import java.io.IOException; public interface SocketFactory { Socket createSocket(String aHost, int aPort) throws UnknownHostException, IOException; } --- NEW FILE: SocketFactoryImpl.java --- package alt.java.net; import java.net.UnknownHostException; import java.io.IOException; public class SocketFactoryImpl implements SocketFactory { public Socket createSocket(String host, int port) throws UnknownHostException, IOException { return new SocketImpl(new java.net.Socket(host, port)); } } --- NEW FILE: SocketImpl.java --- package alt.java.net; import java.net.InetAddress; import java.net.SocketException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class SocketImpl implements Socket { private final java.net.Socket socket; public SocketImpl(java.net.Socket socket) { this.socket = socket; } public InetAddress getInetAddress() { return socket.getInetAddress(); } public InetAddress getLocalAddress() { return socket.getLocalAddress(); } public int getPort() { return socket.getPort(); } public int getLocalPort() { return socket.getLocalPort(); } public InputStream getInputStream() throws IOException { return socket.getInputStream(); } public OutputStream getOutputStream() throws IOException { return socket.getOutputStream(); } public void setTcpNoDelay(boolean on) throws SocketException { socket.setTcpNoDelay(on); } public boolean getTcpNoDelay() throws SocketException { return socket.getTcpNoDelay(); } public void setSoLinger(boolean on, int linger) throws SocketException { socket.setSoLinger(on, linger); } public int getSoLinger() throws SocketException { return socket.getSoLinger(); } public synchronized void setSoTimeout(int timeout) throws SocketException { socket.setSoTimeout(timeout); } public synchronized int getSoTimeout() throws SocketException { return socket.getSoTimeout(); } public synchronized void setSendBufferSize(int size) throws SocketException { socket.setSendBufferSize(size); } public synchronized int getSendBufferSize() throws SocketException { return socket.getSendBufferSize(); } public synchronized void setReceiveBufferSize(int size) throws SocketException { socket.setReceiveBufferSize(size); } public synchronized int getReceiveBufferSize() throws SocketException { return socket.getReceiveBufferSize(); } public void setKeepAlive(boolean on) throws SocketException { socket.setKeepAlive(on); } public boolean getKeepAlive() throws SocketException { return socket.getKeepAlive(); } public synchronized void close() throws IOException { socket.close(); } public void shutdownInput() throws IOException { socket.shutdownInput(); } public void shutdownOutput() throws IOException { socket.shutdownOutput(); } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:26:26
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/jdk/common/alt/java/io Added Files: StreamFactory.java StreamFactoryImpl.java Log Message: Lots of small changes to mocks --- NEW FILE: StreamFactory.java --- package alt.java.io; import java.io.FileNotFoundException; import java.io.InputStream; public interface StreamFactory { InputStream createInputStream(File aFile) throws FileNotFoundException; } --- NEW FILE: StreamFactoryImpl.java --- package alt.java.io; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; public class StreamFactoryImpl implements StreamFactory { public InputStream createInputStream(File aFile) throws FileNotFoundException { return new FileInputStream(aFile.getRealFile()); } } |
From: Jeff M. <cus...@us...> - 2002-06-19 15:11:03
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects In directory usw-pr-cvs1:/tmp/cvs-serv7626/com/mockobjects Modified Files: ReturnObjectList.java Log Message: Added support for booleans to ReturnObjectList Index: ReturnObjectList.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ReturnObjectList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReturnObjectList.java 23 Apr 2002 11:09:59 -0000 1.2 +++ ReturnObjectList.java 19 Jun 2002 15:11:00 -0000 1.3 @@ -38,6 +38,14 @@ } /** + * Add a next boolean to the end of the list. + * @param aBooleanToReturn boolean to be added to the list + */ + public void addObjectToReturn(boolean aBooleanToReturn){ + myObjects.add(new Boolean(aBooleanToReturn)); + } + + /** * Returns the next object from the list. Each object it returned in the * order in which they where added. */ |
From: Jeff M. <cus...@us...> - 2002-06-19 15:07:18
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/test In directory usw-pr-cvs1:/tmp/cvs-serv6355/com/mockobjects/test Modified Files: AllTests.java Log Message: Fixed AllTests to execute test no the test subject Index: AllTests.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/test/AllTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AllTests.java 19 May 2002 21:38:28 -0000 1.3 +++ AllTests.java 19 Jun 2002 15:07:11 -0000 1.4 @@ -61,7 +61,7 @@ } public static void addTestReturnObjectList(TestSuite suite) { - suite.addTestSuite(ReturnObjectList.class); + suite.addTestSuite(TestReturnObjectList.class); } public static void main(String[] args) { |
From: Jeff M. <cus...@us...> - 2002-06-10 14:06:23
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/net In directory usw-pr-cvs1:/tmp/cvs-serv30776/src/jdk/common/com/mockobjects/net Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/net added to the repository |
From: Jeff M. <cus...@us...> - 2002-06-10 14:06:23
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/net In directory usw-pr-cvs1:/tmp/cvs-serv30776/src/jdk/common/alt/java/net Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/net added to the repository |
From: Jeff M. <je...@mk...> - 2002-06-06 12:33:19
|
On Wed, 2002-06-05 at 23:15, Scott Lamb wrote: > On Wed, Jun 05, 2002 at 11:15:56AM +0100, Jeff Martin wrote: > > Probably the thing to do is inherit where possible from the common/1.3 > > mocks and implement any new methods using notImplemented(); apart from > > any that you may need to be fully mocked. > > Hmm, I was thinking more about the single copy in common implementing the > additional functionality. It wouldn't accomplish anything for JDK1.3 and > lower, but I don't think it would hurt anything either. Yes your absolutely right. > > I don't understand how inheriting from the others would work. Especially > inheriting 1.3 stuff from 1.4 - it compiles ${src.jdk.dir}/${jdk.version} > and ${src.jdk.dir}/common, so a build on 1.4 won't build the 1.3 dir. Again your right (I'm only using half a brain at the moment.) > > With the InterfaceImplementor stuff, this wasn't an issue for the > non-implemented stuff - it just used whatever JDK you are compiling against > to decide what stubs it needed. But of course, it didn't help for the more > interesting, manually-produced code. I didn't worry about this since I > didn't actually need to use any of the extra JDK 1.4 stuff in question, just > to made it compile. ;o) > > > The 1.3 stuff is probably still the code that is primarily used as most > > people won't have migrated to 1.4. (Least that's my experience) > > *nod* I guess I'm an early adopter. I particularly like a couple JDK 1.4 > features, like assertions. > Yeah there's some nice stuff in there, but the whole overriding the default XML parser stuff is uuch, and I've not been able to get it to run tomcat without stacktracing. So we're sticking to 1.3 a bit longer. > -- > Scott Lamb > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Scott L. <sl...@sl...> - 2002-06-05 22:16:34
|
On Wed, Jun 05, 2002 at 11:15:56AM +0100, Jeff Martin wrote: > Probably the thing to do is inherit where possible from the common/1.3 > mocks and implement any new methods using notImplemented(); apart from > any that you may need to be fully mocked. Hmm, I was thinking more about the single copy in common implementing the additional functionality. It wouldn't accomplish anything for JDK1.3 and lower, but I don't think it would hurt anything either. I don't understand how inheriting from the others would work. Especially inheriting 1.3 stuff from 1.4 - it compiles ${src.jdk.dir}/${jdk.version} and ${src.jdk.dir}/common, so a build on 1.4 won't build the 1.3 dir. With the InterfaceImplementor stuff, this wasn't an issue for the non-implemented stuff - it just used whatever JDK you are compiling against to decide what stubs it needed. But of course, it didn't help for the more interesting, manually-produced code. I didn't worry about this since I didn't actually need to use any of the extra JDK 1.4 stuff in question, just to made it compile. > The 1.3 stuff is probably still the code that is primarily used as most > people won't have migrated to 1.4. (Least that's my experience) *nod* I guess I'm an early adopter. I particularly like a couple JDK 1.4 features, like assertions. -- Scott Lamb |
From: Jeff M. <je...@mk...> - 2002-06-05 17:38:17
|
It's actually a lot easier than that. The build system currently tailors the build to each JDK. So as long as someone builds against the relavent JDK a jar will be produced that is appropriate. We just need to put some 1.4 specific code in the src/jdk/1.4 dir. On Wed, 2002-06-05 at 17:58, Trenton Lipscomb wrote: > > The 1.3 stuff is probably still the code that is > > primarily used as most people won't have migrated > > to 1.4. (Least that's my experience) > > Agreed. Our platform upgrade cycle is 6 - 9 months. Luckily, 1.4 was announced at the beginning, so it's being considered, but it'll be next year before we switch. > > As an alternative, so we can support both 1.3 and 1.4 developers, any mock that needs to be JDK-specific could be instantiated via a factory. The factory could look at the rev of JDK you're running and select the appropriate class accordingly. > > *trenton > > -----Original Message----- > From: Jeff Martin [mailto:je...@mk...] > Sent: Wednesday, June 05, 2002 3:16 AM > To: MockObjects > Subject: Re: [MO-java-dev] Compiling under JDK1.4? > > > On Mon, 2002-06-03 at 00:08, Scott Lamb wrote: > > When will mockobjects be able to compile under JDK 1.4? It does not now > > - the SQL stuff does not implement nearly all of the necessary interfaces. > > Sorry hadn't realized this was the case. > > > > > I had this working in April, but you didn't like my approach - > > automatically generating all the stuff that throws > > NotImplementedException, getting rid of a bunch of existing code in > > there as well as fixing this problem, at the expense of a slightly more > > complicated build.xml. > > > > What approach would you like? It would be easy to paste the generated > > code into the source files. As much as I don't like that way, it would > > work. And I really would like to see it working under 1.4. Keeping 1.3 > > around just for this is silly. > > > > Probably the thing to do is inherit where possible from the common/1.3 > mocks and implement any new methods using notImplemented(); apart from > any that you may need to be fully mocked. > > The 1.3 stuff is probably still the code that is primarily used as most > people won't have migrated to 1.4. (Least that's my experience) > > > > -- > > Scott Lamb > > > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > -- > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Trenton L. <Tre...@cn...> - 2002-06-05 16:59:01
|
> The 1.3 stuff is probably still the code that is > primarily used as most people won't have migrated > to 1.4. (Least that's my experience) Agreed. Our platform upgrade cycle is 6 - 9 months. Luckily, 1.4 was announced at the beginning, so it's being considered, but it'll be next year before we switch. As an alternative, so we can support both 1.3 and 1.4 developers, any mock that needs to be JDK-specific could be instantiated via a factory. The factory could look at the rev of JDK you're running and select the appropriate class accordingly. *trenton -----Original Message----- From: Jeff Martin [mailto:je...@mk...] Sent: Wednesday, June 05, 2002 3:16 AM To: MockObjects Subject: Re: [MO-java-dev] Compiling under JDK1.4? On Mon, 2002-06-03 at 00:08, Scott Lamb wrote: > When will mockobjects be able to compile under JDK 1.4? It does not now > - the SQL stuff does not implement nearly all of the necessary interfaces. Sorry hadn't realized this was the case. > > I had this working in April, but you didn't like my approach - > automatically generating all the stuff that throws > NotImplementedException, getting rid of a bunch of existing code in > there as well as fixing this problem, at the expense of a slightly more > complicated build.xml. > > What approach would you like? It would be easy to paste the generated > code into the source files. As much as I don't like that way, it would > work. And I really would like to see it working under 1.4. Keeping 1.3 > around just for this is silly. > Probably the thing to do is inherit where possible from the common/1.3 mocks and implement any new methods using notImplemented(); apart from any that you may need to be fully mocked. The 1.3 stuff is probably still the code that is primarily used as most people won't have migrated to 1.4. (Least that's my experience) > -- > Scott Lamb > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Jeff M. <je...@mk...> - 2002-06-05 10:19:36
|
On Mon, 2002-06-03 at 00:08, Scott Lamb wrote: > When will mockobjects be able to compile under JDK 1.4? It does not now > - the SQL stuff does not implement nearly all of the necessary interfaces. Sorry hadn't realized this was the case. > > I had this working in April, but you didn't like my approach - > automatically generating all the stuff that throws > NotImplementedException, getting rid of a bunch of existing code in > there as well as fixing this problem, at the expense of a slightly more > complicated build.xml. > > What approach would you like? It would be easy to paste the generated > code into the source files. As much as I don't like that way, it would > work. And I really would like to see it working under 1.4. Keeping 1.3 > around just for this is silly. > Probably the thing to do is inherit where possible from the common/1.3 mocks and implement any new methods using notImplemented(); apart from any that you may need to be fully mocked. The 1.3 stuff is probably still the code that is primarily used as most people won't have migrated to 1.4. (Least that's my experience) > -- > Scott Lamb > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Scott L. <sl...@sl...> - 2002-06-02 23:08:59
|
When will mockobjects be able to compile under JDK 1.4? It does not now - the SQL stuff does not implement nearly all of the necessary interfaces. I had this working in April, but you didn't like my approach - automatically generating all the stuff that throws NotImplementedException, getting rid of a bunch of existing code in there as well as fixing this problem, at the expense of a slightly more complicated build.xml. What approach would you like? It would be easy to paste the generated code into the source files. As much as I don't like that way, it would work. And I really would like to see it working under 1.4. Keeping 1.3 around just for this is silly. -- Scott Lamb |
From: Jeff M. <je...@mk...> - 2002-05-27 09:27:24
|
The idea is to try and separate the data which is used by the class your testing and the data created/manipulated by the class your testing. Also using a list lets you know more about what is actually happening if the get(String name) did a lookup to return a value you could make the call 1000 times instead of once an not know about it. If you provide a list you eventually run out of things in the list to return and the test fails. There is now a class called ReturnObjectList which formalizes this process ReturnObjectList list = new ReturnObjectList("a list of stuff"); ... list.addObjectToReturn(...); ... return list.nextObjectToReturn(); MockAttributes should be changed to use this. I'm happy to change it but since I'm in the middle of an office move committing it to cvs is a little convoluted. What should be done is to name the argument to get method an expected one. Actually I'll just attach the changes (not in diff format as I can't see cvs :( ). What needs to be done though is to On Wed, 2002-05-22 at 22:29, mark mascolino wrote: > > Hello all, > > I am relatively new to the world of Mock Objects and have come across your > implementation. I found a good reason to use the MockAttributes and > MockAttribute classes and found that the implementations are a bit limiting. > For example MockAttributes' get(String name) method does not use the name > parameter at all and returns the first item found in an ArrayList. It also > removes that item from ArrayList. > > I was wondering if this limited implementation was intended (based on some > Mock Object Philosophy that I am unaware of) or was just choosen because it > got the job done quickly. If it was the latter, I think I might be > interested in providing patches if people would find them useful. > > thanks in advance... > mark > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: <Vin...@ge...> - 2002-05-23 19:36:59
|
I don't know anything about the naming stuff, but you're welcome to send a patch to enhance the functionality of the mock. I think some guy somewhere will find the time to review it and apply it if it makes sense :-) Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > mark mascolino > Sent: Wednesday, May 22, 2002 5:30 PM > To: moc...@li... > Subject: [MO-java-dev] MockAttributes > > > > Hello all, > > I am relatively new to the world of Mock Objects and have > come across your > implementation. I found a good reason to use the MockAttributes and > MockAttribute classes and found that the implementations are > a bit limiting. > For example MockAttributes' get(String name) method does not > use the name > parameter at all and returns the first item found in an > ArrayList. It also > removes that item from ArrayList. > > I was wondering if this limited implementation was intended > (based on some > Mock Object Philosophy that I am unaware of) or was just > choosen because it > got the job done quickly. If it was the latter, I think I might be > interested in providing patches if people would find them useful. > > thanks in advance... > mark > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > |
From: mark m. <ma...@et...> - 2002-05-22 21:25:29
|
Hello all, I am relatively new to the world of Mock Objects and have come across your implementation. I found a good reason to use the MockAttributes and MockAttribute classes and found that the implementations are a bit limiting. For example MockAttributes' get(String name) method does not use the name parameter at all and returns the first item found in an ArrayList. It also removes that item from ArrayList. I was wondering if this limited implementation was intended (based on some Mock Object Philosophy that I am unaware of) or was just choosen because it got the job done quickly. If it was the latter, I think I might be interested in providing patches if people would find them useful. thanks in advance... mark |
From: Nat P. <np...@us...> - 2002-05-22 10:03:09
|
Update of /cvsroot/mockobjects/nat In directory usw-pr-cvs1:/tmp/cvs-serv29055 Log Message: Initial import of Nat Pryce's Mock libraries Status: Vendor Tag: nat-pryce Release Tags: import N nat/README N nat/jmock/source/com/b13media/mock/And.java N nat/jmock/source/com/b13media/mock/ExpectedCall.java N nat/jmock/source/com/b13media/mock/ExpectedReturn.java N nat/jmock/source/com/b13media/mock/ExpectedThrow.java N nat/jmock/source/com/b13media/mock/IsAnything.java N nat/jmock/source/com/b13media/mock/IsEqual.java N nat/jmock/source/com/b13media/mock/IsGreaterThan.java N nat/jmock/source/com/b13media/mock/IsInstanceOf.java N nat/jmock/source/com/b13media/mock/IsLessThan.java N nat/jmock/source/com/b13media/mock/IsNot.java N nat/jmock/source/com/b13media/mock/IsNull.java N nat/jmock/source/com/b13media/mock/IsSame.java N nat/jmock/source/com/b13media/mock/Mock.java N nat/jmock/source/com/b13media/mock/Or.java N nat/jmock/source/com/b13media/mock/P.java N nat/jmock/source/com/b13media/mock/Predicate.java N nat/jmock/test/SystemTestSuite.java N nat/jmock/test/com/b13media/mock/Test_Mock.java N nat/jmock/test/com/b13media/mock/Test_Predicates.java N nat/PythonMock/LICENSE.txt N nat/PythonMock/mock.py N nat/PythonMock/mock_test.py N nat/PythonMock/README.txt No conflicts created by this import ***** Bogus filespec: - Imported sources |