1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.rdf.api;
19
20 import static org.junit.Assert.*;
21
22 import java.util.Objects;
23
24 import org.junit.Test;
25
26 public class DummyTripleTest {
27 Triple triple = new DummyTriple();
28
29 @Test
30 public void getSubject() throws Exception {
31 assertEquals(1, ((DummyIRI) triple.getSubject()).i);
32 }
33 @Test
34 public void getPredicate() throws Exception {
35 assertEquals(2, ((DummyIRI) triple.getPredicate()).i);
36 }
37 @Test
38 public void getObject() throws Exception {
39 assertEquals(3, ((DummyIRI) triple.getObject()).i);
40 }
41
42 @Test
43 public void equals() throws Exception {
44 assertEquals(triple, new DummyTriple());
45 }
46
47 @Test
48 public void testHashCode() {
49 final int expected = Objects.hash(triple.getSubject(), triple.getPredicate(), triple.getObject());
50 assertEquals(expected, triple.hashCode());
51 }
52 }
53