> From what I can remember, there are some issues with [1]
> https://issues.apache.org/jira/browse/MAILBOX-133. It's abut the
> tests, which require a running HBase cluster. I will try to fix it
> tomorrow.
>
> I think I can fix this by creating a special testing configuration for
> HBase mailbox (using spring testing framework and
> @ContextConfiguration ) in which I start a MiniHBase cluster.
>
> But this is kind of weird, that testing integration requires something
> like this.

I tried to fix the issue without much success. I manage to create the
cluster but the test seems to hang and does nothing.
I attached the patch so you can follow my modifications. Things are
going quite slow because I lost some stuff, including my glasses.

Does the test require some information in HBase, like a table schema?

Regards,

-- 
Ioan Eugen Stan
http://ieugen.blogspot.com/
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/ieugen/contracte/james/mailbox/spring
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: pom.xml
--- pom.xml Base (BASE)
+++ pom.xml Locally Modified (Based On LOCAL)
@@ -27,6 +27,21 @@
   <groupId>org.apache.james</groupId>
   <artifactId>apache-james-mailbox-spring</artifactId>
   <name>Apache James Mailbox Spring</name>
+    
+    <repositories>
+        <repository>
+            <id>hadoop-non-releases</id>
+            <name>Hadoop non-releases</name>
+            <url>http://people.apache.org/~rawson/repo/</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+    </repositories>
+    
   <dependencies>
     <dependency>
       <groupId>org.apache.james</groupId>
@@ -142,5 +157,18 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+        <dependency>
+            <groupId>org.apache.hbase</groupId>
+            <artifactId>hbase</artifactId>
+            <version>0.90.3</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-test</artifactId>
+            <version>0.20-append-r1057313</version>
+            <scope>test</scope>
+        </dependency>
   </dependencies>
 </project>
Index: src/main/resources/META-INF/org/apache/james/spring-mailbox.xml
--- src/main/resources/META-INF/org/apache/james/spring-mailbox.xml Base (BASE)
+++ src/main/resources/META-INF/org/apache/james/spring-mailbox.xml Locally Modified (Based On LOCAL)
@@ -41,10 +41,8 @@
 -->
     <import resource="classpath:META-INF/org/apache/james/spring-mailbox-maildir.xml" />
     <import resource="classpath:META-INF/org/apache/james/spring-mailbox-memory.xml" />
-<!-- 
-    HBase temporary desactivated while mailbox-spring test fails
     <import resource="classpath:META-INF/org/apache/james/spring-mailbox-hbase.xml" />
--->
+
     <!-- 
       Mailbox Copier
      -->
Index: src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java
--- src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java Base (BASE)
+++ src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java Locally Modified (Based On LOCAL)
@@ -20,6 +20,8 @@
 
 import junit.framework.Assert;
 
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.james.mailbox.copier.MailboxCopierImpl;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -27,9 +29,17 @@
 public class SpringMailboxTest {
     
     private static SpringMailbox springMailbox;
+    private static MiniHBaseCluster hbaseCluster;
     
     @BeforeClass
     public static void init() {
+        HBaseTestingUtility htu = new HBaseTestingUtility();
+        htu.getConfiguration().setBoolean("dfs.support.append", true);
+        try {
+            hbaseCluster = htu.startMiniCluster();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         springMailbox = new SpringMailbox();
     }
     
@@ -38,5 +48,4 @@
         Assert.assertEquals(AnonymousAuthenticator.class.getName(), springMailbox.getBean("authenticator").getClass().getName());
         Assert.assertEquals(MailboxCopierImpl.class.getName(), springMailbox.getBean("mailboxcopier").getClass().getName());
     }
-
 }
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to