public class StudentTestableWindowController extends TestableWindowController
TestableWindowController
.
For most of your programming assignments, you will be extending an instance of the StudentTestableWindowController class. For Example:
public class Cube extends StudentTestableWindowController { ... }
Therefore, all instantiations of the class that you create can make use of the assert statements presented below. Unlike the typical JUnit assert statements, these must called as instance methods on an object:
Cube x = new Cube(); x.assertCanvasEmpty();
The TestableWindowController
class that
StudentTestableWindowController class inherits from contains additional
assert statements that can be referenced the same way. These methods
are far more generic than the more specific functions in
StudentTestableWindowController. The StudentTestableWindowController
will be useful for a lot of your purposes, but a more generic
function may be useful, from time to time.
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
StudentTestableWindowController() |
Modifier and Type | Method and Description |
---|---|
void |
assertCanvasEmpty()
Asserts there are no visible shape objects on the canvas.
|
void |
assertColor(double x,
double y,
Color color)
assertColor asserts that the shape being evaluated has the desired color.
|
void |
assertColor(objectdraw.DrawableInterface shape,
Color color)
assertColor asserts that the shape being evaluated has the desired color.
|
void |
assertCorrectArcAngle(objectdraw.FilledArc shape,
double angle)
assertCorrectArcAngle asserts that the shape being evaluated spans the correct angle.
|
void |
assertCorrectArcAngle(objectdraw.FramedArc shape,
double angle)
assertCorrectArcAngle asserts that the shape being evaluated spans the correct angle.
|
void |
assertCorrectArcHeight(objectdraw.FilledRoundedRect shape,
double height)
assertCorrectArcHeight asserts that the shape being evaluated has a correct corner arc height.
|
void |
assertCorrectArcHeight(objectdraw.FramedRoundedRect shape,
double height)
assertCorrectArcHeight asserts that the shape being evaluated has a correct corner arc height.
|
void |
assertCorrectArcWidth(objectdraw.FilledRoundedRect shape,
double width)
assertCorrectArcWidth asserts that the shape being evaluated has a correct corner arc width.
|
void |
assertCorrectArcWidth(objectdraw.FramedRoundedRect shape,
double width)
assertCorrectArcWidth asserts that the shape being evaluated has a correct corner arc width.
|
void |
assertCorrectFilledArcAngle(double x,
double y,
double angle)
assertCorrectArcAngle asserts that the shape being evaluated spans the correct angle.
|
void |
assertCorrectFilledArcStartAngle(double x,
double y,
double angle)
assertCorrectStartAngle asserts that the shape being evaluated has the correct starting angle.
|
void |
assertCorrectFilledRoundedRectArcHeight(double x,
double y,
double height)
assertCorrectArcHeight asserts that the shape being evaluated has a correct corner arc height.
|
void |
assertCorrectFilledRoundedRectArcWidth(double x,
double y,
double width)
assertCorrectArcWidth asserts that the shape being evaluated has a correct corner arc width.
|
void |
assertCorrectFont(double x,
double y,
Font font)
assertCorrectFont asserts that the textbox being evaluated is displaying the correct font.
|
void |
assertCorrectFont(objectdraw.Text shape,
Font font)
assertCorrectFont asserts that the textbox being evaluated is displaying the correct font.
|
void |
assertCorrectFramedArcAngle(double x,
double y,
double angle)
assertCorrectArcAngle asserts that the shape being evaluated spans the correct angle.
|
void |
assertCorrectFramedArcStartAngle(double x,
double y,
double angle)
assertCorrectStartAngle asserts that the frame arc being evaluated has the correct starting angle.
|
void |
assertCorrectFramedRoundedRectArcHeight(double x,
double y,
double height)
assertCorrectArcHeight asserts that the shape being evaluated has a correct corner arc height.
|
void |
assertCorrectFramedRoundedRectArcWidth(double x,
double y,
double width)
assertCorrectArcWidth asserts that the shape being evaluated has a correct corner arc width.
|
void |
assertCorrectImage(double x,
double y,
Image image)
assertCorrectImage asserts that the VisibleImage displayed is the correct image.
|
void |
assertCorrectImage(objectdraw.VisibleImage shape,
Image image)
assertCorrectImage asserts that the VisibleImage displayed is the correct image.
|
void |
assertCorrectStartAngle(objectdraw.FilledArc shape,
double angle)
assertCorrectStartAngle asserts that the shape being evaluated has the correct starting angle.
|
void |
assertCorrectStartAngle(objectdraw.FramedArc shape,
double angle)
assertCorrectStartAngle asserts that the shape being evaluated has the correct starting angle.
|
void |
assertCorrectText(double x,
double y,
String text)
assertCorrectText asserts that the textbox being evaluated is displaying the correct text.
|
void |
assertCorrectText(objectdraw.Text shape,
String text)
assertCorrectText asserts that the textbox being evaluated is displaying the correct text.
|
void |
assertExistAngLine(double x,
double y)
assertExistAngLine asserts that there exists an angle line at the given starting location.
|
void |
assertExistFilledArc(double x,
double y)
assertExistFilledArc asserts that there exists a filled arc at the specified (x, y) position
|
void |
assertExistFilledOval(double x,
double y)
assertExistFilledOval asserts that there exists a filled oval at the specified (x, y) position
|
void |
assertExistFilledRect(double x,
double y)
assertExistFilledRect asserts that there exists a filled rectangle at the specified (x, y) position
|
void |
assertExistFilledRoundedRect(double x,
double y)
assertExistFilledRoundedRect asserts that there exists a filled, rounded rectangle at the specified (x, y) position
|
void |
assertExistFramedArc(double x,
double y)
assertExistFramedArc asserts that there exists a framed arc at the specified (x, y) position
|
void |
assertExistFramedOval(double x,
double y)
assertExistFramedOval asserts that there exists a framed oval at the specified (x, y) position
|
void |
assertExistFramedRect(double x,
double y)
assertExistFramedRect asserts that there exists a framed rectangle at the specified (x, y) position
|
void |
assertExistFramedRoundedRect(double x,
double y)
assertExistFramedRect asserts that there exists a framed, rounded rectangle at the specified (x, y) position
|
void |
assertExistLine(double startx,
double starty)
assertExistLine asserts that there exists a line starting at the specified (x, y) position
|
void |
assertExistLine(double startx,
double starty,
double endx,
double endy)
assertExistLine asserts that there exists a line connection the start and end points.
|
void |
assertExistText(double x,
double y)
assertExistText asserts that there exists a textbox at the specified (x, y) position
|
void |
assertExistVisibleImage(double x,
double y)
assertExistVisibleImage asserts that there exists a VisibleImage at the specified (x, y) position
|
void |
assertHeight(double x,
double y,
double height)
assertHeight asserts that the shape being evaluated is a desired height.
|
void |
assertHeight(objectdraw.Drawable2DInterface shape,
double height)
assertHeight asserts that the shape being evaluated is a desired height.
|
void |
assertInvisible(double x,
double y)
assertInvisible asserts that the shape being evaluated is invisible to the canvas.
|
void |
assertInvisible(objectdraw.DrawableInterface shape)
assertInvisible asserts that the shape being evaluated is invisible to the canvas.
|
void |
assertIsAnEndpoint(double x,
double y,
double epx,
double epy)
assertIsAnEndpoint asserts that a line being tested has an endpoint at the given position.
|
void |
assertIsAnEndpoint(objectdraw.Line shape,
double x,
double y)
assertIsAnEndpoint asserts that a line being tested has an endpoint at the given position.
|
void |
assertLocationInShape(double x,
double y,
double xLoc,
double yLoc)
assertLocationInShape asserts that the shape being evaluated includes the specified (x,y) coordinate.
|
void |
assertLocationInShape(objectdraw.Drawable2DInterface shape,
double x,
double y)
assertLocationInShape asserts that the shape being evaluated includes the specified (x,y) coordinate.
|
void |
assertNotCanvasEmpty()
Asserts there is at least one visible element on the canvas.
|
void |
assertVisible(double x,
double y)
assertVisible asserts that the shape being evaluated is visible
|
void |
assertVisible(objectdraw.DrawableInterface shape)
assertVisible asserts that the shape being evaluated is visible
|
void |
assertWidth(double x,
double y,
double width)
assertWidth asserts that the shape being evaluated is a desired width.
|
void |
assertWidth(objectdraw.Drawable2DInterface shape,
double width)
assertWidth asserts that the shape being evaluated is a desired width.
|
assertHas2DObject, assertHas2DObject, assertHasLine, assertHasLine, assertNo2DObject, assertNo2DObject, assertNoLine, assertNoLine, get2DObject, get2DObjects, getCanvas, getFrame, getLine, getLines, has2DObject, hasLine, helpinit, paint, waitForInit
begin, onMouseClick, onMouseDrag, onMouseEnter, onMouseExit, onMouseMove, onMousePress, onMouseRelease
destroy, getAudio, getImage, getTime, getVersion, init, placeInFrame, resize, setup, start, startController, startController, stop
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public void assertCanvasEmpty()
public void assertNotCanvasEmpty()
public void assertExistFramedRect(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFilledRect(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistAngLine(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFilledArc(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFilledOval(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFramedArc(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFramedOval(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFramedRoundedRect(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistFilledRoundedRect(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistLine(double startx, double starty)
startx
- the x coordinate where the line beginsstarty
- the y coordinate where the line beginspublic void assertExistLine(double startx, double starty, double endx, double endy)
startx
- the x coordinate where the line begins.starty
- the y coordinate where the line begins.endx
- the x coordinate where the line ends.endy
- the y coordinate where the line ends.public void assertExistText(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertExistVisibleImage(double x, double y)
x
- the x coordinatey
- the y coordinatepublic void assertColor(double x, double y, Color color)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.color
- the color that is desired.public void assertVisible(double x, double y)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.public void assertInvisible(double x, double y)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.public void assertWidth(double x, double y, double width)
x
- the x coordinats of the shape being evaluated.y
- the y coordinate of the shape being evaluated.width
- the desired width of shapepublic void assertHeight(double x, double y, double height)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.height
- the desired height of shape.public void assertLocationInShape(double x, double y, double xLoc, double yLoc)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.xLoc
- the x coordinate of the location to be testedyLoc
- the y coordinate of the location to be testedpublic void assertCorrectFramedArcStartAngle(double x, double y, double angle)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectFilledArcStartAngle(double x, double y, double angle)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectFramedArcAngle(double x, double y, double angle)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectFilledArcAngle(double x, double y, double angle)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectFramedRoundedRectArcWidth(double x, double y, double width)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.width
- the appropriate width for shape.public void assertCorrectFramedRoundedRectArcHeight(double x, double y, double height)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.height
- the appropriate height for shape.public void assertCorrectFilledRoundedRectArcWidth(double x, double y, double width)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.width
- the appropriate width for shape.public void assertCorrectFilledRoundedRectArcHeight(double x, double y, double height)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.height
- the appropriate height for shape.public void assertCorrectText(double x, double y, String text)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.text
- desired textpublic void assertCorrectFont(double x, double y, Font font)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.font
- desired fontpublic void assertIsAnEndpoint(double x, double y, double epx, double epy)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.epx
- x coordinate of pointepy
- y coordinate of pointpublic void assertCorrectImage(double x, double y, Image image)
x
- the x coordinate of the shape being evaluated.y
- the y coordinate of the shape being evaluated.image
- the correct image to be displayed in VisibleImage.public void assertColor(objectdraw.DrawableInterface shape, Color color)
shape
- the shape being evaluated.color
- the color that is desired.public void assertVisible(objectdraw.DrawableInterface shape)
shape
- the shape being evaluated.public void assertInvisible(objectdraw.DrawableInterface shape)
shape
- the shape being evaluated.public void assertWidth(objectdraw.Drawable2DInterface shape, double width)
shape
- the shape being evaluatedwidth
- the desired width of shapepublic void assertHeight(objectdraw.Drawable2DInterface shape, double height)
shape
- the shape being evaluated.height
- the desired height of shape.public void assertLocationInShape(objectdraw.Drawable2DInterface shape, double x, double y)
shape
- the shape being evaluated.x
- the x coordinatey
- the y coordinatepublic void assertCorrectStartAngle(objectdraw.FramedArc shape, double angle)
shape
- the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectStartAngle(objectdraw.FilledArc shape, double angle)
shape
- the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectArcAngle(objectdraw.FramedArc shape, double angle)
shape
- the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectArcAngle(objectdraw.FilledArc shape, double angle)
shape
- the shape being evaluated.angle
- angle that is to be evaluated.public void assertCorrectArcWidth(objectdraw.FramedRoundedRect shape, double width)
shape
- the shape being evaluated.width
- the appropriate width for shape.public void assertCorrectArcHeight(objectdraw.FramedRoundedRect shape, double height)
shape
- the shape being evaluated.height
- the appropriate height for shape.public void assertCorrectArcWidth(objectdraw.FilledRoundedRect shape, double width)
shape
- the shape being evaluated.width
- the appropriate width for shape.public void assertCorrectArcHeight(objectdraw.FilledRoundedRect shape, double height)
shape
- the shape being evaluated.height
- the appropriate height for shape.public void assertCorrectText(objectdraw.Text shape, String text)
shape
- the shape being evaluated.text
- desired textpublic void assertCorrectFont(objectdraw.Text shape, Font font)
shape
- the shape being evaluated.font
- desired fontpublic void assertIsAnEndpoint(objectdraw.Line shape, double x, double y)
shape
- the shape being evaluated.x
- x coordinate of pointy
- y coordinate of pointpublic void assertCorrectImage(objectdraw.VisibleImage shape, Image image)
shape
- the shape being evaluated.image
- the correct image to be displayed in VisibleImage.