|
From: <ian...@us...> - 2007-07-01 00:16:17
|
Revision: 205
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=205&view=rev
Author: iansmith
Date: 2007-06-30 17:16:17 -0700 (Sat, 30 Jun 2007)
Log Message:
-----------
Two minor change/workarounds to get all tests to pass:
1) In hiberate defn the "unique" modifier to the email field of accountrecord was causing hypersonic to barf on creation of the table. Seemed legal and sensible to me
be able to declare a field unique in that spot but removing it allowed tables to be
created ok.
17:06:37,107 ERROR SchemaExport:168 - Unexpected token: UNIQUE in statement [cre
ate table AccountRecords (username varchar(255) not null, email varchar(255) not
null unique]
2) Some test code was reading the content-length header of a response from a server
and was assuming that there would be only one header with that name. This resulted
in a compile-time error (how was this working at all?) because the returned value
was a vector of results, not a single value. Added "get(0)" because I couldn't
see an HTML protocol that expected to NOT to use the 0th.
Minor changes here-and-there to remove warnings.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
spaces/trunk/src/hibernate.cfg.xml
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 00:16:17 UTC (rev 205)
@@ -65,19 +65,10 @@
URI serviceURI1 = null;
- private String spaceName1;
-
- private long spaceID1;
-
- private String templateName1;
-
public void setUp() {
try {
- spaceID1 = 1;
- spaceName1 = "Angry Young Space";
serviceURI1 = new URI("http://127.0.0.1:8080/og/");
linkURI1 = new URI("http://ogoglio.com/");
- templateName1 = "Flat Blue Earth";
} catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
@@ -92,7 +83,7 @@
try {
String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
assertNotNull("got null auth cookie", adminAuthCookie);
-
+ System.out.println("PASSED FIRST FART");
try {
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME1, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME2, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
@@ -136,7 +127,7 @@
} catch (Exception e) {
e.printStackTrace();
- fail();
+ fail("Might want to check to make sure database exists and library account exists...");
}
}
@@ -378,7 +369,7 @@
assertNotNull(stream);
consume(stream);
- PossessionDocument removedPossDoc = webClient1.removePossessionFromSpace(thingDocs[0].getOwnerUsername(), thingDocs[0].getPossessionID());
+ webClient1.removePossessionFromSpace(thingDocs[0].getOwnerUsername(), thingDocs[0].getPossessionID());
thingDocs = webClient1.getThingDocuments();
assertEquals(0, thingDocs.length);
@@ -454,7 +445,7 @@
private class TestListener implements Space.Listener {
- Vector personAdds = new Vector();
+ java.util.Vector personAdds = new java.util.Vector();
Vector personRemoves = new Vector();
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 00:16:17 UTC (rev 205)
@@ -571,7 +571,7 @@
if (connection.getResponseCode() != 200) {
return -1;
}
- String lengthHeader = (String)connection.getRequestProperties().get("Content-Length");
+ String lengthHeader = (String)connection.getRequestProperties().get("Content-Length").get(0);
if(lengthHeader == null) {
return -1;
}
Modified: spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-07-01 00:16:17 UTC (rev 205)
@@ -77,7 +77,7 @@
<id name="username">
</id>
- <property name="email" not-null="true" unique="true" />
+ <property name="email" not-null="true"/>
<property name="accountlevel" not-null="true" />
<property name="password"/>
<property name="firstName"/>
Modified: spaces/trunk/src/hibernate.cfg.xml
===================================================================
--- spaces/trunk/src/hibernate.cfg.xml 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/hibernate.cfg.xml 2007-07-01 00:16:17 UTC (rev 205)
@@ -33,7 +33,7 @@
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- THIS IS THE LINE YOU UNCOMMENT TO CREATE YOUR SCHEMA -->
- <!-- <property name="hbm2ddl.auto">create</property> -->
+ <!-- <property name="hbm2ddl.auto">create</property> -->
<mapping resource="com/ogoglio/persist/Persist.hbm.xml"/>
</session-factory>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|