Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Nov 17, 2019
1 parent b9c0481 commit a52fe37
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/test/java/org/jd/core/v1/JarFileToJavaSourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,25 @@ public class JarFileToJavaSourceTest extends TestCase {
protected JavaFragmentToTokenProcessor tokenizer = new JavaFragmentToTokenProcessor();
protected WriteTokenProcessor writer = new WriteTokenProcessor();

// TODO In progress
// @Test
// public void testCommonsLang3() throws Exception {
// // Decompile and recompile 'commons-lang3-3.9.jar'
// test(org.apache.commons.lang3.JavaVersion.class);
// }

@Test
public void testCommonsCollections4() throws Exception {
// Test 'commons-collections4-4.1.jar'
// Decompile and recompile 'commons-collections4-4.1.jar'
test(org.apache.commons.collections4.CollectionUtils.class);
}

@Test
public void testCommonsCodec() throws Exception {
// Decompile and recompile 'commons-codec-1.13.jar'
test(org.apache.commons.codec.Charsets.class);
}

protected void test(Class clazz) throws Exception {
test(new FileInputStream(Paths.get(clazz.getProtectionDomain().getCodeSource().getLocation().toURI()).toFile()));
}
Expand Down Expand Up @@ -72,6 +85,8 @@ protected void test(InputStream inputStream) throws Exception {
if (path.endsWith(".class") && (path.indexOf('$') == -1)) {
String internalTypeName = path.substring(0, path.length() - 6); // 6 = ".class".length()

// TODO DEBUG if (!internalTypeName.endsWith("/Rule")) continue;

message.setHeader("mainInternalTypeName", internalTypeName);
printer.init();

Expand Down

0 comments on commit a52fe37

Please sign in to comment.