diff options
author | acolyer <acolyer> | 2005-09-21 14:59:55 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-21 14:59:55 +0000 |
commit | a39f595c0cdcddf8eac0b99e1918d0578f2dc501 (patch) | |
tree | 94865da1d5f277582d9d0720347693cd3b3c258a /bcel-builder/testsrc/org/aspectj/apache/bcel | |
parent | fc2d08e2ae9d03fb377bd0ed0bd56983af4687a5 (diff) | |
download | aspectj-a39f595c0cdcddf8eac0b99e1918d0578f2dc501.tar.gz aspectj-a39f595c0cdcddf8eac0b99e1918d0578f2dc501.zip |
tests and implementation for 108120 - runtime pointcut parsing and matching.
Diffstat (limited to 'bcel-builder/testsrc/org/aspectj/apache/bcel')
-rw-r--r-- | bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java new file mode 100644 index 000000000..06bd9ccc8 --- /dev/null +++ b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java @@ -0,0 +1,61 @@ +/* ******************************************************************* + * Copyright (c) 2005 Contributors. + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Adrian Colyer Initial implementation + * ******************************************************************/ +package org.aspectj.apache.bcel.classfile.tests; + +import org.aspectj.apache.bcel.classfile.JavaClass; +import org.aspectj.apache.bcel.util.ClassLoaderRepository; +import org.aspectj.apache.bcel.util.Repository; + +import junit.framework.TestCase; + +/** + * @author colyer + * + */ +public class GetReflectMembersTest extends TestCase { + + private Repository bcelRepository; + private JavaClass jc; + + public void testGetMethod() throws Exception { + assertNotNull(jc.getMethod(GetMe.class.getMethod("foo",new Class[] {String.class}))); + } + + public void testGetConstructor() throws Exception { + assertNotNull(jc.getMethod(GetMe.class.getConstructor(new Class[] {int.class}))); + } + + public void testGetField() throws Exception { + assertNotNull(jc.getField(GetMe.class.getDeclaredField("x"))); + } + + protected void setUp() throws Exception { + super.setUp(); + this.bcelRepository = new ClassLoaderRepository(getClass().getClassLoader()); + this.jc = bcelRepository.loadClass(GetMe.class); + } + + protected void tearDown() throws Exception { + super.tearDown(); + this.bcelRepository.clear(); + } + + private static class GetMe { + + private int x; + + public GetMe(int x) { this.x = x;} + + public void foo(String s) {}; + + } +} |