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 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.batch;
  13. import java.io.File;
  14. import java.io.IOException;
  15. import java.util.*;
  16. import org.aspectj.ajdt.ajc.Constants;
  17. import org.aspectj.testing.util.TestUtil;
  18. public class WorkingTestMain {
  19. public static void main(String[] args1) throws IOException {
  20. //testExamples();
  21. testOne();
  22. }
  23. public static void testOne() throws IOException {
  24. //CommandTestCase.checkCompile("src1/Parents.java", CommandTestCase.NO_ERRORS);
  25. //CommandTestCase.checkCompile("../../tests/new/ArgsInCflow2.java", CommandTestCase.NO_ERRORS);
  26. //CommandTestCase.checkCompile("src1/ParentsFail.java", CommandTestCase.NO_ERRORS);
  27. List args = new ArrayList();
  28. args.add("-verbose");
  29. //args.add("-1.3");
  30. args.add("-d");
  31. args.add("out");
  32. args.add("-classpath");
  33. args.add(Constants.aspectjrtClasspath() + File.pathSeparator
  34. + "../testing-client/bin");
  35. //args.add("../runtime/bin;../lib/junit/junit.jar");
  36. // args.add("-injars");
  37. // args.add("testdata/testclasses.jar");
  38. //args.add("-aspectpath");
  39. //args.add("../weaver/testdata/megatrace.jar");
  40. args.add("c:/aspectj/scratch/arno/*.java");
  41. //args.add("-XnoInline");
  42. //args.add("../tests/new/Counting1.java");
  43. //args.add("-Xlint:error");
  44. //args.add("testdata/src1/InterType.java");
  45. //args.add("@" + examplesDir + "tjp/files.lst");
  46. CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
  47. //CommandTestCase.runCompiler(args, new int[] {11, 14, 18, 32, 43});
  48. //CommandTestCase.printGenerated("../out", "AroundA1");
  49. // CommandTestCase.printGenerated("../out", "SuperC");
  50. CommandTestCase.printGenerated("../out", "org.schmidmeier.unittests.cache.TimeCacheTestsWorking");
  51. TestUtil.runMain("out;../lib/test/testing-client.jar", "org.schmidmeier.unittests.cache.AllTimeCacheTests");
  52. }
  53. private static String examplesDir = "../docs/examples/";
  54. private static void example(String[] argfiles, String[] classes) {
  55. List args = new ArrayList();
  56. args.add("-verbose");
  57. args.add("-d");
  58. args.add("out");
  59. args.add("-classpath");
  60. args.add(Constants.aspectjrtClasspath());
  61. for (String argfile : argfiles) {
  62. args.add("@" + examplesDir + argfile);
  63. }
  64. CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
  65. for (String aClass : classes) {
  66. TestUtil.runMain("out", aClass);
  67. }
  68. }
  69. public static void testExamples() throws IOException {
  70. example(new String[] {"observer/files.lst"},
  71. new String[] {}); // don't run the gui
  72. example(new String[] {"tjp/files.lst"},
  73. new String[] {"tjp.Demo"});
  74. example(new String[] {"telecom/timing.lst"},
  75. new String[] {"telecom.TimingSimulation"});
  76. example(new String[] {"telecom/billing.lst"},
  77. new String[] {"telecom.BillingSimulation"});
  78. example(new String[] {"tracing/tracev1.lst"},
  79. new String[] {"tracing.version1.TraceMyClasses"});
  80. example(new String[] {"tracing/tracev2.lst"},
  81. new String[] {"tracing.version2.TraceMyClasses"});
  82. example(new String[] {"tracing/tracev3.lst"},
  83. new String[] {"tracing.version3.TraceMyClasses"});
  84. example(new String[] {"introduction/files.lst"},
  85. new String[] {"introduction.HashablePoint", "introduction.ComparablePoint"});
  86. example(new String[] {"bean/files.lst"},
  87. new String[] {"bean.Demo"});
  88. example(new String[] {"spacewar/demo.lst"},
  89. new String[] {}); // don't run the gui
  90. example(new String[] {"spacewar/debug.lst"},
  91. new String[] {}); // don't run the gui
  92. System.out.println("done!!!!!!!!!!!!!!!!!!!!");
  93. }
  94. }