/******************************************************************************* * Copyright (c) 2022 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt *******************************************************************************/ package org.aspectj.systemtest.ajc1920; import junit.framework.Test; import org.aspectj.testing.XMLBasedAjcTestCase; /** * @author Alexander Kriegisch */ public class Bugs1920Tests extends XMLBasedAjcTestCase { public void testSwitchWith_Integer_MAX_VALUE() { runTest("switch with Integer.MAX_VALUE case"); } public void testParenthesisedExpressionWithAjKeyword() { runTest("parenthesised expression with AspectJ keyword"); } public void testInterfaceInnerAspectImplicitlyStatic() { runTest("inner aspect of interface is implicitly static"); } public void testExactArrayTypeMatchCompiledTogether() { runTest("exact array type matching, aspect compiled together with target class"); } public void testExactArrayTypeMatchCompiledSeparately() { runTest("exact array type matching, aspect compiled separately from target class"); } public void testFuzzyArrayTypeMatchCompiledTogether() { runTest("fuzzy array type matching, aspect compiled together with target class"); } public void testFuzzyArrayTypeMatchCompiledSeparately() { runTest("fuzzy array type matching, aspect compiled separately from target class"); } public void test_GitHub_214() { runTest("ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning"); } /** * Add correct annotations to multiple ITD methods with the same name and same number of arguments, i.e. copy the * annotations correctly from the aspect into the target class instead of falsely always copying the annotations (if * any) from the first ITD method found. *
* See GitHub issue 246. */ public void test_GitHub_246() { runTest("add correct annotations to multiple ITD methods with the same name and same number of arguments"); } /** * Make sure to create one {@code ajc$inlineAccessMethod} for identically named (overloaded) private aspect methods. *
* See GitHub issue 250. */ public void test_GitHub_250() { runTest("correctly handle overloaded private methods in aspects"); } /** * If one generic method overrides another one with a narrower return type, avoid matching bridge methods. *
* See Spring GitHub issue 27761, * AspectJ GitHub issue 257. *
* This test uses an ASM-modified class file reproducing the problem seen in Spring in plain AspectJ. Before the * bugfix, it fails with "advice defined in RepositoryAspect has not been applied [Xlint:adviceDidNotMatch]". */ public void test_Spring_GitHub_27761() { runTest("do not match bridge methods"); } /** * In 1.9.20, a regression bug occurred, matching negated types like '!void' and '!String' incorrectly. *
* See GitHub issue 257. */ public void test_GitHub_257() { runTest("handle negated type patterns correctly"); } public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs1920Tests.class); } @Override protected java.net.URL getSpecFile() { return getClassResource("ajc1920.xml"); } }