james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ieu...@apache.org
Subject svn commit: r1299475 - /james/server/trunk/data-jcr/src/test/java/org/apache/james/user/jcr/JcrUserRepositoryTest.java
Date Sun, 11 Mar 2012 22:43:49 GMT
Author: ieugen
Date: Sun Mar 11 22:43:49 2012
New Revision: 1299475

URL: http://svn.apache.org/viewvc?rev=1299475&view=rev
Log:
JAMES-1393

- updated tests to juni 4.x style
- added @Override and reformated code
Issue #JAMES-1393 - Upgrate all test suites to junit 4.10

Modified:
    james/server/trunk/data-jcr/src/test/java/org/apache/james/user/jcr/JcrUserRepositoryTest.java

Modified: james/server/trunk/data-jcr/src/test/java/org/apache/james/user/jcr/JcrUserRepositoryTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/data-jcr/src/test/java/org/apache/james/user/jcr/JcrUserRepositoryTest.java?rev=1299475&r1=1299474&r2=1299475&view=diff
==============================================================================
--- james/server/trunk/data-jcr/src/test/java/org/apache/james/user/jcr/JcrUserRepositoryTest.java
(original)
+++ james/server/trunk/data-jcr/src/test/java/org/apache/james/user/jcr/JcrUserRepositoryTest.java
Sun Mar 11 22:43:49 2012
@@ -16,17 +16,16 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-
 package org.apache.james.user.jcr;
 
 import java.io.File;
-
 import org.apache.commons.configuration.DefaultConfigurationBuilder;
 import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.james.user.api.UsersRepository;
-import org.apache.james.user.jcr.JCRUsersRepository;
 import org.apache.james.user.lib.AbstractUsersRepositoryTest;
+import org.junit.After;
+import org.junit.Before;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.InputSource;
 
@@ -35,39 +34,45 @@ public class JcrUserRepositoryTest exten
     private static final String JACKRABBIT_HOME = "target/jackrabbit";
     private RepositoryImpl repository;
 
+    @Override
     protected UsersRepository getUsersRepository() throws Exception {
-        JCRUsersRepository repos = new JCRUsersRepository();
-        repos.setRepository(repository);
-        DefaultConfigurationBuilder config = new DefaultConfigurationBuilder();
-        config.addProperty("username", "admin");
-        config.addProperty("password", "test");
-        repos.configure(config);
-        repos.setLog(LoggerFactory.getLogger("MockLog"));
-        return repos;
+	JCRUsersRepository repos = new JCRUsersRepository();
+	repos.setRepository(repository);
+	DefaultConfigurationBuilder config = new DefaultConfigurationBuilder();
+	config.addProperty("username", "admin");
+	config.addProperty("password", "test");
+	repos.configure(config);
+	repos.setLog(LoggerFactory.getLogger("MockLog"));
+	return repos;
     }
 
-    protected void setUp() throws Exception {
-        File home = new File(JACKRABBIT_HOME);
-        if (home.exists()) {
-            delete(home);
-        }
-        RepositoryConfig config = RepositoryConfig.create(new InputSource(this.getClass().getClassLoader().getResourceAsStream("test-repository.xml")),
JACKRABBIT_HOME);
-        repository = RepositoryImpl.create(config);
-        super.setUp();
+    @Override
+    @Before
+    public void setUp() throws Exception {
+	File home = new File(JACKRABBIT_HOME);
+	if (home.exists()) {
+	    delete(home);
+	}
+	RepositoryConfig config = RepositoryConfig.create(new InputSource(this.getClass().getClassLoader().
+		getResourceAsStream("test-repository.xml")), JACKRABBIT_HOME);
+	repository = RepositoryImpl.create(config);
+	super.setUp();
     }
 
     private void delete(File file) {
-        if (file.isDirectory()) {
-            File[] contents = file.listFiles();
-            for (int i = 0; i < contents.length; i++) {
-                delete(contents[i]);
-            }
-        }
-        file.delete();
+	if (file.isDirectory()) {
+	    File[] contents = file.listFiles();
+	    for (int i = 0; i < contents.length; i++) {
+		delete(contents[i]);
+	    }
+	}
+	file.delete();
     }
 
+    @Override
+    @After
     protected void tearDown() throws Exception {
-        super.tearDown();
-        repository.shutdown();
+	super.tearDown();
+	repository.shutdown();
     }
 }



---------------------------------------------------------------------
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