You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2005/02/02 18:36:54 UTC

svn commit: r149537 - in incubator/beehive/trunk/controls/test/src: controls/org/apache/beehive/controls/test/controls/versioning/ units/org/apache/beehive/controls/test/java/versioning/

Author: jsong
Date: Wed Feb  2 09:36:52 2005
New Revision: 149537

URL: http://svn.apache.org/viewcvs?view=rev&rev=149537
Log:
Add test for controls versioning.

Added:
    incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java
    incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHelloImpl.jcs
    incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/versioning/
    incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/versioning/VersionRequiredTest.java

Added: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java?view=auto&rev=149537
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java (added)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHello.java Wed Feb  2 09:36:52 2005
@@ -0,0 +1,20 @@
+package org.apache.beehive.controls.test.controls.versioning;
+
+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;
+import org.apache.beehive.controls.api.versioning.VersionRequired;
+
+/**
+ * A control extension with VersionRequired annotation
+ */
+@ControlInterface
+@VersionRequired( major=3, minor=5 )
+public interface SubHello extends Hello
+{
+	int getVersion();
+}

Added: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHelloImpl.jcs
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHelloImpl.jcs?view=auto&rev=149537
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHelloImpl.jcs (added)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/versioning/SubHelloImpl.jcs Wed Feb  2 09:36:52 2005
@@ -0,0 +1,14 @@
+package org.apache.beehive.controls.test.controls.versioning;
+
+import java.lang.reflect.Method;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.versioning.VersionSupported;
+
+//@VersionSupported( major=2) commented out temporarily
+
+@ControlImplementation
+public class SubHelloImpl extends HelloImpl implements SubHello
+{ 
+    public int getVersion(){return 0;}
+} 

Added: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/versioning/VersionRequiredTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/versioning/VersionRequiredTest.java?view=auto&rev=149537
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/versioning/VersionRequiredTest.java (added)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/versioning/VersionRequiredTest.java Wed Feb  2 09:36:52 2005
@@ -0,0 +1,38 @@
+package org.apache.beehive.controls.test.java.versioning;
+
+
+import java.beans.Beans;
+import junit.framework.Assert;
+import junit.framework.TestCase;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.versioning.VersionRequired;
+import org.apache.beehive.controls.test.controls.versioning.HelloBean;
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
+
+
+
+
+@Freq("detailed")
+public class VersionRequiredTest extends TestCase
+{
+    public VersionRequiredTest( String s ) { super( s ); }
+
+    public void setUp() { }
+
+    /**
+     * A control that contains a nested control
+     */
+    @Control
+    @VersionRequired(major =3)
+    public HelloBean helloBean;
+
+
+    @Freq("detailed")
+    public void testRequiredVersion() throws Exception
+    {
+		fail("VersionRequired is not enforced.");
+    }
+
+}