Test of compareTo method, of class Place.
()
| 823 | * Test of compareTo method, of class Place. |
| 824 | */ |
| 825 | @Test |
| 826 | public void testCompareTo() { |
| 827 | System.out.println("compareTo"); |
| 828 | |
| 829 | Place instance = new Place("MyPlace", 1, 1, layer); |
| 830 | Place p1 = new Place("MyPlace", 0, 0, layer); |
| 831 | Place p2 = new Place("Another Place", -1, 2, layer); |
| 832 | |
| 833 | try { |
| 834 | instance.compareTo(null); |
| 835 | fail(); |
| 836 | } catch (Exception e) {} |
| 837 | |
| 838 | int expResult = instance.getName().compareTo(p1.getName()); |
| 839 | int result = instance.compareTo(p1); |
| 840 | assertEquals(expResult, result); |
| 841 | |
| 842 | expResult = instance.getName().compareTo(p2.getName()); |
| 843 | result = instance.compareTo(p2); |
| 844 | assertEquals(expResult, result); |
| 845 | } |
| 846 | |
| 847 | /** |
| 848 | * Test of removeConnections method, of class Place. |