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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /********************************************************************
  2. * Copyright (c) 2005 Contributors. All rights reserved.
  3. * This program and the accompanying materials are made available
  4. * under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution and is available at
  6. * http://eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: IBM Corporation - initial API and implementation
  9. * Helen Hawkins - iniital version
  10. *******************************************************************/
  11. package org.aspectj.tools.ajdoc;
  12. import java.io.File;
  13. import org.aspectj.util.FileUtil;
  14. import junit.framework.TestCase;
  15. public class EnumTest extends TestCase {
  16. private File outdir;
  17. protected void setUp() throws Exception {
  18. super.setUp();
  19. outdir = new File("../ajdoc/testdata/pr119453/doc");
  20. }
  21. protected void tearDown() throws Exception {
  22. super.tearDown();
  23. FileUtil.deleteContents(new File("ajdocworkingdir"));
  24. (new File("ajdocworkingdir")).delete();
  25. FileUtil.deleteContents(new File("testdata/pr119453/doc"));
  26. (new File("testdata/pr119453/doc")).delete();
  27. }
  28. /**
  29. * Test for pr122728 - no StringOutOfBoundsException
  30. * when processing an Enum
  31. */
  32. public void testEnum() throws Exception {
  33. outdir.delete();
  34. File f = new File("../ajdoc/testdata/pr122728/src/pack/MyEnum.java");
  35. String[] args = {
  36. "-XajdocDebug",
  37. "-private",
  38. "-source",
  39. "1.5",
  40. "-d",
  41. outdir.getAbsolutePath(),
  42. f.getAbsolutePath()
  43. };
  44. org.aspectj.tools.ajdoc.Main.main(args);
  45. }
  46. /**
  47. * Test for pr122728 - no StringOutOfBoundsException
  48. * when processing an Enum
  49. */
  50. public void testInlinedEnum() throws Exception {
  51. outdir.delete();
  52. File f = new File("../ajdoc/testdata/pr122728/src/pack/ClassWithInnerEnum.java");
  53. String[] args = {
  54. "-XajdocDebug",
  55. "-private",
  56. "-source",
  57. "1.5",
  58. "-d",
  59. outdir.getAbsolutePath(),
  60. f.getAbsolutePath()
  61. };
  62. org.aspectj.tools.ajdoc.Main.main(args);
  63. }
  64. /**
  65. * Test for pr122728 - no StringOutOfBoundsException
  66. * when processing an Enum
  67. */
  68. public void testEnumWithMethods() throws Exception {
  69. outdir.delete();
  70. File f = new File("../ajdoc/testdata/pr122728/src/pack/EnumWithMethods.java");
  71. String[] args = {
  72. "-XajdocDebug",
  73. "-private",
  74. "-source",
  75. "1.5",
  76. "-d",
  77. outdir.getAbsolutePath(),
  78. f.getAbsolutePath()
  79. };
  80. org.aspectj.tools.ajdoc.Main.main(args);
  81. }
  82. }