You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ReflectionWorldSpecificTest.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* *******************************************************************
  2. * Copyright (c) 2005 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Adrian Colyer Initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.reflect;
  13. import junit.framework.TestCase;
  14. import org.aspectj.weaver.ResolvedType;
  15. import org.aspectj.weaver.UnresolvedType;
  16. import org.aspectj.weaver.World;
  17. public class ReflectionWorldSpecificTest extends TestCase {
  18. public void testDelegateCreation() {
  19. World world = new ReflectionWorld(true, getClass().getClassLoader());
  20. ResolvedType rt = world.resolve("java.lang.Object");
  21. assertNotNull(rt);
  22. assertEquals("Ljava/lang/Object;", rt.getSignature());
  23. }
  24. public void testArrayTypes() {
  25. IReflectionWorld world = new ReflectionWorld(true, getClass().getClassLoader());
  26. String[] strArray = new String[1];
  27. ResolvedType rt = world.resolve(strArray.getClass());
  28. assertTrue(rt.isArray());
  29. }
  30. public void testPrimitiveTypes() {
  31. IReflectionWorld world = new ReflectionWorld(true, getClass().getClassLoader());
  32. assertEquals("int", UnresolvedType.INT, world.resolve(int.class));
  33. assertEquals("void", UnresolvedType.VOID, world.resolve(void.class));
  34. }
  35. }