@Test public void testMajorRadiusSetterError() { Ellipse ellipse = new Ellipse(); try { ellipse.setMajorRadius(-1); fail("invalid setter value for major radius"); } catch (Exception ex) { assertTrue("major radius invalid setter exception type", ex instanceof IllegalArgumentException); } }
public Ellipse setMajorRadius(double radius) { if (radius < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Ellipse", "setMajorRadius", "invalidRadius")); } this.majorRadius = radius; this.reset(); return this; }
Ellipse extends AbstractShape { public Ellipse setMajorRadius(double radius) { if (radius < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Ellipse", "setMajorRadius", "invalidRadius")); } this.majorRadius = radius; this.reset(); return this; } }
Ellipse extends AbstractShape { public Ellipse setMajorRadius(double radius) { if (radius < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Ellipse", "setMajorRadius", "invalidRadius")); } this.majorRadius = radius; this.reset(); return this; } Ellipse();  Ellipse(ShapeAttributes attributes);  Ellipse(Position center, double majorRadius, double minorRadius);  Ellipse(Position center, double majorRadius, double minorRadius, ShapeAttributes attributes); }
Ellipse extends AbstractShape { public Ellipse setMajorRadius(double radius) { if (radius < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Ellipse", "setMajorRadius", "invalidRadius")); } this.majorRadius = radius; this.reset(); return this; } Ellipse();  Ellipse(ShapeAttributes attributes);  Ellipse(Position center, double majorRadius, double minorRadius);  Ellipse(Position center, double majorRadius, double minorRadius, ShapeAttributes attributes); Position getCenter(); Ellipse setCenter(Position position); double getMajorRadius(); Ellipse setMajorRadius(double radius); double getMinorRadius(); Ellipse setMinorRadius(double radius); double getHeading(); Ellipse setHeading(double degrees); boolean isExtrude(); Ellipse setExtrude(boolean extrude); boolean isFollowTerrain(); Ellipse setFollowTerrain(boolean followTerrain); int getMaximumIntervals(); Ellipse setMaximumIntervals(int numIntervals); }
Ellipse extends AbstractShape { public Ellipse setMajorRadius(double radius) { if (radius < 0) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Ellipse", "setMajorRadius", "invalidRadius")); } this.majorRadius = radius; this.reset(); return this; } Ellipse();  Ellipse(ShapeAttributes attributes);  Ellipse(Position center, double majorRadius, double minorRadius);  Ellipse(Position center, double majorRadius, double minorRadius, ShapeAttributes attributes); Position getCenter(); Ellipse setCenter(Position position); double getMajorRadius(); Ellipse setMajorRadius(double radius); double getMinorRadius(); Ellipse setMinorRadius(double radius); double getHeading(); Ellipse setHeading(double degrees); boolean isExtrude(); Ellipse setExtrude(boolean extrude); boolean isFollowTerrain(); Ellipse setFollowTerrain(boolean followTerrain); int getMaximumIntervals(); Ellipse setMaximumIntervals(int numIntervals);  }