Author: batosai
Date: 2008-09-12 10:47:29 +0000 (Fri, 12 Sep 2008)
New Revision: 22617
Modified:
trunk/plugins/WoT/src/plugins/WoT/Identity.java
trunk/plugins/WoT/src/plugins/WoT/IdentityParser.java
trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java
trunk/plugins/WoT/src/plugins/WoT/OwnIdentity.java
trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java
trunk/plugins/WoT/src/plugins/WoT/TrustTest.java
trunk/plugins/WoT/src/plugins/WoT/WoT.java
trunk/plugins/WoT/src/plugins/WoT/WoTTest.java
Log:
Removed context setting on Identity creation, as we can't store it properly.
Modified: trunk/plugins/WoT/src/plugins/WoT/Identity.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/Identity.java 2008-09-12 10:13:54 UTC
(rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/Identity.java 2008-09-12 10:47:29 UTC
(rev 22617)
@@ -48,21 +48,20 @@
private ArrayList<String> contexts;
- public Identity (FreenetURI requestURI, String nickName, String
publishTrustList, String context) throws InvalidParameterException {
+ public Identity (FreenetURI requestURI, String nickName, String
publishTrustList) throws InvalidParameterException {
setRequestURI(requestURI);
setNickName(nickName);
setPublishTrustList(publishTrustList);
props = new HashMap<String, String>();
contexts = new ArrayList<String>();
- contexts.add(context);
id = getIdFromURI(getRequestURI());
Logger.debug(this, "New identity : " + getNickName());
}
- public Identity (String requestURI, String nickName, String
publishTrustList, String context) throws InvalidParameterException,
MalformedURLException {
- this(new FreenetURI(requestURI), nickName, publishTrustList,
context);
+ public Identity (String requestURI, String nickName, String
publishTrustList) throws InvalidParameterException, MalformedURLException {
+ this(new FreenetURI(requestURI), nickName, publishTrustList);
}
Modified: trunk/plugins/WoT/src/plugins/WoT/IdentityParser.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/IdentityParser.java 2008-09-12
10:13:54 UTC (rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/IdentityParser.java 2008-09-12
10:47:29 UTC (rev 22617)
@@ -94,7 +94,7 @@
// TODO Don't create Identity
object before we succesfully fetched it !
- trustee = new
Identity(attrs.getValue("uri"), "Not found yet...", "false", "test");
+ trustee = new
Identity(attrs.getValue("uri"), "Not found yet...", "false");
db.store(trustee);
identity.setTrust(db, trustee,
value, comment);
fetcher.fetch(trustee);
Modified: trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java 2008-09-12 10:13:54 UTC
(rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java 2008-09-12 10:47:29 UTC
(rev 22617)
@@ -29,9 +29,12 @@
protected void setUp() throws Exception {
super.setUp();
- identity = new Identity(uri, "test", "true", "bar");
db = Db4o.openFile("identityTest.db4o");
+
+ identity = new Identity(uri, "test", "true");
+ identity.addContext("bleh", db);
+
db.store(identity);
db.commit();
}
Modified: trunk/plugins/WoT/src/plugins/WoT/OwnIdentity.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/OwnIdentity.java 2008-09-12 10:13:54 UTC
(rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/OwnIdentity.java 2008-09-12 10:47:29 UTC
(rev 22617)
@@ -48,14 +48,14 @@
private FreenetURI insertURI;
private Date lastInsert;
- public OwnIdentity (FreenetURI insertURI, FreenetURI requestURI, String
nickName, String publishTrustList, String context) throws
InvalidParameterException {
- super(requestURI, nickName, publishTrustList, context);
+ public OwnIdentity (FreenetURI insertURI, FreenetURI requestURI, String
nickName, String publishTrustList) throws InvalidParameterException {
+ super(requestURI, nickName, publishTrustList);
setInsertURI(insertURI);
setLastInsert(new Date(0));
}
- public OwnIdentity (String insertURI, String requestURI, String
nickName, String publishTrustList, String context) throws
InvalidParameterException, MalformedURLException {
- this(new FreenetURI(insertURI), new FreenetURI(requestURI),
nickName, publishTrustList, context);
+ public OwnIdentity (String insertURI, String requestURI, String
nickName, String publishTrustList) throws InvalidParameterException,
MalformedURLException {
+ this(new FreenetURI(insertURI), new FreenetURI(requestURI),
nickName, publishTrustList);
}
public void initTrustTree (ObjectContainer db) throws
DuplicateScoreException {
Modified: trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java 2008-09-12 10:13:54 UTC
(rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java 2008-09-12 10:47:29 UTC
(rev 22617)
@@ -34,8 +34,8 @@
super.setUp();
db = Db4o.openFile("scoreTest.db4o");
- a = new OwnIdentity(uriA, uriA, "A", "true", "test");
- b = new Identity(uriB, "B", "true", "test");
+ a = new OwnIdentity(uriA, uriA, "A", "true");
+ b = new Identity(uriB, "B", "true");
db.store(a);
db.store(b);
Score score = new Score(a,b,100,1,40);
Modified: trunk/plugins/WoT/src/plugins/WoT/TrustTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/TrustTest.java 2008-09-12 10:13:54 UTC
(rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/TrustTest.java 2008-09-12 10:47:29 UTC
(rev 22617)
@@ -35,8 +35,8 @@
super.setUp();
db = Db4o.openFile("trustTest.db4o");
- a = new Identity(uriA, "A", "true", "test");
- b = new Identity(uriB, "B", "true", "test");
+ a = new Identity(uriA, "A", "true");
+ b = new Identity(uriB, "B", "true");
Trust trust = new Trust(a,b,100,"test");
db.store(trust);
db.store(a);
Modified: trunk/plugins/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/WoT.java 2008-09-12 10:13:54 UTC (rev
22616)
+++ trunk/plugins/WoT/src/plugins/WoT/WoT.java 2008-09-12 10:47:29 UTC (rev
22617)
@@ -101,7 +101,7 @@
seed = Identity.getByURI(db, seedURI);
} catch (UnknownIdentityException e) {
try {
- seed = new Identity(seedURI, "Fetching seed
identity...", "true", "bootstrap");
+ seed = new Identity(seedURI, "Fetching seed
identity...", "true");
} catch (Exception e1) {
Logger.error(this, "Seed identity creation
error", e);
return;
@@ -303,7 +303,7 @@
catch (UnknownIdentityException e) {
// TODO Only add the identity after it is successfully
fetched
- identity = new Identity(requestURI, "Not found yet...",
"false", "test");
+ identity = new Identity(requestURI, "Not found yet...",
"false");
db.store(identity);
db.commit();
Logger.debug(this, "Trying to fetch manually added
identity (" + identity.getRequestURI() + ")");
@@ -330,7 +330,7 @@
private OwnIdentity createIdentity(String insertURI, String requestURI,
String nickName, String publishTrustList, String context) throws
InvalidParameterException, TransformerConfigurationException,
FileNotFoundException, ParserConfigurationException, TransformerException,
IOException, InsertException, Db4oIOException, DatabaseClosedException,
DuplicateScoreException, NotTrustedException, DuplicateTrustException {
// TODO Add context in the creation form
- OwnIdentity identity = new OwnIdentity(insertURI, requestURI,
nickName, publishTrustList, "testing");
+ OwnIdentity identity = new OwnIdentity(insertURI, requestURI,
nickName, publishTrustList);
db.store(identity);
identity.initTrustTree(db);
Modified: trunk/plugins/WoT/src/plugins/WoT/WoTTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/WoTTest.java 2008-09-12 10:13:54 UTC
(rev 22616)
+++ trunk/plugins/WoT/src/plugins/WoT/WoTTest.java 2008-09-12 10:47:29 UTC
(rev 22617)
@@ -42,7 +42,7 @@
public void testInitTrustTree() throws DuplicateScoreException,
NotInTrustTreeException, MalformedURLException, InvalidParameterException {
- OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true",
"test");
+ OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
db.store(a);
a.initTrustTree(db);
@@ -64,8 +64,8 @@
public void testSetTrust() throws DuplicateTrustException,
InvalidParameterException, DuplicateScoreException, NotTrustedException,
NotInTrustTreeException, MalformedURLException {
- OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true",
"test");
- Identity b = new Identity(uriB, "B", "true", "test");
+ OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
+ Identity b = new Identity(uriB, "B", "true");
db.store(a);
db.store(b);
@@ -134,9 +134,9 @@
}
public void testRemoveTrust() throws MalformedURLException,
InvalidParameterException, DuplicateScoreException, DuplicateTrustException,
NotTrustedException, NotInTrustTreeException {
- OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true",
"test");
- Identity b = new Identity(uriB, "B", "true", "test");
- Identity c = new Identity(uriC, "C", "true", "test");
+ OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
+ Identity b = new Identity(uriB, "B", "true");
+ Identity c = new Identity(uriC, "C", "true");
db.store(a);
db.store(b);
db.store(c);
@@ -196,9 +196,9 @@
}
public void testTrustLoop() throws MalformedURLException,
InvalidParameterException, DuplicateScoreException, DuplicateTrustException,
NotInTrustTreeException {
- OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true",
"test");
- Identity b = new Identity(uriB, "B", "true", "test");
- Identity c = new Identity(uriC, "C", "true", "test");
+ OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
+ Identity b = new Identity(uriB, "B", "true");
+ Identity c = new Identity(uriC, "C", "true");
db.store(a);
db.store(b);
db.store(c);
@@ -231,8 +231,8 @@
}
public void testOwnIndentitiesTrust() throws MalformedURLException,
InvalidParameterException, DuplicateScoreException, DuplicateTrustException,
NotTrustedException, NotInTrustTreeException {
- OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true",
"test");
- OwnIdentity b = new OwnIdentity(uriB, uriB, "B", "true",
"test");
+ OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
+ OwnIdentity b = new OwnIdentity(uriB, uriB, "B", "true");
db.store(a);
db.store(b);
a.initTrustTree(db);