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.

BuildClasspathTest.java 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. * Wes Isberg initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.internal.build;
  13. import java.io.File;
  14. import junit.framework.TestCase;
  15. import org.aspectj.internal.tools.build.Messager;
  16. import org.aspectj.internal.tools.build.Module;
  17. import org.aspectj.internal.tools.build.Modules;
  18. import org.aspectj.internal.tools.build.Result;
  19. import org.aspectj.internal.tools.build.Result.Kind;
  20. public class BuildClasspathTest extends TestCase {
  21. public void testKindsGet() {
  22. Kind kind = Result.kind(Result.NORMAL, Result.ASSEMBLE);
  23. same(kind, "RELEASE_ALL");
  24. kind = Result.kind(Result.NORMAL, !Result.ASSEMBLE);
  25. same(kind, "RELEASE");
  26. kind = Result.kind(!Result.NORMAL, Result.ASSEMBLE);
  27. same(kind, "TEST_ALL");
  28. kind = Result.kind(!Result.NORMAL, !Result.ASSEMBLE);
  29. same(kind, "TEST");
  30. }
  31. private void same(Kind kind, String name) {
  32. if (!name.equals(kind.toString())) {
  33. fail("expected \"" + name + "\" got \"" + kind + "\"");
  34. }
  35. }
  36. // public void testClasspath() {
  37. // Messager handler = new Messager();
  38. // File baseDir = new File("..");
  39. // File jarDir = new File("../aj-build/jars");
  40. // Modules modules = new Modules(baseDir, jarDir, handler);
  41. // Module module = modules.getModule("ajbrowser");
  42. // Kind kind = Result.kind(Result.NORMAL, !Result.ASSEMBLE);
  43. // Result result = module.getResult(kind);
  44. // print(result);
  45. // }
  46. // public void testBuildClasspath() {
  47. // Messager handler = new Messager();
  48. // File baseDir = new File("..");
  49. // File jarDir = new File("../aj-build/jars");
  50. // Modules modules = new Modules(baseDir, jarDir, handler);
  51. // Module module = modules.getModule("build");
  52. // Kind kind = Result.kind(Result.NORMAL, !Result.ASSEMBLE);
  53. // Result result = module.getResult(kind);
  54. // print(result);
  55. // }
  56. private void print(Result result) {
  57. System.out.println(result + " libjars" + result.getLibJars());
  58. System.out.println(result + " required" + result.getRequired());
  59. }
  60. }