Author: jsong
Date: Thu Oct 21 12:38:31 2004
New Revision: 55254

Added:
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControlImpl.jcs
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControlOverrideImpl.jcs
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestControl.java
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestControlImpl.jcs
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestOverrideControlImpl.jcs
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/index.jsp
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/controlsWeb.controls.properties
Modified:
   incubator/beehive/trunk/controls/test/build.xml
Log:
Adding two basic Controls Binding tests

Contributed by Zach Smith ([EMAIL PROTECTED])



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 21 12:38:31 2004
@@ -56,6 +56,7 @@
 
     <path id="test.classpath">
         <pathelement location="${junit.jar}"/>
+        <pathelement location="${milton.jar}"/>
         <pathelement location="${tools.jar}"/>
         <pathelement location="${velocity14.jar}"/>
         <pathelement location="${velocitydep14.jar}"/>

Added: 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java
        Thu Oct 21 12:38:31 2004
@@ -0,0 +1,11 @@
+package org.apache.beehive.controls.test.controls.binding;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
[EMAIL PROTECTED] (
+    defaultBinding = 
"org.apache.beehive.controls.test.controls.binding.BindingTestControlImpl"
+)
+public interface BindingTestControl
+{ 
+    public String getStatus();
+}

Added: 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControlImpl.jcs
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControlImpl.jcs
     Thu Oct 21 12:38:31 2004
@@ -0,0 +1,15 @@
+package org.apache.beehive.controls.test.controls.binding;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+
[EMAIL PROTECTED]
+public class BindingTestControlImpl 
+    implements java.io.Serializable, BindingTestControl
+{
+    public String getStatus()
+    {
+       return Report.FAIL;
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControlOverrideImpl.jcs
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControlOverrideImpl.jcs
     Thu Oct 21 12:38:31 2004
@@ -0,0 +1,15 @@
+package org.apache.beehive.controls.test.controls.binding;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+
[EMAIL PROTECTED]
+public class BindingTestControlOverrideImpl 
+    implements java.io.Serializable, BindingTestControl
+{
+    public String getStatus()
+    {
+       return Report.PASS;
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestControl.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestControl.java
 Thu Oct 21 12:38:31 2004
@@ -0,0 +1,11 @@
+package org.apache.beehive.controls.test.controls.binding;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
[EMAIL PROTECTED] (
+  defaultBinding = 
"org.apache.beehive.controls.test.controls.binding.DefaultBindingTestOverrideControlImpl"
+)
+public interface DefaultBindingTestControl
+{ 
+    public String getStatus();
+}

Added: 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestControlImpl.jcs
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestControlImpl.jcs
      Thu Oct 21 12:38:31 2004
@@ -0,0 +1,15 @@
+package org.apache.beehive.controls.test.controls.binding;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+
[EMAIL PROTECTED]
+public class DefaultBindingTestControlImpl 
+    implements java.io.Serializable, DefaultBindingTestControl
+{
+    public String getStatus()
+    {
+       return Report.FAIL;
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestOverrideControlImpl.jcs
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/DefaultBindingTestOverrideControlImpl.jcs
      Thu Oct 21 12:38:31 2004
@@ -0,0 +1,15 @@
+package org.apache.beehive.controls.test.controls.binding;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+
[EMAIL PROTECTED]
+public class DefaultBindingTestOverrideControlImpl 
+    implements java.io.Serializable, DefaultBindingTestControl
+{
+    public String getStatus()
+    {
+       return Report.PASS;
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java
        Thu Oct 21 12:38:31 2004
@@ -0,0 +1,29 @@
+package org.apache.beehive.controls.test.jpf.binding;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Desc;
+
+public class TestControlBinding extends HtmlReportTestCase
+{
+    public TestControlBinding(String s){super(s);}
+
+    @Freq("checkin")
+    @Status("inactive")
+    @Desc("Test that a control implementation can be overridden with binding: 
" +
+         "http://issues.apache.org/jira/browse/BEEHIVE-20";)
+    public void testBindingOverride() throws Exception
+    {
+       assertReport("/controlsWeb/binding/index.jsp", "testBindingOverride");
+    }
+
+    @Freq("checkin")
+    @Desc("Test that a @ControlImplementation can set a defaultBinding " +
+         "to an impl that is not the default naming scheme (ie 
ControlNameImpl)")
+    public void testDefaultBinding() throws Exception
+    {
+       assertReport("/controlsWeb/binding/index.jsp", "testDefaultBinding");
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf
  Thu Oct 21 12:38:31 2004
@@ -0,0 +1,67 @@
+/*
+ *
+ * N E T U I
+ *
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * All Rights Reserved. Unpublished rights reserved under the copyright laws
+ * of the United States. The software contained on this media is proprietary
+ * to and embodies the confidential technology of BEA Systems, Inc. The
+ * possession or receipt of this information does not convey any right to
+ * disclose its contents, reproduce it, or use,  or license the use,
+ * for manufacture or sale, the information or anything described
+ * therein. Any use, disclosure, or reproduction without BEA System's
+ * prior written permission is strictly prohibited.
+ *
+ * $Header:$
+ */
+package binding;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.FormData;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+
+import org.apache.beehive.controls.test.controls.binding.BindingTestControl;
+import 
org.apache.beehive.controls.test.controls.binding.DefaultBindingTestControl;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+
[EMAIL PROTECTED](
+    forwards = {
+        @Jpf.Forward(name=Report.RESULTS,path = Report.RESULTSJSP) 
+    }
+)
+public class BindingTests extends PageFlowController
+{
+
+    @Control
+    public BindingTestControl btc;
+
+    @Control
+    public DefaultBindingTestControl dbtc;
+
+    @Jpf.Action
+    protected Forward begin()
+    {
+       return new Forward(Report.RESULTS, Report.KEY, new 
+                          Report(Report.ABORT,"begin() is not a test 
method!"));
+    }
+
+    @Jpf.Action
+    protected Forward testBindingOverride()
+    {
+       return new Forward(Report.RESULTS, Report.KEY, new 
+                          Report(btc.getStatus()));
+    }
+
+    @Jpf.Action
+    protected Forward testDefaultBinding()
+    {
+       return new Forward(Report.RESULTS, Report.KEY, new 
+                          Report(dbtc.getStatus()));
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/index.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/index.jsp 
Thu Oct 21 12:38:31 2004
@@ -0,0 +1,10 @@
+<[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<html>
+    <head>
+    </head>
+    <body>
+        <netui:anchor 
action="testDefaultBinding">testDefaultBinding</netui:anchor><br>
+        <netui:anchor 
action="testBindingOverride">testBindingOverride</netui:anchor>
+    </body>
+</html>
\ No newline at end of file

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/controlsWeb.controls.properties
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/controlsWeb.controls.properties
   Thu Oct 21 12:38:31 2004
@@ -0,0 +1,2 @@
+## This file is part of the Controls Binding tests ###
+org.apache.beehive.controls.test.controls.binding.BindingTestControlBean=org.apache.beehive.controls.test.controls.binding.BindingTestControlOverrideBean
\ No newline at end of file

Reply via email to