aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
blob: 42df7f208c6ff69d218d9b9de677f848ba7a86ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
/*******************************************************************************
 * Copyright (c) 2004 IBM 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 *
 * Contributors:
 *    Andy Clement - initial API and implementation
 *******************************************************************************/
package org.aspectj.systemtest.ajc150;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;

import junit.framework.Test;

import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.apache.bcel.classfile.Signature;
import org.aspectj.apache.bcel.util.ClassPath;
import org.aspectj.apache.bcel.util.SyntheticRepository;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
import org.aspectj.asm.IProgramElement;
import org.aspectj.asm.IRelationship;
import org.aspectj.asm.internal.Relationship;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.util.LangUtil;

public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
	  
  public static Test suite() {
    return XMLBasedAjcTestCase.loadSuite(Ajc150Tests.class);
  }

  protected File getSpecFile() {
    return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
  }

  /*
  public void testBrokenDispatchByITD_pr72834() { runTest("broken dispatch");}
  public void testMissingAccessor_pr73856() { runTest("missing accessor");}
  public void testCunningDeclareParents_pr92311() { runTest("cunning declare parents");}
  public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
  */
  public void testGeneratingCodeForAnOldRuntime_pr116679_1() { runTest("generating code for a 1.2.1 runtime - 1");}
  public void testGeneratingCodeForAnOldRuntime_pr116679_2() { runTest("generating code for a 1.2.1 runtime - 2");}
  public void testAmbiguousMethod_pr118599_1() { runTest("ambiguous method when binary weaving - 1");}
  public void testAmbiguousMethod_pr118599_2() { runTest("ambiguous method when binary weaving - 2");}
  public void testAroundAdviceArrayAdviceSigs_pr118781()     { runTest("verify error with around advice array sigs");}
  public void testAtDeclareParents_pr117681() { runTest("at declare parents");}
  public void testPrivilegeProblem_pr87525() { runTest("privilege problem with switch");}
  public void testGenericAspects_pr115237() { runTest("aspectOf and generic aspects");}
  public void testClassFormatError_pr114436() { runTest("ClassFormatError binary weaving perthis");}
  public void testParserException_pr115788() { runTest("parser exception");}
  public void testPossibleStaticImports_pr113066_1() { runTest("possible static imports bug - 1");}
  public void testPossibleStaticImports_pr113066_2() { runTest("possible static imports bug - 2");}
  public void testPossibleStaticImports_pr113066_3() { runTest("possible static imports bug - 3");}
  public void testITDCtor_pr112783()                 { runTest("Problem with constructor ITDs");}
  public void testAnnotatedITDFs_pr114005_1()        { runTest("Annotated ITDFs - 1");}
  public void testAnnotatedITDFs_pr114005_2()        { runTest("Annotated ITDFs - 2");}
  public void testCantCallSuperMethods_pr90143() { runTest("cant call super methods");}
  public void testBrokenDecp_pr112476()       { runTest("binary weaving decp broken");}
  public void testUnboundFormal_pr112027()    { runTest("unexpected error unboundFormalInPC");}
  public void testNPEScopeSetup_pr115038()    { runTest("NPE in ensureScopeSetup");}
  public void testCCEGenerics_pr113445()      { runTest("Generics ClassCastException");}
  public void testMatthewsAspect_pr113947_1() { runTest("maws generic aspect - 1");}
  public void testMatthewsAspect_pr113947_2() { runTest("maws generic aspect - 2");}
  public void testFieldGet_pr114343()         { runTest("field-get, generics and around advice");}
  public void testFieldGet_pr114343_2()       { runTest("field-get, generics and around advice - 2");}
  public void testFieldGet_pr114343_3()       { runTest("field-get, generics and around advice - 3");}
  public void testCaptureBinding_pr114744()   { runTest("capturebinding wildcard problem");}
  
  public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
  public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
  public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
  public void testBadDecp_pr110788_4() { runTest("bad generic decp - 4");}

  public void testVarargsITD_pr110906() { runTest("ITD varargs problem");}
  public void testBadRenderer_pr86903() { runTest("bcelrenderer bad");}
  //public void testIllegalInitialization_pr118326_1() { runTest("illegal initialization - 1");}
  //public void testIllegalInitialization_pr118326_2() { runTest("illegal initialization - 2");}
  public void testLintForAdviceSorting_pr111667() { runTest("lint for advice sorting");}
  
  public void testIncompatibleClassChangeError_pr113630_1() {runTest("IncompatibleClassChangeError - errorscenario");}
  public void testIncompatibleClassChangeError_pr113630_2() {runTest("IncompatibleClassChangeError - workingscenario");}
  
  public void testFieldGetProblemWithGenericField_pr113861() {runTest("field-get problems with generic field");}
  public void testAccesstoPrivateITDInNested_pr118698() { runTest("access to private ITD from nested type");}

  public void testDeclareAnnotationOnNonExistentType_pr99191_1() { runTest("declare annotation on non existent type - 1");}
  public void testDeclareAnnotationOnNonExistentType_pr99191_2() { runTest("declare annotation on non existent type - 2");}  
  public void testDeclareAnnotationOnNonExistentType_pr99191_3() { runTest("declare annotation on non existent type - 3");}  
  public void testDeclareAnnotationOnNonExistentType_pr99191_4() { runTest("declare annotation on non existent type - 4");}  
  public void testDeclareAnnotationOnNonExistentType_pr99191_5() { runTest("declare annotation on non existent type - 5");}  
  
  public void testBadGenericSigAttribute_pr110927() { 
	runTest("cant create signature attribute");
	Signature sig = GenericsTests.getClassSignature(ajc,"I");
	if (sig==null) fail("Couldn't find signature attribute for type I");
	String sigString = sig.getSignature();
	if (!(sigString.equals("Ljava/lang/Object;LIE2;LIE1<Ljava/lang/String;>;") ||
          sigString.equals("Ljava/lang/Object;LIE1<Ljava/lang/String;>;LIE2;"))) {
		fail("Signature was "+sigString+" when should have been something like Ljava/lang/Object;LIE1<Ljava/lang/String;>;LIE2;");
	}
  }

  public void test_typeProcessingOrderWhenDeclareParents() {
	runTest("Order of types passed to compiler determines weaving behavior");
  }
  
  public void test_aroundMethod() {
  	runTest("method called around in class");
  }
 
  public void test_aroundMethodAspect() {
  	runTest("method called around in aspect");
  }
  
  public void test_ambiguousBindingsDetection() {
  	runTest("Various kinds of ambiguous bindings");
  }
  
  public void test_ambiguousArgsDetection() {
  	runTest("ambiguous args");
  }
  
  public void testIncorrectExceptionTableWhenBreakInMethod_pr78021() {
  	runTest("Injecting exception into while loop with break statement causes catch block to be ignored");
  }
  
  
  public void testIncorrectExceptionTableWhenReturnInMethod_pr79554() {
  	runTest("Return in try-block disables catch-block if final-block is present");
  }

  public void testMissingDebugInfoForGeneratedMethods_pr82570() throws ClassNotFoundException {
  	runTest("Weaved code does not include debug lines");
  	boolean f = false;
    JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"PR82570_1");
    Method[] meths = jc.getMethods();
    for (int i = 0; i < meths.length; i++) {
		Method method = meths[i];
		if (f) System.err.println("Line number table for "+method.getName()+method.getSignature()+" = "+method.getLineNumberTable());
		assertTrue("Didn't find a line number table for method "+method.getName()+method.getSignature(),
				method.getLineNumberTable()!=null);
    }

    // This test would determine the info isn't there if you pass -g:none ...
