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.

Ajc1611Tests.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*******************************************************************************
  2. * Copyright (c) 2008 Contributors
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Andy Clement - initial API and implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.ajc1611;
  12. import java.io.File;
  13. import junit.framework.Test;
  14. import org.aspectj.apache.bcel.classfile.JavaClass;
  15. import org.aspectj.apache.bcel.classfile.Method;
  16. import org.aspectj.systemtest.ajc150.GenericsTests;
  17. import org.aspectj.testing.XMLBasedAjcTestCase;
  18. /**
  19. * @author Andy Clement
  20. */
  21. public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
  22. // error without the fix:
  23. // Second.java:8:0::0 Bound mismatch: The generic method foo(R, Class<T>) of type II is not applicable for the arguments (E1,
  24. // Class<capture#1-of ? extends E2>). The inferred type capture#1-of ? extends E2 is not a valid substitute for the bounded
  25. // parameter <R extends I1>
  26. public void testBoundsChecking_pr336880() {
  27. runTest("bounds check confusion");
  28. }
  29. public void testClashingItds_pr336774() {
  30. runTest("clashing itds");
  31. }
  32. public void testBadGenericSigAttribute_pr336745() {
  33. runTest("incorrect signature");
  34. JavaClass jc = GenericsTests.getClass(ajc, "C");
  35. assertNotNull(jc);
  36. Method m = getMethod(jc, "m");
  37. Method mitd = getMethod(jc, "mitd");
  38. assertEquals("<T::LI;>(TT;)V", m.getGenericSignature());
  39. assertEquals("<T::LI;>(TT;)V", mitd.getGenericSignature());
  40. }
  41. private Method getMethod(JavaClass jc, String name) {
  42. for (Method m : jc.getMethods()) {
  43. if (m.getName().equals(name)) {
  44. return m;
  45. }
  46. }
  47. return null;
  48. }
  49. public void testESJP_336471() {
  50. runTest("esjp");
  51. }
  52. public void testITIT_336136() {
  53. runTest("itit");
  54. }
  55. public void testITIT_336136_2() {
  56. runTest("itit - 2");
  57. }
  58. public void testDeserialization_335682() {
  59. runTest("pr335682");
  60. }
  61. public void testDeserialization_335682_2() {
  62. runTest("pr335682 - 2");
  63. }
  64. public void testDeserialization_335682_3() {
  65. runTest("pr335682 - 3");
  66. }
  67. public void testDeserialization_335682_5() {
  68. runTest("pr335682 - 5");
  69. }
  70. public void testNPEAddSerialVersionUID_bug335783() {
  71. runTest("pr335783");
  72. }
  73. public void testGenericsAndItds_333469() {
  74. runTest("pr333469");
  75. }
  76. public void testMissingType_332388() {
  77. runTest("pr332388");
  78. }
  79. public void testMissingType_332388_2() {
  80. runTest("pr332388 - 2");
  81. }
  82. public void testDeclareField_328840() {
  83. runTest("pr328840");
  84. }
  85. // public void testAnnoStyleAdviceChain_333274() {
  86. // runTest("anno style advice chain");
  87. // }
  88. //
  89. // public void testAnnoStyleAdviceChain_333274_2() {
  90. // runTest("code style advice chain");
  91. // }
  92. //
  93. // public void testAnnoStyleAdviceChain_333274_3() {
  94. // runTest("code style advice chain - no inline");
  95. // }
  96. // ---
  97. public static Test suite() {
  98. return XMLBasedAjcTestCase.loadSuite(Ajc1611Tests.class);
  99. }
  100. @Override
  101. protected File getSpecFile() {
  102. return getClassResource("ajc1611.xml");
  103. }
  104. }