Example #1
0
 @Test
 public void enclosingClassName() throws Exception {
   assertThat(Convert.enclosingClassName("MyClass")).isEqualTo("");
   assertThat(Convert.enclosingClassName("MyClass$InnerClass")).isEqualTo("MyClass");
   assertThat(Convert.enclosingClassName("MyClass$$InnerClass$class")).isEqualTo("MyClass$");
   assertThat(Convert.enclosingClassName("MyClass$$InnerClass$")).isEqualTo("MyClass$");
 }
 private JavaSymbol.TypeJavaSymbol getClassSymbol(String bytecodeName, int flags) {
   return bytecodeCompleter.getClassSymbol(Convert.flatName(bytecodeName), flags);
 }
Example #3
0
 @Test
 public void fullName() throws Exception {
   assertThat(Convert.fullName(null, "MyClass")).isEqualTo("MyClass");
   assertThat(Convert.fullName("", "MyClass")).isEqualTo("MyClass");
   assertThat(Convert.fullName("org.example", "MyClass")).isEqualTo("org.example.MyClass");
 }
Example #4
0
 @Test
 public void bytecodeName() {
   assertThat(Convert.bytecodeName("org.example.MyClass")).isEqualTo("org/example/MyClass");
   assertThat(Convert.bytecodeName("org.example.MyClass$InnerClass"))
       .isEqualTo("org/example/MyClass$InnerClass");
 }
Example #5
0
 @Test
 public void shortName() {
   assertThat(Convert.shortName("org")).isEqualTo("org");
   assertThat(Convert.shortName("org.example")).isEqualTo("example");
 }
Example #6
0
 @Test
 public void packagePart() {
   assertThat(Convert.packagePart("org")).isEqualTo("");
   assertThat(Convert.packagePart("org.example")).isEqualTo("org");
 }