Update of /var/cvs/tests/convertimage/org/mmbase/bridge/tests
In directory james.mmbase.org:/tmp/cvs-serv9593

Modified Files:
        ConvertImageTest.java 
Log Message:
details only


See also: 
http://cvs.mmbase.org/viewcvs/tests/convertimage/org/mmbase/bridge/tests


Index: ConvertImageTest.java
===================================================================
RCS file: 
/var/cvs/tests/convertimage/org/mmbase/bridge/tests/ConvertImageTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ConvertImageTest.java       1 Oct 2008 17:05:22 -0000       1.11
+++ ConvertImageTest.java       22 Apr 2009 08:20:43 -0000      1.12
@@ -15,7 +15,7 @@
  * JUnit tests for convertimage-interface implementation.
  *
  * @author Michiel Meeuwissen
- * @version $Id: ConvertImageTest.java,v 1.11 2008/10/01 17:05:22 michiel Exp $
+ * @version $Id: ConvertImageTest.java,v 1.12 2009/04/22 08:20:43 michiel Exp $
  */
 public class ConvertImageTest extends org.mmbase.tests.BridgeTest {
 
@@ -27,7 +27,6 @@
         return Queries.count(nodeManager.createQuery());
     }
 
-
     public void testImportedJpegImage() {
         Cloud cloud = getCloud();
         Node node = cloud.getNode("jpeg.test.image");
@@ -36,9 +35,7 @@
         //node.delete();
     }
 
-    /**
-     * test if an image can be converted using the getIntValue
-     */
+    //test if an image can be converted using the getIntValue
     public void testGetInvalueCachedImage() {
         Cloud cloud = getCloud();
         Node node = cloud.getNode("jpeg.test.image");
@@ -50,10 +47,7 @@
         assertEquals(1, countIcaches());
     }
 
-    /**
-     * test if an image can be converted using getFunctionValue
-     *
-     */
+    // test if an image can be converted using getFunctionValue
     public void testFunctionValueCachedImage() {
         Cloud cloud = getCloud();
         Node node = cloud.getNode("jpeg.test.image");
@@ -82,6 +76,7 @@
         Factory.init(parameters);
     }
 
+
     public void testFailAnImage() {
         // MMB-495
         Map<String, String> originalParameters = breakImaging();
@@ -95,8 +90,10 @@
         assertEquals(3, countIcaches());
         assertTrue(icacheNumber > 0);
         Node icache = cloud.getNode(icacheNumber);
-        icache.getFunctionValue("wait", null); // this should fail.
-        assertTrue(icache.isNull("handle"));
+        icache.getFunctionValue("wait", null); // this should fail because 
imaging is broken now
+
+        //hence:
+        assertTrue("Found icache: " + icache.getNumber() + " " + 
icache.getSize("handle") + " bytes", icache.isNull("handle"));
         assertEquals(3, countIcaches());
 
         restoreImaging(originalParameters);
@@ -108,15 +105,16 @@
         assertEquals(3, countIcaches());
         assertFalse(icache.isNull("handle"));
 
+        assertTrue(icache.getSize("handle") > 0);
+
 
     }
 
-    /**
-     * Java api to get access times is only available in java 7. This is a 
quick and dirty hack, at
-     * least working in linux. It does not actually try to determin the access 
times of individual
-     * files, it simply returns a string containing the access times. For test 
cases 'equals' on the
-     * string should suffice.
-     */
+    // Java api to get access times is only available in java 7. This is a 
quick and dirty hack, at
+    // least working in linux. It does not actually try to determin the access 
times of individual
+    // files, it simply returns a string containing the access times. For test 
cases 'equals' on the
+    //string should suffice.
+
     public String getImagesAccessTimes() {
         CharTransformer accessTimes = new AbstractCommandStringTransformer() {
                 public String[] getCommand() {
@@ -146,11 +144,8 @@
         }
     }
 
-    private static Cloud cloud;
-    /**
-     * test what happens if template is errorneous
-     *
-     */
+
+    //test what happens if template is errorneous
     public void testErrorneousTemplate() {
         Cloud cloud = getCloud();
         Query q = cloud.getNodeManager("icaches").createQuery();
@@ -167,9 +162,10 @@
         // etc.
     }
 
-    /**
-     * Sets up before each test.
-     */
+    private static Cloud cloud;
+
+
+    ///Sets up before each test.
     public void setUp() throws Exception {
         if (cloud == null) {
             startMMBase();
@@ -206,6 +202,9 @@
         try {
             InputStream in = this.getClass().getResourceAsStream(name);
 
+            if (in == null) {
+                throw new Error("No such resource '" + name + "'");
+            }
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
             byte[] buffer = new byte[200];
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to