01: package com.jeantessier.classreader;
02:
03: import junit.framework.*;
04:
05: public class TestSignatureHelper extends TestCase {
06: public void testConvert() {
07: assertEquals("int", SignatureHelper.convert("I"));
08: assertEquals("int[]", SignatureHelper.convert("[I"));
09: // assertEquals(null, SignatureHelper.convert("package/Class"));
10: assertEquals("package.Class", SignatureHelper
11: .convert("Lpackage/Class;"));
12: assertEquals("package.Class[]", SignatureHelper
13: .convert("[Lpackage/Class;"));
14: // assertEquals(null, SignatureHelper.convert("List"));
15: }
16:
17: public void testConvertClassName() {
18: assertEquals("I", SignatureHelper.convertClassName("I"));
19: assertEquals("int[]", SignatureHelper.convertClassName("[I"));
20: assertEquals("package.Class", SignatureHelper
21: .convertClassName("package/Class"));
22: assertEquals("package.Class", SignatureHelper
23: .convertClassName("Lpackage/Class;"));
24: assertEquals("package.Class[]", SignatureHelper
25: .convertClassName("[Lpackage/Class;"));
26: assertEquals("List", SignatureHelper.convertClassName("List"));
27: }
28: }
|