|
From: <pe...@us...> - 2004-01-13 15:11:39
|
Update of /cvsroot/neuclear/neuclear-id/src/test-cactus/org/neuclear/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv29148/src/test-cactus/org/neuclear/receiver
Modified Files:
MockReceiver.java
Log Message:
Now builds.
Now need to do unit tests
Index: MockReceiver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test-cactus/org/neuclear/receiver/MockReceiver.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MockReceiver.java 12 Dec 2003 00:13:11 -0000 1.2
--- MockReceiver.java 13 Jan 2004 15:11:36 -0000 1.3
***************
*** 2,5 ****
--- 2,8 ----
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.crypto.signers.Signer;
+ import org.neuclear.commons.crypto.signers.TestCaseSigner;
+ import org.neuclear.commons.crypto.signers.InvalidPassphraseException;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.builders.AuthenticationTicketBuilder;
***************
*** 26,29 ****
--- 29,36 ----
$Id$
$Log$
+ Revision 1.3 2004/01/13 15:11:36 pelle
+ Now builds.
+ Now need to do unit tests
+
Revision 1.2 2003/12/12 00:13:11 pelle
This may actually work now. Need to put a few more test cases in to make sure.
***************
*** 41,44 ****
--- 48,58 ----
*/
public class MockReceiver implements Receiver {
+ public MockReceiver() {
+ try {
+ signer=new TestCaseSigner();
+ } catch (InvalidPassphraseException e) {
+ throw new RuntimeException(e);
+ }
+ }
/**
* Add your main transaction processing logic within this method.
***************
*** 46,55 ****
* you can not trust it.
*
! * @param obj
! * @throws UnsupportedTransaction
*/
! public ElementProxy receive(SignedNamedObject obj) throws UnsupportedTransaction, NeuClearException {
received = obj;
! return new AuthenticationTicketBuilder("neu://test", obj.getName(), "http://localhost");//Just some dummy
}
--- 60,69 ----
* you can not trust it.
*
! * @param obj
! * @throws UnsupportedTransaction
*/
! public SignedNamedObject receive(SignedNamedObject obj) throws UnsupportedTransaction, NeuClearException {
received = obj;
! return new AuthenticationTicketBuilder("neu://test", obj.getName(), "http://localhost").convert("neu://bob@test",signer);//Just some dummy
}
***************
*** 57,61 ****
return received;
}
!
private SignedNamedObject received = null;
}
--- 71,75 ----
return received;
}
! private Signer signer;
private SignedNamedObject received = null;
}
|