|
From: <pe...@us...> - 2003-12-11 23:57:34
|
Update of /cvsroot/neuclear/neuclear-id/src/test-cactus/org/neuclear/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv1620/src/test-cactus/org/neuclear/receiver
Modified Files:
ReceiverServletTest.java
Added Files:
MockReceiver.java
Log Message:
Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
--- NEW FILE: MockReceiver.java ---
package org.neuclear.receiver;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.xml.ElementProxy;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: MockReceiver.java,v 1.1 2003/12/11 23:57:30 pelle Exp $
$Log: MockReceiver.java,v $
Revision 1.1 2003/12/11 23:57:30 pelle
Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
*/
/**
* User: pelleb
* Date: Dec 11, 2003
* Time: 6:03:55 PM
*/
public class MockReceiver implements Receiver {
/**
* Add your main transaction processing logic within this method.
* Remember you must check the validity of the SignedNamedObject here. Until you do so
* you can not trust it.
*
* @param obj
* @throws UnsupportedTransaction
*/
public ElementProxy receive(SignedNamedObject obj) throws UnsupportedTransaction, NeuClearException {
received = obj;
return;
}
public SignedNamedObject getLastReceived() {
return received;
}
private SignedNamedObject received = null;
}
Index: ReceiverServletTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test-cactus/org/neuclear/receiver/ReceiverServletTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ReceiverServletTest.java 28 Nov 2003 00:12:59 -0000 1.2
--- ReceiverServletTest.java 11 Dec 2003 23:57:30 -0000 1.3
***************
*** 7,16 ****
import org.neuclear.commons.crypto.signers.JCESigner;
import org.neuclear.commons.crypto.signers.TestCaseSigner;
- import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.builders.AuthenticationTicketBuilder;
- import org.neuclear.xml.ElementProxy;
import org.neuclear.xml.XMLException;
import org.neuclear.xml.xmlsec.XMLSecTools;
import java.security.GeneralSecurityException;
--- 7,16 ----
import org.neuclear.commons.crypto.signers.JCESigner;
import org.neuclear.commons.crypto.signers.TestCaseSigner;
import org.neuclear.id.builders.AuthenticationTicketBuilder;
import org.neuclear.xml.XMLException;
import org.neuclear.xml.xmlsec.XMLSecTools;
+ import javax.servlet.ServletException;
+ import java.io.IOException;
import java.security.GeneralSecurityException;
***************
*** 35,38 ****
--- 35,42 ----
$Id$
$Log$
+ Revision 1.3 2003/12/11 23:57:30 pelle
+ Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
+ Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
+
Revision 1.2 2003/11/28 00:12:59 pelle
Getting the NeuClear web transactions working.
***************
*** 58,78 ****
}
! public void testReceiveBase64() {
ReceiverServlet servlet = new ReceiverServlet();
! servlet.setReceiver(new Receiver() {
! /**
! * Add your main transaction processing logic within this method.
! * Remember you must check the validity of the SignedNamedObject here. Until you do so
! * you can not trust it.
! *
! * @param obj
! * @throws org.neuclear.receiver.UnsupportedTransaction
! *
! */
! public ElementProxy receive(SignedNamedObject obj) throws UnsupportedTransaction, NeuClearException {
! return null;
! }
- });
}
}
--- 62,76 ----
}
! public void testReceiveBase64() throws ServletException, IOException {
ReceiverServlet servlet = new ReceiverServlet();
! MockReceiver receiver = new MockReceiver();
! servlet.setReceiver(receiver);
! servlet.init(config);
! servlet.service(request, response);
! assertNotNull(receiver.getLastReceived());
! assertEquals(receiver.getLastReceived().getSignatory().getName(), "neu://bob@test");
}
+
+
}
|