Revision d93a241d
Added by Andreas Müller over 13 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacadeTest.java | ||
---|---|---|
509 | 509 |
*/ |
510 | 510 |
@Test |
511 | 511 |
public void testGetSetAbsoluteElevation() { |
512 |
Assert.assertEquals("Absolute elevation must be same", |
|
513 |
absoluteElevation, specimenFacade.getAbsoluteElevation()); |
|
512 |
Assert.assertEquals("Absolute elevation must be same",absoluteElevation, specimenFacade.getAbsoluteElevation()); |
|
514 | 513 |
specimenFacade.setAbsoluteElevation(400); |
515 |
Assert.assertEquals("Absolute elevation must be 400", |
|
516 |
Integer.valueOf(400), specimenFacade.getAbsoluteElevation()); |
|
514 |
Assert.assertEquals("Absolute elevation must be 400",Integer.valueOf(400), specimenFacade.getAbsoluteElevation()); |
|
517 | 515 |
} |
518 | 516 |
|
519 | 517 |
/** |
... | ... | |
523 | 521 |
*/ |
524 | 522 |
@Test |
525 | 523 |
public void testGetSetAbsoluteElevationError() { |
526 |
Assert.assertEquals("Absolute elevation error must be same", |
|
527 |
absoluteElevationError, |
|
528 |
specimenFacade.getAbsoluteElevationError()); |
|
524 |
Assert.assertEquals("Absolute elevation must be same",absoluteElevation, specimenFacade.getAbsoluteElevation()); |
|
525 |
Assert.assertEquals("Absolute elevation error must be same",absoluteElevationError, specimenFacade.getAbsoluteElevationError()); |
|
529 | 526 |
specimenFacade.setAbsoluteElevationError(4); |
530 |
Assert.assertEquals("Absolute elevation error must be 4", |
|
531 |
Integer.valueOf(4), specimenFacade.getAbsoluteElevationError()); |
|
527 |
Assert.assertEquals("Absolute elevation error must be 4",Integer.valueOf(4), specimenFacade.getAbsoluteElevationError()); |
|
528 |
Assert.assertEquals("Absolute elevation must be same",absoluteElevation, specimenFacade.getAbsoluteElevation()); |
|
529 |
|
|
532 | 530 |
} |
533 | 531 |
|
534 | 532 |
@Test() |
535 | 533 |
public void testGetSetAbsoluteElevationRange() { |
536 | 534 |
Integer expected = absoluteElevation - 2; |
537 |
Assert.assertEquals("", expected, |
|
538 |
specimenFacade.getAbsoluteElevationMinimum()); |
|
535 |
Assert.assertEquals("", expected, specimenFacade.getAbsoluteElevationMinimum()); |
|
539 | 536 |
expected = absoluteElevation + 2; |
540 |
Assert.assertEquals("", expected, |
|
541 |
specimenFacade.getAbsoluteElevationMaximum()); |
|
537 |
Assert.assertEquals("", expected,specimenFacade.getAbsoluteElevationMaximum());
|
|
538 |
|
|
542 | 539 |
specimenFacade.setAbsoluteElevationRange(30, 36); |
543 |
Assert.assertEquals("", Integer.valueOf(36), |
|
544 |
specimenFacade.getAbsoluteElevationMaximum()); |
|
545 |
Assert.assertEquals("", Integer.valueOf(30), |
|
546 |
specimenFacade.getAbsoluteElevationMinimum()); |
|
540 |
Assert.assertEquals("", Integer.valueOf(36),specimenFacade.getAbsoluteElevationMaximum()); |
|
541 |
Assert.assertEquals("", Integer.valueOf(30),specimenFacade.getAbsoluteElevationMinimum()); |
|
542 |
Assert.assertEquals("", Integer.valueOf(33),specimenFacade.getAbsoluteElevation()); |
|
543 |
Assert.assertEquals("", Integer.valueOf(3),specimenFacade.getAbsoluteElevationError()); |
|
544 |
|
|
545 |
|
|
547 | 546 |
try { |
548 | 547 |
specimenFacade.setAbsoluteElevationRange(30, 35); |
549 | 548 |
Assert.fail("Odd distance needs to throw IllegalArgumentException"); |
550 | 549 |
} catch (IllegalArgumentException e) { |
551 | 550 |
Assert.assertTrue("Exception needs to be thrown", true); |
552 | 551 |
} |
552 |
|
|
553 | 553 |
specimenFacade.setAbsoluteElevationRange(41, null); |
554 |
Assert.assertEquals("", Integer.valueOf(41), |
|
555 |
specimenFacade.getAbsoluteElevationMaximum()); |
|
556 |
Assert.assertEquals("", Integer.valueOf(41), |
|
557 |
specimenFacade.getAbsoluteElevationMinimum()); |
|
558 |
Assert.assertEquals("", Integer.valueOf(41), |
|
559 |
specimenFacade.getAbsoluteElevation()); |
|
554 |
Assert.assertEquals("", Integer.valueOf(41),specimenFacade.getAbsoluteElevationMaximum()); |
|
555 |
Assert.assertEquals("", Integer.valueOf(41),specimenFacade.getAbsoluteElevationMinimum()); |
|
556 |
Assert.assertEquals("", Integer.valueOf(41),specimenFacade.getAbsoluteElevation()); |
|
560 | 557 |
Assert.assertNotNull("", specimenFacade.getAbsoluteElevationError()); |
561 |
Assert.assertEquals("", Integer.valueOf(0), |
|
562 |
specimenFacade.getAbsoluteElevationError()); |
|
558 |
Assert.assertEquals("", Integer.valueOf(0),specimenFacade.getAbsoluteElevationError());
|
|
559 |
|
|
563 | 560 |
specimenFacade.setAbsoluteElevationRange(null, null); |
564 | 561 |
Assert.assertNull("", specimenFacade.getAbsoluteElevation()); |
565 | 562 |
Assert.assertNull("", specimenFacade.getAbsoluteElevationError()); |
Also available in: Unified diff
some more tests for testGetSetAbsoluteElevationRange