User Tools

Site Tools


invariant:ex3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
invariant:ex3 [2007/02/25 18:23] – created bdefraininvariant:ex3 [2021/02/05 13:53] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Invariants: Preconditions ======+[[invariant:intro|Intro]] 
 +[[invariant:ex1|Ex1]] 
 +[[invariant:ex2|Ex2]] 
 +[[invariant:ex3|Ex3]] 
 +[[invariant:ex4|Ex4]] 
 +[[invariant:ex5|Ex5]]====== Invariants: Preconditions ======
  
-===== Point Precondition =====+===== Point Preconditions =====
  
 **Task:** Pass the suite ''tests.PointPreconditions''. **Task:** Pass the suite ''tests.PointPreconditions''.
Line 11: Line 16:
 </note> </note>
  
-This should make the test case of tests.Test2a pass, which wouldn't without your aspect. +This should make the test cases of ''tests.PointPreconditions'' pass, which wouldn't without your aspect. 
  
 ===== Group Preconditions ===== ===== Group Preconditions =====
Line 17: Line 22:
 **Task:** Pass the suite ''tests.GroupPreconditions''. **Task:** Pass the suite ''tests.GroupPreconditions''.
  
-''Group'' is a ''FigureElement'' class that encapsulates groups of other figure elements. As such, only actual figure element objects should be added to ''Group'' objects. Write an aspect to throw an ''IllegalArgumentException'' whenever an attempt is made to call ''Group.add()'' on a ''null'' value, or on the group itself.+''Group'' is a ''FigureElement'' class that encapsulates groups of other figure elements. As such, only actual figure element objects should be added to ''Group'' objects. Also, a group cannot be added to itself. Write an aspect to throw an ''IllegalArgumentException'' whenever an attempt is made to call ''Group.add()'' with a ''null'' value, or with the group itself.
  
 <note tip> <note tip>
Line 23: Line 28:
 </note> </note>
  
 +This should make the test cases of ''tests.GroupPreconditions'' pass.
 +
 +----
 +
 +After you have completed the exercise, remove your aspect from the build path; then continue with [[invariant:ex4|Exercise 4]].
invariant/ex3.1172424191.txt.gz · Last modified: 2007/02/25 18:23 by bdefrain