summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/java/java-test.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-12-11 04:03:29 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-12-11 04:03:29 +0000
commit86b1de85536e93c59a25702a5a2d3e384202ffd2 (patch)
treec61d91970980199c597304ddcb01919993fbeb82 /sca-cpp/trunk/modules/java/java-test.cpp
parent5f29c3b769fcdb2532d4948aa1c649d4330304b9 (diff)
More changes to port to C++11, adjust to use the new JSON support, and cleanup rest of the modules.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1419987 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/java/java-test.cpp')
-rw-r--r--sca-cpp/trunk/modules/java/java-test.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/sca-cpp/trunk/modules/java/java-test.cpp b/sca-cpp/trunk/modules/java/java-test.cpp
index f811a4f58d..7ae170d03f 100644
--- a/sca-cpp/trunk/modules/java/java-test.cpp
+++ b/sca-cpp/trunk/modules/java/java-test.cpp
@@ -32,8 +32,8 @@ namespace tuscany {
namespace java {
bool testEvalExpr() {
- gc_scoped_pool pool;
- JavaRuntime javaRuntime;
+ const gc_scoped_pool pool;
+ const JavaRuntime javaRuntime;
{
const failable<JavaClass> obj = readClass(javaRuntime, ".", "test.CalcImpl");
assert(hasContent(obj));
@@ -48,7 +48,7 @@ bool testEvalExpr() {
const value exp = mklist<value>("even", 2);
const failable<value> r = evalClass(javaRuntime, exp, content(obj));
assert(hasContent(r));
- assert(content(r) == value(true));
+ assert(content(r) == trueValue);
}
{
const failable<JavaClass> obj = readClass(javaRuntime, ".", "test.AdderImpl");
@@ -77,12 +77,12 @@ const value add(const list<value>& args) {
}
bool testEvalLambda() {
- gc_scoped_pool pool;
- JavaRuntime javaRuntime;
+ const gc_scoped_pool pool;
+ const JavaRuntime javaRuntime;
{
const failable<JavaClass> obj = readClass(javaRuntime, ".", "test.CalcImpl");
assert(hasContent(obj));
- const value tcel = mklist<value>("add", 3, 4, lambda<value(const list<value>&)>(add));
+ const value tcel = mklist<value>("add", 3, 4, lvvlambda(add));
const failable<value> r = evalClass(javaRuntime, tcel, content(obj));
assert(hasContent(r));
assert(content(r) == value(7));
@@ -90,7 +90,7 @@ bool testEvalLambda() {
{
const failable<JavaClass> obj = readClass(javaRuntime, ".", "test.CalcImpl");
assert(hasContent(obj));
- const value tcel = mklist<value>("addEval", 3, 4, lambda<value(const list<value>&)>(add));
+ const value tcel = mklist<value>("addEval", 3, 4, lvvlambda(add));
const failable<value> r = evalClass(javaRuntime, tcel, content(obj));
assert(hasContent(r));
assert(content(r) == value(7));
@@ -99,26 +99,26 @@ bool testEvalLambda() {
}
bool testClassLoader() {
- gc_scoped_pool pool;
- JavaRuntime javaRuntime;
+ const gc_scoped_pool pool;
+ const JavaRuntime javaRuntime;
const failable<JavaClass> obj = readClass(javaRuntime, ".", "org.apache.tuscany.ClassLoader$Test");
assert(hasContent(obj));
const value exp = mklist<value>("testClassLoader");
const failable<value> r = evalClass(javaRuntime, exp, content(obj));
assert(hasContent(r));
- assert(content(r) == value(true));
+ assert(content(r) == trueValue);
return true;
}
bool testIterableUtil() {
- gc_scoped_pool pool;
- JavaRuntime javaRuntime;
+ const gc_scoped_pool pool;
+ const JavaRuntime javaRuntime;
const failable<JavaClass> obj = readClass(javaRuntime, ".", "org.apache.tuscany.IterableUtil$Test");
assert(hasContent(obj));
const value exp = mklist<value>("testList");
const failable<value> r = evalClass(javaRuntime, exp, content(obj));
assert(hasContent(r));
- assert(content(r) == value(true));
+ assert(content(r) == trueValue);
return true;
}