Author: jsong
Date: Thu Oct 7 19:17:16 2004
New Revision: 54039
Added:
incubator/beehive/trunk/controls/test/src/auxilaries/
incubator/beehive/trunk/controls/test/src/auxilaries/org/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/HelloChecked.java
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/HelloChecker.java
Modified:
incubator/beehive/trunk/controls/test/build.xml
incubator/beehive/trunk/controls/test/src/README.txt
Log:
apparently, 'aux' is reserved on windows so the original change to refactor the
test build was causing all sorts of problems. renaming aux to auxilary and
updating the required files.
Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml (original)
+++ incubator/beehive/trunk/controls/test/build.xml Thu Oct 7 19:17:16 2004
@@ -24,7 +24,7 @@
<property name="controls.test.units"
location="${controls.test.src}/units"/>
<property name="controls.test.drivers"
location="${controls.test.src}/drivers"/>
<property name="controls.test.controls"
location="${controls.test.src}/controls"/>
- <property name="controls.test.auxilaries"
location="${controls.test.src}/aux"/>
+ <property name="controls.test.auxilaries"
location="${controls.test.src}/auxilaries"/>
<property name="build.dir" location="${basedir}/build"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.beans" location="${build.dir}/classes/beans"/>
Modified: incubator/beehive/trunk/controls/test/src/README.txt
==============================================================================
--- incubator/beehive/trunk/controls/test/src/README.txt (original)
+++ incubator/beehive/trunk/controls/test/src/README.txt Thu Oct 7
19:17:16 2004
@@ -19,7 +19,7 @@
directly or which access a JPF or JWS whith instantiates the driver and
runs the test.
-* aux
+* auxilaries
Auxilary files are things like Checkers. Checkers must be compiled *before*
the clients that will need them are built. Files in 'aux' should not
Added:
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/HelloChecked.java
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/HelloChecked.java
Thu Oct 7 19:17:16 2004
@@ -0,0 +1,45 @@
+package org.apache.beehive.controls.test.controls.checker;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
[EMAIL PROTECTED]( checkerClass=HelloChecker.class )
+public interface HelloChecked
+{
+ //
+ // A simple enumerated type used to customize the greeting by gender
+ //
+ public enum GenderType
+ {
+ NEUTRAL, MALE, FEMALE
+ }
+
+ public @interface Gender
+ {
+ GenderType value();
+ }
+
+ /**
+ * Declare a simple PropertySet, that allows the salutation used by the
custom
+ * control to be customized.
+ */
+ @PropertySet
+ @Target( {ElementType.TYPE, ElementType.FIELD, ElementType.METHOD} )
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Greeting
+ {
+ String salutation() default "Hello";
+ Gender gender() default @Gender(GenderType.NEUTRAL);
+ }
+
+ java.lang.String hello(java.lang.String name);
+
+ java.lang.String lastVisitor();
+
+ int visitorCount();
+}
Added:
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/HelloChecker.java
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/controls/test/src/auxilaries/org/apache/beehive/controls/test/controls/checker/HelloChecker.java
Thu Oct 7 19:17:16 2004
@@ -0,0 +1,35 @@
+package org.apache.beehive.controls.test.controls.checker;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.Declaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.declaration.FieldDeclaration;
+
+import org.apache.beehive.controls.api.bean.ControlChecker;
+
+public class HelloChecker implements ControlChecker
+{
+ public void check(Declaration decl, AnnotationProcessorEnvironment env)
+ {
+ // Just refer to the public interface in some way to test
+ // this kind of dep.
+ HelloChecked.GenderType gt = HelloChecked.GenderType.NEUTRAL;
+
+ if ( decl instanceof TypeDeclaration )
+ {
+ env.getMessager().printNotice(decl.getPosition(),
+ "HelloChecker: found type decl=" + decl);
+ }
+ else if ( decl instanceof FieldDeclaration )
+ {
+ env.getMessager().printNotice(decl.getPosition(),
+ "HelloChecker: found field decl=" + decl);
+ }
+ else
+ {
+ env.getMessager().printNotice(decl.getPosition(),
+ "HelloChecker: found decl=" + decl);
+ }
+ }
+}
+