|
From: <pe...@us...> - 2003-10-02 23:29:14
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/test/org/neuclear/store
Modified Files:
AbstractStoreTest.java EncryptedFileStoreTest.java
FileStoreTest.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: AbstractStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/AbstractStoreTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AbstractStoreTest.java 24 Sep 2003 23:56:49 -0000 1.4
--- AbstractStoreTest.java 2 Oct 2003 23:29:03 -0000 1.5
***************
*** 2,5 ****
--- 2,11 ----
$Id$
$Log$
+ Revision 1.5 2003/10/02 23:29:03 pelle
+ Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ Cleaned up much of the tests and they all pass now.
+ The FileStoreTests need to be rethought out, by adding a test key.
+
Revision 1.4 2003/09/24 23:56:49 pelle
Refactoring nearly done. New model for creating signed objects.
***************
*** 100,103 ****
--- 106,110 ----
import junit.framework.TestCase;
import org.neuclear.id.InvalidIdentityException;
+ import org.neuclear.id.builders.IdentityBuilder;
import org.neudist.utils.NeudistException;
***************
*** 114,118 ****
public AbstractStoreTest(String name) throws GeneralSecurityException {
super(name);
! setUp();
}
--- 121,126 ----
public AbstractStoreTest(String name) throws GeneralSecurityException {
super(name);
! store = getStoreInstance();
! generateKeys();
}
***************
*** 121,129 ****
public abstract Store getStoreInstance();
- protected void setUp() throws GeneralSecurityException {
- store = getStoreInstance();
- generateKeys();
- }
-
protected static synchronized void generateKeys() throws GeneralSecurityException {
if (kg == null) {
--- 129,132 ----
***************
*** 147,172 ****
public void testStore() throws NeudistException, InvalidIdentityException {
System.out.println("\nTesting " + this.getClass().getName());
! // System.out.println("Storing "+rootName);
! // store.receive(new Identity(rootName,root,root.getPublic()));
! // System.out.println("Storing "+bobName);
! // store.receive(new Identity(bobName,root,bob.getPublic()));
! // System.out.println("Storing "+bobAliceName);
! // store.receive(new Identity(bobAliceName,bob,alice.getPublic()));
! // System.out.println("Storing "+eveName);
! // store.receive(new Identity(eveName,root,eve.getPublic()));
! // System.out.println("Fetching "+rootName);
! // SignedNamedObject nobj1=store.fetch(rootName);
! // assertEquals(NSTools.normalizeNameURI(rootName),nobj1.getName());
! // System.out.println("Fetching "+bobName);
! // SignedNamedObject nobj2=store.fetch(bobName);
! // assertEquals(NSTools.normalizeNameURI(bobName),nobj2.getName());
! //
! // System.out.println("Fetching "+bobAliceName);
! // SignedNamedObject nobj3=store.fetch(bobAliceName);
! // assertEquals(NSTools.normalizeNameURI(bobAliceName),nobj3.getName());
! //
! // System.out.println("Fetching "+eveName);
! // SignedNamedObject nobj4=store.fetch(eveName);
! // assertEquals(NSTools.normalizeNameURI(eveName),nobj4.getName());
}
--- 150,177 ----
public void testStore() throws NeudistException, InvalidIdentityException {
System.out.println("\nTesting " + this.getClass().getName());
! System.out.println("Storing " + rootName);
! store.receive(new IdentityBuilder(rootName, root.getPrivate(), root.getPublic()));
! System.out.println("Storing " + bobName);
! store.receive(new IdentityBuilder(bobName, root.getPrivate(), bob.getPublic()));
! System.out.println("Storing " + bobAliceName);
! store.receive(new IdentityBuilder(bobAliceName, bob.getPrivate(), alice.getPublic()));
! System.out.println("Storing " + eveName);
! store.receive(new IdentityBuilder(eveName, root.getPrivate(), eve.getPublic()));
! /* TODO: To complete this part I need to have a parent testkey in a keystore that is signed by root.
! System.out.println("Fetching "+rootName);
! SignedNamedObject nobj1=store.fetch(rootName);
! assertEquals(NSTools.normalizeNameURI(rootName),nobj1.getName());
! System.out.println("Fetching "+bobName);
! SignedNamedObject nobj2=store.fetch(bobName);
! assertEquals(NSTools.normalizeNameURI(bobName),nobj2.getName());
!
! System.out.println("Fetching "+bobAliceName);
! SignedNamedObject nobj3=store.fetch(bobAliceName);
! assertEquals(NSTools.normalizeNameURI(bobAliceName),nobj3.getName());
!
! System.out.println("Fetching "+eveName);
! SignedNamedObject nobj4=store.fetch(eveName);
! assertEquals(NSTools.normalizeNameURI(eveName),nobj4.getName());
! */
}
Index: EncryptedFileStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/EncryptedFileStoreTest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** EncryptedFileStoreTest.java 19 Sep 2003 14:41:54 -0000 1.1.1.1
--- EncryptedFileStoreTest.java 2 Oct 2003 23:29:03 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.1.1.1 2003/09/19 14:41:54 pelle
* First import into the neuclear project. This was originally under the SF neudist
***************
*** 34,69 ****
package org.neuclear.store;
- import junit.framework.Test;
- import junit.framework.TestSuite;
-
import java.security.GeneralSecurityException;
! public class EncryptedFileStoreTest extends AbstractStoreTest{
public EncryptedFileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
- public static void main (String[] args) {
- try {
- AbstractStoreTest test=new EncryptedFileStoreTest("Encrypted Test");
- test.setUp();
- test.testStore();
- } catch (Exception e) {
- // if (e instanceof NeudistException) {
- // ((NeudistException)e).getParcel().printStackTrace();
- // } else
- e.printStackTrace();
-
- }
- // junit.textui.TestRunner.run (suite());
- }
/**
*/
public Store getStoreInstance() {
! return new EncryptedFileStore("/home/java/projects/neuclear/build/tests/efs");
}
- public static Test suite() {
- return new TestSuite(EncryptedFileStoreTest.class);
- }
}
--- 40,55 ----
package org.neuclear.store;
import java.security.GeneralSecurityException;
! public class EncryptedFileStoreTest extends AbstractStoreTest {
public EncryptedFileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
/**
*/
public Store getStoreInstance() {
! return new EncryptedFileStore("target/neuclear/tests/efs");
}
}
Index: FileStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/FileStoreTest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** FileStoreTest.java 19 Sep 2003 14:41:56 -0000 1.1.1.1
--- FileStoreTest.java 2 Oct 2003 23:29:03 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.1.1.1 2003/09/19 14:41:56 pelle
* First import into the neuclear project. This was originally under the SF neudist
***************
*** 37,76 ****
package org.neuclear.store;
- import junit.framework.Test;
- import junit.framework.TestSuite;
-
import java.security.GeneralSecurityException;
! public class FileStoreTest extends AbstractStoreTest{
! public FileStoreTest() throws GeneralSecurityException {
! super("FileStoreTest");
! }
public FileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
- public static void main (String[] args) {
- try {
- AbstractStoreTest test=new FileStoreTest();
- test.setUp();
- test.testStore();
- } catch (Exception e) {
- // if (e instanceof NeudistException) {
- // ((NeudistException)e).getParcel().printStackTrace();
- // } else
- e.printStackTrace();
-
- }
-
- // junit.textui.TestRunner.run (suite());
- }
/**
*/
public Store getStoreInstance() {
! return new FileStore("/home/java/projects/neuclear/build/tests/fs");
}
- public static Test suite() {
- return new TestSuite(FileStoreTest.class);
- }
}
--- 43,58 ----
package org.neuclear.store;
import java.security.GeneralSecurityException;
! public class FileStoreTest extends AbstractStoreTest {
public FileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
/**
*/
public Store getStoreInstance() {
! return new FileStore("target/neuclear/tests/fs");
}
}
|