1 package net.firstpartners.nounit.snippet.test; 2 3 26 import java.util.HashMap ; 27 28 import net.firstpartners.nounit.snippet.ISnippet; 29 import net.firstpartners.nounit.snippet.SnippetCalls; 30 import net.firstpartners.nounit.snippet.SnippetClass; 31 import net.firstpartners.nounit.snippet.SnippetMethod; 32 import net.firstpartners.nounit.snippet.SnippetPackage; 33 import net.firstpartners.nounit.snippet.Snippets; 34 35 38 public class TestSnippetData { 39 40 41 44 public static Snippets getSnippetPackages() { 45 46 Snippets someClasses = getSnippetClasses(); 47 48 ISnippet testProject1 = new SnippetPackage("location1",someClasses); 49 ISnippet testProject2 = new SnippetPackage("location1",someClasses); 50 ISnippet testProject3 = new SnippetPackage("location1",someClasses); 51 52 Snippets somePackages = new Snippets(); 53 somePackages.add(testProject1); 54 somePackages.add(testProject2); 55 somePackages.add(testProject3); 56 57 return somePackages; 58 59 } 60 61 64 public static Snippets getSnippetClasses() { 65 66 Snippets someMethods = getSnippetMethods(); 67 68 ISnippet testClass = new SnippetClass("TestName", 69 "protected", 70 "java.lang.Object", 71 someMethods); 72 73 Snippets someClasses = new Snippets(); 74 someClasses.add(testClass); 75 76 return someClasses; 77 78 } 79 80 83 public static Snippets getSnippetMethods() { 84 85 Snippets someMethods = new Snippets(); 87 HashMap methodParams = new HashMap (); 88 89 methodParams.put("0","java.lang.String"); 91 methodParams.put("1","java.lang.Integer"); 92 methodParams.put("2","java.lang.Double"); 93 94 ISnippet testClass1 = new SnippetMethod("method1","public",methodParams,null); 96 ISnippet testClass2 = new SnippetMethod("method2","protected",methodParams,null); 97 ISnippet testClass3 = new SnippetMethod("method3","private",methodParams,null); 98 99 Snippets someClasses = new Snippets(); 101 someMethods.add(testClass1); 102 someMethods.add(testClass2); 103 someMethods.add(testClass3); 104 105 return someMethods; 106 107 } 108 109 112 public static Snippets getSnippetCalledMethods() { 113 114 Snippets someCalledMethods = new Snippets(); 116 HashMap methodParams = new HashMap (); 117 118 methodParams.put("0","java.lang.String"); 120 methodParams.put("1","java.lang.Integer"); 121 methodParams.put("2","java.lang.Double"); 122 123 ISnippet testClass1 = new SnippetCalls("Class1","called-method1",methodParams); 125 ISnippet testClass2 = new SnippetCalls("Class2","called-method2",methodParams); 126 ISnippet testClass3 = new SnippetCalls("Class3","called-method3",methodParams); 127 128 Snippets someClasses = new Snippets(); 130 someCalledMethods.add(testClass1); 131 someCalledMethods.add(testClass2); 132 someCalledMethods.add(testClass3); 133 134 return someCalledMethods; 135 136 } 137 138 } | Popular Tags |