forked from markmandel/JavaLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractTestCase.cfc
More file actions
47 lines (32 loc) · 1.64 KB
/
Copy pathAbstractTestCase.cfc
File metadata and controls
47 lines (32 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<cfcomponent hint="An abstract test case for default setup, teardown, and util methods" extends="mxunit.framework.TestCase" output="false">
<!------------------------------------------- PUBLIC ------------------------------------------->
<cffunction name="setup" hint="setup function" access="public" returntype="void" output="false">
<cfscript>
instance.libPath = expandPath("/unittests/lib");
instance.srcPath = expandPath("/unittests/src");
</cfscript>
</cffunction>
<cffunction name="teardown" hint="tear down function" access="public" returntype="void" output="false">
</cffunction>
<!------------------------------------------- PACKAGE ------------------------------------------->
<!------------------------------------------- PRIVATE ------------------------------------------->
<cffunction name="clean" hint="deletes all the class files" access="private" returntype="void" output="false">
<cfscript>
var local = {};
</cfscript>
<cfdirectory action="list" recurse="true" directory="#instance.srcPath#" filter="*.class" name="local.qClasses">
<cfloop query="local.qClasses">
<cffile action="delete" file="#directory#/#name#">
</cfloop>
<cfdirectory action="list" recurse="true" directory="#expandPath('/javaloader/tmp')#" filter="*.jar" name="local.qJars">
<cfloop query="local.qJars">
<cffile action="delete" file="#directory#/#name#">
</cfloop>
</cffunction>
<cffunction name="println" hint="" access="private" returntype="void" output="false">
<cfargument name="str" hint="" type="string" required="Yes">
<cfscript>
createObject("Java", "java.lang.System").out.println(arguments.str);
</cfscript>
</cffunction>
</cfcomponent>