1 package net.jaekl.cfb.store;
3 import static org.junit.Assert.*;
7 public class LocationTest {
10 public void testGetters() {
12 { Long.valueOf(1), "classname", "methodName", "methodRole", Integer.valueOf(1), Integer.valueOf(2) },
13 { null, null, null, null, null, null },
14 { Long.valueOf(123456789012L), "name", "method", "role", Integer.valueOf(123456), Integer.valueOf(123456789) },
15 { Long.valueOf(723), "", "", "", null, null },
16 { Long.valueOf(987654321L), "class", "method", "role", Integer.valueOf(77981), Integer.valueOf(77982) },
17 { Long.valueOf(23), "Fred", "Wilma", "Barney", Integer.valueOf(-1), null }
20 for (Object[] datum : data) {
21 Long id = (Long)datum[0];
22 String className = (String)datum[1];
23 String methodName = (String)datum[2];
24 String methodRole = (String)datum[3];
25 Integer start = (Integer)datum[4];
26 Integer end = (Integer)datum[5];
28 Location loc = new Location(id, className, methodName, methodRole, start, end);
30 assertEquals(className, loc.getClassName());
31 assertEquals(methodName, loc.getMethodName());
32 assertEquals(methodRole, loc.getMethodRole());
34 assertEquals((-1), loc.getStart());
37 assertEquals(start, Integer.valueOf(loc.getStart()));
40 assertEquals((-1), loc.getEnd());
43 assertEquals(end, Integer.valueOf(loc.getEnd()));