source: tags/1.5.0/contrib/jss/t/javaparser.lisp

Last change on this file was 15066, checked in by Mark Evenson, 7 years ago

Further fixes for JSS

JAVAPARSER now "stacks" its macro definition on the existing one it
inherits from JSS.

Refactor all tests to just pollute CL-USER where necessary (strictly
speaking it shouldn't be necessary as all PROVE tests should be able
to use lexical bindings.

Document existence of Java field access via SHARPSIGN-QUOTATION_MARK,
e.g.

(#"{java.lang.System}.{fileSeparator}")

and the new Java DSL

(asdf:make :javaparser)
(#"'#1"new ByteBuddy?()

.subclass(Object.class,t)
.method(ElementMatchers?.named("toString"))
.intercept(FixedValue?.value("Hello World!"))
.make()
.load(getClass().getClassLoader())
.getLoaded()"

File size: 819 bytes
Line 
1(in-package :cl-user)
2
3(defparameter expanded '(let ((jss::this jss::*object-for-this*))
4      (jcall "getLoaded"
5       (jcall "load"
6        (jcall "make"
7         (jcall "intercept"
8          (jcall "method"
9           (jcall "subclass"
10            (new '|ByteBuddy|)
11            (find-java-class '|Object|)
12            t)
13           (jstatic "named"
14              '|ElementMatchers|
15              "toString"))
16          (jstatic "value"
17             '|FixedValue|
18             "Hello World!")))
19        (jcall "getClassLoader"
20         (jcall "getClass" jss::this))))))
21
22(defparameter source '#1"new ByteBuddy().subclass(Object.class,t)
23   .method(ElementMatchers.named("toString"))
24   .intercept(FixedValue.value("Hello World!"))
25   .make()
26   .load(getClass().getClassLoader())
27   .getLoaded()" )
28
29(in-package :jss-test)
30
31(prove:plan 1)
32(prove:is source expanded)
33
34(prove:finalize)
Note: See TracBrowser for help on using the repository browser.