forked from markmandel/JavaLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadTest.cfc
More file actions
41 lines (26 loc) · 1.37 KB
/
Copy pathLoadTest.cfc
File metadata and controls
41 lines (26 loc) · 1.37 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
<cfcomponent extends="unittests.AbstractTestCase" output="false">
<!------------------------------------------- PUBLIC ------------------------------------------->
<cffunction name="helloWorldTest" hint="test of simple hello world" access="public" returntype="void" output="false">
<cfscript>
var local = StructNew();
local.paths = ArrayNew(1);
local.paths[1] = instance.libPath & "/helloworld.jar";
local.loader = createObject("component", "javaloader.JavaLoader").init(local.paths);
local.helloWorld = local.loader.create("HelloWorld").init();
assertEquals(local.helloWorld.hello(), "Hello World");
</cfscript>
</cffunction>
<cffunction name="missingClassTest" hint="test requesting a missing class, and giving a good error message" access="public" returntype="void" output="false"
mxunit:expectedException="javaloader.ClassNotFoundException"
>
<cfscript>
var local = StructNew();
local.paths = [];
local.paths[1] = instance.libPath & "/helloworld.jar";
local.loader = createObject("component", "javaloader.JavaLoader").init(local.paths);
local.helloWorld = local.loader.create("HelloWorldDoesNotExist").init();
</cfscript>
</cffunction>
<!------------------------------------------- PACKAGE ------------------------------------------->
<!------------------------------------------- PRIVATE ------------------------------------------->
</cfcomponent>