Move test suite into module hierarchy
This commit is contained in:
parent
032d6dcae7
commit
dc941ca543
17 changed files with 1317 additions and 0 deletions
33
test/code/Global/global.js
Executable file
33
test/code/Global/global.js
Executable file
|
@ -0,0 +1,33 @@
|
|||
function onStart() {
|
||||
root.date = new Date();
|
||||
root.string = "root";
|
||||
}
|
||||
|
||||
function hello_macro(param) {
|
||||
return "hello";
|
||||
}
|
||||
|
||||
function echo_macro(param, arg) {
|
||||
return arg || param.what;
|
||||
}
|
||||
|
||||
function isDate_filter(arg) {
|
||||
return arg instanceof Date;
|
||||
}
|
||||
|
||||
function isRootDate_filter(arg) {
|
||||
return (arg instanceof Date) &&
|
||||
arg.getTime() == root.date.getTime();
|
||||
}
|
||||
|
||||
function isResponseDate_filter(arg) {
|
||||
return (arg instanceof Date) && arg == res.data.date;
|
||||
}
|
||||
|
||||
function makeLongString() {
|
||||
var b = new java.lang.StringBuffer();
|
||||
for (var i = 1; i <= 10000; i++) {
|
||||
b.append(i.toString()).append(" ");
|
||||
}
|
||||
return b.toString();
|
||||
}
|
1
test/code/Global/subskins.skin
Executable file
1
test/code/Global/subskins.skin
Executable file
|
@ -0,0 +1 @@
|
|||
mainskin<% #subskin1 %>subskin1<% #subskin2 %>subskin2<% #end %>
|
17
test/code/Organisation/type.properties
Normal file
17
test/code/Organisation/type.properties
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
_db = dbcTest
|
||||
_table = tb_organisation
|
||||
|
||||
_id = org_id
|
||||
_parent = root.organisations
|
||||
|
||||
persons = collection(Person)
|
||||
persons.local = org_id
|
||||
persons.foreign = person_org_id
|
||||
persons.accessname = person_name
|
||||
persons.order = person_name
|
||||
|
||||
name = org_name
|
||||
country = org_country
|
||||
|
||||
someMountpoint = mountpoint(SomeMountpoint)
|
14
test/code/Person/type.properties
Normal file
14
test/code/Person/type.properties
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
_db = dbcTest
|
||||
_table = tb_person
|
||||
|
||||
_id = person_id
|
||||
_parent = organisation.persons, root.persons
|
||||
|
||||
name = person_name
|
||||
height = person_height
|
||||
dateOfBirth = person_dateofbirth
|
||||
|
||||
organisation = object(Organisation)
|
||||
organisation.local = person_org_id
|
||||
organisation.foreign = org_id
|
35
test/code/Root/root.js
Executable file
35
test/code/Root/root.js
Executable file
|
@ -0,0 +1,35 @@
|
|||
function main_action() {
|
||||
res.redirect(root.href("jala.test"));
|
||||
}
|
||||
|
||||
function hello_action() {
|
||||
res.contentType = "text/plain";
|
||||
res.write("Hello");
|
||||
}
|
||||
|
||||
function throwerror_action() {
|
||||
throw Error();
|
||||
}
|
||||
|
||||
function notfound_action() {
|
||||
res.write("Not found");
|
||||
}
|
||||
|
||||
function redirect_action() {
|
||||
res.redirect(this.href("hello"));
|
||||
}
|
||||
|
||||
function error_action() {
|
||||
res.write("Error");
|
||||
}
|
||||
|
||||
function long_action() {
|
||||
res.write(makeLongString());
|
||||
}
|
||||
|
||||
function macro_macro(param) {
|
||||
// change suffix
|
||||
if (param.suffix) param.suffix = ".";
|
||||
return this.string;
|
||||
}
|
||||
|
16
test/code/Root/type.properties
Executable file
16
test/code/Root/type.properties
Executable file
|
@ -0,0 +1,16 @@
|
|||
date = date
|
||||
string = string
|
||||
|
||||
|
||||
organisations = collection(Organisation)
|
||||
organisations.accessname = org_name
|
||||
|
||||
organisationsByCountry = collection(Organisation)
|
||||
organisationsByCountry.group = org_country
|
||||
organisationsByCountry.group.prototype = Country
|
||||
organisationsByCountry.group.order = org_country desc
|
||||
organisationsByCountry.order = org_name desc
|
||||
|
||||
persons = collection(Person)
|
||||
|
||||
someMountpoint = mountpoint(SomeMountpoint)
|
1
test/code/app.properties
Executable file
1
test/code/app.properties
Executable file
|
@ -0,0 +1 @@
|
|||
baseUri = http://localhost:8080/test/
|
5
test/code/db.properties
Normal file
5
test/code/db.properties
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
dbcTest.url = jdbc:mysql://localhost/helmaTest
|
||||
dbcTest.driver = org.gjt.mm.mysql.Driver
|
||||
dbcTest.user = helma
|
||||
dbcTest.password = secret
|
Loading…
Add table
Add a link
Reference in a new issue