use of org.apache.flink.runtime.util.jartestprogram.NestedAnonymousInnerClass in project flink by apache.
the class JarFileCreatorTest method TestAnonymousInnerClassTrick4.
//anonymous inner class in an anonymous inner class accessing a field of the outermost enclosing class.
@Test
public void TestAnonymousInnerClassTrick4() throws Exception {
File out = new File(System.getProperty("java.io.tmpdir"), "jarcreatortest.jar");
JarFileCreator jfc = new JarFileCreator(out);
jfc.addClass(NestedAnonymousInnerClass.class).createJarFile();
Set<String> ans = new HashSet<String>();
ans.add("org/apache/flink/runtime/util/jartestprogram/NestedAnonymousInnerClass.class");
ans.add("org/apache/flink/runtime/util/jartestprogram/NestedAnonymousInnerClass$1$1.class");
ans.add("org/apache/flink/runtime/util/jartestprogram/NestedAnonymousInnerClass$1.class");
ans.add("org/apache/flink/runtime/util/jartestprogram/NestedAnonymousInnerClass$A.class");
Assert.assertTrue("Jar file for Anonymous Inner Class is not correct", validate(ans, out));
out.delete();
}
Aggregations