james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1154677 - in /james/server/trunk/hbase/src: main/java/org/apache/james/domainlist/hbase/ main/java/org/apache/james/domainlist/hbase/def/ main/java/org/apache/james/rrt/hbase/ main/java/org/apache/james/rrt/hbase/def/ main/java/org/apache/...
Date Sun, 07 Aug 2011 09:10:41 GMT
Author: eric
Date: Sun Aug  7 09:10:40 2011
New Revision: 1154677

URL: http://svn.apache.org/viewvc?rev=1154677&view=rev
Log:
Add javadoc (JAMES-1273)

Modified:
    james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/HBaseDomainList.java
    james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/def/HDomainList.java
    james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTable.java
    james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/def/HRecipientRewriteTable.java
    james/server/trunk/hbase/src/main/java/org/apache/james/system/hbase/TablePool.java
    james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/HBaseUsersRepository.java
    james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/def/HUsersRepository.java
    james/server/trunk/hbase/src/test/java/org/apache/james/JamesServerHBaseIntegrationTest.java
    james/server/trunk/hbase/src/test/java/org/apache/james/domainlist/hbase/HBaseDomainListTest.java
    james/server/trunk/hbase/src/test/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTableTest.java
    james/server/trunk/hbase/src/test/java/org/apache/james/system/hbase/TablePoolTest.java
    james/server/trunk/hbase/src/test/java/org/apache/james/user/hbase/HBaseUsersRepositoryTest.java
    james/server/trunk/hbase/src/test/resources/log4j.properties

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/HBaseDomainList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/HBaseDomainList.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/HBaseDomainList.java
(original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/HBaseDomainList.java
Sun Aug  7 09:10:40 2011
@@ -37,10 +37,19 @@ import org.apache.james.system.hbase.Tab
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Implementation of the DomainList for a HBase persistence.
+ */
 public class HBaseDomainList extends AbstractDomainList {
 
+    /**
+     * The Logger.
+     */
     private static Logger log = LoggerFactory.getLogger(HBaseDomainList.class.getName());
 
+    /* (non-Javadoc)
+     * @see org.apache.james.domainlist.api.DomainList#containsDomain(String)
+     */
     @Override
     public boolean containsDomain(String domain) throws DomainListException {
         HTable table = null;
@@ -66,6 +75,9 @@ public class HBaseDomainList extends Abs
         return false;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.domainlist.api.DomainList#addDomain(String)
+     */
     @Override
     public void addDomain(String domain) throws DomainListException {
         HTable table = null;
@@ -111,6 +123,9 @@ public class HBaseDomainList extends Abs
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.domainlist.lib.AbstractDomainList#getDomainListInternal()
+     */
     @Override
     protected List<String> getDomainListInternal() throws DomainListException {
         List<String> list = new ArrayList<String>();

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/def/HDomainList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/def/HDomainList.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/def/HDomainList.java
(original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/domainlist/hbase/def/HDomainList.java
Sun Aug  7 09:10:40 2011
@@ -20,6 +20,12 @@ package org.apache.james.domainlist.hbas
 
 import org.apache.hadoop.hbase.util.Bytes;
 
+/**
+ * Definitions for the DomainList HBase Table.
+ * 
+ * Contains the table name, column family name and
+ * the used column/qualifier names.
+ */
 public interface HDomainList {
 
     byte[] TABLE_NAME = Bytes.toBytes("JAMES_DOMAINLIST");

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTable.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTable.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTable.java
(original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTable.java
Sun Aug  7 09:10:40 2011
@@ -44,10 +44,21 @@ import org.apache.james.system.hbase.Tab
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Implementation of the RecipientRewriteTable for a HBase persistence.
+ * 
+ * TODO Fix wildcards, recursive and alias.
+ */
 public class HBaseRecipientRewriteTable extends AbstractRecipientRewriteTable {
 
+    /**
+     * The Logger.
+     */
     private static Logger log = LoggerFactory.getLogger(HBaseRecipientRewriteTable.class.getName());
     
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#addMappingInternal(String,
String, String)
+     */
     @Override
     protected void addMappingInternal(String user, String domain, String mapping) throws
RecipientRewriteTableException {
         HTable table = null;
@@ -71,6 +82,9 @@ public class HBaseRecipientRewriteTable 
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#removeMappingInternal(String,
String, String)
+     */
     @Override
     protected void removeMappingInternal(String user, String domain, String mapping) throws
RecipientRewriteTableException {
         HTable table = null;
@@ -94,6 +108,9 @@ public class HBaseRecipientRewriteTable 
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#getUserDomainMappingsInternal(String,
String)
+     */
     @Override
     protected Collection<String> getUserDomainMappingsInternal(String user, String
domain) throws RecipientRewriteTableException {
         HTable table = null;
@@ -129,6 +146,9 @@ public class HBaseRecipientRewriteTable 
         return list;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#getAllMappingsInternal()
+     */
     @Override
     protected Map<String, Collection<String>> getAllMappingsInternal() throws
RecipientRewriteTableException {
         HTable table = null;
@@ -178,6 +198,9 @@ public class HBaseRecipientRewriteTable 
         return map;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#mapAddressInternal(String,
String)
+     */
     @Override
     protected String mapAddressInternal(String user, String domain) throws RecipientRewriteTableException
{
         HTable table = null;

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/def/HRecipientRewriteTable.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/def/HRecipientRewriteTable.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/def/HRecipientRewriteTable.java
(original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/rrt/hbase/def/HRecipientRewriteTable.java
Sun Aug  7 09:10:40 2011
@@ -20,6 +20,12 @@ package org.apache.james.rrt.hbase.def;
 
 import org.apache.hadoop.hbase.util.Bytes;
 
+/**
+ * Definitions for the RecipientRewriteTable HBase Table.
+ * 
+ * Contains the table name, column family name and
+ * the used column/qualifier names.
+ */
 public interface HRecipientRewriteTable {
 
     byte[] TABLE_NAME = Bytes.toBytes("JAMES_RRT");

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/system/hbase/TablePool.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/system/hbase/TablePool.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/system/hbase/TablePool.java (original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/system/hbase/TablePool.java Sun
Aug  7 09:10:40 2011
@@ -31,16 +31,42 @@ import org.apache.james.domainlist.hbase
 import org.apache.james.rrt.hbase.def.HRecipientRewriteTable;
 import org.apache.james.user.hbase.def.HUsersRepository;
 
+/**
+ * Table Pool singleton to get the DomainList, RecipientRewriteTable and UserRepository HBase
tables.
+ * 
+ * TODO Two getInstance methods are public, one for the impl, one for the tests. This is
not good.
+ */
 public class TablePool {    
     
     private static Configuration configuration;
     private static TablePool hbaseSchema;
     private static HTablePool htablePool;
     
+    /**
+     * Use getInstance to get an instance of the HTablePool.
+     * 
+     * Don't give any configuration, the default one will be used
+     * via HBaseConfiguration.create().
+     * 
+     * If you want to create the instance with a specific HBase configuration,
+     * use {@link #getInstance(Configuration)}
+     * 
+     * @return
+     * @throws IOException
+     */
     public static TablePool getInstance() throws IOException {
         return getInstance(HBaseConfiguration.create());
     }
 
+    /**
+     * Use getInstance to get an instance of the HTablePool.
+     * 
+     * You can give at first call a specific HBase configuration to suit your needs.
+     * 
+     * @param configuration
+     * @return
+     * @throws IOException
+     */
     public static TablePool getInstance(Configuration configuration) throws IOException {
         if (hbaseSchema == null) {
             TablePool.configuration = configuration;
@@ -53,26 +79,54 @@ public class TablePool {    
         return hbaseSchema;
     }
     
+    /**
+     * Get an instance of the DomainList table.
+     * 
+     * @return
+     */
     public HTable getDomainlistTable() {
         return (HTable) htablePool.getTable(HDomainList.TABLE_NAME);
     }
 
+    /**
+     * Get an instance of the RecipientRewriteTable table.
+     * 
+     * @return
+     */
     public HTable getRecipientRewriteTable() {
         return (HTable) htablePool.getTable(HRecipientRewriteTable.TABLE_NAME);
     }
 
+    /**
+     * Get an instance of the UsersRepository table.
+     * 
+     * @return
+     */
     public HTable getUsersRepositoryTable() {
         return (HTable) htablePool.getTable(HUsersRepository.TABLE_NAME);
     }
 
-    // With later HBase versions, we won't have to put back the table in the pool.
-    // See https://issues.apache.org/jira/browse/HBASE-4054
+    /**
+     * Put back the table in the pool after usage.
+     * 
+     * With later HBase versions, we won't have to put back the table in the pool.
+     * See https://issues.apache.org/jira/browse/HBASE-4054
+     * 
+     * @param table
+     */
     public void putTable(HTable table) {
         if (table != null) {
             htablePool.putTable(table);
         }
     }
     
+    /**
+     * Create a table if needed.
+     * 
+     * @param tableName
+     * @param columnFamilyName
+     * @throws IOException
+     */
     private static void ensureTable(byte[] tableName, byte[] columnFamilyName) throws IOException
{
         HBaseAdmin hbaseAdmin = new HBaseAdmin(configuration);
         if (! hbaseAdmin.tableExists(tableName)) {

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/HBaseUsersRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/HBaseUsersRepository.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/HBaseUsersRepository.java
(original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/HBaseUsersRepository.java
Sun Aug  7 09:10:40 2011
@@ -43,22 +43,32 @@ import org.apache.james.user.lib.model.D
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Implementation of the UserRepository for a HBase persistence.
+ */
 public class HBaseUsersRepository extends AbstractUsersRepository {
     
+    /**
+     * The Logger.
+     */
     private static Logger log = LoggerFactory.getLogger(HBaseUsersRepository.class.getName());
 
+    /**
+     * Hashing algorithm for the password.
+     */
     private String algo;
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.james.user.lib.AbstractUsersRepository#doConfigure(org.apache.commons.configuration.HierarchicalConfiguration)
+    /* (non-Javadoc)
+     * @see org.apache.james.user.lib.AbstractUsersRepository#doConfigure(HierarchicalConfiguration)
      */
     public void doConfigure(HierarchicalConfiguration config) throws ConfigurationException
{
         algo = config.getString("algorithm", "MD5");
         super.doConfigure(config);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#getUserByName(String)
+     */
     @Override
     public User getUserByName(String name) throws UsersRepositoryException {
         KeyValue keyValue = getKeyValue(name);
@@ -69,6 +79,9 @@ public class HBaseUsersRepository extend
         return user;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#updateUser(User)
+     */
     @Override
     public void updateUser(User user) throws UsersRepositoryException {
         if (user == null) {
@@ -84,6 +97,9 @@ public class HBaseUsersRepository extend
         putUser((DefaultUser) user);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#removeUser(String)
+     */
     @Override
     public void removeUser(String name) throws UsersRepositoryException {
         HTable table = null;
@@ -106,12 +122,18 @@ public class HBaseUsersRepository extend
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#contains(String)
+     */
     @Override
     public boolean contains(String name) throws UsersRepositoryException {
         KeyValue keyValue = getKeyValue(name);
         return (keyValue != null);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#test(String, String)
+     */
     @Override
     public boolean test(String name, String password) throws UsersRepositoryException {
         KeyValue keyValue = getKeyValue(name);
@@ -123,6 +145,9 @@ public class HBaseUsersRepository extend
         return false;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#countUsers()
+     */
     @Override
     public int countUsers() throws UsersRepositoryException {
         HTable table = null;
@@ -156,6 +181,9 @@ public class HBaseUsersRepository extend
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.api.UsersRepository#list()
+     */
     @Override
     public Iterator<String> list() throws UsersRepositoryException {
         List<String> list = new ArrayList<String>();
@@ -189,6 +217,9 @@ public class HBaseUsersRepository extend
         return list.iterator();
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.lib.AbstractUsersRepository#doAddUser(String, String)
+     */
     @Override
     protected void doAddUser(String username, String password) throws UsersRepositoryException
{
         DefaultUser user = new DefaultUser(username, algo);
@@ -196,6 +227,13 @@ public class HBaseUsersRepository extend
         putUser(user);
     }
     
+    /**
+     * Utility method to retrieve a HBase KeyValue for a given username.
+     * 
+     * @param username
+     * @return
+     * @throws UsersRepositoryException
+     */
     private KeyValue getKeyValue(String username) throws UsersRepositoryException {
         HTable table = null;
         try {
@@ -218,6 +256,12 @@ public class HBaseUsersRepository extend
         }
     }
     
+    /**
+     * Utility mehtod to put a User in HBase.
+     * 
+     * @param user
+     * @throws UsersRepositoryException
+     */
     private void putUser(DefaultUser user) throws UsersRepositoryException {
         HTable table = null;
         try {

Modified: james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/def/HUsersRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/def/HUsersRepository.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/def/HUsersRepository.java
(original)
+++ james/server/trunk/hbase/src/main/java/org/apache/james/user/hbase/def/HUsersRepository.java
Sun Aug  7 09:10:40 2011
@@ -20,6 +20,12 @@ package org.apache.james.user.hbase.def;
 
 import org.apache.hadoop.hbase.util.Bytes;
 
+/**
+ * Definitions for the UsersRepository HBase Table.
+ * 
+ * Contains the table name, column family name and
+ * the used column/qualifier names.
+ */
 public interface HUsersRepository {
 
     byte[] TABLE_NAME = Bytes.toBytes("JAMES_USERS");

Modified: james/server/trunk/hbase/src/test/java/org/apache/james/JamesServerHBaseIntegrationTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/test/java/org/apache/james/JamesServerHBaseIntegrationTest.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/test/java/org/apache/james/JamesServerHBaseIntegrationTest.java
(original)
+++ james/server/trunk/hbase/src/test/java/org/apache/james/JamesServerHBaseIntegrationTest.java
Sun Aug  7 09:10:40 2011
@@ -32,6 +32,14 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
+/**
+ * Integration Tests for the HBase persistence implementations.
+ * 
+ * Launches a Mini HBase Cluster and run the others tests
+ * via a JUnit Test Suite.
+ * 
+ * HBaseRecipientRewriteTableTest temporary desactivated.
+ */
 @RunWith(Suite.class)
 @SuiteClasses({
     TablePoolTest.class,
@@ -41,10 +49,21 @@ import org.junit.runners.Suite.SuiteClas
   })
 public class JamesServerHBaseIntegrationTest {
 
+    /**
+     * The Logger.
+     */
     private static Logger logger = Logger.getLogger(JamesServerHBaseIntegrationTest.class);
     
+    /**
+     * In Memory HBase Mini Cluster.
+     */
     private static MiniHBaseCluster hbaseCluster;
     
+    /**
+     * Launches the HBase Mini Cluster before the tests.
+     * 
+     * @throws Exception
+     */
     @BeforeClass
     public static void setup() throws Exception {
         HBaseTestingUtility htu = new HBaseTestingUtility();
@@ -58,6 +77,11 @@ public class JamesServerHBaseIntegration
         TablePool.getInstance(getConfiguration());
     }
     
+    /**
+     * Shutdowns the HBase Mini Cluster after the tests.
+     * 
+     * @throws Exception
+     */
     @AfterClass
     public static void tearDown() throws Exception {
        if (hbaseCluster != null) {
@@ -65,6 +89,9 @@ public class JamesServerHBaseIntegration
        }
     }
     
+    /**
+     * @return the HBase Configuration
+     */
     public static Configuration getConfiguration() {
         if (hbaseCluster == null) {
             throw new IllegalStateException("Please instanciate HBaseTestingUtility before
invoking this method");

Modified: james/server/trunk/hbase/src/test/java/org/apache/james/domainlist/hbase/HBaseDomainListTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/test/java/org/apache/james/domainlist/hbase/HBaseDomainListTest.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/test/java/org/apache/james/domainlist/hbase/HBaseDomainListTest.java
(original)
+++ james/server/trunk/hbase/src/test/java/org/apache/james/domainlist/hbase/HBaseDomainListTest.java
Sun Aug  7 09:10:40 2011
@@ -22,8 +22,17 @@ import org.apache.james.domainlist.api.D
 import org.apache.james.domainlist.lib.AbstractDomainListTest;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Tests for the HBase DomainList implementation.
+ * 
+ * Simply create the needed HBaseDomainList instance, and let the
+ * AbstractDomainListTest run the tests
+ */
 public class HBaseDomainListTest extends AbstractDomainListTest {
 
+    /* (non-Javadoc)
+     * @see org.apache.james.domainlist.lib.AbstractDomainListTest#createDomainList()
+     */
     @Override
     protected DomainList createDomainList() {
         HBaseDomainList domainList = new HBaseDomainList();

Modified: james/server/trunk/hbase/src/test/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTableTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/test/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTableTest.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/test/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTableTest.java
(original)
+++ james/server/trunk/hbase/src/test/java/org/apache/james/rrt/hbase/HBaseRecipientRewriteTableTest.java
Sun Aug  7 09:10:40 2011
@@ -29,12 +29,31 @@ import org.apache.james.system.hbase.Tab
 import org.apache.log4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Tests for the HBase RecipientRewriteTable implementation.
+ * 
+ * Simply create the needed HBaseRecipientRewriteTable instance, and let the
+ * AbstractRecipientRewriteTableTest run the tests.
+ * 
+ * TODO Fix wildcards, recursive and alias tests.
+ */
 public class HBaseRecipientRewriteTableTest extends AbstractRecipientRewriteTableTest {
 
+    /**
+     * The Logger.
+     */
     private static Logger logger = Logger.getLogger(HBaseRecipientRewriteTableTest.class);
     
+    /**
+     * Mini Hbase Cluster
+     * 
+     * TODO Remove this when RRT 
+     */
     private static MiniHBaseCluster hbaseCluster;
     
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#setUp()
+     */
     public void setUp() throws Exception {
         super.setUp();
         HBaseTestingUtility htu = new HBaseTestingUtility();
@@ -48,6 +67,9 @@ public class HBaseRecipientRewriteTableT
         TablePool.getInstance(getConfiguration());
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#tearDown()
+     */
     public void tearDown() throws Exception {
         super.tearDown();
        if (hbaseCluster != null) {
@@ -55,6 +77,9 @@ public class HBaseRecipientRewriteTableT
        }
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#getRecipientRewriteTable()
+     */
     @Override
     protected AbstractRecipientRewriteTable getRecipientRewriteTable() throws Exception {
         HBaseRecipientRewriteTable rrt = new HBaseRecipientRewriteTable();
@@ -63,9 +88,8 @@ public class HBaseRecipientRewriteTableT
         return rrt;
     }
 
-    /**
-     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#addMapping(java.lang.String,
-     *      java.lang.String, java.lang.String, int)
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#addMapping(String,
String, String, int)
      */
     protected boolean addMapping(String user, String domain, String mapping, int type) throws
RecipientRewriteTableException {
         try {
@@ -86,9 +110,8 @@ public class HBaseRecipientRewriteTableT
         }
     }
 
-    /**
-     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#removeMapping(java.lang.String,
-     *      java.lang.String, java.lang.String, int)
+    /* (non-Javadoc)
+     * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTableTest#removeMapping(String,
String, String, int)
      */
     protected boolean removeMapping(String user, String domain, String mapping, int type)
throws RecipientRewriteTableException {
         try {
@@ -109,6 +132,9 @@ public class HBaseRecipientRewriteTableT
         }
     }
 
+    /**
+     * @return the HBase configuration.
+     */
     public static Configuration getConfiguration() {
         if (hbaseCluster == null) {
             throw new IllegalStateException("Please instanciate HBaseTestingUtility before
invoking this method");

Modified: james/server/trunk/hbase/src/test/java/org/apache/james/system/hbase/TablePoolTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/test/java/org/apache/james/system/hbase/TablePoolTest.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/test/java/org/apache/james/system/hbase/TablePoolTest.java
(original)
+++ james/server/trunk/hbase/src/test/java/org/apache/james/system/hbase/TablePoolTest.java
Sun Aug  7 09:10:40 2011
@@ -24,6 +24,10 @@ import junit.framework.Assert;
 
 import org.junit.Test;
 
+/**
+ * Simple tests for the TablePool singleton class.
+ * Check that the returned singleton and table instances and not null.
+ */
 public class TablePoolTest {
     
     @Test

Modified: james/server/trunk/hbase/src/test/java/org/apache/james/user/hbase/HBaseUsersRepositoryTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/test/java/org/apache/james/user/hbase/HBaseUsersRepositoryTest.java?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/test/java/org/apache/james/user/hbase/HBaseUsersRepositoryTest.java
(original)
+++ james/server/trunk/hbase/src/test/java/org/apache/james/user/hbase/HBaseUsersRepositoryTest.java
Sun Aug  7 09:10:40 2011
@@ -28,8 +28,17 @@ import org.junit.After;
 import org.junit.Before;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Tests for the HBase UsersRepository implementation.
+ * 
+ * Simply create the needed HBaseUsersRepository instance, and let the
+ * AbstractUsersRepositoryTest run the tests
+ */
 public class HBaseUsersRepositoryTest extends AbstractUsersRepositoryTest {
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.lib.AbstractUsersRepositoryTest#setUp()
+     */
     @Override
     @Before
     protected void setUp() throws Exception {
@@ -37,12 +46,21 @@ public class HBaseUsersRepositoryTest ex
         deleteAll();
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.user.lib.AbstractUsersRepositoryTest#tearDown()
+     */
     @Override
     @After
     protected void tearDown() throws Exception {
         super.tearDown();
     }
 
+    /**
+     * Delete all users in the repository. Used between each tests.
+     * 
+     * @throws UsersRepositoryException
+     * @throws Exception
+     */
     private void deleteAll() throws UsersRepositoryException, Exception {
         Iterator<String> it = getUsersRepository().list();
         while (it.hasNext()) {
@@ -50,6 +68,9 @@ public class HBaseUsersRepositoryTest ex
         }
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.james.user.lib.AbstractUsersRepositoryTest#getUsersRepository()
+     */
     @Override
     protected UsersRepository getUsersRepository() throws Exception {
         HBaseUsersRepository userRepository = new HBaseUsersRepository();

Modified: james/server/trunk/hbase/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/james/server/trunk/hbase/src/test/resources/log4j.properties?rev=1154677&r1=1154676&r2=1154677&view=diff
==============================================================================
--- james/server/trunk/hbase/src/test/resources/log4j.properties (original)
+++ james/server/trunk/hbase/src/test/resources/log4j.properties Sun Aug  7 09:10:40 2011
@@ -1,3 +1,20 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
 log4j.rootLogger=WARN, A1
 log4j.appender.A1=org.apache.log4j.ConsoleAppender
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message