Skip to content

Commit c58b546

Browse files
authored
Merge pull request #9 from lucee/LDEV-5594-migrate-tests2
Ldev 5594 migrate tests2
2 parents 8dea5b5 + 30e7f13 commit c58b546

17 files changed

+347
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
component {
2+
this.name="ldev5323"
3+
4+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
component restpath="/ldev5323root" rest="true" {
2+
3+
remote function getApplicationName() restpath="getApplicationName" httpmethod="GET" {
4+
return "applicationName:" & getApplicationSettings().name;
5+
}
6+
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<cfscript>
2+
new "../restUtils"().clearRestMappings();
3+
dir = getDirectoryFromPath(getCurrentTemplatePath());
4+
RestInitApplication( dir, '/ldev5323root', false, "webweb" );
5+
RestInitApplication( dir & "subdir", '/ldev5323sub', false, "webweb" );
6+
new "../restUtils"().dumpRestConfig();
7+
</cfscript>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
component restpath="/ldev5323sub" rest="true" {
2+
3+
remote function getApplicationName() restpath="getApplicationName" httpmethod="GET" {
4+
return "applicationName:" & getApplicationSettings().name;
5+
}
6+
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
component {
2+
this.name="ldev5324";
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
component restpath="/ldev5324multiple" rest="true" {
2+
// not used, only to check REST endpoint matching
3+
remote function abc() restPath="abc" httpMethod="POST,DELETE" {
4+
return CGI.REQUEST_METHOD;
5+
}
6+
7+
// not used, only to check REST endpoint matching
8+
remote function lala() restPath="multiple" httpMethod="POST,DELETE" {
9+
return CGI.REQUEST_METHOD;
10+
}
11+
12+
remote function multipleMethods() restPath="multipleMethods" httpMethod="POST,DELETE" {
13+
return CGI.REQUEST_METHOD;
14+
}
15+
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
component restpath="/ldev5324nosrl" rest="true" {
2+
3+
remote function getApplicationName() restPath="getApplicationName" httpMethod="GET" {
4+
return "applicationName:" & getApplicationSettings().name;
5+
}
6+
7+
remote function getNoMethod() restPath="noMethod" {
8+
return "no method!";
9+
}
10+
11+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
component restpath="/ldev5324" rest="true" {
2+
3+
remote function getApplicationName() restPath="getApplicationName" httpMethod="GET" {
4+
return "applicationName:" & getApplicationSettings().name;
5+
}
6+
7+
remote function getNoMethod() restPath="noMethod" {
8+
return "no method!";
9+
}
10+
11+
remote function wrongMethod() restPath="wrongMethod" httpMethod="GET" {
12+
return "wrongMethod";
13+
}
14+
15+
remote function multipleMethods() restPath="multipleMethods" httpMethod="GET,POST" {
16+
return CGI.REQUEST_METHOD;
17+
}
18+
19+
remote function getStudent (
20+
required string name restArgSource="Path",
21+
required numeric age restArgSource="Path"
22+
) returnType="student" restPath="{name}-{age}" {
23+
var studentObj = createObject("component", "student").init(arguments.name, arguments.age);
24+
return studentObj;
25+
}
26+
27+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<cfscript>
2+
new "../restUtils"().clearRestMappings();
3+
dir = getDirectoryFromPath(getCurrentTemplatePath());
4+
RestInitApplication( dir, '/ldev5324', false, "webweb" );
5+
new "../restUtils"().dumpRestConfig();
6+
</cfscript>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
component {
2+
3+
property name="name" type="string";
4+
property name="age" type="numeric";
5+
6+
function init(name, age){
7+
this.name = arguments.name;
8+
this.age = arguments.age;
9+
_debug("init()", arguments );
10+
return this;
11+
}
12+
13+
remote function getStudent() returntype="any" httpmethod="GET" produces="application/json" {
14+
_debug("getStudent()", arguments );
15+
return this;
16+
}
17+
18+
remote function updateStudent() returntype="void" httpmethod="PUT" {
19+
_debug("updateStudent()", arguments );
20+
}
21+
22+
remote function deleteStudent() returntype="boolean" httpmethod="DELETE" {
23+
_debug("deleteStudent()", arguments );
24+
return true;
25+
}
26+
27+
private function _debug(method, args){
28+
return;
29+
systemOutput(method, true);
30+
systemOutput(args.toJson(), true);
31+
}
32+
33+
}

0 commit comments

Comments
 (0)