Search in sources :

Example 36 with HashSet

use of java.util.HashSet in project flink by apache.

the class JarFileCreatorTest method TestAnonymousInnerClassTrick3.

//anonymous inner class in non static method accessing a field of its enclosing class.
@Test
public void TestAnonymousInnerClassTrick3() throws Exception {
    File out = new File(System.getProperty("java.io.tmpdir"), "jarcreatortest.jar");
    JarFileCreator jfc = new JarFileCreator(out);
    jfc.addClass(AnonymousInNonStaticMethod2.class).createJarFile();
    Set<String> ans = new HashSet<String>();
    ans.add("org/apache/flink/runtime/util/jartestprogram/AnonymousInNonStaticMethod2$1.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/AnonymousInNonStaticMethod2$A.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/AnonymousInNonStaticMethod2.class");
    Assert.assertTrue("Jar file for Anonymous Inner Class is not correct", validate(ans, out));
    out.delete();
}
Also used : AnonymousInNonStaticMethod2(org.apache.flink.runtime.util.jartestprogram.AnonymousInNonStaticMethod2) File(java.io.File) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 37 with HashSet

use of java.util.HashSet in project flink by apache.

the class JarFileCreatorTest method TestAnonymousClass.

@Test
public void TestAnonymousClass() throws IOException {
    File out = new File(System.getProperty("java.io.tmpdir"), "jarcreatortest.jar");
    JarFileCreator jfc = new JarFileCreator(out);
    jfc.addClass(WordCountWithAnonymousClass.class).createJarFile();
    Set<String> ans = new HashSet<String>();
    ans.add("org/apache/flink/runtime/util/jartestprogram/StaticData.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/WordCountWithAnonymousClass.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/WordCountWithAnonymousClass$1.class");
    Assert.assertTrue("Jar file for Anonymous Class is not correct", validate(ans, out));
    out.delete();
}
Also used : WordCountWithAnonymousClass(org.apache.flink.runtime.util.jartestprogram.WordCountWithAnonymousClass) File(java.io.File) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 38 with HashSet

use of java.util.HashSet in project flink by apache.

the class JarFileCreatorTest method TestUDFPackage.

@Test
public void TestUDFPackage() throws IOException {
    File out = new File(System.getProperty("java.io.tmpdir"), "jarcreatortest.jar");
    JarFileCreator jfc = new JarFileCreator(out);
    jfc.addClass(WordCountWithInnerClass.class).addPackage("org.apache.flink.util").createJarFile();
    Set<String> ans = new HashSet<String>();
    ans.add("org/apache/flink/runtime/util/jartestprogram/StaticData.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/WordCountWithInnerClass.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/WordCountWithInnerClass$Tokenizer.class");
    ans.add("org/apache/flink/util/Collector.class");
    Assert.assertTrue("Jar file for UDF package is not correct", validate(ans, out));
    out.delete();
}
Also used : File(java.io.File) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 39 with HashSet

use of java.util.HashSet in project flink by apache.

the class JarFileCreatorTest method TestAnonymousInnerClassTrick2.

//anonymous inner class in non static method accessing a local variable in its closure.
@Test
public void TestAnonymousInnerClassTrick2() throws Exception {
    File out = new File(System.getProperty("java.io.tmpdir"), "jarcreatortest.jar");
    JarFileCreator jfc = new JarFileCreator(out);
    jfc.addClass(AnonymousInNonStaticMethod.class).createJarFile();
    Set<String> ans = new HashSet<String>();
    ans.add("org/apache/flink/runtime/util/jartestprogram/AnonymousInNonStaticMethod$1.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/AnonymousInNonStaticMethod$A.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/AnonymousInNonStaticMethod.class");
    Assert.assertTrue("Jar file for Anonymous Inner Class is not correct", validate(ans, out));
    out.delete();
}
Also used : AnonymousInNonStaticMethod(org.apache.flink.runtime.util.jartestprogram.AnonymousInNonStaticMethod) File(java.io.File) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 40 with HashSet

use of java.util.HashSet in project flink by apache.

the class JarFileCreatorTest method TestExtendIdentifier.

@Test
public void TestExtendIdentifier() throws IOException {
    File out = new File(System.getProperty("java.io.tmpdir"), "jarcreatortest.jar");
    JarFileCreator jfc = new JarFileCreator(out);
    jfc.addClass(WordCountWithExternalClass2.class).createJarFile();
    Set<String> ans = new HashSet<String>();
    ans.add("org/apache/flink/runtime/util/jartestprogram/StaticData.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/WordCountWithExternalClass2.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/ExternalTokenizer2.class");
    ans.add("org/apache/flink/runtime/util/jartestprogram/ExternalTokenizer.class");
    Assert.assertTrue("Jar file for Extend Identifier is not correct", validate(ans, out));
    out.delete();
}
Also used : File(java.io.File) WordCountWithExternalClass2(org.apache.flink.runtime.util.jartestprogram.WordCountWithExternalClass2) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)12137 Set (java.util.Set)2609 ArrayList (java.util.ArrayList)2318 HashMap (java.util.HashMap)2096 Test (org.junit.Test)2060 Map (java.util.Map)1198 Iterator (java.util.Iterator)979 IOException (java.io.IOException)934 List (java.util.List)911 File (java.io.File)607 LinkedHashSet (java.util.LinkedHashSet)460 Test (org.testng.annotations.Test)460 TreeSet (java.util.TreeSet)271 Collection (java.util.Collection)233 LinkedList (java.util.LinkedList)224 Region (org.apache.geode.cache.Region)202 SSOException (com.iplanet.sso.SSOException)188 Date (java.util.Date)180 LinkedHashMap (java.util.LinkedHashMap)169 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)166