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.

AspectJBuildManagerTest.java 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. * Xerox/PARC initial implementation
  11. * Helen Hawkins Converted to new interface (bug 148190)
  12. * ******************************************************************/
  13. package org.aspectj.ajde.internal;
  14. import java.io.File;
  15. import org.aspectj.ajde.AjdeTestCase;
  16. import org.aspectj.asm.AsmManager;
  17. import junit.framework.TestSuite;
  18. /**
  19. * @author Mik Kersten
  20. */
  21. public class AspectJBuildManagerTest extends AjdeTestCase {
  22. public static TestSuite suite() {
  23. TestSuite result = new TestSuite();
  24. result.addTestSuite(AspectJBuildManagerTest.class);
  25. return result;
  26. }
  27. public void testSequence() {
  28. AsmManager.dumpModelPostBuild=true; // or you wont get a .ajsym file
  29. try {
  30. // XXX should fail? empty configs fail b/c no sources specified
  31. initialiseProject("AspectJBuildManagerTest");
  32. doBuild("empty.lst");
  33. assertTrue("Expected there to be no error messages from the build but found that" +
  34. " there were some " + getErrorMessages("empty.lst"),getErrorMessages("empty.lst").isEmpty());
  35. // TODO-path
  36. initialiseProject("figures-coverage");
  37. doBuild("all.lst");
  38. assertTrue("Expected there to be no error messages from the build but found that" +
  39. " there were some " + getErrorMessages("empty.lst"),getErrorMessages("empty.lst").isEmpty());
  40. File file = new File(getCompilerForConfigFileWithName("all.lst").getCompilerConfiguration().getOutputLocationManager().getDefaultOutputLocation() + "/figures/Main.class");
  41. if (file.exists()) {
  42. file.delete();
  43. } else {
  44. assertTrue("expected class " + file, false);
  45. }
  46. // TODO-path
  47. file = openFile("all.ajsym");
  48. if (file.exists()) {
  49. file.delete();
  50. } else {
  51. assertTrue("expected .ajsym: " + file, false);
  52. }
  53. } finally {
  54. AsmManager.dumpModelPostBuild=false;
  55. }
  56. }
  57. }