Skip to content
Browse files

upgraded Grails to 1.3.6, started adding unit tests

  • Loading branch information...
1 parent b49ba03 commit b7d986b00d183f26b44fc386db1cf524c65e5424 @mindcrime mindcrime committed
View
2 .classpath
@@ -7,6 +7,8 @@
<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/ldap"/>
<classpathentry kind="src" path="grails-app/shindig"/>
+ <classpathentry kind="src" path="test/unit"/>
+ <classpathentry kind="src" path="test/integration"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/commons-math-2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-3.0.1.jar"/>
View
2 .settings/org.eclipse.wst.common.component
@@ -4,5 +4,7 @@
<wb-resource deploy-path="/" source-path="/grails-app/shindig"/>
<wb-resource deploy-path="/" source-path="/grails-app/src"/>
<wb-resource deploy-path="/" source-path="/grails-app/listeners"/>
+ <wb-resource deploy-path="/" source-path="/test/unit"/>
+ <wb-resource deploy-path="/" source-path="/test/integration"/>
</wb-module>
</project-modules>
View
11 application.properties
@@ -1,10 +1,11 @@
#Grails Metadata file
-#Sun Dec 12 00:57:50 EST 2010
-app.grails.version=1.3.3
-app.name=quoddy2
+#Wed Jan 12 22:15:50 EST 2011
app.context=/
+app.grails.version=1.3.6
+app.name=quoddy2
app.servlet.version=2.5
app.version=0.1
-plugins.hibernate=1.3.3
+plugins.code-coverage=1.2
+plugins.hibernate=1.3.6
plugins.navigation=1.1.1
-plugins.tomcat=1.3.3
+plugins.tomcat=1.3.6
View
11 grails-app/controllers/org/fogbeam/quoddy/UserController.groovy
@@ -234,11 +234,18 @@ class UserController {
User user = userService.findUserByUuid( uuid );
Profile profile = user.profile;
- profile.summary = params.summary;
+
+ profile.birthMonth = Integer.parseInt( params.birthMonth );
+ profile.birthDayOfMonth = Integer.parseInt( params.birthDayOfMonth );
+ profile.birthYear = Integer.parseInt( params.birthYear );
+
+ // sex?
+ // TODO: sex
profileService.updateProfile( profile );
- redirect(controller:"user",action:"viewUser", params:[userId:user.userId]);
+ // userHome/index/prhodes
+ redirect(controller:"userHome",action:"index", params:[id:user.userId]);
}
def editAccount =
View
4 grails-app/domain/org/fogbeam/quoddy/profile/Profile.groovy
@@ -84,6 +84,6 @@ class Profile {
organizations:OrganizationAssociation, employmentHistory:HistoricalEmployer, \
educationHistory:EducationalExperience, links:String, contactAddresses:String, favorites: Favorite ];
- static belongsTo = [owner:User];
-
+ static belongsTo = [owner:User];
+
}
View
35 grails-app/views/user/editProfile.gsp
@@ -23,6 +23,41 @@
<dt>Summary:</dt>
<dd><g:textField name="summary" value="${userToEdit?.profile?.summary}" /></dd>
+ <dt>Birthday (mm/dd/yyyy)</dt>
+ <dd>
+ <g:textField name="birthDayOfMonth" value="${userToEdit?.profile?.birthDayOfMonth}" />
+ <g:textField name="birthMonth" value="${userToEdit?.profile?.birthMonth}" />
+ <g:textField name="birthYear" value="${userToEdit?.profile?.birthYear}" />
+ </dd>
+ <dt>Sex</dt>
+ <dd><g:textField name="sex" value="${userToEdit?.profile?.sex}" /></dd>
+
+ <!-- other fields -->
+ <dt>Location:</dt>
+ <dd>&nbsp;</dd>
+ <dt>Hometown:</dt>
+ <dd>&nbsp;</dd>
+ <dt>Languages:</dt>
+ <dd>&nbsp;</dd>
+ <dt>Interests:</dt>
+ <dd>&nbsp;</dd>
+ <dt>Skills:</dt>
+ <dd>&nbsp;</dd>
+ <dt>Groups & Organizations</dt>
+ <dd>&nbsp;</dd>
+ <dt>Employment History</dt>
+ <dd>&nbsp;</dd>
+ <dt>Educational Hisotry</dt>
+ <dd>&nbsp;</dd>
+ <dt>Contact Addresses:</dt>
+ <dd>&nbsp;</dd>
+ <dt>Favorites:</dt>
+ <dd></dd>
+ <dt>Projects:</dt>
+ <dd>&nbsp;</dd>
+
+
+
<dt>&nbsp;</dt>
<dd><g:submitButton name="saveProfile" value="Save"/></dd>
</dl>
View
46 test/unit/org/fogbeam/quoddy/AdminControllerTest.groovy
@@ -0,0 +1,46 @@
+package org.fogbeam.quoddy
+
+import grails.test.ControllerUnitTestCase;
+import groovy.lang.MetaClass;
+
+class AdminControllerTest extends ControllerUnitTestCase
+{
+
+ protected void setUp()
+ {
+ super.setUp()
+ }
+
+ protected void tearDown()
+ {
+ super.tearDown()
+ }
+
+ void testIndex()
+ {
+ def returnMap = controller.index();
+
+ assertEquals( [], returnMap );
+ }
+
+/*
+ void testUpdateNotFound()
+ {
+
+ def bm1 = new Bookmark( url: new URL("http://www.example.com/1"), title: "Bookmark1", notes:"",
+ dateCreated:new Date(), type: "blog", id:1 );
+ def bm2 = new Bookmark( url: new URL("http://www.example.com/2"), title: "Bookmark1", notes:"",
+ dateCreated:new Date(), type: "blog", id:2 );
+
+
+ mockDomain(Bookmark, [bm1, bm2])
+ controller.metaClass.message = {args -> println "foo: ${args}"}
+ controller.params.id = 27;
+ controller.update();
+ assertEquals "list", controller.redirectArgs["action"]
+
+
+ }
+ */
+
+}
View
19 web-app/WEB-INF/tld/c.tld
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
- <description>JSTL 1.1 core library</description>
+ <description>JSTL 1.2 core library</description>
<display-name>JSTL core</display-name>
- <tlib-version>1.1</tlib-version>
+ <tlib-version>1.2</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
@@ -174,6 +174,9 @@ Collection of items to iterate over.
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
+ <deferred-value>
+ <type>java.lang.Object</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -253,6 +256,9 @@ String of tokens to iterate over.
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
+ <deferred-value>
+ <type>java.lang.String</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -467,6 +473,9 @@ Expression to be evaluated.
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
+ <deferred-value>
+ <type>java.lang.Object</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
View
8 web-app/WEB-INF/tld/fmt.tld
@@ -2,12 +2,12 @@
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
- <description>JSTL 1.1 i18n-capable formatting library</description>
+ <description>JSTL 1.2 i18n-capable formatting library</description>
<display-name>JSTL fmt</display-name>
- <tlib-version>1.1</tlib-version>
+ <tlib-version>1.2</tlib-version>
<short-name>fmt</short-name>
<uri>http://java.sun.com/jsp/jstl/fmt</uri>

0 comments on commit b7d986b

Please sign in to comment.
Something went wrong with that request. Please try again.