diff options
| author | 2016-10-18 17:35:11 +0200 | |
|---|---|---|
| committer | 2016-10-18 17:35:11 +0200 | |
| commit | eb93bc2cb083409c123463a20844f7e1ed58deab (patch) | |
| tree | 3a7ded44c9b24ef92a5c07a63ce04212b4606393 /src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java | |
| parent | Revert "apply similar fix to fields" (diff) | |
| download | enigma-fork-eb93bc2cb083409c123463a20844f7e1ed58deab.tar.gz enigma-fork-eb93bc2cb083409c123463a20844f7e1ed58deab.tar.xz enigma-fork-eb93bc2cb083409c123463a20844f7e1ed58deab.zip | |
remove none/ prefix
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java')
| -rw-r--r-- | src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java b/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java index bd7b03a..65af6d8 100644 --- a/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java +++ b/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java | |||
| @@ -46,39 +46,39 @@ public class TestJarIndexLoneClass { | |||
| 46 | public void obfEntries() { | 46 | public void obfEntries() { |
| 47 | assertThat(m_index.getObfClassEntries(), containsInAnyOrder( | 47 | assertThat(m_index.getObfClassEntries(), containsInAnyOrder( |
| 48 | newClass("cuchaz/enigma/inputs/Keep"), | 48 | newClass("cuchaz/enigma/inputs/Keep"), |
| 49 | newClass("none/a") | 49 | newClass("a") |
| 50 | )); | 50 | )); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | @Test | 53 | @Test |
| 54 | public void translationIndex() { | 54 | public void translationIndex() { |
| 55 | assertThat(m_index.getTranslationIndex().getSuperclass(new ClassEntry("none/a")), is(new ClassEntry("java/lang/Object"))); | 55 | assertThat(m_index.getTranslationIndex().getSuperclass(new ClassEntry("a")), is(new ClassEntry("java/lang/Object"))); |
| 56 | assertThat(m_index.getTranslationIndex().getSuperclass(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(new ClassEntry("java/lang/Object"))); | 56 | assertThat(m_index.getTranslationIndex().getSuperclass(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(new ClassEntry("java/lang/Object"))); |
| 57 | assertThat(m_index.getTranslationIndex().getAncestry(new ClassEntry("none/a")), contains(new ClassEntry("java/lang/Object"))); | 57 | assertThat(m_index.getTranslationIndex().getAncestry(new ClassEntry("a")), contains(new ClassEntry("java/lang/Object"))); |
| 58 | assertThat(m_index.getTranslationIndex().getAncestry(new ClassEntry("cuchaz/enigma/inputs/Keep")), contains(new ClassEntry("java/lang/Object"))); | 58 | assertThat(m_index.getTranslationIndex().getAncestry(new ClassEntry("cuchaz/enigma/inputs/Keep")), contains(new ClassEntry("java/lang/Object"))); |
| 59 | assertThat(m_index.getTranslationIndex().getSubclass(new ClassEntry("none/a")), is(empty())); | 59 | assertThat(m_index.getTranslationIndex().getSubclass(new ClassEntry("a")), is(empty())); |
| 60 | assertThat(m_index.getTranslationIndex().getSubclass(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(empty())); | 60 | assertThat(m_index.getTranslationIndex().getSubclass(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(empty())); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | @Test | 63 | @Test |
| 64 | public void access() { | 64 | public void access() { |
| 65 | assertThat(m_index.getAccess(newField("none/a", "a", "Ljava/lang/String;")), is(Access.Private)); | 65 | assertThat(m_index.getAccess(newField("a", "a", "Ljava/lang/String;")), is(Access.Private)); |
| 66 | assertThat(m_index.getAccess(newMethod("none/a", "a", "()Ljava/lang/String;")), is(Access.Public)); | 66 | assertThat(m_index.getAccess(newMethod("a", "a", "()Ljava/lang/String;")), is(Access.Public)); |
| 67 | assertThat(m_index.getAccess(newField("none/a", "b", "Ljava/lang/String;")), is(nullValue())); | 67 | assertThat(m_index.getAccess(newField("a", "b", "Ljava/lang/String;")), is(nullValue())); |
| 68 | assertThat(m_index.getAccess(newField("none/a", "a", "LFoo;")), is(nullValue())); | 68 | assertThat(m_index.getAccess(newField("a", "a", "LFoo;")), is(nullValue())); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | @Test | 71 | @Test |
| 72 | public void classInheritance() { | 72 | public void classInheritance() { |
| 73 | ClassInheritanceTreeNode node = m_index.getClassInheritance(new Translator(), newClass("none/a")); | 73 | ClassInheritanceTreeNode node = m_index.getClassInheritance(new Translator(), newClass("a")); |
| 74 | assertThat(node, is(not(nullValue()))); | 74 | assertThat(node, is(not(nullValue()))); |
| 75 | assertThat(node.getObfClassName(), is("none/a")); | 75 | assertThat(node.getObfClassName(), is("a")); |
| 76 | assertThat(node.getChildCount(), is(0)); | 76 | assertThat(node.getChildCount(), is(0)); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | @Test | 79 | @Test |
| 80 | public void methodInheritance() { | 80 | public void methodInheritance() { |
| 81 | MethodEntry source = newMethod("none/a", "a", "()Ljava/lang/String;"); | 81 | MethodEntry source = newMethod("a", "a", "()Ljava/lang/String;"); |
| 82 | MethodInheritanceTreeNode node = m_index.getMethodInheritance(new Translator(), source); | 82 | MethodInheritanceTreeNode node = m_index.getMethodInheritance(new Translator(), source); |
| 83 | assertThat(node, is(not(nullValue()))); | 83 | assertThat(node, is(not(nullValue()))); |
| 84 | assertThat(node.getMethodEntry(), is(source)); | 84 | assertThat(node.getMethodEntry(), is(source)); |
| @@ -87,43 +87,43 @@ public class TestJarIndexLoneClass { | |||
| 87 | 87 | ||
| 88 | @Test | 88 | @Test |
| 89 | public void classImplementations() { | 89 | public void classImplementations() { |
| 90 | ClassImplementationsTreeNode node = m_index.getClassImplementations(new Translator(), newClass("none/a")); | 90 | ClassImplementationsTreeNode node = m_index.getClassImplementations(new Translator(), newClass("a")); |
| 91 | assertThat(node, is(nullValue())); | 91 | assertThat(node, is(nullValue())); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | @Test | 94 | @Test |
| 95 | public void methodImplementations() { | 95 | public void methodImplementations() { |
| 96 | MethodEntry source = newMethod("none/a", "a", "()Ljava/lang/String;"); | 96 | MethodEntry source = newMethod("a", "a", "()Ljava/lang/String;"); |
| 97 | assertThat(m_index.getMethodImplementations(new Translator(), source), is(empty())); | 97 | assertThat(m_index.getMethodImplementations(new Translator(), source), is(empty())); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | @Test | 100 | @Test |
| 101 | public void relatedMethodImplementations() { | 101 | public void relatedMethodImplementations() { |
| 102 | Set<MethodEntry> entries = m_index.getRelatedMethodImplementations(newMethod("none/a", "a", "()Ljava/lang/String;")); | 102 | Set<MethodEntry> entries = m_index.getRelatedMethodImplementations(newMethod("a", "a", "()Ljava/lang/String;")); |
| 103 | assertThat(entries, containsInAnyOrder( | 103 | assertThat(entries, containsInAnyOrder( |
| 104 | newMethod("none/a", "a", "()Ljava/lang/String;") | 104 | newMethod("a", "a", "()Ljava/lang/String;") |
| 105 | )); | 105 | )); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | @Test | 108 | @Test |
| 109 | @SuppressWarnings("unchecked") | 109 | @SuppressWarnings("unchecked") |
| 110 | public void fieldReferences() { | 110 | public void fieldReferences() { |
| 111 | FieldEntry source = newField("none/a", "a", "Ljava/lang/String;"); | 111 | FieldEntry source = newField("a", "a", "Ljava/lang/String;"); |
| 112 | Collection<EntryReference<FieldEntry,BehaviorEntry>> references = m_index.getFieldReferences(source); | 112 | Collection<EntryReference<FieldEntry,BehaviorEntry>> references = m_index.getFieldReferences(source); |
| 113 | assertThat(references, containsInAnyOrder( | 113 | assertThat(references, containsInAnyOrder( |
| 114 | newFieldReferenceByConstructor(source, "none/a", "(Ljava/lang/String;)V"), | 114 | newFieldReferenceByConstructor(source, "a", "(Ljava/lang/String;)V"), |
| 115 | newFieldReferenceByMethod(source, "none/a", "a", "()Ljava/lang/String;") | 115 | newFieldReferenceByMethod(source, "a", "a", "()Ljava/lang/String;") |
| 116 | )); | 116 | )); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | @Test | 119 | @Test |
| 120 | public void behaviorReferences() { | 120 | public void behaviorReferences() { |
| 121 | assertThat(m_index.getBehaviorReferences(newMethod("none/a", "a", "()Ljava/lang/String;")), is(empty())); | 121 | assertThat(m_index.getBehaviorReferences(newMethod("a", "a", "()Ljava/lang/String;")), is(empty())); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | @Test | 124 | @Test |
| 125 | public void innerClasses() { | 125 | public void innerClasses() { |
| 126 | assertThat(m_index.getInnerClasses(newClass("none/a")), is(empty())); | 126 | assertThat(m_index.getInnerClasses(newClass("a")), is(empty())); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | @Test | 129 | @Test |
| @@ -133,32 +133,32 @@ public class TestJarIndexLoneClass { | |||
| 133 | 133 | ||
| 134 | @Test | 134 | @Test |
| 135 | public void isAnonymousClass() { | 135 | public void isAnonymousClass() { |
| 136 | assertThat(m_index.isAnonymousClass(newClass("none/a")), is(false)); | 136 | assertThat(m_index.isAnonymousClass(newClass("a")), is(false)); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | @Test | 139 | @Test |
| 140 | public void interfaces() { | 140 | public void interfaces() { |
| 141 | assertThat(m_index.getInterfaces("none/a"), is(empty())); | 141 | assertThat(m_index.getInterfaces("a"), is(empty())); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | @Test | 144 | @Test |
| 145 | public void implementingClasses() { | 145 | public void implementingClasses() { |
| 146 | assertThat(m_index.getImplementingClasses("none/a"), is(empty())); | 146 | assertThat(m_index.getImplementingClasses("a"), is(empty())); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | @Test | 149 | @Test |
| 150 | public void isInterface() { | 150 | public void isInterface() { |
| 151 | assertThat(m_index.isInterface("none/a"), is(false)); | 151 | assertThat(m_index.isInterface("a"), is(false)); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | @Test | 154 | @Test |
| 155 | public void testContains() { | 155 | public void testContains() { |
| 156 | assertThat(m_index.containsObfClass(newClass("none/a")), is(true)); | 156 | assertThat(m_index.containsObfClass(newClass("a")), is(true)); |
| 157 | assertThat(m_index.containsObfClass(newClass("none/b")), is(false)); | 157 | assertThat(m_index.containsObfClass(newClass("b")), is(false)); |
| 158 | assertThat(m_index.containsObfField(newField("none/a", "a", "Ljava/lang/String;")), is(true)); | 158 | assertThat(m_index.containsObfField(newField("a", "a", "Ljava/lang/String;")), is(true)); |
| 159 | assertThat(m_index.containsObfField(newField("none/a", "b", "Ljava/lang/String;")), is(false)); | 159 | assertThat(m_index.containsObfField(newField("a", "b", "Ljava/lang/String;")), is(false)); |
| 160 | assertThat(m_index.containsObfField(newField("none/a", "a", "LFoo;")), is(false)); | 160 | assertThat(m_index.containsObfField(newField("a", "a", "LFoo;")), is(false)); |
| 161 | assertThat(m_index.containsObfBehavior(newMethod("none/a", "a", "()Ljava/lang/String;")), is(true)); | 161 | assertThat(m_index.containsObfBehavior(newMethod("a", "a", "()Ljava/lang/String;")), is(true)); |
| 162 | assertThat(m_index.containsObfBehavior(newMethod("none/a", "b", "()Ljava/lang/String;")), is(false)); | 162 | assertThat(m_index.containsObfBehavior(newMethod("a", "b", "()Ljava/lang/String;")), is(false)); |
| 163 | } | 163 | } |
| 164 | } | 164 | } |