diff options
author | aclement <aclement> | 2006-01-09 13:31:55 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-01-09 13:31:55 +0000 |
commit | d69ce9aebb3ed4410f07e9992105748b69a0ff5e (patch) | |
tree | 7cdc63adaf53988c549f23601474df7a2ad65de5 /ajdoc/testsrc/org/aspectj | |
parent | 3cadffc3529d94894dfa955497edcfae257c95a6 (diff) | |
download | aspectj-d69ce9aebb3ed4410f07e9992105748b69a0ff5e.tar.gz aspectj-d69ce9aebb3ed4410f07e9992105748b69a0ff5e.zip |
fixes for ajdoc crash - bug 122728
Diffstat (limited to 'ajdoc/testsrc/org/aspectj')
-rw-r--r-- | ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTests.java | 1 | ||||
-rw-r--r-- | ajdoc/testsrc/org/aspectj/tools/ajdoc/EnumTest.java | 98 |
2 files changed, 99 insertions, 0 deletions
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTests.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTests.java index 409121665..129f18a78 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTests.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTests.java @@ -42,6 +42,7 @@ public class AjdocTests extends TestCase { suite.addTestSuite(CoverageTestCase.class); suite.addTestSuite(ITDTest.class); suite.addTestSuite(FullyQualifiedArgumentTest.class); + suite.addTestSuite(EnumTest.class); suite.addTestSuite(ExecutionTestCase.class);// !!! must be last because it exists //$JUnit-END$ return suite; diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/EnumTest.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/EnumTest.java new file mode 100644 index 000000000..39e9d0773 --- /dev/null +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/EnumTest.java @@ -0,0 +1,98 @@ +/******************************************************************** + * Copyright (c) 2005 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation + * Helen Hawkins - iniital version + *******************************************************************/ +package org.aspectj.tools.ajdoc; + +import java.io.File; + +import org.aspectj.util.FileUtil; + +import junit.framework.TestCase; + + +public class EnumTest extends TestCase { + + private File outdir; + + protected void setUp() throws Exception { + super.setUp(); + outdir = new File("../ajdoc/testdata/pr119453/doc"); + } + + protected void tearDown() throws Exception { + super.tearDown(); + + FileUtil.deleteContents(new File("ajdocworkingdir")); + (new File("ajdocworkingdir")).delete(); + + FileUtil.deleteContents(new File("testdata/pr119453/doc")); + (new File("testdata/pr119453/doc")).delete(); + } + + /** + * Test for pr122728 - no StringOutOfBoundsException + * when processing an Enum + */ + public void testEnum() throws Exception { + outdir.delete(); + File f = new File("../ajdoc/testdata/pr122728/src/pack/MyEnum.java"); + + String[] args = { + "-XajdocDebug", + "-private", + "-source", + "1.5", + "-d", + outdir.getAbsolutePath(), + f.getAbsolutePath() + }; + org.aspectj.tools.ajdoc.Main.main(args); + } + + /** + * Test for pr122728 - no StringOutOfBoundsException + * when processing an Enum + */ + public void testInlinedEnum() throws Exception { + outdir.delete(); + File f = new File("../ajdoc/testdata/pr122728/src/pack/ClassWithInnerEnum.java"); + + String[] args = { + "-XajdocDebug", + "-private", + "-source", + "1.5", + "-d", + outdir.getAbsolutePath(), + f.getAbsolutePath() + }; + org.aspectj.tools.ajdoc.Main.main(args); + } + + /** + * Test for pr122728 - no StringOutOfBoundsException + * when processing an Enum + */ + public void testEnumWithMethods() throws Exception { + outdir.delete(); + File f = new File("../ajdoc/testdata/pr122728/src/pack/EnumWithMethods.java"); + + String[] args = { + "-XajdocDebug", + "-private", + "-source", + "1.5", + "-d", + outdir.getAbsolutePath(), + f.getAbsolutePath() + }; + org.aspectj.tools.ajdoc.Main.main(args); + } +} |