1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.apache.commons.classscan.bcel;
15
16 import static org.junit.Assert.assertEquals;
17 import static org.junit.Assert.assertNull;
18
19 import java.net.URISyntaxException;
20
21 import org.apache.commons.classscan.MetaClassLoader;
22 import org.apache.commons.classscan.MetaRegistry;
23 import org.apache.commons.classscan.model.MetaClass;
24 import org.junit.Before;
25 import org.junit.Test;
26
27 public class PrimitiveClassTest {
28
29 MetaClassLoader classLoader;
30 MetaClass byteClass;
31
32 @Before
33 public void loadLocation() throws URISyntaxException {
34 classLoader = MetaRegistry.DEFAULT_REGISTRY.getMetaClassLoader(Byte.TYPE.getClassLoader());
35 byteClass = classLoader.findMetaClass(Byte.TYPE.getCanonicalName());
36 }
37
38 @Test
39 public void testGetClassLocation() throws URISyntaxException {
40 assertNull(byteClass.getClassLocation());
41 }
42
43 @Test
44 public void testGetCanonicalName() {
45 assertEquals(Byte.TYPE.getCanonicalName(), byteClass.getName());
46 }
47
48 @Test
49 public void testGetParent() throws URISyntaxException {
50 assertNull(byteClass.getParent());
51 }
52
53 @Test
54 public void testGetInterfaces() {
55 assertEquals(0, byteClass.getInterfaces().size());
56 }
57
58 @Test
59 public void testGetAnnotations() {
60 assertEquals(0, byteClass.getAnnotations().size());
61 }
62
63 @Test
64 public void testGetMethods() {
65 assertEquals(0, byteClass.getMethods().size());
66 }
67
68 @Test
69 public void testGetFields() {
70 assertEquals(0, byteClass.getFields().size());
71 }
72 }