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.

WorkingTestMain.java 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * Xerox/PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.batch;
  13. import java.io.IOException;
  14. import java.util.*;
  15. import java.util.List;
  16. import org.aspectj.testing.util.TestUtil;
  17. public class WorkingTestMain {
  18. public static void main(String[] args1) throws IOException {
  19. //testExamples();
  20. testOne();
  21. }
  22. public static void testOne() throws IOException {
  23. //CommandTestCase.checkCompile("src1/Parents.java", CommandTestCase.NO_ERRORS);
  24. //CommandTestCase.checkCompile("../../tests/new/ArgsInCflow2.java", CommandTestCase.NO_ERRORS);
  25. //CommandTestCase.checkCompile("src1/ParentsFail.java", CommandTestCase.NO_ERRORS);
  26. List args = new ArrayList();
  27. args.add("-verbose");
  28. //args.add("-1.3");
  29. args.add("-d");
  30. args.add("out");
  31. args.add("-classpath");
  32. args.add("../runtime/bin;../lib/junit/junit.jar;../testing-client/bin");
  33. //args.add("../runtime/bin;../lib/junit/junit.jar");
  34. // args.add("-injars");
  35. // args.add("testdata/testclasses.jar");
  36. //args.add("-aspectpath");
  37. //args.add("../weaver/testdata/megatrace.jar");
  38. args.add("testdata/src1/AroundA1.java");
  39. //args.add("../tests/new/AroundInnerCalls.java");
  40. //args.add("-Xlint:error");
  41. //args.add("testdata/src1/InterType.java");
  42. //args.add("@" + examplesDir + "tjp/files.lst");
  43. CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
  44. //CommandTestCase.runCompiler(args, new int[] {11, 14, 18, 32, 43});
  45. // CommandTestCase.printGenerated("../out", "AdviceOnInheritedMethod");
  46. // CommandTestCase.printGenerated("../out", "SuperC");
  47. // CommandTestCase.printGenerated("../out", "SubC");
  48. //TestUtil.runMain("out;../bcweaver/testdata/megatrace.jar", "Privileged");
  49. //TestUtil.runMain("out;../lib/test/testing-client.jar", "AroundInnerCalls");
  50. }
  51. private static String examplesDir = "c:/aspectj/examples/";
  52. private static void example(String[] argfiles, String[] classes) {
  53. List args = new ArrayList();
  54. args.add("-verbose");
  55. args.add("-d");
  56. args.add("out");
  57. args.add("-classpath");
  58. args.add("../runtime/bin");
  59. for (int i=0; i < argfiles.length; i++) {
  60. args.add("@" + examplesDir + argfiles[i]);
  61. }
  62. CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
  63. for (int i=0; i < classes.length; i++) {
  64. TestUtil.runMain("out", classes[i]);
  65. }
  66. }
  67. public static void testExamples() throws IOException {
  68. // example(new String[] {"observer/files.lst"},
  69. // new String[] {"observer.Demo"});
  70. // example(new String[] {"tjp/files.lst"},
  71. // new String[] {"tjp.Demo"});
  72. example(new String[] {"telecom/timing.lst"},
  73. new String[] {"telecom.TimingSimulation"});
  74. example(new String[] {"telecom/billing.lst"},
  75. new String[] {"telecom.BillingSimulation"});
  76. example(new String[] {"tracing/tracev1.lst"},
  77. new String[] {"tracing.version1.TraceMyClasses"});
  78. example(new String[] {"tracing/tracev2.lst"},
  79. new String[] {"tracing.version2.TraceMyClasses"});
  80. example(new String[] {"tracing/tracev3.lst"},
  81. new String[] {"tracing.version3.TraceMyClasses"});
  82. example(new String[] {"introduction/files.lst"},
  83. new String[] {"introduction.HashablePoint", "introduction.ComparablePoint"});
  84. example(new String[] {"bean/files.lst"},
  85. new String[] {"bean.Demo"});
  86. example(new String[] {"spacewar/demo.lst"},
  87. new String[] {});
  88. example(new String[] {"spacewar/debug.lst"},
  89. new String[] {});
  90. }
  91. }