Beispiel #1
0
  /** Tests the successful setting of the minimum angle. */
  @Test
  public void setMinimum() {
    AngleJoint aj = new AngleJoint(new Body(), new Body());
    aj.setLowerLimit(Math.toRadians(-10));

    TestCase.assertEquals(Math.toRadians(-10), aj.getLowerLimit(), 1e-6);
  }
Beispiel #2
0
  /** Tests the successful setting of the minimum and maximum angle. */
  @Test
  public void setMinAndMax() {
    AngleJoint aj = new AngleJoint(new Body(), new Body());
    aj.setLimits(Math.toRadians(-30), Math.toRadians(20));

    TestCase.assertEquals(Math.toRadians(-30), aj.getLowerLimit(), 1e-6);
    TestCase.assertEquals(Math.toRadians(20), aj.getUpperLimit(), 1e-6);
  }
Beispiel #3
0
 /** Tests the failed setting of the maximum angle. */
 @Test(expected = IllegalArgumentException.class)
 public void setMinimumFail() {
   AngleJoint aj = new AngleJoint(new Body(), new Body());
   aj.setLowerLimit(Math.toRadians(10));
 }
Beispiel #4
0
 /** Tests the failed setting of the minimum and maximum angle. */
 @Test(expected = IllegalArgumentException.class)
 public void setMinAndMaxFail() {
   AngleJoint aj = new AngleJoint(new Body(), new Body());
   aj.setLimits(Math.toRadians(30), Math.toRadians(20));
 }