Author: xor
Date: 2008-11-10 02:23:33 +0000 (Mon, 10 Nov 2008)
New Revision: 23460

Modified:
   trunk/plugins/WoT/test/IdentityTest.java
   trunk/plugins/WoT/test/ScoreTest.java
   trunk/plugins/WoT/test/TrustTest.java
   trunk/plugins/WoT/test/WoTTest.java
Log:
Reflect interface changes of previous comment.

Modified: trunk/plugins/WoT/test/IdentityTest.java
===================================================================
--- trunk/plugins/WoT/test/IdentityTest.java    2008-11-10 02:23:00 UTC (rev 
23459)
+++ trunk/plugins/WoT/test/IdentityTest.java    2008-11-10 02:23:33 UTC (rev 
23460)
@@ -37,7 +37,7 @@

                db = Db4o.openFile("identityTest.db4o");

-               identity = new Identity(uri, "test", "true");
+               identity = new Identity(uri, "test", true);
                identity.addContext("bleh", db);

                db.store(identity);

Modified: trunk/plugins/WoT/test/ScoreTest.java
===================================================================
--- trunk/plugins/WoT/test/ScoreTest.java       2008-11-10 02:23:00 UTC (rev 
23459)
+++ trunk/plugins/WoT/test/ScoreTest.java       2008-11-10 02:23:33 UTC (rev 
23460)
@@ -42,8 +42,8 @@
                super.setUp();
                db = Db4o.openFile("scoreTest.db4o");

-               a = new OwnIdentity(uriA, uriA, "A", "true");
-               b = new Identity(uriB, "B", "true");
+               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/test/TrustTest.java
===================================================================
--- trunk/plugins/WoT/test/TrustTest.java       2008-11-10 02:23:00 UTC (rev 
23459)
+++ trunk/plugins/WoT/test/TrustTest.java       2008-11-10 02:23:33 UTC (rev 
23460)
@@ -43,9 +43,9 @@
                super.setUp();
                db = Db4o.openFile("trustTest.db4o");

-               a = new Identity(uriA, "A", "true");
-               b = new Identity(uriB, "B", "true");
-               Trust trust = new Trust(a,b,100,"test");
+               a = new Identity(uriA, "A", true);
+               b = new Identity(uriB, "B", true);
+               Trust trust = new Trust(a,b,(byte)100,"test");
                db.store(trust);
                db.store(a);
                db.store(b);

Modified: trunk/plugins/WoT/test/WoTTest.java
===================================================================
--- trunk/plugins/WoT/test/WoTTest.java 2008-11-10 02:23:00 UTC (rev 23459)
+++ trunk/plugins/WoT/test/WoTTest.java 2008-11-10 02:23:33 UTC (rev 23460)
@@ -52,7 +52,7 @@

        public void testInitTrustTree() throws DuplicateScoreException, 
NotInTrustTreeException, MalformedURLException, InvalidParameterException {

-               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
+               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", true);
                db.store(a);
                a.initTrustTree(db);

@@ -74,13 +74,13 @@

        public void testSetTrust() throws DuplicateTrustException, 
InvalidParameterException, DuplicateScoreException, NotTrustedException, 
NotInTrustTreeException, MalformedURLException {

-               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
-               Identity b = new Identity(uriB, "B", "true");
+               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", true);
+               Identity b = new Identity(uriB, "B", true);
                db.store(a);
                db.store(b);

                // With A's trust tree not initialized, B shouldn't get a Score.
-               a.setTrust(db, b, 10, "Foo");
+               a.setTrust(db, b, (byte)10, "Foo");

                assertTrue(Identity.getNbIdentities(db) == 1);
                assertTrue(OwnIdentity.getNbOwnIdentities(db) == 1);
@@ -89,7 +89,7 @@

                // Initialize A's trust tree and set the trust relationship
                a.initTrustTree(db);
-               a.setTrust(db, b, 100, "Foo");
+               a.setTrust(db, b, (byte)100, "Foo");

                // Check we have the correct number of objects
                assertTrue(Identity.getNbIdentities(db) == 1);
@@ -114,7 +114,7 @@
                assertTrue(b.getScore(a, db).getCapacity() == 40);

                // Change the trust value and comment
-               a.setTrust(db, b, 50, "Bar");
+               a.setTrust(db, b, (byte)50, "Bar");

                // Check we have the correct number of objects
                assertTrue(Identity.getNbIdentities(db) == 1);
@@ -144,15 +144,15 @@
        }

        public void testRemoveTrust() throws MalformedURLException, 
InvalidParameterException, DuplicateScoreException, DuplicateTrustException, 
NotTrustedException, NotInTrustTreeException {
-               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
-               Identity b = new Identity(uriB, "B", "true");
-               Identity c = new Identity(uriC, "C", "true");
+               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);
                a.initTrustTree(db);
-               a.setTrust(db, b, 100, "Foo");
-               b.setTrust(db, c, 50, "Bar");
+               a.setTrust(db, b, (byte)100, "Foo");
+               b.setTrust(db, c, (byte)50, "Bar");

                // Check we have the correct number of objects
                assertTrue(OwnIdentity.getNbOwnIdentities(db) == 1);
@@ -175,7 +175,7 @@
                assertTrue(c.getScore(a, db).getRank() == 2);
                assertTrue(c.getScore(a, db).getCapacity() == 16);

-               a.setTrust(db, b, -1, "Bastard");
+               a.setTrust(db, b, (byte)-1, "Bastard");

                // Check we have the correct number of objects
                assertTrue(OwnIdentity.getNbOwnIdentities(db) == 1);
@@ -206,17 +206,17 @@
        }

        public void testTrustLoop() throws MalformedURLException, 
InvalidParameterException, DuplicateScoreException, DuplicateTrustException, 
NotInTrustTreeException {
-               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
-               Identity b = new Identity(uriB, "B", "true");
-               Identity c = new Identity(uriC, "C", "true");
+               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);
                a.initTrustTree(db);
-               a.setTrust(db, b, 100, "Foo");
-               b.setTrust(db, c, 50, "Bar");
-               c.setTrust(db, a, 100, "Bleh");
-               c.setTrust(db, b, 50, "Oops");
+               a.setTrust(db, b, (byte)100, "Foo");
+               b.setTrust(db, c, (byte)50, "Bar");
+               c.setTrust(db, a, (byte)100, "Bleh");
+               c.setTrust(db, b, (byte)50, "Oops");

                // Check we have the correct number of objects
                assertTrue(OwnIdentity.getNbOwnIdentities(db) == 1);
@@ -241,14 +241,14 @@
        }

        public void testOwnIndentitiesTrust() throws MalformedURLException, 
InvalidParameterException, DuplicateScoreException, DuplicateTrustException, 
NotTrustedException, NotInTrustTreeException {
-               OwnIdentity a = new OwnIdentity(uriA, uriA, "A", "true");
-               OwnIdentity b = new OwnIdentity(uriB, uriB, "B", "true");
+               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);
                b.initTrustTree(db);
-               a.setTrust(db, b, 100, "Foo");
-               b.setTrust(db, a, 100, "Bar");
+               a.setTrust(db, b, (byte)100, "Foo");
+               b.setTrust(db, a, (byte)100, "Bar");

                // Check we have the correct number of objects
                assertTrue(OwnIdentity.getNbOwnIdentities(db) == 2);


Reply via email to