Browse Source

265729: testcode

tags/pre268419
aclement 15 years ago
parent
commit
11e7c2ef99

+ 13
- 0
tests/multiIncremental/pr265729_client/base/src/be/cronos/aop/App.java View File

@@ -0,0 +1,13 @@
package be.cronos.aop;


@InterTypeAspectSupport
public class App {
public static void main(String[] args) {
// System.out.println( "Hello World!" ); //should throw compiler error,
// OK
App app = new App();
app.foo(42);

}
}

+ 38
- 0
tests/multiIncremental/pr265729_client/base/src/be/cronos/experiment/AppTest.java View File

@@ -0,0 +1,38 @@
//package be.cronos.experiment;
//
//import junit.framework.Test;
//import junit.framework.TestCase;
//import junit.framework.TestSuite;
//
///**
// * Unit test for simple App.
// */
//public class AppTest
// extends TestCase
//{
// /**
// * Create the test case
// *
// * @param testName name of the test case
// */
// public AppTest( String testName )
// {
// super( testName );
// }
//
// /**
// * @return the suite of tests being tested
// */
// public static Test suite()
// {
// return new TestSuite( AppTest.class );
// }
//
// /**
// * Rigourous Test :-)
// */
// public void testApp()
// {
// assertTrue( true );
// }
//}

+ 16
- 0
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/App.java View File

@@ -0,0 +1,16 @@
package be.cronos.aop;

import be.cronos.aop.InterTypeAspectSupport;

@InterTypeAspectSupport
public class App
{
public static void main( String[] args )
{
//System.out.println( "Hello World!" ); //should throw compiler error, OK
App app = new App();
app.foo(42);

}
}

+ 12
- 0
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/InterTypeAspectSupport.java View File

@@ -0,0 +1,12 @@
package be.cronos.aop;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface InterTypeAspectSupport {

}

+ 16
- 0
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/EnforceLogging.aj View File

@@ -0,0 +1,16 @@
package be.cronos.aop.aspects;

//import junit.framework.TestCase;

public aspect EnforceLogging {
pointcut scope():
!within(*TestCase+);

pointcut printing():
get(* System.out) || get(* System.err) || call(* printStackTrace());

declare error
: scope() && printing()
: "Don't print to Console, use logger";

}

+ 16
- 0
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/InterTypeAspect.aj View File

@@ -0,0 +1,16 @@
package be.cronos.aop.aspects;

import be.cronos.aop.InterTypeAspectSupport;

public aspect InterTypeAspect {

public interface InterTypeAspectInterface {
}
declare parents : (@InterTypeAspectSupport *) implements InterTypeAspectInterface;
public String InterTypeAspectInterface.foo(int i) {
return "bar";
}

}

Loading…
Cancel
Save