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: Steve F. <sm...@us...> - 2002-02-22 16:25:08
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/naming In directory usw-pr-cvs1:/tmp/cvs-serv13797/com/mockobjects/naming Added Files: MockContext.java Log Message: Setup files common to all j2ee versions --- NEW FILE: MockContext.java --- package com.mockobjects.naming; import javax.naming.*; import com.mockobjects.*; public class MockContext extends MockObject implements Context{ private Object myObjectToReturn; private ExpectationValue myBindName = new ExpectationValue( MockContext.class.getName() + "myBindName"); private ExpectationValue myBindObject = new ExpectationValue( MockContext.class.getName() + "myBindObject"); private ExpectationValue myRebindName = new ExpectationValue( MockContext.class.getName() + "myRebindName"); private ExpectationValue myLookupName = new ExpectationValue( MockContext.class.getName() + "myLookupName"); public void setupLookup(Object aObjectToReturn){ this.myObjectToReturn = aObjectToReturn; } public void setExpectedLookupName(String aLookupName){ this.myLookupName.setExpected(aLookupName); } public Object lookup(Name name) throws NamingException{ this.myLookupName.setActual(name); return myObjectToReturn; } public Object lookup(String name) throws NamingException{ this.myLookupName.setActual(name); return myObjectToReturn; } public void bind(Name aBindName, Object aBindObject) throws NamingException{ this.myBindName.setExpected(aBindName); this.myBindObject.setExpected(aBindObject); } public void setExpectedBind(String aBindName, Object aBindObject){ this.myBindName.setExpected(aBindName); this.myBindObject.setExpected(aBindObject); } public void setExpectedReBind(String aBindName, Object aBindObject){ this.myRebindName.setExpected(aBindName); this.myRebindName.setExpected(aBindObject); } public void bind(String aBindName, Object aBindObject) throws NamingException{ this.myBindName.setActual(aBindName); this.myBindObject.setActual(aBindObject); } public void rebind(Name aBindName, Object aBindObject) throws NamingException{ this.myRebindName.setActual(aBindName); this.myRebindName.setActual(aBindObject); } public void rebind(String aBindName, Object aBindObject) throws NamingException{ this.myRebindName.setActual(aBindName); this.myRebindName.setActual(aBindObject); } public void unbind(Name name) throws NamingException{ notImplemented(); } public void unbind(String name) throws NamingException{ notImplemented(); } public void rename(Name name, Name name2) throws NamingException{ notImplemented(); } public void rename(String name, String name2) throws NamingException{ notImplemented(); } public NamingEnumeration list(Name name) throws NamingException{ notImplemented(); return null; } public NamingEnumeration list(String name) throws NamingException{ notImplemented(); return null; } public NamingEnumeration listBindings(Name name) throws NamingException{ notImplemented(); return null; } public NamingEnumeration listBindings(String name) throws NamingException{ notImplemented(); return null; } public void destroySubcontext(Name name) throws NamingException{ notImplemented(); } public void destroySubcontext(String name) throws NamingException{ notImplemented(); } public Context createSubcontext(Name name) throws NamingException{ notImplemented(); return null; } public Context createSubcontext(String name) throws NamingException{ notImplemented(); return null; } public Object lookupLink(Name name) throws NamingException{ notImplemented(); return null; } public Object lookupLink(String name) throws NamingException{ notImplemented(); return null; } public NameParser getNameParser(Name name) throws NamingException{ notImplemented(); return null; } public NameParser getNameParser(String name) throws NamingException{ notImplemented(); return null; } public Name composeName(Name name, Name name2) throws NamingException{ notImplemented(); return null; } public String composeName(String name, String name2) throws NamingException{ notImplemented(); return null; } public Object addToEnvironment(String name, Object object) throws NamingException{ notImplemented(); return null; } public Object removeFromEnvironment(String name) throws NamingException{ notImplemented(); return null; } public java.util.Hashtable getEnvironment() throws NamingException{ notImplemented(); return null; } public void close() throws NamingException{ notImplemented(); } public String getNameInNamespace() throws NamingException{ notImplemented(); return null; } } |
From: Steve F. <sm...@us...> - 2002-02-22 16:13:46
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects In directory usw-pr-cvs1:/tmp/cvs-serv8246/mockobjects Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects added to the repository |
From: Steve F. <sm...@us...> - 2002-02-22 16:07:33
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com In directory usw-pr-cvs1:/tmp/cvs-serv5660/com Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com added to the repository |
From: Steve F. <sm...@us...> - 2002-02-22 15:59:33
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3 In directory usw-pr-cvs1:/tmp/cvs-serv2977/1.3 Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3 added to the repository |
From: Steve F. <sm...@us...> - 2002-02-22 15:57:46
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.2 In directory usw-pr-cvs1:/tmp/cvs-serv2442/1.2 Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.2 added to the repository |
From: Steve F. <sm...@us...> - 2002-02-22 15:57:03
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1_2 In directory usw-pr-cvs1:/tmp/cvs-serv2261/1_2 Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/1_2 added to the repository |
From: Steve F. <sm...@us...> - 2002-02-22 15:56:19
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common In directory usw-pr-cvs1:/tmp/cvs-serv2030/common Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/common added to the repository |
From: Steve F. <sm...@us...> - 2002-02-22 15:47:15
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/servlet In directory usw-pr-cvs1:/tmp/cvs-serv31670 Modified Files: MockHttpServletRequest.java Log Message: removed some tautologous comments Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockHttpServletRequest.java 4 Feb 2002 10:42:53 -0000 1.2 +++ MockHttpServletRequest.java 22 Feb 2002 15:47:12 -0000 1.3 @@ -43,127 +43,75 @@ setupAddParameter(paramName, value); } - /** - * getAttribute method comment. - */ public Object getAttribute(String arg1) { return null; } - /** - * getAttributeNames method comment. - */ public java.util.Enumeration getAttributeNames() { return null; } - /** - * getAuthType method comment. - */ public String getAuthType() { return null; } - /** - * getCharacterEncoding method comment. - */ public String getCharacterEncoding() { return null; } - /** - * getContentLength method comment. - */ public int getContentLength() { return 0; } - /** - * getContentType method comment. - */ public String getContentType() { return null; } - /** - * getContentType method comment. - */ + public void setContentType(String contentType) { this.contentType = contentType; } - /** - * getContextPath method comment. - */ + public java.lang.String getContextPath() { return null; } - /** - * getCookies method comment. - */ public javax.servlet.http.Cookie[] getCookies() { return null; } - /** - * getDateHeader method comment. - */ public long getDateHeader(String arg1) { return 0; } - /** - * getHeader method comment. - */ public String getHeader(String arg1) { return null; } - /** - * getHeaderNames method comment. - */ public java.util.Enumeration getHeaderNames() { return null; } - /** - * getHeaders method comment. - */ public java.util.Enumeration getHeaders(java.lang.String arg1) { return null; } - /** - * getInputStream method comment. - */ public javax.servlet.ServletInputStream getInputStream() throws java.io.IOException { return null; } - /** - * getIntHeader method comment. - */ public int getIntHeader(String arg1) { return 0; } - /** - * getLocale method comment. - */ public java.util.Locale getLocale() { return null; } - /** - * getLocales method comment. - */ public java.util.Enumeration getLocales() { return null; } - /** - * getMethod method comment. - */ public String getMethod() { return null; } @@ -188,37 +136,22 @@ return myPathInfo; } - /** - * getPathTranslated method comment. - */ public String getPathTranslated() { return null; } - /** - * getProtocol method comment. - */ public String getProtocol() { return null; } - /** - * getQueryString method comment. - */ public String getQueryString() { return null; } - /** - * getReader method comment. - */ public java.io.BufferedReader getReader() throws java.io.IOException { return null; } - /** - * getRealPath method comment. - */ public String getRealPath(String arg1) { return null; } @@ -227,80 +160,47 @@ this.remoteAddress = remoteAddress; } - /** - * getRemoteAddr method comment. - */ public String getRemoteAddr() { return remoteAddress; } - /** - * getRemoteHost method comment. - */ public String getRemoteHost() { return null; } - /** - * getRemoteUser method comment. - */ public String getRemoteUser() { return null; } - /** - * getRequestDispatcher method comment. - */ public javax.servlet.RequestDispatcher getRequestDispatcher( java.lang.String arg1) { return null; } - /** - * getRequestedSessionId method comment. - */ public String getRequestedSessionId() { return null; } - /** - * getRequestURI method comment. - */ public String getRequestURI() { return null; } - /** - * getScheme method comment. - */ public String getScheme() { return null; } - /** - * getServerName method comment. - */ public String getServerName() { return null; } - /** - * getServerPort method comment. - */ public int getServerPort() { return 0; } - /** - * getServletPath method comment. - */ public String getServletPath() { return null; } - /** - * getSession method comment. - */ public HttpSession getSession() { return httpSession; } @@ -309,9 +209,6 @@ this.httpSession = httpSession; } - /** - * getSession method comment. - */ public HttpSession getSession(boolean arg1) { return null; } @@ -320,58 +217,34 @@ this.userPrincipal = userPrincipal; } - /** - * getUserPrincipal method comment. - */ public java.security.Principal getUserPrincipal() { return userPrincipal; } - /** - * isRequestedSessionIdFromCookie method comment. - */ public boolean isRequestedSessionIdFromCookie() { return false; } - /** - * isRequestedSessionIdFromUrl method comment. - */ public boolean isRequestedSessionIdFromUrl() { return false; } - /** - * isRequestedSessionIdFromURL method comment. - */ public boolean isRequestedSessionIdFromURL() { return false; } - /** - * isRequestedSessionIdValid method comment. - */ public boolean isRequestedSessionIdValid() { return false; } - /** - * isSecure method comment. - */ public boolean isSecure() { return false; } - /** - * isUserInRole method comment. - */ public boolean isUserInRole(java.lang.String arg1) { return false; } - /** - * removeAttribute method comment. - */ public void removeAttribute(java.lang.String arg1) { } @@ -381,9 +254,6 @@ new MapEntry(attributeName, attributeValue)); } - /** - * setAttribute method comment. - */ public void setAttribute(String attributeName, Object attributeValue) { mySetAttributes.addActual( new MapEntry(attributeName, attributeValue)); @@ -420,4 +290,3 @@ return null; } } - |
From: Steve F. <sm...@us...> - 2002-02-22 10:28:48
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/util In directory usw-pr-cvs1:/tmp/cvs-serv31794/src/core/com/mockobjects/util Modified Files: Null.java Log Message: Fixed missing hashCode in Null object Index: Null.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/util/Null.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Null.java 29 Jul 2001 19:50:24 -0000 1.1 +++ Null.java 22 Feb 2002 10:28:44 -0000 1.2 @@ -4,7 +4,7 @@ final private String myDescription; public Null() { - this("null"); + this("Null"); } public Null(String description) { @@ -14,6 +14,10 @@ public boolean equals(Object other) { return other instanceof Null; + } + + public int hashCode() { + return "Null".hashCode(); } public String toString() { |
From: Steve F. <sm...@us...> - 2002-02-22 10:28:48
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/test In directory usw-pr-cvs1:/tmp/cvs-serv31794/src/core/com/mockobjects/test Modified Files: AllTests.java Added Files: TestNull.java Log Message: Fixed missing hashCode in Null object --- NEW FILE: TestNull.java --- package com.mockobjects.test; import java.util.*; import junit.framework.*; import com.mockobjects.*; import com.mockobjects.util.*; /** * JUnit test case for TestMapEntry */ public class TestNull extends TestCaseMo { public TestNull(String name) { super(name); } public static void main(String[] args) { start(new String[] { TestNull.class.getName()}); } public static Test suite() { return new TestSuite(TestNull.class); } public void testEquals() { assertEquals("Should be same value", new Null(), new Null()); assertEquals("Should be same hashCode", new Null().hashCode(), new Null().hashCode()); assertEquals("Should be same value", new Null("one"), new Null("two")); assertEquals("Should be same hashCode", new Null("one").hashCode(), new Null("two").hashCode()); } public void testDescription() { assertEquals("Description", "what it is", new Null("what it is").toString()); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/test/AllTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AllTests.java 29 Jul 2001 19:50:24 -0000 1.1 +++ AllTests.java 22 Feb 2002 10:28:44 -0000 1.2 @@ -46,6 +46,10 @@ suite.addTest(TestMapEntry.suite()); } + public static void addTestNull(TestSuite suite) { + suite.addTestSuite(TestNull.class); + } + public static void addTestVerifier(TestSuite suite) { suite.addTest(TestVerifier.suite()); } |
From: Jeff M. <cus...@us...> - 2002-02-09 14:48:36
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/naming/directory In directory usw-pr-cvs1:/tmp/cvs-serv5423/src/core/com/mockobjects/naming/directory Modified Files: MockDirContext.java Log Message: Changed references to myName to aName Index: MockDirContext.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/naming/directory/MockDirContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockDirContext.java 28 Jan 2002 17:43:43 -0000 1.1 +++ MockDirContext.java 9 Feb 2002 14:48:33 -0000 1.2 @@ -34,16 +34,16 @@ } public Attributes getAttributes(Name aName) throws NamingException{ - return getAttributes(myName.toString()); + return getAttributes(aName.toString()); } public Attributes getAttributes(String aName) throws NamingException{ - return getAttributes(myName, null); + return getAttributes(aName, null); } public Attributes getAttributes(Name aName, String[] attrIds) throws NamingException{ - return getAttributes(myName.toString(), attrIds); + return getAttributes(aName.toString(), attrIds); } public Attributes getAttributes(String aName, String[] attrIds) @@ -64,7 +64,7 @@ public void modifyAttributes(Name aName, int aModificationOperation, Attributes attributes) throws NamingException{ - modifyAttributes(myName.toString(), aModificationOperation, attributes); + modifyAttributes(aName.toString(), aModificationOperation, attributes); } public void modifyAttributes(String aName, int aModificationOperation, |
From: Jeff M. <cus...@us...> - 2002-02-09 14:47:36
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/naming In directory usw-pr-cvs1:/tmp/cvs-serv5235/src/core/com/mockobjects/naming Modified Files: MockContext.java Log Message: Change reference to myName to aName Index: MockContext.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/naming/MockContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockContext.java 28 Jan 2002 17:43:43 -0000 1.1 +++ MockContext.java 9 Feb 2002 14:47:31 -0000 1.2 @@ -11,8 +11,6 @@ MockContext.class.getName() + "myBindObject"); private ExpectationValue myRebindName = new ExpectationValue( MockContext.class.getName() + "myRebindName"); - private ExpectationValue myRebindName = new ExpectationValue( - MockContext.class.getName() + "myRebindName"); private ExpectationValue myLookupName = new ExpectationValue( MockContext.class.getName() + "myLookupName"); |
From: Jeff M. <je...@cu...> - 2002-02-04 18:02:36
|
On Mon, 2002-02-04 at 15:52, Steve Freeman wrote: > From: "Jeff Martin" <je...@cu...> > > I've completed adding my local changes to the source code. This mostly > > consists of new classes in the servlet and jms packages. > > > > I've checked in these changes under the j2ee directory rather than the > > j2ee12 dir because I didn't want to end up with three different versions > > of these packages. The old jms and servlet packages still need to be > > deleted from the core directory but I thought I'd make sure everyone > > agrees that these are now dead and need to be buried. > Are the src/core/com/mockobjects ones dead as this seems to be the first stage moving the objects out of core in to j2ee (as a starting point). The other thing is the jdk packages. Is moving these to a proper place more important than the arrangement of the j2ee packages? > We need to think about how we're going to do this. We can have a common > directory for files that are shared across versions. If we don't have a > versioned j2ee directory, how are we going to support 1.2 and 1.3 in > parallel? > Always a pain trying to do this. Do we actually need to support 1.2 at the moment as it would simplify things to just start with 1.3 and worry about 1.4 when it arrives? > > I've also changed the build file so that it now compiles from the j2ee > > dir rather than the core. There are still probably more changes to be > > made to this especially when the j2ee gets seperated out into versioned > > directories. > > good, thanks. Maybe I should give up the branch and we can do it > incrementally? That's supposed to be the XP way. > > Steve > > > -- Jeff Martin Memetic Engineer http://www.custommonkey.org/ |
From: Steve F. <st...@m3...> - 2002-02-04 16:15:12
|
From: "Jeff Martin" <je...@cu...> > I've completed adding my local changes to the source code. This mostly > consists of new classes in the servlet and jms packages. > > I've checked in these changes under the j2ee directory rather than the > j2ee12 dir because I didn't want to end up with three different versions > of these packages. The old jms and servlet packages still need to be > deleted from the core directory but I thought I'd make sure everyone > agrees that these are now dead and need to be buried. We need to think about how we're going to do this. We can have a common directory for files that are shared across versions. If we don't have a versioned j2ee directory, how are we going to support 1.2 and 1.3 in parallel? > I've also changed the build file so that it now compiles from the j2ee > dir rather than the core. There are still probably more changes to be > made to this especially when the j2ee gets seperated out into versioned > directories. good, thanks. Maybe I should give up the branch and we can do it incrementally? That's supposed to be the XP way. Steve |
From: Jeff M. <je...@cu...> - 2002-02-04 11:39:21
|
I've completed adding my local changes to the source code. This mostly consists of new classes in the servlet and jms packages. I've checked in these changes under the j2ee directory rather than the j2ee12 dir because I didn't want to end up with three different versions of these packages. The old jms and servlet packages still need to be deleted from the core directory but I thought I'd make sure everyone agrees that these are now dead and need to be buried. I've also changed the build file so that it now compiles from the j2ee dir rather than the core. There are still probably more changes to be made to this especially when the j2ee gets seperated out into versioned directories. -- Jeff Martin Memetic Engineer http://www.custommonkey.org/ |
From: Jeff M. <cus...@us...> - 2002-02-04 11:32:33
|
Update of /cvsroot/mockobjects/mockobjects-java In directory usw-pr-cvs1:/tmp/cvs-serv16683 Modified Files: build.xml Log Message: Changed compile target to use files from j2ee dir Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/build.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- build.xml 2002/01/09 15:08:00 1.16 +++ build.xml 2002/02/04 11:32:30 1.17 @@ -63,6 +63,7 @@ <property name="src.core.dir" value="${src.dir}/core"/> <property name="src.examples.dir" value="${src.dir}/examples"/> <property name="src.extensions.dir" value="${src.dir}/extensions"/> + <property name="src.j2ee.dir" value="${src.dir}/j2ee"/> <property name="conf.dir" value="conf"/> <property name="doc.dir" value="doc"/> <property name="xdoc.dir" value="${doc.dir}/xdocs"/> @@ -241,24 +242,13 @@ <!-- Run the java compilation --> <target name="compile" depends="prepare-compile"> - <javac srcdir="${out.src.dir}" + <javac destdir="${out.classes.dir}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"> - - <!-- Exclude all files that are not .java source files --> - - <!-- All doc files --> - <exclude name="**/package.html"/> - <exclude name="**/overview.html"/> - - <!-- All conf files (including test files) --> - <exclude name="**/*.txt"/> - <exclude name="**/*.xml"/> - <exclude name="**/*.properties"/> - - <!-- Exclude all java files for which no library is present --> + <src path="${src.core.dir}" /> + <src path="${src.j2ee.dir}" /> <exclude name="${package.prefix}/servlet/**" unless="servlet.present"/> <exclude name="${package.prefix}/jms/**" unless="jms.present"/> |
From: Jeff M. <cus...@us...> - 2002-02-04 11:28:58
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/jms In directory usw-pr-cvs1:/tmp/cvs-serv15879 Modified Files: MockConnection.java MockMessageConsumer.java MockSession.java Added Files: MockMessagePublisher.java MockObjectMessage.java MockTopic.java MockTopicConnection.java MockTopicConnectionFactory.java MockTopicPublisher.java MockTopicSession.java MockTopicSubscriber.java Log Message: Added new mocks for jms Topic classes --- NEW FILE: MockMessagePublisher.java --- package com.mockobjects.jms; import com.mockobjects.*; import javax.jms.*; public class MockMessagePublisher extends MockObject implements MessageProducer{ public void close() throws JMSException{ notYetImplemented(); } public int getDeliveryMode() throws JMSException{ notYetImplemented(); return -1; } public boolean getDisableMessageID() throws JMSException{ notYetImplemented(); return false; } public boolean getDisableMessageTimestamp() throws JMSException{ notYetImplemented(); return false; } public int getPriority() throws JMSException{ notYetImplemented(); return -1; } public long getTimeToLive() throws JMSException{ notYetImplemented(); return -1; } public void setDeliveryMode(int deliveryMode) throws JMSException{ notYetImplemented(); } public void setDisableMessageID(boolean disableMessageId) throws JMSException{ notYetImplemented(); } public void setDisableMessageTimestamp(boolean disableMessageTimeStamp) throws JMSException{ notYetImplemented(); } public void setPriority(int priority) throws JMSException{ notYetImplemented(); } public void setTimeToLive(long timeToLive) throws JMSException{ notYetImplemented(); } } --- NEW FILE: MockObjectMessage.java --- package com.mockobjects.jms; import java.io.*; import javax.jms.*; public class MockObjectMessage extends MockMessage implements ObjectMessage{ private Serializable objectToReturn; public void setupGetObject(Serializable objectToReturn){ this.objectToReturn = objectToReturn; } public Serializable getObject() throws JMSException{ return objectToReturn; } public void setObject(Serializable serialisable) throws JMSException{ } } --- NEW FILE: MockTopic.java --- package com.mockobjects.jms; import com.mockobjects.*; import javax.jms.*; public class MockTopic extends MockObject implements Topic{ public String getTopicName() throws JMSException{ notYetImplemented(); return null; } } --- NEW FILE: MockTopicConnection.java --- package com.mockobjects.jms; import com.mockobjects.*; import javax.jms.*; public class MockTopicConnection extends MockConnection implements TopicConnection{ private TopicSession topicSessionToReturn; public void setupCreateTopicSession(TopicSession topicSessionToReturn){ this.topicSessionToReturn = topicSessionToReturn; } public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException{ notYetImplemented(); return null; } public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException{ notYetImplemented(); return null; } public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException{ return topicSessionToReturn; } } --- NEW FILE: MockTopicConnectionFactory.java --- package com.mockobjects.jms; import com.mockobjects.*; import javax.jms.*; public class MockTopicConnectionFactory extends MockObject implements TopicConnectionFactory{ private TopicConnection topicConnectionToReturn; public void setupCreateTopicConnection( TopicConnection topicConnectionToReturn){ this.topicConnectionToReturn = topicConnectionToReturn; } public TopicConnection createTopicConnection() throws JMSException{ return topicConnectionToReturn; } public TopicConnection createTopicConnection(String userName, String password) throws JMSException{ return topicConnectionToReturn; } } --- NEW FILE: MockTopicPublisher.java --- package com.mockobjects.jms; import javax.jms.*; import com.mockobjects.*; public class MockTopicPublisher extends MockMessagePublisher implements TopicPublisher{ private ExpectationValue message = new ExpectationValue("message"); public void setExpectedMessage(Message message){ this.message.setExpected(message); } public Topic getTopic() throws JMSException{ notYetImplemented(); return null; } public void publish(Message message) throws JMSException{ this.message.setActual(message); } public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException{ this.message.setActual(message); } public void publish(Topic topic, Message message) throws JMSException{ this.message.setActual(message); } public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException{ this.message.setActual(message); } } --- NEW FILE: MockTopicSession.java --- package com.mockobjects.jms; import com.mockobjects.*; import javax.jms.*; public class MockTopicSession extends MockSession implements TopicSession{ private Topic topicToReturn; private ExpectationValue topicName = new ExpectationValue("topicName"); private ExpectationCounter createTopicCalls = new ExpectationCounter("createTopicCalls"); private TopicPublisher topicPublisherToReturn; private TopicSubscriber topicSubscriberToReturn; public void setupCreateTopic(Topic topicToReturn){ this.topicToReturn = topicToReturn; } public void setExpectedTopicName(String topicName){ this.topicName.setExpected(topicName); } public void setupCreateTopicCalls(int createTopicCalls){ this.createTopicCalls.setExpected(createTopicCalls); } public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException{ notYetImplemented(); return null; } public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messsageSelecter, boolean noLocal) throws JMSException{ notYetImplemented(); return null; } public void setupCreatePublisher(TopicPublisher topicPublisherToReturn){ this.topicPublisherToReturn = topicPublisherToReturn; } public TopicPublisher createPublisher(Topic topic) throws JMSException{ return topicPublisherToReturn; } public void setupTopicSubscriber(TopicSubscriber topicSubscriberToReturn){ this.topicSubscriberToReturn = topicSubscriberToReturn; } public TopicSubscriber createSubscriber(Topic topic) throws JMSException{ return topicSubscriberToReturn; } public TopicSubscriber createSubscriber(Topic topic, String messsageSelecter, boolean noLocal) throws JMSException{ return topicSubscriberToReturn; } public TemporaryTopic createTemporaryTopic() throws JMSException{ notYetImplemented(); return null; } public Topic createTopic(String topicName) throws JMSException{ this.topicName.setActual(topicName); this.createTopicCalls.inc(); return topicToReturn; } public void unsubscribe(String topicName) throws JMSException{ notYetImplemented(); } } --- NEW FILE: MockTopicSubscriber.java --- package com.mockobjects.jms; import javax.jms.*; import com.mockobjects.*; public class MockTopicSubscriber extends MockMessageConsumer implements TopicSubscriber{ public boolean getNoLocal() throws JMSException{ notYetImplemented(); return false; } public Topic getTopic() throws JMSException{ notYetImplemented(); return null; } } Index: MockConnection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/jms/MockConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockConnection.java 2001/11/22 00:05:41 1.1 +++ MockConnection.java 2002/02/04 11:28:55 1.2 @@ -77,4 +77,4 @@ throw myException; } } -} \ No newline at end of file +} Index: MockMessageConsumer.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/jms/MockMessageConsumer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockMessageConsumer.java 2001/11/22 00:05:41 1.1 +++ MockMessageConsumer.java 2002/02/04 11:28:55 1.2 @@ -3,91 +3,97 @@ import com.mockobjects.*; import javax.jms.*; -public abstract class MockMessageConsumer extends MockObject implements MessageConsumer { +public class MockMessageConsumer extends MockObject implements MessageConsumer{ + private Message myMessage; + private boolean myExpiresOnTimeout = false; + private JMSException myException; + protected ExpectationCounter myCloseCalls = + new ExpectationCounter("MockMessageConsumer.close"); + protected ExpectationCounter myReceiveCalls = + new ExpectationCounter("MockMessageConsumer.receive"); + private ExpectationValue messageListener = + new ExpectationValue("messageListener"); - protected ExpectationCounter myCloseCalls = new ExpectationCounter("MockMessageConsumer.close"); - protected ExpectationCounter myReceiveCalls = new ExpectationCounter("MockMessageConsumer.receive"); + public void setExpectedMessageListener(MessageListener messageListener){ + this.messageListener.setExpected(messageListener); + } + + public void close() throws JMSException { + throwExceptionIfAny(); + myCloseCalls.inc(); + } + + public MessageListener getMessageListener() throws JMSException { + notImplemented(); + return null; + } + + public String getMessageSelector() throws JMSException { + notImplemented(); + return null; + } - private Message myMessage; - private boolean myExpiresOnTimeout = false; - private JMSException myException; - - public MockMessageConsumer() { - } - - public void close() throws JMSException { - throwExceptionIfAny(); - myCloseCalls.inc(); - } - - public MessageListener getMessageListener() throws JMSException { - notImplemented(); - return null; - } - - public String getMessageSelector() throws JMSException { - notImplemented(); - return null; - } - - public Message receive() throws JMSException { - throwExceptionIfAny(); - myReceiveCalls.inc(); - if (myExpiresOnTimeout) { - synchronized(this) { - try { - wait(); - } catch (InterruptedException e) { - throw new junit.framework.AssertionFailedError("Thread interrupted"); + public Message receive() throws JMSException { + throwExceptionIfAny(); + myReceiveCalls.inc(); + if (myExpiresOnTimeout) { + synchronized(this) { + try { + wait(); + } catch (InterruptedException e) { + throw new junit.framework.AssertionFailedError( + "Thread interrupted"); + } + } } - } + return myMessage; + } + + public Message receive(long timeout) throws JMSException { + throwExceptionIfAny(); + myReceiveCalls.inc(); + if (myExpiresOnTimeout) { + return null; + } else { + return myMessage; + } + } + + + public Message receiveNoWait() throws JMSException { + throwExceptionIfAny(); + myReceiveCalls.inc(); + return myMessage; } - return myMessage; - } - public Message receive(long timeout) throws JMSException { - throwExceptionIfAny(); - myReceiveCalls.inc(); - if (myExpiresOnTimeout) { - return null; - } else { - return myMessage; - } - } - - public Message receiveNoWait() throws JMSException { - throwExceptionIfAny(); - myReceiveCalls.inc(); - return myMessage; - } - - public void setMessageListener(MessageListener listener) throws JMSException { - notImplemented(); - } - - public void setExpectedCloseCalls(int callCount) { - myCloseCalls.setExpected(callCount); - } - - public void setExpectedReceiveCalls(int callCount) { - myReceiveCalls.setExpected(callCount); - } - - public void setupReceivedMessage(Message message) { - myMessage = message; - } - - public void setupExpiresOnTimeout(boolean expiresOnTimeout) { - myExpiresOnTimeout = expiresOnTimeout; - } - - public void setupThrowException(JMSException e) { - myException = e; - } - - protected void throwExceptionIfAny() throws JMSException { - if (null != myException) { - throw myException; + public void setExpectedCloseCalls(int callCount) { + myCloseCalls.setExpected(callCount); + } + + public void setExpectedReceiveCalls(int callCount) { + myReceiveCalls.setExpected(callCount); + } + + public void setupReceivedMessage(Message message) { + myMessage = message; + } + + public void setupExpiresOnTimeout(boolean expiresOnTimeout) { + myExpiresOnTimeout = expiresOnTimeout; + } + + public void setupThrowException(JMSException e) { + myException = e; + } + + public void setMessageListener(MessageListener messageListener) + throws JMSException{ + this.messageListener.setActual(messageListener); + } + + protected void throwExceptionIfAny() throws JMSException { + if (null != myException) { + throw myException; + } } - } -} \ No newline at end of file +} Index: MockSession.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/jms/MockSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockSession.java 2001/11/22 00:05:41 1.1 +++ MockSession.java 2002/02/04 11:28:55 1.2 @@ -6,109 +6,113 @@ public class MockSession extends MockObject implements Session { - protected ExpectationCounter myCloseCalls = new ExpectationCounter("MockSession.close"); - protected ExpectationCounter myCreateTextMessageCalls = new ExpectationCounter("MockSession.createTextMessage"); + protected ExpectationCounter myCloseCalls = + new ExpectationCounter("MockSession.close"); + protected ExpectationCounter myCreateTextMessageCalls = + new ExpectationCounter("MockSession.createTextMessage"); + + private TextMessage myTextMessage = new MockTextMessage(); + private JMSException myException; + private ObjectMessage objectMessageToReturn; - private TextMessage myTextMessage = new MockTextMessage(); - private JMSException myException; + public void setupCreateObjectMessage(ObjectMessage objectMessageToReturn){ + this.objectMessageToReturn = objectMessageToReturn; + } + + public ObjectMessage createObjectMessage() throws JMSException { + return objectMessageToReturn; + } + + public ObjectMessage createObjectMessage(Serializable object) + throws JMSException { + return objectMessageToReturn; + } + + public void rollback() throws JMSException { + notImplemented(); + } + + public void setupTextMessage(TextMessage textMessage) { + myTextMessage = textMessage; + } + + public BytesMessage createBytesMessage() throws JMSException { + notImplemented(); + return null; + } + + public MapMessage createMapMessage() throws JMSException { + notImplemented(); + return null; + } + + public Message createMessage() throws JMSException { + notImplemented(); + return null; + } + + public boolean getTransacted() throws JMSException { + notImplemented(); + return false; + } + + public void recover() throws JMSException { + notImplemented(); + } + + public void close() throws JMSException { + throwExceptionIfAny(); + myCloseCalls.inc(); + } + + public void commit() throws JMSException { + notImplemented(); + } + + public void setMessageListener(MessageListener listener) + throws JMSException { + notImplemented(); + } + + public void setExpectedCloseCalls(int callCount) { + myCloseCalls.setExpected(callCount); + } + + public void setExpectedCreateTextMessageCalls(int callCount) { + myCreateTextMessageCalls.setExpected(callCount); + } + + public StreamMessage createStreamMessage() throws JMSException { + notImplemented(); + return null; + } + + public TextMessage createTextMessage() throws JMSException { + myCreateTextMessageCalls.inc(); + return myTextMessage; + } + + public TextMessage createTextMessage(String text) throws JMSException { + myTextMessage.setText(text); + return myTextMessage; + } - public MockSession() { - } + public MessageListener getMessageListener() throws JMSException { + notImplemented(); + return null; + } + + public void run() { + notImplemented(); + } + + public void setupThrowException(JMSException e) { + myException = e; + } - public void close() throws JMSException { - throwExceptionIfAny(); - myCloseCalls.inc(); - } - - public void commit() throws JMSException { - notImplemented(); - } - - public BytesMessage createBytesMessage() throws JMSException { - notImplemented(); - return null; - } - - public MapMessage createMapMessage() throws JMSException { - notImplemented(); - return null; - } - - public Message createMessage() throws JMSException { - notImplemented(); - return null; - } - - public ObjectMessage createObjectMessage() throws JMSException { - notImplemented(); - return null; - } - - public ObjectMessage createObjectMessage(Serializable object) throws JMSException { - notImplemented(); - return null; - } - - public StreamMessage createStreamMessage() throws JMSException { - notImplemented(); - return null; - } - - public TextMessage createTextMessage() throws JMSException { - myCreateTextMessageCalls.inc(); - return myTextMessage; - } - - public TextMessage createTextMessage(String text) throws JMSException { - myTextMessage.setText(text); - return myTextMessage; - } - - public MessageListener getMessageListener() throws JMSException { - notImplemented(); - return null; - } - - public boolean getTransacted() throws JMSException { - notImplemented(); - return false; - } - - public void recover() throws JMSException { - notImplemented(); - } - - public void rollback() throws JMSException { - notImplemented(); - } - - public void run() { - notImplemented(); - } - - public void setMessageListener(MessageListener listener) throws JMSException { - notImplemented(); - } - - public void setExpectedCloseCalls(int callCount) { - myCloseCalls.setExpected(callCount); - } - - public void setExpectedCreateTextMessageCalls(int callCount) { - myCreateTextMessageCalls.setExpected(callCount); - } - - public void setupTextMessage(TextMessage textMessage) { - myTextMessage = textMessage; - } - - public void setupThrowException(JMSException e) { - myException = e; - } - - protected void throwExceptionIfAny() throws JMSException { - if (null != myException) { - throw myException; + protected void throwExceptionIfAny() throws JMSException { + if (null != myException) { + throw myException; + } } - } -} \ No newline at end of file +} |
From: Jeff M. <cus...@us...> - 2002-02-04 10:42:58
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/servlet In directory usw-pr-cvs1:/tmp/cvs-serv3825 Modified Files: MockHttpServletRequest.java MockHttpServletResponse.java MockHttpSession.java Added Files: MockFilterChain.java MockFilterConfig.java MockJspWriter.java MockPageContext.java MockServletConfig.java MockServletContext.java Log Message: Added new JSP mock objects Continued adding support for servlet packages --- NEW FILE: MockFilterChain.java --- package com.mockobjects.servlet; import com.mockobjects.*; import javax.servlet.*; import java.io.IOException; public class MockFilterChain extends MockObject implements FilterChain { public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException{ } } --- NEW FILE: MockFilterConfig.java --- package com.mockobjects.servlet; import com.mockobjects.*; import java.util.*; import javax.servlet.*; public class MockFilterConfig extends MockObject implements FilterConfig { private ServletContext servletContext; public String getFilterName(){ return null; } public void setupGetServletContext(ServletContext servletContext){ this.servletContext = servletContext; } public ServletContext getServletContext(){ return servletContext; } public String getInitParameter(String name){ return null; } public Enumeration getInitParameterNames(){ return null; } } --- NEW FILE: MockJspWriter.java --- package com.mockobjects.servlet; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import junit.framework.*; import junit.textui.*; import java.util.*; import java.io.*; import java.net.*; import com.mockobjects.*; public class MockJspWriter extends JspWriter{ private ExpectationValue expectedData = new ExpectationValue("data"); private StringWriter stringWriter = new StringWriter(); private PrintWriter printWriter = new PrintWriter(stringWriter); public MockJspWriter(){ super(0, true); } public void setExpectedData(String data){ expectedData.setExpected(data); } public void newLine(){ } public void flush() { } public void print(double d){ } public void println(){ } public void close(){ } public void print(int i){ } public void print(long l){ } public void print(float f){ } public void println(char c){ } public void clear(){ } public void print(boolean b){ } public void print(String s){ printWriter.print(s); } public void println(String s){ printWriter.print(s); } public void print(char c){ } public void write(char[] c, int i1, int i2) { } public void println(char[] c){ } public void println(boolean b){ } public void clearBuffer(){ } public void print(Object o){ } public void println(long l){ } public void println(int i){ } public void print(char[] c){ } public void println(float f){ } public void println(double d){ } public int getRemaining(){ return -1; } public void println(Object o){ } public void verify(){ printWriter.flush(); expectedData.setActual(stringWriter.toString()); expectedData.verify(); } } --- NEW FILE: MockPageContext.java --- package com.mockobjects.servlet; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public class MockPageContext extends PageContext{ private JspWriter jspWriter; private ServletRequest request; private HttpSession httpSession; private ServletContext servletContext; public void release(){ } public JspWriter getOut(){ return jspWriter; } public void setJspWriter(JspWriter jspWriter){ this.jspWriter = jspWriter; } public void handlePageException(Exception e){ } public ServletContext getServletContext(){ return servletContext; } public void setServletContext(ServletContext servletContext){ this.servletContext = servletContext; } public int getAttributesScope(String s){ return -1; } public void include(String s){ } public void removeAttribute(String s, int i){ } public Enumeration getAttributeNamesInScope(int i){ return null; } public void forward(String s){ } public Object getPage(){ return null; } public void handlePageException(Throwable t){ } public void setRequest(ServletRequest servletRequest){ this.request = servletRequest; } public ServletRequest getRequest(){ return request; } public ServletResponse getResponse(){ return null; } public void removeAttribute(String s){ } public Object getAttribute(String s, int i){ return null; } public ServletConfig getServletConfig(){ return null; } public void initialize(Servlet servlet, ServletRequest servletRequest, ServletResponse servletResponse, String s, boolean b, int i, boolean b2){ } public Object findAttribute(String s) { return null; } public HttpSession getSession() { return httpSession; } public void setSession(HttpSession httpSession) { this.httpSession = httpSession; } public void setAttribute(String s, Object o){ } public void setAttribute(String s, Object o, int i) { } public Object getAttribute(String s) { return null; } public Exception getException() { return null; } public void verify(){ } } --- NEW FILE: MockServletConfig.java --- package com.mockobjects.servlet; import javax.servlet.*; import junit.framework.*; import junit.textui.*; import java.util.*; import java.io.*; import java.net.*; import com.mockobjects.*; /** * @version $Revision: 1.1 $ */ public class MockServletConfig extends MockObject implements ServletConfig { private Dictionary myParameters = new Hashtable(); private ServletContext servletContext; public String getInitParameter(String paramName) { return (String)myParameters.get(paramName); } public void setInitParameter(String paramName, String paramValue) { myParameters.put(paramName, paramValue); } public java.util.Enumeration getInitParameterNames() { return myParameters.keys(); } public void setupAddInitParameter(String paramName, String value) { myParameters.put(paramName, value); } public void setupNoParameters() { myParameters = new Hashtable(); } public void setServletContext(ServletContext servletContext){ this.servletContext = servletContext; } public ServletContext getServletContext(){ return servletContext; } public String getServletName(){ return null; } } --- NEW FILE: MockServletContext.java --- package com.mockobjects.servlet; import java.io.*; import java.net.*; import java.util.*; import javax.servlet.*; import com.mockobjects.*; public class MockServletContext extends MockObject implements ServletContext{ private HashMap attributes = new HashMap(); private Set resourcePaths; private List realPaths = new ArrayList(); private URL resource; private HashMap initParameters = new HashMap(); private ExpectationValue expectedLogValue = new ExpectationValue("log"); private ExpectationValue expectedLogThrowable = new ExpectationValue("log throwable"); private ExpectationValue requestDispatcherURI = new ExpectationValue("RequestDispatcher URI"); private RequestDispatcher requestDispatcher; public Enumeration getServlets(){ return null; } public void log(String string){ expectedLogValue.setActual(string); } public void setExpectedLog(String string){ expectedLogValue.setExpected(string); } public void setupGetResource(URL resource){ this.resource = resource; } public URL getResource(String string){ return resource; } public void setupGetResourcePaths(Set resourcePaths){ this.resourcePaths = resourcePaths; } public Set getResourcePaths(String string){ return resourcePaths; } public ServletContext getContext(String string){ return null; } public int getMinorVersion(){ return -1; } public void removeAttribute(String string){ } public void log(String string, Throwable t){ log(string); expectedLogThrowable.setActual(t); } public void setExpectedLogThrowable(Throwable throwable){ expectedLogThrowable.setExpected(throwable); } public void addRealPath(String realPath){ this.realPaths.add(realPath); } public String getRealPath(String string){ return realPaths.remove(0).toString(); } public Enumeration getServletNames(){ return null; } public Servlet getServlet(String string){ return null; } public void log(Exception exception, String string){ } public String getServerInfo(){ return null; } public void setExpectedRequestDispatcherURI(String uri){ this.requestDispatcherURI.setExpected(uri); } public void setupGetRequestDispatcher( RequestDispatcher requestDispatcher){ this.requestDispatcher = requestDispatcher; } public RequestDispatcher getRequestDispatcher(String uri){ requestDispatcherURI.setActual(uri); return requestDispatcher; } public int getMajorVersion(){ return -1; } public Set getResourcePaths(){ return null; } public void setAttribute(String string, Object object){ attributes.put(string, object); } public String getMimeType(String string){ return null; } public RequestDispatcher getNamedDispatcher(String string){ return null; } public String getInitParameter(String paramName){ return (String)initParameters.get(paramName); } public void setInitParameter(String paramName, String paramValue){ initParameters.put(paramName,paramValue); } public Object getAttribute(String string){ return attributes.get(string); } public Enumeration getAttributeNames(){ return null; } public String getServletContextName() { return null; } public InputStream getResourceAsStream(String string){ return null; } public Enumeration getInitParameterNames(){ return null; } } Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockHttpServletRequest.java 2001/11/22 00:05:42 1.1 +++ MockHttpServletRequest.java 2002/02/04 10:42:53 1.2 @@ -1,13 +1,29 @@ package com.mockobjects.servlet; -import java.util.*; +import javax.servlet.*; import javax.servlet.http.*; +import javax.servlet.jsp.*; +import junit.framework.*; +import junit.textui.*; +import java.util.*; +import java.io.*; +import java.net.*; import com.mockobjects.*; -public class MockHttpServletRequest implements HttpServletRequest { +/** + * @version $Revision$ + */ +public class MockHttpServletRequest extends MockObject implements HttpServletRequest { private Dictionary myParameters = new Hashtable(); - + private HttpSession httpSession; + private String contentType; private String myPathInfo; + private String remoteAddress; + private java.security.Principal userPrincipal; + private ExpectationSet mySetAttributes = + new ExpectationSet(MockHttpServletRequest.class.getName() + + ".setAttribute"); + public MockHttpServletRequest() { super(); @@ -68,7 +84,12 @@ public String getContentType() { return null; } - + /** + * getContentType method comment. + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } /** * getContextPath method comment. */ @@ -149,7 +170,10 @@ public String getParameter(String paramName) { String[] values = getParameterValues(paramName); - return (values == null ? null : values[0]); + if (values == null) + return null; + + return values[0]; } public java.util.Enumeration getParameterNames() { @@ -199,11 +223,15 @@ return null; } + public void setupGetRemoteAddr(String remoteAddress){ + this.remoteAddress = remoteAddress; + } + /** * getRemoteAddr method comment. */ public String getRemoteAddr() { - return null; + return remoteAddress; } /** @@ -273,22 +301,30 @@ /** * getSession method comment. */ - public javax.servlet.http.HttpSession getSession() { - return null; + public HttpSession getSession() { + return httpSession; } + public void setSession(HttpSession httpSession) { + this.httpSession = httpSession; + } + /** * getSession method comment. */ - public javax.servlet.http.HttpSession getSession(boolean arg1) { + public HttpSession getSession(boolean arg1) { return null; } + public void setupGetUserPrincipal(java.security.Principal userPrincipal){ + this.userPrincipal = userPrincipal; + } + /** * getUserPrincipal method comment. */ public java.security.Principal getUserPrincipal() { - return null; + return userPrincipal; } /** @@ -339,10 +375,18 @@ public void removeAttribute(java.lang.String arg1) { } + public void addExpectedSetAttribute(String attributeName, + Object attributeValue) { + mySetAttributes.addExpected( + new MapEntry(attributeName, attributeValue)); + } + /** * setAttribute method comment. */ - public void setAttribute(String arg1, Object arg2) { + public void setAttribute(String attributeName, Object attributeValue) { + mySetAttributes.addActual( + new MapEntry(attributeName, attributeValue)); } /** @@ -367,4 +411,13 @@ public void setupPathInfo(String pathInfo) { myPathInfo = pathInfo; } + public StringBuffer getRequestURL(){ + return null; + } + public void setCharacterEncoding(String s){ + } + public Map getParameterMap(){ + return null; + } } + Index: MockHttpServletResponse.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/servlet/MockHttpServletResponse.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockHttpServletResponse.java 2001/11/22 00:05:42 1.1 +++ MockHttpServletResponse.java 2002/02/04 10:42:53 1.2 @@ -12,6 +12,8 @@ private ExpectationCounter mySetStatusCalls = new ExpectationCounter("MockHttpServletResponse.setStatus"); private ExpectationList myRedirects = new ExpectationList("MockHttpServletResponse.sendRedirect"); private ServletOutputStream myOutputStream = new MockServletOutputStream(); + private ExpectationValue myErrorCode = new ExpectationValue("MockHttpServletResponse.sendError"); + private ExpectationValue myErrorMessage = new ExpectationValue("MockHttpServletResponse.sendError"); /** * MockHttpServletResponse constructor comment. @@ -118,12 +120,31 @@ public void reset() { } - public void sendError(int arg1) throws java.io.IOException { - fail("Not implemented"); + public void resetBuffer(){ } - public void sendError(int arg1, String arg2) throws java.io.IOException { - fail("Not implemented"); + public void setExpectedError(int anErrorCode){ + myErrorCode.setExpected(anErrorCode); + } + + public void setExpectedError(int anErrorCode, String anErrorMessage){ + setExpectedError(anErrorCode); + myErrorMessage.setExpected(anErrorMessage); + } + + public void setExpectedErrorNothing(){ + myErrorCode.setExpectNothing(); + myErrorMessage.setExpectNothing(); + } + + public void sendError(int anErrorCode) throws java.io.IOException { + myErrorCode.setActual(anErrorCode); + } + + public void sendError(int anErrorCode, String anErrorMessage) + throws IOException { + sendError(anErrorCode); + myErrorMessage.setActual(anErrorMessage); } public void sendRedirect(String aURL) throws java.io.IOException { Index: MockHttpSession.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/com/mockobjects/servlet/MockHttpSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockHttpSession.java 2001/11/22 00:05:42 1.1 +++ MockHttpSession.java 2002/02/04 10:42:53 1.2 @@ -1,21 +1,22 @@ package com.mockobjects.servlet; +import javax.servlet.*; +import javax.servlet.http.*; import java.util.*; -import javax.servlet.http.HttpSessionContext; -import javax.servlet.http.HttpSession; - import com.mockobjects.*; public class MockHttpSession extends MockObject implements HttpSession, Verifiable { public ExpectationSet myAttributes = new ExpectationSet("session attributes"); + public HashMap attributes = new HashMap(); + + private ServletContext servletContext; public MockHttpSession() { super(); } public Object getAttribute(String arg1) { - notImplemented(); - return null; + return attributes.get(arg1); } public Enumeration getAttributeNames() { @@ -45,6 +46,14 @@ return null; } + public void setupServletContext(ServletContext servletContext){ + this.servletContext = servletContext; + } + + public ServletContext getServletContext(){ + return servletContext; + } + public Object getValue(String arg1) { notImplemented(); return null; @@ -72,6 +81,7 @@ } public void setAttribute(String aKey, Object aValue) { + attributes.put(aKey, aValue); myAttributes.addActual(new MapEntry(aKey, aValue)); } |
From: Vincent M. <vm...@oc...> - 2002-02-02 15:30:02
|
> -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Jeff Martin > Sent: 02 February 2002 13:32 > To: MockObjects > Subject: Re: [MO-java-dev] MockObjects License > > My opinion is that sticking with a BSD style license is best as it leads > to the least confusion, so it's less likely to scare people off (Most > suit friendly). > > The only problem with the current license is who actually holds the > copyright. Having the ASF named in the mockobjects license is not really > good for either party as it leads to confusion and makes the whole > licensing thing a bit of a joke. > > All those in favor of current license with amended licenser raise you > mouse hand now. ;o) +1 > > > On Tue, 2002-01-29 at 15:22, Olaf Kock wrote: > > Hi all, > > > > I'll second LGPL. This means the library code itself is effectively > > GPLed, but may be used (linked) in closed source development and > > development of software licensed with any other license. > > > > see http://www.gnu.org/licenses/licenses.html#LGPL for the license text > > as well as more information. > > > > > So that's not as bad as the GPL. > > > > You'll also find an article by R. Stallman at that url in which he > > basically states that the LGPL is evil in most cases. I don't second > > that opinion, though ;-) > > > > Best, > > > > Olaf > > > > -- > > > > abstrakt gmbh > > Behringstrasse 16b > > 22765 Hamburg > > Tel: +49-40-39804630 > > Fax: +49-40-39804639 > > http://www.abstrakt.de/ > > > > Wir sind umgezogen. Bitte beachten Sie > > die neue Adresse + Telefonnr. > > > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > -- > > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Jeff M. <je...@mk...> - 2002-02-02 13:32:51
|
My opinion is that sticking with a BSD style license is best as it leads to the least confusion, so it's less likely to scare people off (Most suit friendly). The only problem with the current license is who actually holds the copyright. Having the ASF named in the mockobjects license is not really good for either party as it leads to confusion and makes the whole licensing thing a bit of a joke. All those in favor of current license with amended licenser raise you mouse hand now. ;o) On Tue, 2002-01-29 at 15:22, Olaf Kock wrote: > Hi all, > > I'll second LGPL. This means the library code itself is effectively > GPLed, but may be used (linked) in closed source development and > development of software licensed with any other license. > > see http://www.gnu.org/licenses/licenses.html#LGPL for the license text > as well as more information. > > > So that's not as bad as the GPL. > > You'll also find an article by R. Stallman at that url in which he > basically states that the LGPL is evil in most cases. I don't second > that opinion, though ;-) > > Best, > > Olaf > > -- > > abstrakt gmbh > Behringstrasse 16b > 22765 Hamburg > Tel: +49-40-39804630 > Fax: +49-40-39804639 > http://www.abstrakt.de/ > > Wir sind umgezogen. Bitte beachten Sie > die neue Adresse + Telefonnr. > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |
From: Vincent M. <vm...@oc...> - 2002-02-01 23:27:10
|
> -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Steve Freeman > Sent: 01 February 2002 21:37 > To: MockObjects > Subject: Re: [MO-java-dev] What goes where? > > I've been attempting to shuffle the structure so it can cope better with > things like multiple versions of the libraries, etc. As you can all see, > I haven't got very far -- although I have branched CVS. > > My view is that we should have 3 basic packages, I think others agree. > - core - the expectation libraries and associated utilities > - jdkxx - mocks for packages that ship with the jdk, e.g sql & io. > - j2eexx - mocks for packages that ship with the enterprise edition, eg > jms & servlet +1 > > where 'xx' is a version number (of the java release) like 12 or 13. > +1 > the reason for copying to the out directory is so that the Ant filter > can write release information into the sources. This was copied from > Cactus, maybe we don't need it. > > Steve > > ----- Original Message ----- > From: "Jeff Martin" <je...@cu...> > To: "MockObjects" <moc...@li...> > Sent: Friday, February 01, 2002 7:39 PM > Subject: [MO-java-dev] What goes where? > > > > where are thing supposed to be going these days. Do things like jms > and > > servlet packages go in the j2ee directory or are they just being left > > under core? > > > > Also is it necessary to build compile from the source files in the out > > dir? Coz it causes no end of fun when vim takes me to edit those files > > instead of the ones in src ;o) > > > > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Vincent M. <vm...@oc...> - 2002-02-01 23:26:00
|
> -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Steve Freeman > Sent: 01 February 2002 21:37 > To: MockObjects > Subject: Re: [MO-java-dev] What goes where? > > I've been attempting to shuffle the structure so it can cope better with > things like multiple versions of the libraries, etc. As you can all see, > I haven't got very far -- although I have branched CVS. > > My view is that we should have 3 basic packages, I think others agree. > - core - the expectation libraries and associated utilities > - jdkxx - mocks for packages that ship with the jdk, e.g sql & io. > - j2eexx - mocks for packages that ship with the enterprise edition, eg > jms & servlet > > where 'xx' is a version number (of the java release) like 12 or 13. > > the reason for copying to the out directory is so that the Ant filter > can write release information into the sources. This was copied from > Cactus, maybe we don't need it. > Actually that was something I was doing when I had the following in my source code, a while ago : /** * @version @version@ ... and Ant was replacing the token with the actual version. I have now modified Cactus sources to be the standard (when using CVS) : /** * @version $Id: $ ... so, yes, I don't see a need to copy the source files before compiling them, provided we use "$Id: $" -Vincent > Steve > > ----- Original Message ----- > From: "Jeff Martin" <je...@cu...> > To: "MockObjects" <moc...@li...> > Sent: Friday, February 01, 2002 7:39 PM > Subject: [MO-java-dev] What goes where? > > > > where are thing supposed to be going these days. Do things like jms > and > > servlet packages go in the j2ee directory or are they just being left > > under core? > > > > Also is it necessary to build compile from the source files in the out > > dir? Coz it causes no end of fun when vim takes me to edit those files > > instead of the ones in src ;o) > > > > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Steve F. <st...@m3...> - 2002-02-01 21:55:01
|
I've been attempting to shuffle the structure so it can cope better with things like multiple versions of the libraries, etc. As you can all see, I haven't got very far -- although I have branched CVS. My view is that we should have 3 basic packages, I think others agree. - core - the expectation libraries and associated utilities - jdkxx - mocks for packages that ship with the jdk, e.g sql & io. - j2eexx - mocks for packages that ship with the enterprise edition, eg jms & servlet where 'xx' is a version number (of the java release) like 12 or 13. the reason for copying to the out directory is so that the Ant filter can write release information into the sources. This was copied from Cactus, maybe we don't need it. Steve ----- Original Message ----- From: "Jeff Martin" <je...@cu...> To: "MockObjects" <moc...@li...> Sent: Friday, February 01, 2002 7:39 PM Subject: [MO-java-dev] What goes where? > where are thing supposed to be going these days. Do things like jms and > servlet packages go in the j2ee directory or are they just being left > under core? > > Also is it necessary to build compile from the source files in the out > dir? Coz it causes no end of fun when vim takes me to edit those files > instead of the ones in src ;o) |
From: Jeff M. <je...@cu...> - 2002-02-01 19:40:12
|
where are thing supposed to be going these days. Do things like jms and servlet packages go in the j2ee directory or are they just being left under core? Also is it necessary to build compile from the source files in the out dir? Coz it causes no end of fun when vim takes me to edit those files instead of the ones in src ;o) -- Jeff Martin Memetic Engineer http://www.custommonkey.org/ |
From: Steve F. <st...@m3...> - 2002-01-29 16:14:18
|
I'm happy to be corrected. Any dissenting opinions? Otherwise, we'll change the licence. Steve ----- Original Message ----- From: "Olaf Kock" <ok...@ab...> To: "MockObjects" <moc...@li...> Sent: Tuesday, January 29, 2002 3:22 PM Subject: Re: [MO-java-dev] MockObjects License > Hi all, > > I'll second LGPL. This means the library code itself is effectively > GPLed, but may be used (linked) in closed source development and > development of software licensed with any other license. > > see http://www.gnu.org/licenses/licenses.html#LGPL for the license text > as well as more information. > > > So that's not as bad as the GPL. > > You'll also find an article by R. Stallman at that url in which he > basically states that the LGPL is evil in most cases. I don't second > that opinion, though ;-) > > Best, > > Olaf > > -- > > abstrakt gmbh > Behringstrasse 16b > 22765 Hamburg > Tel: +49-40-39804630 > Fax: +49-40-39804639 > http://www.abstrakt.de/ > > Wir sind umgezogen. Bitte beachten Sie > die neue Adresse + Telefonnr. > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > |