|
Revision 3290, 1.8 KB
(checked in by chf, 11 months ago)
|
|
preliminary native code wrapping
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | package com.sun.fortress.tests.unit_tests; |
|---|
| 19 | |
|---|
| 20 | import java.lang.reflect.Method; |
|---|
| 21 | import java.util.*; |
|---|
| 22 | import org.objectweb.asm.*; |
|---|
| 23 | |
|---|
| 24 | import com.sun.fortress.interpreter.evaluator.values.*; |
|---|
| 25 | import com.sun.fortress.useful.TestCaseWrapper; |
|---|
| 26 | import com.sun.fortress.compiler.nativeInterface.*; |
|---|
| 27 | |
|---|
| 28 | public class WrapperGeneratorJUTest extends TestCaseWrapper { |
|---|
| 29 | public WrapperGeneratorJUTest(String testName) { |
|---|
| 30 | super(testName); |
|---|
| 31 | } |
|---|
| 32 | public WrapperGeneratorJUTest() { |
|---|
| 33 | super("WrapperGeneratorTest"); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | public void testPrintln() { |
|---|
| 37 | MyClassLoader loader = new MyClassLoader(); |
|---|
| 38 | Class c = FortressTransformer.transform(loader, "com.sun.fortress.nativeHelpers.simplePrintln"); |
|---|
| 39 | Class[] parameterTypes = new Class[1]; |
|---|
| 40 | try { |
|---|
| 41 | parameterTypes[0] = Class.forName("com.sun.fortress.interpreter.evaluator.values.FString"); |
|---|
| 42 | Method m = c.getMethod("println", parameterTypes); |
|---|
| 43 | FString foo = FString.make("fa la la"); |
|---|
| 44 | m.invoke(null, foo); |
|---|
| 45 | } catch (Throwable t) { |
|---|
| 46 | throw new RuntimeException(t); |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | } |
|---|