From 97c8fff7799309dfe86dc146283667ae734a43d7 Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 31 May 2008 22:32:01 +0000 Subject: [PATCH] 234943: implementation --- .../systemtest/ajc161/AllTestsAspectJ161.java | 1 + .../OptimizedAnnotationFieldBinding.java | 69 ++++++++++ .../ajc161/annotationFieldBinding.xml | 118 ++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java create mode 100644 tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml diff --git a/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java b/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java index 5ce598fa8..d5de6f84f 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java +++ b/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java @@ -19,6 +19,7 @@ public class AllTestsAspectJ161 { TestSuite suite = new TestSuite("AspectJ 1.6.1 tests"); //$JUnit-BEGIN$ suite.addTest(Ajc161Tests.suite()); + suite.addTest(OptimizedAnnotationFieldBinding.suite()); //$JUnit-END$ return suite; } diff --git a/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java b/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java new file mode 100644 index 000000000..72cba14e2 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java @@ -0,0 +1,69 @@ +/* ******************************************************************* + * Copyright (c) 2008 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://www.eclipse.org/legal/epl-v10.html + * + * Contributors + * Andy Clement + * ******************************************************************/ +package org.aspectj.systemtest.ajc161; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +/** + * Optimising Annotation Field Binding - better code gen for the cases where the user just wants a field from the + * annotation on a method but not the whole annotation. + * + */ +public class OptimizedAnnotationFieldBinding extends XMLBasedAjcTestCase { + + public void testCaseOne_Syntax() { + runTest("case one - syntax"); + } + public void testCaseTwo_NoSuchField() { + runTest("case two - no such field"); + } + public void testCaseThree_Ambiguous() { + runTest("case three - ambiguous"); + } + public void testCaseFour_DefaultValue() { + runTest("case four - default value"); + } + public void testCaseFive_NotAnEnum_CompilerLimitation() { + runTest("case five - not an enum - compiler limitation"); + } + public void testCaseSeven_AnnosInPackagesOne() { + runTest("case seven - annos in packages one"); + } + public void testCaseEight_AnnosInPackagesTwo() { + runTest("case eight - annos in packages two"); + } + public void testCaseNine_AllInDifferentPackages() { + runTest("case nine - everything in different packages"); + } + public void testCaseTen_BindingMultipleThings() { + runTest("case ten - binding multiple things"); + } + public void testCaseEleven_BindingMultipleAnnotationFields() { + runTest("case eleven - binding multiple annotation fields"); + } + public void testCaseTwelve_BindingAnnoAndAnnoValue() { + runTest("case twelve - binding anno and anno value"); + } + + ///////////////////////////////////////// + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(OptimizedAnnotationFieldBinding.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml"); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml b/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml new file mode 100644 index 000000000..1d6e1d354 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.39.5