Esempio n. 1
0
 @Test
 public void testClone() {
   assertEquals(gen11, gen11.clone());
   assertEquals(gen11, gen11.clone());
   assertEquals(rev99, rev99.clone());
   assertEquals(rev99, rev99.clone());
 }
Esempio n. 2
0
 @Test
 public void testGetOrdinal() {
   assertEquals(4, gen11.getOrdinal());
   assertEquals(5, gen12.getOrdinal());
   assertEquals(36, gen21.getOrdinal());
   assertEquals(37, gen22.getOrdinal());
   assertEquals(31935, rev11.getOrdinal());
   assertEquals(31936, rev12.getOrdinal());
   assertEquals(31956, rev21.getOrdinal());
   assertEquals(31957, rev22.getOrdinal());
   assertEquals(32359, rev99.getOrdinal());
 }
Esempio n. 3
0
 @Test
 public void testGetVerse() {
   assertEquals(gen11.getVerse(), 1);
   assertEquals(gen12.getVerse(), 2);
   assertEquals(gen21.getVerse(), 1);
   assertEquals(gen22.getVerse(), 2);
   assertEquals(rev11.getVerse(), 1);
   assertEquals(rev12.getVerse(), 2);
   assertEquals(rev21.getVerse(), 1);
   assertEquals(rev22.getVerse(), 2);
   assertEquals(rev99.getVerse(), 21);
 }
Esempio n. 4
0
 @Test
 public void testGetChapter() {
   assertEquals(gen11.getChapter(), 1);
   assertEquals(gen12.getChapter(), 1);
   assertEquals(gen21.getChapter(), 2);
   assertEquals(gen22.getChapter(), 2);
   assertEquals(rev11.getChapter(), 1);
   assertEquals(rev12.getChapter(), 1);
   assertEquals(rev21.getChapter(), 2);
   assertEquals(rev22.getChapter(), 2);
   assertEquals(rev99.getChapter(), 22);
 }
Esempio n. 5
0
 @Test
 public void testGetBook() {
   assertEquals(gen11.getBook(), BibleBook.GEN);
   assertEquals(gen12.getBook(), BibleBook.GEN);
   assertEquals(gen21.getBook(), BibleBook.GEN);
   assertEquals(gen22.getBook(), BibleBook.GEN);
   assertEquals(rev11.getBook(), BibleBook.REV);
   assertEquals(rev12.getBook(), BibleBook.REV);
   assertEquals(rev21.getBook(), BibleBook.REV);
   assertEquals(rev22.getBook(), BibleBook.REV);
   assertEquals(rev99.getBook(), BibleBook.REV);
 }
Esempio n. 6
0
 @Test
 public void testToString() {
   assertEquals("Gen 1:1", gen11.toString());
   assertEquals("Gen 1:2", gen12.toString());
   assertEquals("Gen 2:1", gen21.toString());
   assertEquals("Gen 2:2", gen22.toString());
   assertEquals("Rev 1:1", rev11.toString());
   assertEquals("Rev 1:2", rev12.toString());
   assertEquals("Rev 2:1", rev21.toString());
   assertEquals("Rev 2:2", rev22.toString());
   assertEquals("Rev 22:21", rev99.toString());
 }
Esempio n. 7
0
 @Test
 public void testEquals() {
   assertTrue(!gen11.equals(null));
   assertTrue(!gen11.equals(Integer.valueOf(0)));
   assertTrue(!gen11.equals("org.crosswire.jsword.passage.Verse"));
   assertTrue(gen11.equals(gen11a));
   assertTrue(!gen11.equals(gen12));
   assertTrue(!gen11.equals(rev99));
   assertTrue(!gen11.equals(gen12));
 }
Esempio n. 8
0
  @Test
  public void testAddSubtract() {
    assertEquals(v11n.distance(gen11, gen12), 1);
    assertEquals(v11n.distance(gen11, gen11), 0);
    assertEquals(v11n.distance(gen12, gen11), -1);
    Verse last = gen11.clone();
    for (int i = 0; i < v11n.maximumOrdinal(); i += 99) {
      Verse next = v11n.add(last, i);
      assertEquals(v11n.distance(last, next), i);

      Verse next2 = v11n.subtract(next, i);
      assertEquals(gen11.getOsisID(), gen11, next2);
    }
    assertEquals(gen11.getOsisID(), gen11, v11n.subtract(gen11, 0));
    assertEquals(gen11.getOsisID(), gen10, v11n.subtract(gen11, 1));
    assertEquals(gen11.getOsisID(), gen00, v11n.subtract(gen11, 2));
    assertEquals(gen11.getOsisID(), gen11, v11n.add(gen11, 0));
    assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 0));
    assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 1));
    assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 2));
  }
Esempio n. 9
0
 @Test
 public void testVerseHasName() {
   Verse v = new Verse(Versifications.instance().getVersification(Versifications.DEFAULT_V11N), 5);
   assertEquals("Gen 1:2", v.getName());
 }
Esempio n. 10
0
 @Test
 public void testToVerseArray() {
   assertEquals(gen11.toVerseArray().length, 1);
 }
Esempio n. 11
0
 @Test
 public void testCompareTo() {
   assertTrue(gen11.compareTo(rev99) < 0);
   assertTrue(rev99.compareTo(gen11) > 0);
   assertEquals(gen11.compareTo(gen11), 0);
 }
Esempio n. 12
0
 @Test
 public void testHashCode() {
   assertEquals(gen11.hashCode(), gen11a.hashCode());
   assertTrue(gen11.hashCode() != 0);
 }