You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/06/30 19:30:54 UTC
svn commit: r418339 [2/3] - in /beehive/trunk/controls/test/src:
controls/org/apache/beehive/controls/test/controls/overload/
controls/org/apache/beehive/controls/test/controls/serialization/
controls/org/apache/beehive/controls/test/controls/threading...
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/Props.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/Props.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/Props.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/Props.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.bean.ExternalPropertySets;
+import org.apache.beehive.controls.api.events.EventSet;
+import org.apache.beehive.controls.api.packaging.PropertyInfo;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.beans.PropertyChangeEvent;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A simple control that can be used for property testing of basic primitive properties,
+ * as well as nested an array property types.
+ */
+@ControlInterface
+@ExternalPropertySets({ExtPropertySet.class})
+public interface Props {
+ //
+ // A simple enumeration used to test enum annotations
+ //
+ public enum SimpleEnum {
+ ChoiceA, ChoiceB, ChoiceC; }
+
+ //
+ // Define static final constants for SimpleProps defaults
+ //
+ static final int INT_DEFAULT = 87;
+ static final String STRING_DEFAULT = "Hello";
+ static final Class CLASS_DEFAULT = java.lang.Object.class;
+ static final SimpleEnum ENUM_DEFAULT = SimpleEnum.ChoiceA;
+
+ //
+ //
+ // Define a PropertySet that tests simple types
+ //
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ public @interface SimpleProps {
+ int simpleInt() default INT_DEFAULT;
+
+ String simpleString() default STRING_DEFAULT;
+
+ Class simpleClass() default java.lang.Object.class;
+
+ SimpleEnum simpleEnum() default SimpleEnum.ChoiceA;
+ }
+
+ //
+ // Define static final constants for ArrayProps defaults
+ //
+ static final int [] ARRAY_INT_DEFAULT = {99, 33, 66, 22};
+ static final String [] ARRAY_STRING_DEFAULT = {"How", "are", "you", ",", "today", "?"};
+ static final Class [] ARRAY_CLASS_DEFAULT = {java.util.HashMap.class, java.util.Iterator.class};
+ static final SimpleEnum [] ARRAY_ENUM_DEFAULT = {SimpleEnum.ChoiceB, SimpleEnum.ChoiceC};
+
+ //
+ // Define a PropertySet that tests array types
+ //
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD})
+ public @interface ArrayProps {
+ int [] arrayInt() default {99, 33, 66, 22};
+
+ String [] arrayString() default {"How", "are", "you", ",", "today", "?"};
+
+ Class [] arrayClass() default {java.util.HashMap.class, java.util.Iterator.class};
+
+ SimpleEnum [] arrayEnum() default {SimpleEnum.ChoiceB, SimpleEnum.ChoiceC};
+ }
+
+ //
+ // Define static final constants for SimpleProps defaults
+ //
+ static final int ANNOT_INT_DEFAULT = 9999999;
+ static final String ANNOT_STRING_DEFAULT = "Hola";
+ static final Class ANNOT_CLASS_DEFAULT = java.beans.Beans.class;
+ static final SimpleEnum ANNOT_ENUM_DEFAULT = SimpleEnum.ChoiceC;
+
+ //
+ // Define a PropertySet that tests properties that are themselves annotation types
+ //
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ public @interface TestAnnot {
+ @PropertyInfo(bound = true) // will generate PropertyChange events
+ SimpleProps simpleAnnot()
+ default @SimpleProps(
+ simpleInt = ANNOT_INT_DEFAULT,
+ simpleString = ANNOT_STRING_DEFAULT,
+ simpleClass = java.beans.Beans.class,
+ simpleEnum = SimpleEnum.ChoiceC);
+
+ ArrayProps arrayAnnot();
+ }
+
+ //
+ // Exposes PropertyChange events to an external client.
+ //
+ @EventSet
+ public interface PropertyEvents {
+ public void onChange(PropertyChangeEvent pce);
+ }
+
+ //
+ // Define property keys to enable access to test members in a PropertyMap
+ //
+ public Annotation getControlPropertySet(Class propertySet);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/Props.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsExtension.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsExtension.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsExtension.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsExtension.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+
+/**
+ * Defines a new extension interface that derives from Props
+ */
+@ControlExtension
+@Props.SimpleProps(simpleInt = 3)
+// matches INT_PRIM_VALUE below
+public interface PropsExtension extends Props {
+ // the class annotation value set above
+ public static int SIMPLE_INT_VALUE = 3;
+
+ // the method annotation vales set below
+ public static Class SIMPLE_CLASS_VALUE1 = java.beans.Beans.class;
+ public static Class SIMPLE_CLASS_VALUE2 = org.apache.beehive.controls.api.bean.ControlBean.class;
+
+ @SimpleProps(simpleClass = java.beans.Beans.class)
+ public Object getPropertySetOnMethod1(Class propertySet);
+
+ @SimpleProps(simpleClass = org.apache.beehive.controls.api.bean.ControlBean.class)
+ public Object getPropertySetOnMethod2(Class propertySet);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsExtension.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property;
+
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Extensible;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.events.Client;
+import org.apache.beehive.controls.api.events.EventHandler;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.beans.PropertyChangeEvent;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+@ControlImplementation
+public class PropsImpl implements Props, Extensible, java.io.Serializable {
+ static final long serialVersionUID = 1L;
+
+ @Context
+ ControlBeanContext context;
+
+ @Client
+ PropertyEvents client;
+
+ /**
+ * Provides a simple test API to externally query the control instance PropertySet values
+ * returned by ControlBeanContext APIs
+ */
+ public Annotation getControlPropertySet(Class propertySet) {
+ return context.getControlPropertySet(propertySet);
+ }
+
+ /**
+ * Set up a handler for context property change events, then expose them using the
+ * EventSet declared on the public interface.
+ */
+ @EventHandler(field = "context", eventSet = ControlBeanContext.LifeCycle.class,
+ eventName = "onPropertyChange")
+ public void onContextChange(PropertyChangeEvent pce) {
+ client.onChange(pce);
+ }
+
+ /**
+ * This implementation of Extensible.invoke allows the testing of annotations found
+ * on JCX methods
+ */
+ public Object invoke(Method m, Object [] args) throws Throwable {
+ if (!(args[0] instanceof Class) ||
+ !(((Class) args[0]).isAnnotationPresent(PropertySet.class)))
+ throw new IllegalArgumentException("Arg 0 must be an PropertySet interface!");
+
+ return context.getMethodPropertySet(m, (Class) args[0]);
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/PropsImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * A control interface with three single-member propertySets and one method
+ */
+@ControlInterface
+public interface SingleProperty {
+ static final String GREET_DEFAULT = "Hello";
+
+ /**
+ * A single member property with default value
+ */
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Greeting {
+ public String GreetWord() default GREET_DEFAULT;
+ }
+
+ /**
+ * A single member property without default value
+ */
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Identity {
+ public String name();
+ }
+
+ /**
+ * A single member property of primitive types
+ */
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Identifier {
+ public int age() default 20;
+ }
+
+
+ public String sayHello();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+/**
+ * A control impl that accesses the property declared by its control interface via control context
+ */
+
+@ControlImplementation(isTransient = true)
+public class SinglePropertyImpl implements SingleProperty {
+ @Context
+ ControlBeanContext context;
+
+ /*Accesses the propertySet value and returns the value*/
+ public String sayHello() {
+ /**BUG: could not refer to Greeting directly*/
+ Greeting greeting = (SingleProperty.Greeting) context.getControlPropertySet(SingleProperty.Greeting.class);
+
+ return greeting.GreetWord();
+ }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property.constraint;
+
+import org.apache.beehive.controls.api.bean.AnnotationConstraints;
+import org.apache.beehive.controls.api.bean.AnnotationMemberTypes;
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A control interface for testing Annotation.MembershipRule
+ */
+
+@ControlInterface
+public interface BookControl {
+ /**
+ * A propertySet with AT_LEAST_ONE constraint
+ * User needs to set at least one value when instantiating controls declaratively;
+ * It is unknow what will happens when instantiating controls programmatically.
+ */
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.MembershipRule(AnnotationConstraints.MembershipRuleValues.AT_LEAST_ONE)
+ public @interface Price {
+ @AnnotationMemberTypes.Decimal(minValue = 10)
+ public String us_price() default "";
+
+ @AnnotationMemberTypes.Decimal(minValue = 10)
+ public String ca_price() default "";
+
+ @AnnotationMemberTypes.Decimal(minValue = 10)
+ public String eu_price() default "";
+ }
+
+ /**
+ * A propertySet with AT_MOST_ONE
+ * User can not set more than one value when instantiating controls declaratively;
+ * It is unknow what will happens when instantiating controls programmatically.
+ */
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.MembershipRule(AnnotationConstraints.MembershipRuleValues.AT_MOST_ONE)
+ public @interface Language {
+ @AnnotationMemberTypes.Text(maxLength = 10)
+ public String coverlanguage() default "";
+
+ @AnnotationMemberTypes.Text(maxLength = 10)
+ public String contentlanguage() default "";
+
+ @AnnotationMemberTypes.Text(maxLength = 10)
+ public String authorlanguage() default "";
+ }
+
+ /**
+ * A propertySet with EXACTLY_ONE
+ * User must set one value, and only one value when instantiating controls declaratively;
+ * It is unknow what will happens when instantiating controls programmatically.
+ */
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.MembershipRule(AnnotationConstraints.MembershipRuleValues.EXACTLY_ONE)
+ public @interface Intro {
+ @AnnotationMemberTypes.Text(maxLength = 8)
+ public String title() default "";
+
+ @AnnotationMemberTypes.Text(maxLength = 8)
+ public String subject() default "";
+
+ @AnnotationMemberTypes.Text(maxLength = 8)
+ public String content() default "";
+ }
+
+
+ /**
+ * Negative tests: members without @AnnotationMemberTypes causes compile errors
+ */
+
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.MembershipRule(AnnotationConstraints.MembershipRuleValues.AT_LEAST_ONE)
+ public @interface Material {
+ /*
+ public Object paper;
+ public Object cover;
+ */
+ }
+
+
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.MembershipRule(AnnotationConstraints.MembershipRuleValues.EXACTLY_ONE)
+ public @interface Publisher {
+ /*
+ public Object paper;
+ public Object cover;
+ */
+ }
+
+ public String hello();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property.constraint;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+@ControlImplementation(isTransient = true)
+public class BookControlImpl implements BookControl {
+ @Context
+ ControlBeanContext ctx;
+
+ public String hello() {
+ return "Hello";
+ }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/BookControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property.constraint;
+
+import org.apache.beehive.controls.api.bean.AnnotationConstraints;
+import org.apache.beehive.controls.api.bean.AnnotationMemberTypes;
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A control interface that declares PropertySets with constraints
+ */
+
+@ControlInterface
+public interface PersonControl {
+
+ public final static double SAVINGS_MIN_VALUE = 100;
+ public final static String ISSUEDATE_MAXVALUE = "2007/01/31";
+ public final static String EXPIRYDATE_MINVALUE = "2007/02/28";
+ //public final static String ISSUEDATE_MAXVALUE=null;
+
+ /**
+ * A propertySet with ALL_IF_ANY
+ * Rule is enforced at build time when users instantiate the control declaratively.
+ * It is unknow what will happens when instantiating controls programmatically.
+ */
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.MembershipRule(AnnotationConstraints.MembershipRuleValues.ALL_IF_ANY)
+ public @interface Address {
+ @AnnotationMemberTypes.Text(maxLength = 8)
+ public String street();
+
+ @AnnotationMemberTypes.Text(maxLength = 8)
+ public String city();
+
+ @AnnotationMemberTypes.Text(maxLength = 8)
+ public String province();
+
+ @AnnotationMemberTypes.Int(minValue = 0, maxValue = 100000)
+ public int zipcode() default 0;
+
+ }
+
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @AnnotationConstraints.AllowExternalOverride
+ public @interface Assets {
+ //JIRA-203 AnnotationMemberTypes.Decimal should support float
+
+ @AnnotationMemberTypes.Decimal(places = 2, minValue = SAVINGS_MIN_VALUE, maxValue = 10000)
+ public String savings() default "0";
+ }
+
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface ID {
+ @AnnotationMemberTypes.Text(isLong = true)
+ public String idnumber() default "0";
+ }
+
+
+ @PropertySet
+ @Target({ElementType.FIELD, ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface DriverLicense {
+ @AnnotationMemberTypes.Date(maxValue = ISSUEDATE_MAXVALUE)
+ public String issuedate() default "";
+
+ @AnnotationMemberTypes.Date(minValue = EXPIRYDATE_MINVALUE)
+ public String expirydate() default "";
+
+ /* Test passing a null to revokedate.
+ Commented out temporarily
+ @AnnotationMemberTypes.Date(minValue=ISSUEDATE_MAXVALUE)
+ public String revokedate() default null;
+ */
+ }
+
+ public String hello();
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.property.constraint;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+@ControlImplementation(isTransient = true)
+public class PersonControlImpl implements PersonControl {
+ @Context
+ ControlBeanContext ctx;
+
+ public String hello() {
+ //Person person = (Person)ctx.getControlPropertySet(Person.class);
+ //return "Hello " + person.name();
+ return "Hello";
+ }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/property/constraint/PersonControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with two methods declared.
+ * This control interface is designed to test threading model of
+ * control framework.
+ */
+
+@ControlInterface
+public interface DefaultThreadControl {
+ public long doSlowIncrement(boolean isBlocker);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+/**
+ * An impl of DefaultThreadControl.
+ * <p/>
+ * Test objective: create an instance of this impl, have one thread
+ * invoke doGet, and another thread invoke doSet
+ */
+@ControlImplementation
+public class DefaultThreadControlImpl implements DefaultThreadControl, java.io.Serializable {
+
+ private long counter = 0;
+ private boolean marker = false;
+
+
+ public long doSlowIncrement(boolean isBlocker) {
+
+ if (isBlocker) {
+ marker = true;
+ while (marker) {
+ counter++;
+ try {
+ Thread.currentThread().sleep(200);
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ return counter;
+ }
+ else {
+ marker = false;
+ return counter;
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/DefaultThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with two methods declared.
+ * This control interface is designed to test threading model of
+ * control framework.
+ */
+
+@ControlInterface
+public interface MultiThreadControl {
+ public final static String METHOD1 = "blocker";
+ public final static String METHOD2 = "unblocker";
+ public final static long EXPECTED_DELAY = 150;
+
+ public long doSlowIncrement(boolean isBlocker);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+/**
+ * An impl of HelloControl.
+ * This impl is multi-threaded
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.MULTI_THREADED)
+public class MultiThreadControlImpl implements MultiThreadControl, java.io.Serializable {
+ private long counter = 0;
+ private boolean marker = false;
+
+
+ public long doSlowIncrement(boolean isBlocker) {
+
+ if (isBlocker) {
+ marker = true;
+ while (marker) {
+ counter++;
+ try {
+ Thread.currentThread().sleep(200);
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ return counter;
+ }
+ else {
+ marker = false;
+ return counter;
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/MultiThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with two methods declared.
+ * This control interface is designed to test threading model of
+ * control framework.
+ */
+
+@ControlInterface
+public interface SingleThreadControl {
+ public long doSlowIncrement(boolean isBlocker);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+/**
+ * An impl of HelloControl.
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.SINGLE_THREADED)
+public class SingleThreadControlImpl implements SingleThreadControl, java.io.Serializable {
+ private long counter = 0;
+ private boolean marker = false;
+
+
+ public long doSlowIncrement(boolean isBlocker) {
+
+ if (isBlocker) {
+ marker = true;
+ while (marker) {
+ counter++;
+ try {
+ Thread.currentThread().sleep(200);
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ return counter;
+ }
+ else {
+ marker = false;
+ return counter;
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/SingleThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface
+ */
+@ControlInterface
+public interface CompositeMThreadControl {
+
+ public int startSingleThreadNestedControl();
+
+ public int stopSingleThreadNestedControl();
+
+ public int startMultiThreadNestedControl();
+
+ public int stopMultiThreadNestedControl();
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+import java.io.Serializable;
+
+/**
+ * A multi-threaded impl of CompositeMThreadControl.
+ * Exposes methods to invoke the nested controls
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.MULTI_THREADED)
+public class CompositeMThreadControlImpl implements CompositeMThreadControl, Serializable {
+
+ @Control
+ NestedSThreadControlBean nestedS;
+
+ @Control
+ NestedMThreadControlBean nestedM;
+
+ public int startSingleThreadNestedControl() {
+ return nestedS.doSlowIncrement(false);
+ }
+
+ public int stopSingleThreadNestedControl() {
+ return nestedS.doSlowIncrement(true);
+ }
+
+ public int startMultiThreadNestedControl() {
+ return nestedM.doSlowIncrement(false);
+ }
+
+ public int stopMultiThreadNestedControl() {
+ return nestedM.doSlowIncrement(true);
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/CompositeMThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with two methods declared.
+ * This control interface is designed to a nested control and
+ * test control threading.
+ */
+
+@ControlInterface
+public interface NestedMThreadControl {
+ public int doSlowIncrement(boolean isStopper);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+/**
+ * An impl of NestedMThreadControl.
+ * If this impl is multi-threaded, a thread could stop the loop started by another thread.
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.MULTI_THREADED)
+public class NestedMThreadControlImpl implements NestedMThreadControl, java.io.Serializable {
+ private boolean marker = false;
+ private int counter = 0;
+
+ public int doSlowIncrement(boolean isStopper) {
+ if (isStopper) {
+ marker = false;
+ return counter;
+ }
+ else {
+ marker = true;
+ while (marker) {
+ counter++;
+ try {
+ Thread.currentThread().sleep(200);
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ return counter;
+ }
+ }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with two methods declared.
+ * This control interface is designed to a nested control and
+ * test control threading.
+ */
+
+@ControlInterface
+public interface NestedMultiThreadControl {
+
+ public long doRead();
+
+ public void doSet();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+import java.util.Date;
+
+/**
+ * An impl of NestedMultiThreadControl.
+ * <p/>
+ * Test objective: doRead and doSet on same instance should not
+ * inter-lock each other when invoked by different thread.
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.MULTI_THREADED)
+public class NestedMultiThreadControlImpl implements NestedMultiThreadControl, java.io.Serializable {
+ public final static int LOOPS = 20;
+ private long count = 0;
+
+ public long doRead() {
+ return count;
+ }
+
+ public void doSet() {
+ for (int i = 0; i < LOOPS; i++) {
+ try {
+ Thread.sleep(1);
+ }
+ catch (InterruptedException e) {
+ }
+ Date now = new Date();
+ count = now.getTime();
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedMultiThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with one methods declared.
+ */
+@ControlInterface
+public interface NestedSThreadControl {
+ public int doSlowIncrement(boolean isStopper);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+/**
+ * An impl of NestedSThreadControl.
+ * If this impl is single-threaded, a thread could never stop the loop started by another thread.
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.SINGLE_THREADED)
+public class NestedSThreadControlImpl implements NestedSThreadControl, java.io.Serializable {
+ private boolean marker = false;
+ private int count = 0;
+
+ public int doSlowIncrement(boolean isStopper) {
+
+ if (isStopper) {
+ marker = false;
+ return count;
+ }
+ else {
+ marker = true;
+ while (marker) {
+ count++;
+ try {
+ Thread.currentThread().sleep(200);
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ return count;
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * A control interface with two methods declared.
+ * This control interface is designed to a nested control and
+ * test control threading.
+ */
+
+@ControlInterface
+public interface NestedSingleThreadControl {
+
+ public long doRead();
+
+ public void doSet();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControlImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControlImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.threading.nested;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Threading;
+import org.apache.beehive.controls.api.bean.ThreadingPolicy;
+
+import java.util.Date;
+
+/**
+ * An impl of NestedHelloControl.
+ * By default, control impl is single thread.
+ * <p/>
+ * Test objective: doRead and doSet on same instance should
+ * inter-lock each other when invoked by different thread.
+ */
+@ControlImplementation
+@Threading(ThreadingPolicy.SINGLE_THREADED)
+public class NestedSingleThreadControlImpl
+ implements NestedSingleThreadControl, java.io.Serializable {
+ public final static int LOOPS = 50;
+ private long count = 0;
+
+ public long doRead() {
+ return count;
+ }
+
+ public void doSet() {
+ for (int i = 0; i < LOOPS; i++) {
+ try {
+ Thread.sleep(1);
+ }
+ catch (InterruptedException e) {
+ }
+ Date now = new Date();
+ count = now.getTime();
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/threading/nested/NestedSingleThreadControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/Hello.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/Hello.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/Hello.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/Hello.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.versioning;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+import org.apache.beehive.controls.api.versioning.Version;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@ControlInterface
+@Version(major = 2, minor = 1)
+public interface Hello {
+ //
+ // 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();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/Hello.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/HelloImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/HelloImpl.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/HelloImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/HelloImpl.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.versioning;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Extensible;
+import org.apache.beehive.controls.api.versioning.VersionSupported;
+
+import java.lang.reflect.Method;
+
+@ControlImplementation
+@VersionSupported(major = 2)
+public class HelloImpl implements Hello, Extensible, java.io.Serializable {
+ public String _lastVisitor = "<none>";
+ int _visitorCount = 0;
+
+ public String hello(String name) {
+ _lastVisitor = name;
+ _visitorCount++;
+ return "Hello, " + name;
+ }
+
+ public String lastVisitor() {
+ return _lastVisitor;
+ }
+
+ public int visitorCount() {
+ return _visitorCount;
+ }
+
+ /**
+ * Implements the Extensible.invoke interface when a JCX-declared method is called
+ */
+ public Object invoke(Method method, Object [] args) {
+ //
+ // To Be Implemented
+ //
+ return null;
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/HelloImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java?rev=418339&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java Fri Jun 30 10:30:50 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.versioning;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+import org.apache.beehive.controls.api.versioning.VersionRequired;
+
+/**
+ * A control extension with VersionRequired annotation
+ */
+@ControlExtension
+@VersionRequired(major = 1, minor = 1)
+public interface SubHello extends Hello {
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java
------------------------------------------------------------------------------
svn:eol-style = native