//    cR = ajc(baseDir,new String[]{"PR82570_1.java","-g:none"});
//    assertTrue("Expected no compile problem:"+cR,!cR.hasErrorMessages());
//    System.err.println(cR.getStandardError());
//    jc = getClassFrom(ajc.getSandboxDirectory(),"PR82570_1");
//    meths = jc.getMethods();
//    for (int i = 0; i < meths.length; i++) {
//		Method method = meths[i];
//		assertTrue("Found a line number table for method "+method.getName(),
//				method.getLineNumberTable()==null);
//    }
  }

  
  public void testCanOverrideProtectedMethodsViaITDandDecp_pr83303() {
  	runTest("compiler error when mixing inheritance, overriding and polymorphism");
  }
  
  public void testPerTypeWithin_pr106554() {runTest("Problem in staticinitialization with pertypewithin aspect");}
  
  public void testPerTypeWithinMissesNamedInnerTypes() {
  	runTest("pertypewithin() handing of inner classes (1)");
  }
  
  public void testPerTypeWithinMissesAnonymousInnerTypes() {
  	runTest("pertypewithin() handing of inner classes (2)");
  }

  public void testPerTypeWithinIncorrectlyMatchingInterfaces() {
  	runTest("pertypewithin({interface}) illegal field modifier");
  }
  
  public void test051_arrayCloningInJava5() {
    runTest("AJC possible bug with static nested classes");
  }
 
  public void testBadASMforEnums() throws IOException {
  	runTest("bad asm for enums");
  	
  	if (LangUtil.is15VMOrGreater()) {
	  	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	  	PrintWriter pw = new PrintWriter(baos);
	  	AsmManager.dumptree(pw,AsmManager.getDefault().getHierarchy().getRoot(),0);
	  	pw.flush();
	  	String tree = baos.toString();
	  	assertTrue("Expected 'Red [enumvalue]' somewhere in here:"+tree,tree.indexOf("Red  [enumvalue]")!=-1);
  	}
  }
  
  public void npeOnTypeNotFound() {
	  runTest("structure model npe on type not found");
  }
 
  public void testNoRuntimeExceptionSoftening() {
	  runTest("declare soft of runtime exception");
  }
  
  public void testRuntimeNoSoftenWithHandler() {
	  runTest("declare soft w. catch block");
  }
  
  public void testSyntaxError() {
	  runTest("invalid cons syntax");
  }
  
  public void testVarargsInConsBug() {
	  runTest("varargs in constructor sig");
  }
  
  public void testAspectpathdirs() {
	  runTest("dirs on aspectpath");
  }
  
  public void testIntroSample() {
	  runTest("introduction sample");
  }
  
  public void testPTWInterface() {
	  runTest("pertypewithin({interface}) illegal field modifier");
  }
  
  public void testEnumCalledEnumEtc() {
	  runTest("enum called Enum, annotation called Annotation, etc");
  }
  
  public void testInternalCompilerError_pr86832() {
	  runTest("Internal compiler error");
  }
  
  public void testCloneMethod_pr83311() {
	  runTest("overriding/polymorphism error on interface method introduction");
  }

  
  // IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
  // of time - if you see it hanging, someone has messed with the optimization.
  public void testIfEvaluationExplosion_pr94086() {
	  runTest("Exploding compile time with if() statements in pointcut");
  }
  
  public void testReflectNPE_pr94167() {runTest("NPE in reflect implementation");}
  
  public void testStaticImports_pr84260() {runTest("static import failures");} 
  
  public void testGenerics_pr99089() {runTest("ArrayIndexOutOfBoundsException - Generics in privileged aspects");}
  public void testGenerics_pr95993() {runTest("NPE at ClassScope.java:660 when compiling generic class");}
  
  public void testItdGenerics_pr99228()  {runTest("ITD of a field into a generic class");}
  public void testItdGenerics_pr98320()  {runTest("intertype with nested generic type");}
  public void testItdGenerics_pr100227() {runTest("inner class with generic enclosing class");}
  public void testItdGenerics_pr100260() {runTest("methods inherited from a generic parent");}
  
  public void testSyntaxErrorNPE_pr103266() {runTest("NPE on syntax error");}
  
  public void testFinalAbstractClass_pr109486() { runTest("Internal compiler error (ClassParser.java:242)");}
 
  public void testComplexBinding_pr102210() { runTest("NullPointerException trying to compile");}
  
  public void testIllegalStateExceptionOnNestedParameterizedType_pr106634() { 
	  runTest("IllegalStateException unpacking signature of nested parameterized type");
  }
  
  public void testParseErrorOnAnnotationStarPlusPattern() {
	  runTest("(@Foo *)+ type pattern parse error");
  }
  
  public void test_pr106130_tooManyLocals() {
	  runTest("test weaving with > 256 locals");
  }
  
  public void testMissingNamePattern_pr106461() { runTest("missing name pattern"); }
  
  public void testMissingNamePattern_pr107059() {
	  runTest("parser crashes on call(void (@a *)(..)");
  }
  
  public void testIntermediateAnnotationMatching() {
	  runTest("intermediate annotation matching");
  }
  
  public void testBadRuntimeTestGeneration() {
	  runTest("target(@Foo *)");
  }
  
  public void testErrorMessageOnITDWithTypePatterns() {
	  runTest("clear error message on itd with type pattern");
  }
  
  public void testAjKeywordsAsIdentifiers() {
	  runTest("before and after are valid identifiers in classes");
  }
  
  public void testAjKeywordsAsIdentifiers2() {
	  runTest("before and after are valid identifiers in classes, part 2");	  
  }
  
  public void testNoBeforeReturningAdvice() {
	  runTest("before returning advice not allowed!");
  }
  
  public void testDetectVoidFieldType() {
	  runTest("void field type in pointcut expression");
  }
  
  public void testPointcutOverriding() {
	  runTest("overriding final pointcut from super-aspect");
  }
  
  public void testAtSuppressWarnings() {
	  runTest("@SuppressWarnings should suppress");
  }
  
  public void testDEOWWithBindingPointcut() {
	  runTest("declare warning : foo(str) : ...;");
  }
  
  public void testAroundAdviceAndInterfaceInitializer() {
	  runTest("around advice on interface initializer");
  }
  
  public void testGoodErrorMessageOnUnmatchedMemberSyntax() {
	  runTest("good error message for unmatched member syntax");
  }
  
  public void testITDWithNoExceptionAndIntermediary() {
	  runTest("itd override with no exception clause");
  }
  
  public void testAnonymousInnerClasses() {
	  runTest("anonymous inner classes");
  }

  public void testMultipleAnonymousInnerClasses() {
	  runTest("multiple anonymous inner classes");
  }
  
  public void testPrivilegedMethodAccessorsGetRightExceptions_pr82989() {
	  runTest("Compiler error due to a wrong exception check in try blocks");
  }
  
  public void testAnonymousInnerClassWithMethodReturningTypeParameter_pr107898() {
	  runTest("anonymous inner class with method returning type parameter");
  }
  
  public void testMatchingOfObjectArray() {
	  runTest("matching against Object[]");
  }
  
  public void testMultipleAnonymousInnerClasses_pr108104() {
	  runTest("multiple anonymous inner classes 2");
  }
  
  public void testSignatureMatchingInMultipleOverrideScenario() {
	  runTest("signature matching in override scenario");
  }
 
  public void testWildcardAnnotationMatching_pr108245() {
	  runTest("wildcard annotation matching - pr108245");
  }
  
  public void testInnerTypesAndTypeVariables() {
	  runTest("inner types and type variables");
  }
  
  public void testAtAfterThrowingWithNoFormal() {
	  runTest("@AfterThrowing with no formal specified");
  }
  
  public void testParameterizedVarArgsMatch() {
	  runTest("varargs with type variable");
  }
  
  public void testFieldAccessInsideITDM() {
	  runTest("itd field access inside itd method");
  }

  public void testTypeVarWithTypeVarBound() {
	  runTest("type variable with type variable bound");
  }
  
  public void testEnumSwitchInITD() {
	  runTest("switch on enum inside ITD method");
  }
  
  public void testInnerTypeOfGeneric() {
	  runTest("inner type of generic interface reference from parameterized type");
  }
  
  public void testDeclareParentsIntroducingCovariantReturnType() {
	  runTest("declare parents introducing override with covariance");
  }
  
  public void testInnerClassPassedToVarargs() {
	  runTest("inner class passed as argument to varargs method");
  }
  
  public void testInlinedFieldAccessInProceedCall() {
	  runTest("inlined field access in proceed call");
  }
  
  public void testVisibiltyInSignatureMatchingWithOverridesPart1() {
	  runTest("visibility in signature matching with overrides - 1");
  }

  public void testVisibiltyInSignatureMatchingWithOverridesPart2() {
	  runTest("visibility in signature matching with overrides - 2");
  }

  public void testVisibiltyInSignatureMatchingWithOverridesPart3() {
	  runTest("visibility in signature matching with overrides - 3");
  }
  
  public void testArgsGeneratedCorrectlyForAdviceExecution() {
	  runTest("args generated correctly for advice execution join point");
  }
  
  public void testNoUnusedWarningsOnAspectTypes() {
	  runTest("no unused warnings on aspect types");
  }
  
  public void testSyntheticArgumentsOnITDConstructorsNotUsedInMatching() {
	  runTest("synthetic arguments on itd cons are not used in matching");
  }
  
  public void testParsingOfGenericTypeSignature() {
	  runTest("parse generic type signature with parameterized type in interface");
  }
  
  public void testOverrideAndCovarianceWithDecPRuntime() {
	  runTest("override and covariance with decp - runtime");
  }
  
  public void testOverrideAndCovarianceWithDecPRuntimeMultiFiles() {
	  runTest("override and covariance with decp - runtime separate files");
  }

  public void testOverrideAndCovarianceWithDecPRuntimeMultiFilesBinaryWeaving() {
	  runTest("override and covariance with decp - binary weaving");
  }
  
  public void testAbstractSynchronizedITDMethods() {
	  runTest("abstract synchronized itdms not detected");
  }
  
  public void testSynchronizedITDInterfaceMethods() {
	  runTest("synchronized itd interface methods");
  }
  
  public void testNoWarningOnUnusedPointcut() {
	  runTest("unused private pointcuts");
  }
  
  public void testITDOnInterfaceWithExistingMember() {
	  runTest("itd interface method already existing on interface");
  }
  
  public void testFinalITDMOnInterface() {
	  runTest("final itd methods on interfaces");
  }
  
  public void testPrivatePointcutOverriding() {
	  runTest("can't override private pointcut in abstract aspect");
  }

  public void testAdviceOnCflow() {
	  runTest("advising cflow advice execution");
  }
  
  public void testNoTypeMismatchOnSameGenericTypes() {
	  runTest("no type mismatch on generic types in itds");
  }
  
  public void testSuperCallInITD() {
	  runTest("super call in ITD");
  }

  public void testSuperCallInITDPart2() {
	  runTest("super call in ITD - part 2");
  }
  
  public void testAtAnnotationBadTest_pr103740() {
	  runTest("Compiler failure on at_annotation");
  }
  
  public void testNoUnusedParameterWarningsForSyntheticAdviceArgs() {
	  runTest("no unused parameter warnings for synthetic advice args");
  }
  
  public void testNoVerifyErrorWithSetOnInnerType() {
	  runTest("no verify error with set on inner type");
  }
  
  public void testCantFindTypeErrorWithGenericReturnTypeOrParameter() {
	  runTest("cant find type error with generic return type or parameter");
  }

  public void testNoVerifyErrorOnGenericCollectionMemberAccess() {
	  runTest("no verify error on generic collection member access");
  }
  
  public void testRawAndGenericTypeConversionITDCons() {
	  runTest("raw and generic type conversion with itd cons");
  }
  
  public void testAtAnnotationBindingWithAround() {
	  runTest("@annotation binding with around advice");
  }
  
  public void testUnableToBuildShadows_pr109728() { runTest("Unable to build shadows");}

  public void testMessageOnMissingTypeInDecP() {
	  runTest("declare parents on a missing type");
  }
  
  public void testParameterizedGenericMethods() {
	  runTest("parameterized generic methods");
  }
  
  public void testIllegalChangeToPointcutDeclaration_pr111915() {
	runTest("test illegal change to pointcut declaration");
  }
  
  public void testCantProvideDefaultImplViaITD_pr110307_1() {runTest("Cant provide default implementation via ITD - 1");}
  public void testCantProvideDefaultImplViaITD_pr110307_2() {runTest("Cant provide default implementation via ITD - 2");}
  public void testCantProvideDefaultImplViaITD_pr110307_3() {runTest("Cant provide default implementation via ITD - 3");}
  public void testCantProvideDefaultImplViaITD_pr110307_4() {runTest("Cant provide default implementation via ITD - 4");}
  public void testCantProvideDefaultImplViaITD_pr110307_5() {runTest("Cant provide default implementation via ITD - 5");}
  
  // Needs a change in the compiler so that getType() can be overridden in the intertype scope - thats
  // where we can police whether a type variable has been used without being specified appropriately.
  //public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}

  public void testCantProvideDefaultImplViaITD_pr110307_7() {runTest("Cant provide default implementation via ITD - 7");}
  
  public void testCallJoinPointsInAnonymousInnerClasses() {
	  runTest("call join points in anonymous inner classes");
  }
  
  public void testNoRequirementForUnwovenTypesToBeExposedToWeaver() {
	  runTest("default impl of Runnable");
  }
  
  public void testArrayCloneCallJoinPoints() {
	  runTest("array clone call join points in 1.4 vs 1.3");
  }
  
  public void testDebugInfoForAroundAdvice() {
	  runTest("debug info in around advice inlining");
  }
  
  public void testCCEWithGenericWildcard_pr112602() {
	  runTest("ClassCastException with generic wildcard");
  }
  
  public void testAdviceInStructureModelWithAnonymousInnerClass_pr77269() {
	  //AsmManager.setReporting("c:/debug.txt",true,true,true,true);
	  runTest("advice in structure model with anonymous inner class");  
  	  IHierarchy top = AsmManager.getDefault().getHierarchy();
  	    	  
  	  // checking that the run() method inside anonymous inner class is in 
  	  // the structure model
  	  IProgramElement anonRunMethodIPE = top.findElementForLabel(top.getRoot(),
  			  IProgramElement.Kind.METHOD,"run()");  	 
  	 
  	  assertNotNull("Couldn't find 'run()' element in the tree",anonRunMethodIPE);
  	  List l = AsmManager.getDefault().getRelationshipMap().get(anonRunMethodIPE);	
  	  assertNotNull("Should have some relationships but does not",l);
  	  assertTrue("Should have one relationship but has " + l.size(),l.size()==1);
  	  Relationship rel = (Relationship)l.get(0);
  	  List targets = rel.getTargets();
  	  assertTrue("Should have one target but has" + targets.size(),
  			  targets.size()==1);
  	  IProgramElement target = AsmManager.getDefault().getHierarchy().findElementForHandle((String)targets.get(0));
  	  assertEquals("target of relationship should be 'before(): p..' but is "
  			  + target.toLabelString(),"before(): p..",target.toLabelString());
  	  

  	  IProgramElement adviceIPE = top.findElementForLabel(top.getRoot(),
  			  IProgramElement.Kind.ADVICE,"before(): p..");  	  
  	  assertNotNull("Couldn't find 'before(): p..' element in the tree",adviceIPE);
  	  l = AsmManager.getDefault().getRelationshipMap().get(adviceIPE);
  	  assertNotNull("Should have some relationships but does not",l);
  	  assertTrue("Should have a relationship but does not ",l.size()>0);
  	  for (Iterator iter = l.iterator(); iter.hasNext();) {
		IRelationship element = (IRelationship) iter.next();
		if (element.getName().equals("advises")) {
			rel = (Relationship) element;
			break;
		}
	  }
  	  targets = rel.getTargets();
  	  assertTrue("Should have one target but has" + targets.size(),
  			  targets.size()==1);
  	  target = AsmManager.getDefault().getHierarchy().findElementForHandle((String)targets.get(0));
  	  assertEquals("target of relationship should be 'run()' but is "
  			  + target.toLabelString(),"run()",target.toLabelString());
  	  
  }
 
  public void testAdviceInStructureModelWithNamedInnerClass_pr77269() {
	  //AsmManager.setReporting("c:/debug.txt",true,true,true,true);
	  runTest("advice in structure model with named inner class");  
  	  IHierarchy top = AsmManager.getDefault().getHierarchy();
  	    	  
  	  // checking that the m() method inside named inner class is in 
  	  // the structure model
  	  IProgramElement namedMethodIPE = top.findElementForLabel(top.getRoot(),
  			  IProgramElement.Kind.METHOD,"m()");  	  
  	  assertNotNull("Couldn't find 'm()' element in the tree",namedMethodIPE);
  	  List l = AsmManager.getDefault().getRelationshipMap().get(namedMethodIPE);	
  	  assertNotNull("Should have some relationships but does not",l);
  	  assertTrue("Should have one relationship but has " + l.size(),l.size()==1);
  	  Relationship rel = (Relationship)l.get(0);
  	  List targets = rel.getTargets();
  	  assertTrue("Should have one target but has" + targets.size(),
  			  targets.size()==1);
  	  IProgramElement target = AsmManager.getDefault().getHierarchy().findElementForHandle((String)targets.get(0));
  	  assertEquals("target of relationship should be 'before(): p..' but is "
  			  + target.toLabelString(),"before(): p..",target.toLabelString());
  	  

  	  IProgramElement adviceIPE = top.findElementForLabel(top.getRoot(),
  			  IProgramElement.Kind.ADVICE,"before(): p..");  	  
  	  assertNotNull("Couldn't find 'before(): p..' element in the tree",adviceIPE);
  	  l = AsmManager.getDefault().getRelationshipMap().get(adviceIPE);
  	  assertNotNull("Should have some relationships but does not",l);
  	  assertTrue("Should have a relationship but does not ",l.size()>0);
  	  for (Iterator iter = l.iterator(); iter.hasNext();) {
		IRelationship element = (IRelationship) iter.next();
		if (element.getName().equals("advises")) {
			rel = (Relationship) element;
			break;
		}
	  }
  	  targets = rel.getTargets();
  	  assertTrue("Should have one target but has" + targets.size(),
  			  targets.size()==1);
  	  target = AsmManager.getDefault().getHierarchy().findElementForHandle((String)targets.get(0));
  	  assertEquals("target of relationship should be 'm()' but is "
  			  + target.toLabelString(),"m()",target.toLabelString());
  	  
  }
  
  public void testDWInStructureModelWithAnonymousInnerClass_pr77269() {
      // AsmManager.setReporting("c:/debug.txt",true,true,true,true);
	  runTest("declare warning in structure model with anonymous inner class");  
  	  IHierarchy top = AsmManager.getDefault().getHierarchy();
  	  IProgramElement pe = top.findElementForLabel(top.getRoot(),
  			  IProgramElement.Kind.CODE,"method-call(void pack.Test.someMethod())");  	 	 
  	  assertNotNull("Couldn't find 'method-call(void pack.Test.someMethod())' element in the tree",pe);
  }
  
  public void testVarArgsIITDInConstructor() {
	  runTest("ITD varargs in constructor");
  }
   
  public void testWeaveInfoMessageForDeclareAtMethodOnITDdMethod() {
	  runTest("weaveinfo message for declare at method on an ITDd method");
  }
  
  public void testITDCWithNoExplicitConsCall() {
	  runTest("ITDC with no explicit cons call");
  }
  
  public void testJava5SpecificFeaturesUsedAtJava14OrLower() {
	  runTest("java 5 pointcuts and declares at pre-java 5 compliance levels");
  }
  
  public void testAnonymousTypes() {
	  runTest("Anonymous types and nome matching");
  }
  
  public void testAdviceExecutionJPToStringForms() {
	  runTest("adviceexecution join point toString forms");
  }
  
  public void testAssertWithinPointcutExpression() {
	  runTest("pointcut expression containing 'assert'");
  }
  
  public void testNoVerifyErrorWithTwoThisPCDs_pr113447() {
	  runTest("no verify error with two this pcds");
  }

  public void testNoVerifyErrorWithTwoAtThisPCDs_pr113447() {
	  runTest("no verify error with two at this pcds");
  }
  
  public void testNoVerifyErrorWithAtWithinPCDs_pr113447() {
	  runTest("no verify error with at within pcds");
  }
  
  public void testNoVerifyErrorWithAtWithincodePCDs_pr113447() {
	  runTest("no verify error with at withincode pcds");
  }
  
  public void testNoVerifyErrorWithAtAnnotationPCDs_pr113447() {
	  runTest("no verify error with at annotation pcds");
  }
  
  public void testNoVerifyErrorWithTwoArgsPCDs_pr113447() {
	  runTest("no verify error with two args pcds");
  }
  
  public void testNoStackOverflowWithCircularPCDInGenericAspect() {
	  runTest("no StackOverflowError with circular pcd in generic aspect");
  }
  
  public void testNoStackOverflowWithCircularPCDInGenericAspect2() {
	  runTest("no StackOverflowError with circular pcd in generic aspect - 2");
  }

  public void testNPEInThisJoinPointStaticPart() {
	  runTest("thisJoinPointStaticPart in if test");
  }

  public void testPointcutParsingOfCompiledPointcuts() {
	  runTest("pointcut parsing with ajc compiled pointcut references");
  }
  
  public void testReflectionOfAbstractITDs() {
	  runTest("reflection on abstract ITDs (Billing example)");
  }
  
  public void testDeclareSoftWithAdviceExecution() {
	  runTest("declare soft and adviceexecution");
  }

  public void testDeclareSoftWithExclusions() {
	  runTest("declare soft and exclusions");
  }
  
  public void testReturningObjectBinding() {
	  runTest("returning(Object) binding");
  }
  
  public void testPerTargetAndNegation() {
	  runTest("pertarget and negated pointcut");
  }
  
  public void testParameterizedPointcutAndAdvice() {
	  runTest("parameterized pointcut and advice");
  }
  
  public void testDoublyParameterizedAbstractType() {
	  runTest("double parameter generic abstract type");
  }
  

  public void testArgNamesInAdviceAnnotations() {
	  runTest("arg names in advice annotations");
  }
  
  /*
   * Load-time weaving bugs
   */
  public void testNPEinWeavingAdaptor_pr116626() { runTest("NPE in WeavingAdaptor");}
  
  public void testXlintMessageForImproperAnnotationType_pr115252_Exact() {runTest("xlint message for improper exact annotation type");}
  public void testXlintMessageForImproperAnnotationType_pr115252_OR() {runTest("xlint message for improper annotation type inside OR");}
  public void testXlintMessageForImproperAnnotationType_pr115252_AND() {runTest("xlint message for improper annotation type inside AND");}
  public void testXlintMessageForImproperAnnotationType_pr115252_Return() {runTest("xlint message for improper annotated return type");}  
  public void testXlintMessageForImproperAnnotationType_pr115252_Declaring() {runTest("xlint message for improper annotated declaring type");}  
  public void testXlintMessageForImproperAnnotationType_pr115252_Parameter() {runTest("xlint message for improper annotated parameter type");}  
  public void testXlintMessageForImproperAnnotationType_pr115252_Throws() {runTest("xlint message for improper annotated throws pattern");}  
  public void testXlintMessageForImproperAnnotationType_pr115252_MoreThanOne() {runTest("xlint message for more than one improper annotated parameter type");}  
  
  public void testDeclareAtTypeInStructureModel_pr115607() {
      AsmManager.setReporting("c:/debug.txt",true,true,true,true);
	  runTest("declare at type appears correctly in structure model");  
  	  IHierarchy top = AsmManager.getDefault().getHierarchy();
  	  IProgramElement pe = top.findElementForLabel(top.getRoot(),
  			  IProgramElement.Kind.DECLARE_ANNOTATION_AT_TYPE,"declare @type: Simple : @I");  	 	 
  	  assertNotNull("Couldn't find 'declare @type: Simple : @I' element in the tree",pe);
  	  List l = AsmManager.getDefault().getRelationshipMap().get(pe);	
	  assertNotNull("Should have some relationships but does not",l);
  }
  
  public void testNoNPEWhenInaccessibleMethodIsCalledWithinITD_pr119019() {
	  runTest("no NPE when inaccessible method is called within itd");
  }
  
  public void testNoNPEWithOrPointcutAndMoreThanOneArgs_pr118149() {
	  runTest("no NPE with or pointcut and more than one args");
  }
  
  // helper methods.....
  
  public SyntheticRepository createRepos(File cpentry) {
	ClassPath cp = new ClassPath(cpentry+File.pathSeparator+System.getProperty("java.class.path"));
	return SyntheticRepository.getInstance(cp);
  }
  
  protected JavaClass getClassFrom(File where,String clazzname) throws ClassNotFoundException {
	SyntheticRepository repos = createRepos(where);
	return repos.loadClass(clazzname);
  }

}