root/trunk/ProjectFortress/src/com/sun/fortress/tests/unit_tests/WrapperGeneratorJUTest.java @ 3290

Revision 3290, 1.8 KB (checked in by chf, 11 months ago)

preliminary native code wrapping

Line 
1/*******************************************************************************
2    Copyright 2009 Sun Microsystems, Inc.,
3    4150 Network Circle, Santa Clara, California 95054, U.S.A.
4    All rights reserved.
5
6    U.S. Government Rights - Commercial software.
7    Government users are subject to the Sun Microsystems, Inc. standard
8    license agreement and applicable provisions of the FAR and its supplements.
9
10    Use is subject to license terms.
11
12    This distribution may include materials developed by third parties.
13
14    Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
15    trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
16******************************************************************************/
17
18package com.sun.fortress.tests.unit_tests;
19
20import java.lang.reflect.Method;
21import java.util.*;
22import org.objectweb.asm.*;
23
24import com.sun.fortress.interpreter.evaluator.values.*;
25import com.sun.fortress.useful.TestCaseWrapper;
26import com.sun.fortress.compiler.nativeInterface.*;
27
28public 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}
Note: See TracBrowser for help on using the browser.