You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/08/15 20:47:32 UTC

svn commit: r232851 - in /beehive/trunk/controls/test: build.xml src/units/org/apache/beehive/controls/test/java/beaninfo/BeanInfoTest.java

Author: ekoneil
Date: Mon Aug 15 11:47:22 2005
New Revision: 232851

URL: http://svn.apache.org/viewcvs?rev=232851&view=rev
Log:
Attempt to fix controls DRTs failing on win32.

The problem is with line endings on the *.beaninfo files under controls/test.

BB: self
DRT: Controls pass


Modified:
    beehive/trunk/controls/test/build.xml
    beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/BeanInfoTest.java

Modified: beehive/trunk/controls/test/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/build.xml?rev=232851&r1=232850&r2=232851&view=diff
==============================================================================
--- beehive/trunk/controls/test/build.xml (original)
+++ beehive/trunk/controls/test/build.xml Mon Aug 15 11:47:22 2005
@@ -360,7 +360,6 @@
         <antcall target="run"/>
 
         <echo message="${do.start.appserver}"/>
-
         <property name="test.freq" value="checkin"/>
 
         <antcall target="run.test"/>
@@ -377,19 +376,23 @@
     </target>
     
     <target name="run.test">
+        <antcall target="build-test-webapp"/>
         <parallel>
             <echo message="start a new thread to build controlsWeb"/>
             <start-server shmem="false" javaOptions=""/>
             <sequential>
                 <try>
-                    <antcall target="build-test-webapp"/>
                     <echo message="continue the new thread, wait for app server to start"/>
                     <sleep seconds="20"/>
                     <echo message="continue the new thread, deploy controlsWeb"/>
-                    <ant dir ="./webapps" antfile="build.xml" target="ensure.deployed" inheritAll="false"/>
+
+                    <ant dir ="webapps" antfile="build.xml" target="ensure.deployed" inheritAll="false"/>
+
                     <echo message="continue the new thread, run junit tests"/>
+
                     <antcall target="run"/>
-                    <ant dir ="./webapps" antfile="build.xml" target="undeploy" inheritall="false"/>
+
+                    <ant dir ="webapps" antfile="build.xml" target="undeploy" inheritall="false"/>
                     <echo message="continue the new thread, undeploy controlsWeb"/>
                     <echo message="stop app server, finish the new thread"/>
                     <finally>

Modified: beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/BeanInfoTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/BeanInfoTest.java?rev=232851&r1=232850&r2=232851&view=diff
==============================================================================
--- beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/BeanInfoTest.java (original)
+++ beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/BeanInfoTest.java Mon Aug 15 11:47:22 2005
@@ -18,13 +18,14 @@
 
 package org.apache.beehive.controls.test.java.beaninfo;
 
-import junit.framework.Assert;
+import java.io.FileOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
 import junit.framework.TestCase;
 
 import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
-
-import java.io.*;
-
 import org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean;
 import org.apache.beehive.controls.test.controls.util.ControlIntrospector;
 
@@ -35,42 +36,58 @@
  * java -classpath build/classes/beans:../build/jars/controls.jar org.apache.beehive.controls.test.controls.util.ControlIntrospector org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean
  */
 @Freq("checkin")
-public class BeanInfoTest extends TestCase
-{
-    public BeanInfoTest(String s) { super(s); }
-
-    public void setUp() { }
-
-    /**
-     * Tests basic Context events for Controls
-     */
-    public void testBeanInfo() throws Exception
-    {
-
-        StringWriter sw = new StringWriter();
-        File tempFile = File.createTempFile("InfoTestBean", ".beaninfo");
-        FileOutputStream fos = new FileOutputStream(tempFile);
-        ControlIntrospector ci = new ControlIntrospector(InfoTestBean.class, fos);
-        ci.introspect();
-        fos.close();
-
-        InputStream valid =
-            this.getClass().getClassLoader().getResourceAsStream(
-                "org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo");
-        if (valid == null)
-            fail("Could not locate valid beaninfo file");
-
-        InputStream current = new FileInputStream(tempFile);
-        int validVal, currentVal;
-        do
-        {
-            validVal = valid.read();
-            currentVal = current.read();
-            if (validVal != currentVal)
-                fail("BeanInfo data in " + tempFile.getName() + " differs from valid file");
+public class BeanInfoTest
+    extends TestCase {
+
+    public BeanInfoTest(String s) {
+        super(s);
+    }
+
+    public void testBeanInfo()
+        throws Exception {
+
+        File tempFile = null;
+        FileOutputStream fos = null;
+        try {
+            tempFile = File.createTempFile("InfoTestBean", ".beaninfo");
+            fos = new FileOutputStream(tempFile);
+            ControlIntrospector ci = new ControlIntrospector(InfoTestBean.class, fos);
+            ci.introspect();
+        }
+        finally {
+            if(fos != null)
+                fos.close();
+        }
+
+        InputStream valid = null;
+        InputStream current = null;
+        try {
+            valid =
+                this.getClass().getClassLoader().getResourceAsStream("org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo");
+            if (valid == null)
+                fail("Could not locate valid beaninfo file");
+
+            current = new FileInputStream(tempFile);
+            int validVal;
+            int currentVal;
+            do
+            {
+                validVal = valid.read();
+                currentVal = current.read();
+
+                System.out.println(validVal + "/" + currentVal);
+
+                if (validVal != currentVal)
+                    fail("BeanInfo data in " + tempFile.getName() + " differs from valid file");
+            }
+            while (validVal != -1);
+        }
+        finally {
+            if(current != null)
+                current.close();
+            if(valid != null)
+                valid.close();
         }
-        while (validVal != -1);
-        current.close();
 
         // Pass, so remove the temporary output file
         tempFile.delete();