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.

UtilityTestCase.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  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://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.bcel;
  13. import java.io.IOException;
  14. import junit.framework.TestCase;
  15. public class UtilityTestCase extends TestCase {
  16. public UtilityTestCase(String name) {
  17. super(name);
  18. }
  19. public void disassembleTest(String name) throws IOException {
  20. BcelWorld world = new BcelWorld("../weaver/bin");
  21. // world.setFastDelegateSupport(false);
  22. world.addPath(WeaveTestCase.classDir);
  23. LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(name)));
  24. clazz.print();
  25. System.out.println();
  26. }
  27. public void testHelloWorld() throws IOException {
  28. disassembleTest("Test");
  29. }
  30. public void testFancyHelloWorld() throws IOException {
  31. disassembleTest("FancyHelloWorld");
  32. }
  33. // public void testSwitchy() throws IOException {
  34. // disassembleTest("TestSwitchy");
  35. // }
  36. public static void main(String[] args) throws IOException {
  37. BcelWorld world = new BcelWorld();
  38. LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(args[0])));
  39. clazz.print();
  40. }
  41. }