Permalink
Browse files

fixed typos from manuscript in chapter 9, also corrected use of isVal…

…id which now throws an exception during test
  • Loading branch information...
1 parent 78a5aef commit a25b83505c9f3c0aa0398e868b5d29167fe8f3a9 @krimple committed Jun 6, 2012
@@ -1,5 +1,5 @@
#HSQL Database Engine 1.8.0.10
-#Sun Feb 26 20:30:39 EST 2012
+#Wed Jun 06 07:39:56 EDT 2012
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
@@ -10,7 +10,7 @@
<aspectj.version>1.6.12.M2</aspectj.version>
<java.version>1.6</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <roo.version>1.2.1.RELEASE</roo.version>
+ <roo.version>1.2.2.RELEASE</roo.version>
<slf4j.version>1.6.2</slf4j.version>
<spring.version>3.1.0.RELEASE</spring.version>
<powermock.version>1.4.8</powermock.version>
@@ -33,7 +33,7 @@
@Column(name = "max_capacity")
@Min(1L)
@Max(9999L)
- private Integer maxiumumCapacity;
+ private Integer maximumCapacity;
@NotNull
@Enumerated(EnumType.STRING)
@@ -30,8 +30,8 @@
private Instructor instructor;
@AssertTrue(message = "course.full.exception")
- public boolean isValid() {
- int maxCapacity = course.getMaxiumumCapacity();
+ public boolean validate() {
+ int maxCapacity = course.getMaximumCapacity();
return registrations.size() <= maxCapacity;
}
@@ -7,7 +7,7 @@ label_org_rooina_coursemanager_model_course_coursetype=Course Type
label_org_rooina_coursemanager_model_course_createddate=Created Date
label_org_rooina_coursemanager_model_course_description=Description
label_org_rooina_coursemanager_model_course_id=Id
-label_org_rooina_coursemanager_model_course_maxiumumcapacity=Maxiumum Capacity
+label_org_rooina_coursemanager_model_course_maximumcapacity=Maximum Capacity
label_org_rooina_coursemanager_model_course_name=Name
label_org_rooina_coursemanager_model_course_offerings=Offerings
label_org_rooina_coursemanager_model_course_plural=Courses
@@ -67,7 +67,7 @@ label_org_rooinaction_coursemanager_model_course_coursetype=Course Type
label_org_rooinaction_coursemanager_model_course_createddate=Created Date
label_org_rooinaction_coursemanager_model_course_description=Description
label_org_rooinaction_coursemanager_model_course_id=Id
-label_org_rooinaction_coursemanager_model_course_maxiumumcapacity=Maxiumum Capacity
+label_org_rooinaction_coursemanager_model_course_maximumcapacity=Maximum Capacity
label_org_rooinaction_coursemanager_model_course_name=Name
label_org_rooinaction_coursemanager_model_course_offerings=Offerings
label_org_rooinaction_coursemanager_model_course_plural=Courses
@@ -5,7 +5,7 @@
<form:create id="fc_org_rooinaction_coursemanager_model_Course" modelAttribute="course" path="/courses" render="${empty dependencies}" z="Jb56dWTQ+C+WVs6Lqwwe1i1jBuk=">
<field:textarea field="name" id="c_org_rooinaction_coursemanager_model_Course_name" required="true" z="6aq/bVTy+KcU9NlufAcbAsSt/9Y="/>
<field:textarea field="description" id="c_org_rooinaction_coursemanager_model_Course_description" required="true" z="Q9ukgXh+wGR3LOcC4ckjUaS0Aw8="/>
- <field:input field="maxiumumCapacity" id="c_org_rooinaction_coursemanager_model_Course_maxiumumCapacity" max="9999" min="1" required="true" validationMessageCode="field_invalid_integer" z="hf2xBBpmWBfb0v8nQ6vIIGyOfbE="/>
+ <field:input field="maximumCapacity" id="c_org_rooinaction_coursemanager_model_Course_maximumCapacity" max="9999" min="1" required="true" validationMessageCode="field_invalid_integer" z="hf2xBBpmWBfb0v8nQ6vIIGyOfbE="/>
<field:select field="courseType" id="c_org_rooinaction_coursemanager_model_Course_courseType" items="${coursetypeenums}" path="coursetypeenums" required="true" z="izXSG9CROOC8Ud1vFTb3n8PKWiI="/>
<field:input field="trainingProgram" id="c_org_rooinaction_coursemanager_model_Course_trainingProgram" z="8WiQTyNlzLGmT7kULWa95MQ3ZcI="/>
<field:input field="tags" id="c_org_rooinaction_coursemanager_model_Course_tags" z="XGZQA4Z4ZtWk+X6syPv5GQnTNww="/>
@@ -6,7 +6,7 @@
<table:table data="${courses}" id="l_org_rooinaction_coursemanager_model_Course" path="/courses" z="U0m1wu8eGzG3+wo0U2obtDRhs0o=">
<table:column id="c_org_rooinaction_coursemanager_model_Course_name" property="name" z="ufXSBbrxBH90UpAXQVn1uBw4YK8="/>
<table:column id="c_org_rooinaction_coursemanager_model_Course_description" property="description" z="HBRpKIt6MM1zEsZ3S1yxVteHv7M="/>
- <table:column id="c_org_rooinaction_coursemanager_model_Course_maxiumumCapacity" property="maxiumumCapacity" z="Y+Z9J0JoJLBpdDFixlhd9v6QWho="/>
+ <table:column id="c_org_rooinaction_coursemanager_model_Course_maximumCapacity" property="maximumCapacity" z="Y+Z9J0JoJLBpdDFixlhd9v6QWho="/>
<table:column id="c_org_rooinaction_coursemanager_model_Course_courseType" property="courseType" z="qm/dUs/P+qJyWSA9Z3zS7+jxQfc="/>
<table:column id="c_org_rooinaction_coursemanager_model_Course_trainingProgram" property="trainingProgram" z="kFLf3ClejXDlKnAzDW2uYDBLnJA="/>
<table:column id="c_org_rooinaction_coursemanager_model_Course_tags" property="tags" z="kOtGL6vPaS4MTz7UhGV2RYZMkv0="/>
@@ -5,7 +5,7 @@
<page:show id="ps_org_rooinaction_coursemanager_model_Course" object="${course}" path="/courses" z="eBafIdGrFi8BjAepyA3D3xRWZMw=">
<field:display field="name" id="s_org_rooinaction_coursemanager_model_Course_name" object="${course}" z="yZD4KdR6ciSu6TW2468SYcFMVGA="/>
<field:display field="description" id="s_org_rooinaction_coursemanager_model_Course_description" object="${course}" z="/EYozAzYNULXsSjBiK0ngVBEvxE="/>
- <field:display field="maxiumumCapacity" id="s_org_rooinaction_coursemanager_model_Course_maxiumumCapacity" object="${course}" z="djnqup5QkAnKeDPS00VDotS+vdc="/>
+ <field:display field="maximumCapacity" id="s_org_rooinaction_coursemanager_model_Course_maximumCapacity" object="${course}" z="djnqup5QkAnKeDPS00VDotS+vdc="/>
<field:display field="courseType" id="s_org_rooinaction_coursemanager_model_Course_courseType" object="${course}" z="xcREAwaX3ObsyMtt8vXxXmYeW14="/>
<field:display field="trainingProgram" id="s_org_rooinaction_coursemanager_model_Course_trainingProgram" object="${course}" z="+298sFDo7eErz5vYftitwThd11Q="/>
<field:display field="tags" id="s_org_rooinaction_coursemanager_model_Course_tags" object="${course}" z="IVOBSk9nfBO3+ew5GDNLEAaGhiY="/>
@@ -5,7 +5,7 @@
<form:update id="fu_org_rooinaction_coursemanager_model_Course" modelAttribute="course" path="/courses" versionField="Version" z="6Y9GFhgVFgmCzMZkYPHatg5Pc8Q=">
<field:textarea field="name" id="c_org_rooinaction_coursemanager_model_Course_name" required="true" z="6aq/bVTy+KcU9NlufAcbAsSt/9Y="/>
<field:textarea field="description" id="c_org_rooinaction_coursemanager_model_Course_description" required="true" z="Q9ukgXh+wGR3LOcC4ckjUaS0Aw8="/>
- <field:input field="maxiumumCapacity" id="c_org_rooinaction_coursemanager_model_Course_maxiumumCapacity" max="9999" min="1" required="true" validationMessageCode="field_invalid_integer" z="hf2xBBpmWBfb0v8nQ6vIIGyOfbE="/>
+ <field:input field="maximumCapacity" id="c_org_rooinaction_coursemanager_model_Course_maximumCapacity" max="9999" min="1" required="true" validationMessageCode="field_invalid_integer" z="hf2xBBpmWBfb0v8nQ6vIIGyOfbE="/>
<field:select field="courseType" id="c_org_rooinaction_coursemanager_model_Course_courseType" items="${coursetypeenums}" path="coursetypeenums" required="true" z="izXSG9CROOC8Ud1vFTb3n8PKWiI="/>
<field:input field="trainingProgram" id="c_org_rooinaction_coursemanager_model_Course_trainingProgram" z="8WiQTyNlzLGmT7kULWa95MQ3ZcI="/>
<field:input field="tags" id="c_org_rooinaction_coursemanager_model_Course_tags" z="XGZQA4Z4ZtWk+X6syPv5GQnTNww="/>
@@ -32,7 +32,7 @@
</tr>
<tr>
<td>type</td>
- <td>_maxiumumCapacity_id</td>
+ <td>_maximumCapacity_id</td>
<td>1</td>
</tr>
<tr>
@@ -27,7 +27,7 @@ public void addAndFetchCourse() {
c.setCourseType(CourseTypeEnum.CONTINUING_EDUCATION);
c.setName("Stand-up Comedy");
c.setDescription("You'll laugh, you'll cry, it will become a part of you.");
- c.setMaxiumumCapacity(10);
+ c.setMaximumCapacity(10);
c.persist();
c.flush();
@@ -38,7 +38,7 @@ public void addAndFetchCourse() {
Assert.assertNotNull(c2);
Assert.assertEquals(c.getName(), c2.getName());
Assert.assertEquals(c2.getDescription(), c.getDescription());
- Assert.assertEquals(c.getMaxiumumCapacity(), c2.getMaxiumumCapacity());
+ Assert.assertEquals(c.getMaximumCapacity(), c2.getMaximumCapacity());
Assert.assertEquals(c.getCourseType(), c2.getCourseType());
}
@@ -69,7 +69,7 @@ public void testPersistTagsInCourses() {
public void testSpecificException() {
Course c = new Course();
c.setCourseType(CourseTypeEnum.CONTINUING_EDUCATION);
- c.setMaxiumumCapacity(10);
+ c.setMaximumCapacity(10);
//c.setRunDate(new Date());
c.setName(null);
c.setDescription(null);
@@ -101,7 +101,7 @@ public void testFindByNameFinder() {
c.setName("Basket Weaving");
c.setCourseType(CourseTypeEnum.SEMINAR);
c.setDescription("Weaving baskets is an essential skill.");
- c.setMaxiumumCapacity(100);
+ c.setMaximumCapacity(100);
c.persist();
c.flush();
@@ -28,7 +28,7 @@ public void testCourseCreate() throws Exception {
webDriver.findElement(By.id("_name_id")).sendKeys("someName1");
webDriver.findElement(By.id("_description_id")).sendKeys("someDescription1");
- webDriver.findElement(By.id("_maxiumumCapacity_id")).sendKeys("1");
+ webDriver.findElement(By.id("_maximumCapacity_id")).sendKeys("1");
webDriver.findElement(By.id("_createdDate_id")).sendKeys("5/1/11");
webDriver.findElement(By.id("proceed")).click();
Assert.assertEquals(true, 0 < webDriver.getPageSource().indexOf("Show Course"));

0 comments on commit a25b835

Please sign in to comment.