@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); }
@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"); }
@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"); }
@Test public void shortName() { assertThat(Convert.shortName("org")).isEqualTo("org"); assertThat(Convert.shortName("org.example")).isEqualTo("example"); }
@Test public void packagePart() { assertThat(Convert.packagePart("org")).isEqualTo(""); assertThat(Convert.packagePart("org.example")).isEqualTo("org"); }