From d2896c5a5f896b4ded80534ab5612a09a57e391c Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Tue, 26 Nov 2013 11:18:51 +0100
Subject: [PATCH] no-jira: fix the error in perf500 test in PropertyTest,
 remove reference to log4j logger in tests, remove duplicate closeSession in
 @after

---
 .../olat/basesecurity/BaseSecurityTest.java   |  13 ---
 .../org/olat/catalog/CatalogManagerTest.java  |  73 ------------
 .../calendar/ICalFileCalendarManagerTest.java |   6 +-
 .../coordinate/cluster/jms/JMSTest.java       |   6 -
 ...ddBaseURLToMediaRelativeURLFilterTest.java |   3 -
 .../assessment/AssessmentManagerTest.java     |  15 +--
 .../auditing/UserNodeAuditManagerTest.java    |   7 +-
 .../config/CourseConfigManagerImplTest.java   |  20 ----
 .../CourseGroupManagementTest.java            |  16 +--
 .../ProjectBrokerManagerTest.java             |  20 +---
 .../olat/group/test/BGAreaManagerTest.java    |  11 --
 .../olat/group/test/BGRightManagerTest.java   |  21 +---
 .../olat/group/test/BusinessGroupDAOTest.java |  12 --
 .../test/BusinessGroupRelationDAOTest.java    |  11 --
 .../group/test/BusinessGroupServiceTest.java  |  12 --
 .../org/olat/modules/fo/ForumManagerTest.java |  20 +---
 .../olat/modules/ims/cp/CPManagerTest.java    |  16 +--
 .../org/olat/modules/wiki/WikiUnitTest.java   |  14 +--
 .../versioning/diff/CookbookDiffTest.java     |  10 +-
 src/test/java/org/olat/note/NoteTest.java     |  27 ++---
 .../olat/portfolio/EPArtefactManagerTest.java |   6 -
 .../olat/portfolio/EPFrontendManagerTest.java |   6 -
 .../portfolio/EPStructureManagerTest.java     |   7 --
 .../portfolio/EPStructureToArtefactTest.java  |   6 -
 .../org/olat/properties/PropertyTest.java     | 110 +++++++++++-------
 .../registration/RegistrationManagerTest.java |  11 +-
 .../RepositoryManagerConcurrentTest.java      |   1 -
 .../repository/RepositoryManagerTest.java     |   1 -
 .../resource/OLATResourceManagerTest.java     |   1 -
 .../accesscontrol/ACOrderManagerTest.java     |   6 -
 .../ACTransactionManagerTest.java             |   6 -
 .../java/org/olat/restapi/CatalogTest.java    |   8 +-
 .../org/olat/restapi/CourseGroupMgmtTest.java |   2 -
 .../java/org/olat/restapi/GroupMgmtTest.java  |   1 -
 .../olat/restapi/RepositoryEntriesTest.java   |   9 +-
 .../java/org/olat/restapi/UserMgmtTest.java   |  11 --
 .../file/FileDocumentFactoryTest.java         |  21 +---
 .../java/org/olat/test/AllTestsJunit4.java    |   1 -
 .../olat/user/EmailCheckPerformanceTest.java  |  33 +-----
 .../user/UserPropertiesPerformanceTest.java   |  24 +---
 40 files changed, 118 insertions(+), 486 deletions(-)
 delete mode 100644 src/test/java/org/olat/catalog/CatalogManagerTest.java

diff --git a/src/test/java/org/olat/basesecurity/BaseSecurityTest.java b/src/test/java/org/olat/basesecurity/BaseSecurityTest.java
index f51fffaab02..87f253c7542 100644
--- a/src/test/java/org/olat/basesecurity/BaseSecurityTest.java
+++ b/src/test/java/org/olat/basesecurity/BaseSecurityTest.java
@@ -37,7 +37,6 @@ import java.util.Map;
 
 import junit.framework.Assert;
 
-import org.junit.After;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
@@ -714,18 +713,6 @@ public class BaseSecurityTest extends OlatTestCase {
 
 		System.out.println("end testGetIdentitiesByPowerSearchWithDate");
 	}
-	
-	
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			e.printStackTrace();
-		} catch (Error err) {
-			err.printStackTrace();
-		}
-	}
 
 	////////////////////
 	// Helper
diff --git a/src/test/java/org/olat/catalog/CatalogManagerTest.java b/src/test/java/org/olat/catalog/CatalogManagerTest.java
deleted file mode 100644
index 02e31ec7aea..00000000000
--- a/src/test/java/org/olat/catalog/CatalogManagerTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
-* OLAT - Online Learning and Training<br>
-* http://www.olat.org
-* <p>
-* Licensed under the Apache License, Version 2.0 (the "License"); <br>
-* you may not use this file except in compliance with the License.<br>
-* You may obtain a copy of the License at
-* <p>
-* http://www.apache.org/licenses/LICENSE-2.0
-* <p>
-* Unless required by applicable law or agreed to in writing,<br>
-* software distributed under the License is distributed on an "AS IS" BASIS, <br>
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
-* See the License for the specific language governing permissions and <br>
-* limitations under the License.
-* <p>
-* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
-* University of Zurich, Switzerland.
-* <hr>
-* <a href="http://www.openolat.org">
-* OpenOLAT - Online Learning and Training</a><br>
-* This file has been modified by the OpenOLAT community. Changes are licensed
-* under the Apache 2.0 license as the original file.  
-* <p>
-*/
-package org.olat.catalog;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Test;
-import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
-import org.olat.test.OlatTestCase;
-
-/**
- * Description:<br>
- * TODO: patrickb Class Description for CatalogManagerTest
- * 
- * <P>
- * Initial Date:  17.04.2007 <br>
- * @author patrickb
- */
-public class CatalogManagerTest extends OlatTestCase {
-
-	private static Logger log = Logger.getLogger(CatalogManagerTest.class.getName());
-	
-
-	/**
-	 * 
-	 *
-	 */
-	@Test
-	public void testGetChildrenOf(){
-		//TODO:pb: unit test for CatalogManagerTest
-	}
-	
-	
-	
-	
-	/**
-	 * TearDown is called after each test
-	 */
-	@After public void tearDown() {
-		try {
-			DB db = DBFactory.getInstance();
-			db.closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-		}
-	}
-
-	
-}
diff --git a/src/test/java/org/olat/commons/calendar/ICalFileCalendarManagerTest.java b/src/test/java/org/olat/commons/calendar/ICalFileCalendarManagerTest.java
index 94942df43d4..b3d95718157 100644
--- a/src/test/java/org/olat/commons/calendar/ICalFileCalendarManagerTest.java
+++ b/src/test/java/org/olat/commons/calendar/ICalFileCalendarManagerTest.java
@@ -39,7 +39,6 @@ import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.log4j.Logger;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -47,6 +46,8 @@ import org.olat.commons.calendar.model.Kalendar;
 import org.olat.commons.calendar.model.KalendarEvent;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.test.JMSCodePointServerJunitHelper;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
@@ -63,7 +64,7 @@ import org.olat.testutils.codepoints.client.TemporaryPausedThread;
  */
 public class ICalFileCalendarManagerTest extends OlatTestCase {
 
-	private static Logger log = Logger.getLogger(ICalFileCalendarManagerTest.class.getName());
+	private static OLog log = Tracing.createLoggerFor(ICalFileCalendarManagerTest.class);
 	private static String  CODEPOINT_SERVER_ID = "ICalFileCalendarManagerTest";
 	private static Identity test = null;
 
@@ -555,7 +556,6 @@ public class ICalFileCalendarManagerTest extends OlatTestCase {
 	@After public void tearDown() throws Exception {
 		try {
 			JMSCodePointServerJunitHelper.stopServer();
-			DBFactory.getInstance().closeSession();
 		} catch (Exception e) {
 			log.error("tearDown failed: ", e);
 		}
diff --git a/src/test/java/org/olat/commons/coordinate/cluster/jms/JMSTest.java b/src/test/java/org/olat/commons/coordinate/cluster/jms/JMSTest.java
index 3eda2d30bca..05a4c6841b7 100644
--- a/src/test/java/org/olat/commons/coordinate/cluster/jms/JMSTest.java
+++ b/src/test/java/org/olat/commons/coordinate/cluster/jms/JMSTest.java
@@ -30,7 +30,6 @@ import static org.junit.Assert.assertNotNull;
 
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DBFactory;
@@ -64,11 +63,6 @@ public class JMSTest extends OlatTestCase {
 			isInitialized = true;
 		}
 	}
-	
-	@After
-	public void tearDown() throws Exception {
-		DBFactory.getInstance().closeSession();
-	}
 
 	/**
 	 * 
diff --git a/src/test/java/org/olat/core/util/filter/impl/AddBaseURLToMediaRelativeURLFilterTest.java b/src/test/java/org/olat/core/util/filter/impl/AddBaseURLToMediaRelativeURLFilterTest.java
index 67229a1e8a5..8e5aa113bb2 100644
--- a/src/test/java/org/olat/core/util/filter/impl/AddBaseURLToMediaRelativeURLFilterTest.java
+++ b/src/test/java/org/olat/core/util/filter/impl/AddBaseURLToMediaRelativeURLFilterTest.java
@@ -24,8 +24,6 @@ import junit.framework.Assert;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 import org.olat.core.util.filter.Filter;
 import org.olat.core.util.filter.FilterFactory;
 
@@ -37,7 +35,6 @@ import org.olat.core.util.filter.FilterFactory;
  * Initial Date:  17.07.2009 <br>
  * @author gnaegi
  */
-@RunWith(JUnit4.class)
 public class AddBaseURLToMediaRelativeURLFilterTest {
 
 	protected Filter filter;
diff --git a/src/test/java/org/olat/course/assessment/AssessmentManagerTest.java b/src/test/java/org/olat/course/assessment/AssessmentManagerTest.java
index 554442b27a6..dce14e941d7 100644
--- a/src/test/java/org/olat/course/assessment/AssessmentManagerTest.java
+++ b/src/test/java/org/olat/course/assessment/AssessmentManagerTest.java
@@ -40,13 +40,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.IdentityEnvironment;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.course.CourseFactory;
 import org.olat.course.CourseModule;
@@ -72,7 +72,7 @@ import org.olat.test.OlatTestCase;
  */
 public class AssessmentManagerTest extends OlatTestCase  {
 	
-	private static Logger log = Logger.getLogger(AssessmentManagerTest.class.getName());
+	private static OLog log = Tracing.createLoggerFor(AssessmentManagerTest.class);
 	
 	private AssessmentManager assessmentManager;	
 	private ICourse course;
@@ -108,15 +108,6 @@ public class AssessmentManagerTest extends OlatTestCase  {
 		}
 	}
 	
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("tearDown failed: ", e);
-		}
-	}
-	
 	/**
 	 * Tests the AssessmentManager methods.
 	 *
diff --git a/src/test/java/org/olat/course/auditing/UserNodeAuditManagerTest.java b/src/test/java/org/olat/course/auditing/UserNodeAuditManagerTest.java
index 64cfcb8c75a..b20ca4cfe25 100644
--- a/src/test/java/org/olat/course/auditing/UserNodeAuditManagerTest.java
+++ b/src/test/java/org/olat/course/auditing/UserNodeAuditManagerTest.java
@@ -75,12 +75,7 @@ public class UserNodeAuditManagerTest extends OlatTestCase  {
 	public void tearDown() throws Exception {			
 		//remove demo course on file system
 		//FIXME: this does not remove all data from the database, see repositoryManger
-		CourseFactory.deleteCourse(course);		
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("tearDown failed: ", e);
-		}
+		CourseFactory.deleteCourse(course);
 	}
 	
 	/**
diff --git a/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java b/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
index a08dd79689c..34d0d5c4419 100644
--- a/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
+++ b/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
@@ -29,7 +29,6 @@ package org.olat.course.config;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DBFactory;
@@ -56,7 +55,6 @@ public class CourseConfigManagerImplTest extends OlatTestCase {
 	private static ICourse course1;
 
 	private static boolean isSetup = false;
-	private static boolean isTearDown = false;
 
 	
 	/**
@@ -102,22 +100,4 @@ public class CourseConfigManagerImplTest extends OlatTestCase {
 		VFSItem cc1File = CourseConfigManagerImpl.getConfigFile(course1);
 		assertFalse("CourseConfig file no longer exists.", cc1File != null);
 	}
-
-	/**
-	 * TearDown is called after each test.
-	 * 
-	 * @throws Exception
-	 */
-	@After
-	public void tearDown() throws Exception {
-		if (isTearDown) return;
-		try {
-			DBFactory.getInstance().closeSession();
-			isTearDown = true;
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-			e.printStackTrace();
-			throw e;
-		}
-	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/olat/course/groupsandrights/CourseGroupManagementTest.java b/src/test/java/org/olat/course/groupsandrights/CourseGroupManagementTest.java
index 403668d3d53..89f7dbbbbed 100644
--- a/src/test/java/org/olat/course/groupsandrights/CourseGroupManagementTest.java
+++ b/src/test/java/org/olat/course/groupsandrights/CourseGroupManagementTest.java
@@ -31,13 +31,13 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.area.BGArea;
@@ -57,7 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 public class CourseGroupManagementTest extends OlatTestCase {
 
-	private static Logger log = Logger.getLogger(CourseGroupManagementTest.class.getName());
+	private static OLog log = Tracing.createLoggerFor(CourseGroupManagementTest.class);
 	private Identity id1, id2, id3;
 	
 	@Autowired
@@ -83,16 +83,6 @@ public class CourseGroupManagementTest extends OlatTestCase {
 			log.error("Exception in setUp(): " + e);
 		}
 	}
-
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-			throw e;
-		}
-	}
 	
 	/** rights tests */
 	@Test
diff --git a/src/test/java/org/olat/course/nodes/projectbroker/ProjectBrokerManagerTest.java b/src/test/java/org/olat/course/nodes/projectbroker/ProjectBrokerManagerTest.java
index 90861e010c7..f5864cdc803 100644
--- a/src/test/java/org/olat/course/nodes/projectbroker/ProjectBrokerManagerTest.java
+++ b/src/test/java/org/olat/course/nodes/projectbroker/ProjectBrokerManagerTest.java
@@ -43,8 +43,6 @@ import java.util.UUID;
 
 import junit.framework.Assert;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.SecurityGroupImpl;
@@ -71,8 +69,7 @@ import org.olat.test.OlatTestCase;
  */
 
 public class ProjectBrokerManagerTest extends OlatTestCase {
-	//
-	private static Logger log = Logger.getLogger(ProjectBrokerManagerTest.class.getName());
+
 	/*
 	 * ::Test Setup::
 	 */
@@ -358,20 +355,5 @@ private Project createProject(String name, Identity creator, Long projectBrokerI
 	return project;
 }
 
-	/**
-	 * @see junit.framework.TestCase#tearDown()
-	 */
-	@After public void tearDown() throws Exception {
-// TODO: Does not cleanup Demo-course because other Test which use Demo-Course too, will be have failures
-//		ICourse course = CourseFactory.loadCourse(resourceableId);
-//		CourseFactory.deleteCourse(course);
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("tearDown failed: ", e);
-		}
-	}
-	
-
 }
 
diff --git a/src/test/java/org/olat/group/test/BGAreaManagerTest.java b/src/test/java/org/olat/group/test/BGAreaManagerTest.java
index fbc384bb66d..9ccacf44b15 100644
--- a/src/test/java/org/olat/group/test/BGAreaManagerTest.java
+++ b/src/test/java/org/olat/group/test/BGAreaManagerTest.java
@@ -40,7 +40,6 @@ import java.util.concurrent.TimeUnit;
 
 import junit.framework.Assert;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -91,16 +90,6 @@ public class BGAreaManagerTest extends OlatTestCase {
 			log.error("Exception in setUp(): " + e);
 		}
 	}
-
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-			throw e;
-		}
-	}
 	
 	@Test
 	public void testCreateLoadBGArea() {
diff --git a/src/test/java/org/olat/group/test/BGRightManagerTest.java b/src/test/java/org/olat/group/test/BGRightManagerTest.java
index 416b315d236..029d0fb9620 100644
--- a/src/test/java/org/olat/group/test/BGRightManagerTest.java
+++ b/src/test/java/org/olat/group/test/BGRightManagerTest.java
@@ -36,8 +36,6 @@ import java.util.UUID;
 
 import junit.framework.Assert;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -45,6 +43,8 @@ import org.olat.basesecurity.Policy;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.course.groupsandrights.CourseRights;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
@@ -64,7 +64,7 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 public class BGRightManagerTest extends OlatTestCase {
 
-	private static Logger log = Logger.getLogger(BGRightManagerTest.class.getName());
+	private static OLog log = Tracing.createLoggerFor(BGRightManagerTest.class);
 	private Identity id1, id2, id3, id4;
 
 	@Autowired
@@ -95,21 +95,6 @@ public class BGRightManagerTest extends OlatTestCase {
 		}
 	}
 
-	/**
-	 * TearDown is called after each test.
-	 * 
-	 * @throws Exception
-	 */
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-			throw e;
-		}
-	}
-
 	/**
 	 * Test if the add right doesn't generate errors
 	 */
diff --git a/src/test/java/org/olat/group/test/BusinessGroupDAOTest.java b/src/test/java/org/olat/group/test/BusinessGroupDAOTest.java
index e6ed4e77b50..c9cd6ff63ff 100644
--- a/src/test/java/org/olat/group/test/BusinessGroupDAOTest.java
+++ b/src/test/java/org/olat/group/test/BusinessGroupDAOTest.java
@@ -32,11 +32,9 @@ import java.util.UUID;
 
 import junit.framework.Assert;
 
-import org.junit.After;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.commons.persistence.PersistenceHelper;
 import org.olat.core.commons.services.mark.MarkManager;
 import org.olat.core.id.Identity;
@@ -84,16 +82,6 @@ public class BusinessGroupDAOTest extends OlatTestCase {
 	@Autowired
 	private MarkManager markManager;
 	
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().commitAndCloseSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-			throw e;
-		}
-	}
-	
 	@Test
 	public void should_service_present() {
 		Assert.assertNotNull(businessGroupDao);
diff --git a/src/test/java/org/olat/group/test/BusinessGroupRelationDAOTest.java b/src/test/java/org/olat/group/test/BusinessGroupRelationDAOTest.java
index 3dc759d3313..45eceb9dac9 100644
--- a/src/test/java/org/olat/group/test/BusinessGroupRelationDAOTest.java
+++ b/src/test/java/org/olat/group/test/BusinessGroupRelationDAOTest.java
@@ -25,11 +25,9 @@ import java.util.UUID;
 
 import junit.framework.Assert;
 
-import org.junit.After;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupShort;
@@ -59,15 +57,6 @@ public class BusinessGroupRelationDAOTest extends OlatTestCase {
 	@Autowired
 	private BaseSecurity securityManager;
 	
-	@After
-	public void shutdown() {
-		try {
-			DBFactory.getInstance().commitAndCloseSession();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-	
 	@Test
 	public void should_service_present() {
 		Assert.assertNotNull(businessGroupDao);
diff --git a/src/test/java/org/olat/group/test/BusinessGroupServiceTest.java b/src/test/java/org/olat/group/test/BusinessGroupServiceTest.java
index 9eade2339a3..3daafbd670a 100644
--- a/src/test/java/org/olat/group/test/BusinessGroupServiceTest.java
+++ b/src/test/java/org/olat/group/test/BusinessGroupServiceTest.java
@@ -31,7 +31,6 @@ import java.util.UUID;
 
 import junit.framework.Assert;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -41,7 +40,6 @@ import org.olat.basesecurity.SecurityGroupImpl;
 import org.olat.collaboration.CollaborationTools;
 import org.olat.collaboration.CollaborationToolsFactory;
 import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Roles;
 import org.olat.core.id.User;
@@ -176,16 +174,6 @@ public class BusinessGroupServiceTest extends OlatTestCase {
 			initialize = true;
 	}
 	
-	@After
-	public void tearDown() throws Exception {
-		try {
-			DBFactory.getInstance().commitAndCloseSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-			throw e;
-		}
-	}
-	
 	@Test
 	public void should_service_present() {
 		Assert.assertNotNull(businessGroupService);
diff --git a/src/test/java/org/olat/modules/fo/ForumManagerTest.java b/src/test/java/org/olat/modules/fo/ForumManagerTest.java
index 4d09c78de5b..de98ba2a21d 100644
--- a/src/test/java/org/olat/modules/fo/ForumManagerTest.java
+++ b/src/test/java/org/olat/modules/fo/ForumManagerTest.java
@@ -34,12 +34,11 @@ import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.olat.user.UserManager;
@@ -50,7 +49,7 @@ import org.olat.user.UserManager;
 
 public class ForumManagerTest extends OlatTestCase {
 
-	private static Logger log = Logger.getLogger(ForumManagerTest.class.getName()); 
+	private static OLog log = Tracing.createLoggerFor(ForumManagerTest.class); 
 
 	public Identity u1;
 	public Identity u2;
@@ -114,18 +113,9 @@ public class ForumManagerTest extends OlatTestCase {
 		 	log.error("Exception in setUp(): "+e);	
 		}
 	}
-
-	/**
-	 * TearDown is called after each test
-	 */
-	@After public void tearDown(){
-		try{
-			DBFactory.getInstance().closeSession();
-		}
-		catch(Exception e) {log.error("Exception in tearDown(): "+e);}
-	}
 	
-	@Test public void testGetMessagesByForumID() throws Exception {
+	@Test
+	public void testGetMessagesByForumID() throws Exception {
 		log.debug("Start testGetMessagesByForumID()");
 		
 		ForumManager foma = ForumManager.getInstance();
diff --git a/src/test/java/org/olat/modules/ims/cp/CPManagerTest.java b/src/test/java/org/olat/modules/ims/cp/CPManagerTest.java
index 5e270cdc6d8..359ca0dbef0 100644
--- a/src/test/java/org/olat/modules/ims/cp/CPManagerTest.java
+++ b/src/test/java/org/olat/modules/ims/cp/CPManagerTest.java
@@ -25,14 +25,16 @@
 */
 package org.olat.modules.ims.cp;
 
-import org.apache.log4j.Logger;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.core.util.vfs.VFSItem;
 import org.olat.core.util.vfs.VFSLeaf;
@@ -40,7 +42,6 @@ import org.olat.ims.cp.CPManager;
 import org.olat.ims.cp.ContentPackage;
 import org.olat.ims.cp.objects.CPItem;
 import org.olat.ims.cp.objects.CPOrganization;
-import org.olat.modules.fo.ForumManagerTest;
 import org.olat.test.OlatTestCase;
 
 /**
@@ -55,7 +56,7 @@ public class CPManagerTest extends OlatTestCase {
 
 	private static final String ITEM_ID = "this_is_a_great_inital_item_identifier";
 	private static final String PAGE_TITLE = "fancy page";
-	private static final Logger log = Logger.getLogger(ForumManagerTest.class.getName());
+	private static final OLog log = Tracing.createLoggerFor(CPManagerTest.class);
 	private CPManager mgr = null;
 	private ContentPackage cp;
 
@@ -79,11 +80,6 @@ public class CPManagerTest extends OlatTestCase {
 	@After
 	public void tearDown() {
 		cp.getRootDir().delete();
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-		}
 	}
 	
 	@Test
diff --git a/src/test/java/org/olat/modules/wiki/WikiUnitTest.java b/src/test/java/org/olat/modules/wiki/WikiUnitTest.java
index 0b000b7d853..6b58228f8f4 100644
--- a/src/test/java/org/olat/modules/wiki/WikiUnitTest.java
+++ b/src/test/java/org/olat/modules/wiki/WikiUnitTest.java
@@ -31,10 +31,7 @@ import static org.junit.Assert.assertNotNull;
 
 import java.util.List;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.OLATResourceable;
 import org.olat.modules.wiki.versioning.ChangeInfo;
 import org.olat.test.OlatTestCase;
@@ -50,10 +47,8 @@ import org.olat.test.OlatTestCase;
 public class WikiUnitTest extends OlatTestCase {
 	private static final String WIKI_CONTENT = "==heading==\n'''bold'''\n[[Image:test.jpg|bla]]";
 
-
-	@Before public void setup() throws Exception {/***/}
-
-	@Test public void testWikiStuff() {
+	@Test
+	public void testWikiStuff() {
 		WikiManager wikiMgr = WikiManager.getInstance();
 		OLATResourceable ores = wikiMgr.createWiki();
 		Wiki wiki = wikiMgr.getOrLoadWiki(ores);
@@ -98,9 +93,4 @@ public class WikiUnitTest extends OlatTestCase {
 		//clean up
 		wikiMgr.deleteWiki(ores);
 	}
-	
-	@After public void tearDown() throws Exception {
-		DBFactory.getInstance().closeSession();
-	}
-
 }
diff --git a/src/test/java/org/olat/modules/wiki/versioning/diff/CookbookDiffTest.java b/src/test/java/org/olat/modules/wiki/versioning/diff/CookbookDiffTest.java
index 6a91a1e2358..e988f8762e3 100644
--- a/src/test/java/org/olat/modules/wiki/versioning/diff/CookbookDiffTest.java
+++ b/src/test/java/org/olat/modules/wiki/versioning/diff/CookbookDiffTest.java
@@ -31,7 +31,6 @@ import static org.junit.Assert.assertEquals;
 import java.util.Iterator;
 import java.util.List;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.modules.wiki.versioning.ChangeInfo;
@@ -45,14 +44,13 @@ public class CookbookDiffTest {
 
 	private CookbookDifferenceService differenceService;
 
-
-	@Before public void setup() throws Exception {
+	@Before
+	public void setup() {
 		differenceService = new CookbookDifferenceService();
 	}
 
-	@After public void tearDown() throws Exception {}
-
-	@Test public void testAddText() {
+	@Test
+	public void testAddText() {
 		String text1 = "Line1\nLine2\nDies ist ein Text.";
 		String text2 = text1 + "Text2";
 		List<ChangeInfo> diffList = differenceService.diff(text1,text2);
diff --git a/src/test/java/org/olat/note/NoteTest.java b/src/test/java/org/olat/note/NoteTest.java
index 8bd8976695c..3bea20ac374 100644
--- a/src/test/java/org/olat/note/NoteTest.java
+++ b/src/test/java/org/olat/note/NoteTest.java
@@ -32,13 +32,13 @@ import static org.junit.Assert.assertTrue;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.resource.OLATResourceManager;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
@@ -55,7 +55,7 @@ public class NoteTest extends OlatTestCase implements OLATResourceable {
 
 	private long RESOURCE_ID = 42;
 	private String RESOURCE_TYPE = "org.olat.note.NoteTest";
-	private static Logger log = Logger.getLogger(NoteTest.class);
+	private static OLog log = Tracing.createLoggerFor(NoteTest.class);
 	private static boolean isInitialized = false;
 	private static Identity identity = null;
 	private static org.olat.resource.OLATResource res = null;
@@ -65,7 +65,8 @@ public class NoteTest extends OlatTestCase implements OLATResourceable {
 	/**
 	 * @see junit.framework.TestCase#setUp()
 	 */
-	@Before public void setup() {
+	@Before
+	public void setup() {
 		if (NoteTest.isInitialized == false) {
 			try {
 				nm = NoteManager.getInstance();
@@ -83,23 +84,9 @@ public class NoteTest extends OlatTestCase implements OLATResourceable {
 			}
 		}
 	}
-	
-	/**
-	 * @see junit.framework.TestCase#tearDown()
-	 */
-	@After public void tearDown() {
-		try {
-			DBFactory.getInstance().closeSession();
-		} catch (Exception e) {
-			log.error("tearDown failed: ", e);
-		}
-	}
 
-	/**
-	 * 
-	 *
-	 */
-	@Test public void testGenericLoadDeleteNote() {
+	@Test
+	public void testGenericLoadDeleteNote() {
 	    Long resourceTypeId = res.getResourceableId(); 
 	    String resourceTypeName = res.getResourceableTypeName();
 	    Note n = nm.loadNoteOrCreateInRAM(identity, resourceTypeName, resourceTypeId);
diff --git a/src/test/java/org/olat/portfolio/EPArtefactManagerTest.java b/src/test/java/org/olat/portfolio/EPArtefactManagerTest.java
index 83f93bae358..fa396fce038 100644
--- a/src/test/java/org/olat/portfolio/EPArtefactManagerTest.java
+++ b/src/test/java/org/olat/portfolio/EPArtefactManagerTest.java
@@ -29,7 +29,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DB;
@@ -83,11 +82,6 @@ public class EPArtefactManagerTest extends OlatTestCase {
 		}
 	}
 	
-	@After
-	public void tearDown() {
-		dbInstance.commitAndCloseSession();
-	}
-	
 	@Test
 	public void testManagers() {
 		assertNotNull(dbInstance);
diff --git a/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java b/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
index 120dcc82c26..ecb30bd58c8 100644
--- a/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
+++ b/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
@@ -29,7 +29,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -107,11 +106,6 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		}
 	}
 	
-	@After
-	public void tearDown() {
-		dbInstance.commitAndCloseSession();
-	}
-	
 	@Test
 	public void testManagers() {
 		assertNotNull(dbInstance);
diff --git a/src/test/java/org/olat/portfolio/EPStructureManagerTest.java b/src/test/java/org/olat/portfolio/EPStructureManagerTest.java
index de712f228f3..5488d0a6cb1 100644
--- a/src/test/java/org/olat/portfolio/EPStructureManagerTest.java
+++ b/src/test/java/org/olat/portfolio/EPStructureManagerTest.java
@@ -30,7 +30,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -96,18 +95,12 @@ public class EPStructureManagerTest extends OlatTestCase {
 		}
 	}
 	
-	@After
-	public void tearDown() {
-		dbInstance.commitAndCloseSession();
-	}
-	
 	@Test
 	public void testManagers() {
 		assertNotNull(dbInstance);
 		assertNotNull(epStructureManager);
 	}
 	
-	
 	@Test
 	public void testGetStructureElementsForUser(){
 		PortfolioStructure el = epFrontendManager.createAndPersistPortfolioDefaultMap(ident1, "users-test-map", "a-map-to-test-get-afterwards");
diff --git a/src/test/java/org/olat/portfolio/EPStructureToArtefactTest.java b/src/test/java/org/olat/portfolio/EPStructureToArtefactTest.java
index 987da16a15b..7b67a65425b 100644
--- a/src/test/java/org/olat/portfolio/EPStructureToArtefactTest.java
+++ b/src/test/java/org/olat/portfolio/EPStructureToArtefactTest.java
@@ -30,7 +30,6 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DB;
@@ -76,11 +75,6 @@ public class EPStructureToArtefactTest extends OlatTestCase {
 		}
 	}
 	
-	@After
-	public void tearDown() {
-		dbInstance.commitAndCloseSession();
-	}
-	
 	@Test
 	public void createStructureToArtefactLink() {
 		//create structure element
diff --git a/src/test/java/org/olat/properties/PropertyTest.java b/src/test/java/org/olat/properties/PropertyTest.java
index 8e1da8eea56..75bab137531 100644
--- a/src/test/java/org/olat/properties/PropertyTest.java
+++ b/src/test/java/org/olat/properties/PropertyTest.java
@@ -38,7 +38,6 @@ import java.util.UUID;
 
 import junit.framework.Assert;
 
-import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
@@ -61,10 +60,7 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 public class PropertyTest extends OlatTestCase {
 
-	private static OLog log = Tracing.createLoggerFor(PropertyTest.class);
-	private static Identity identity, id2, id3, id4 ;
-	private static BusinessGroup group = null;
-	private static OLATResource res;
+	private static final OLog log = Tracing.createLoggerFor(PropertyTest.class);
 
 	@Autowired
 	private DB dbInstance;
@@ -72,35 +68,18 @@ public class PropertyTest extends OlatTestCase {
 	private PropertyManager pm;
 	@Autowired
 	private BusinessGroupService businessGroupService;
-
-	/**
-	 * @see junit.framework.TestCase#setUp()
-	 */
-	@Before
-	public void setup() {
-		if(res == null) {
-			// identity with null User should be ok for test case
-			identity = JunitTestHelper.createAndPersistIdentityAsUser("foo-" + UUID.randomUUID().toString());
-			id2 = JunitTestHelper.createAndPersistIdentityAsUser("eis-" + UUID.randomUUID().toString());
-			id3 = JunitTestHelper.createAndPersistIdentityAsUser("zwoi-" + UUID.randomUUID().toString());
-			id4 = JunitTestHelper.createAndPersistIdentityAsUser("drp-" + UUID.randomUUID().toString());
-			res = JunitTestHelper.createRandomResource();
-	
-			List<BusinessGroup> l = businessGroupService.findBusinessGroupsOwnedBy(identity, null);
-			if (l.size() == 0) {
-				group = businessGroupService.createBusinessGroup(identity, "a buddygroup", "a desc", -1, -1, false, false, null);
-			} else {
-				group =  (BusinessGroup)l.get(0);
-			}
-		}
-	}
 	
 	/**
 	 * testGenericInsertFindDelete
 	 */
 	@Test
 	public void testGenericInsertFindDelete() {
+		//create resource, identity and group
 		OLATResource ores = JunitTestHelper.createRandomResource();
+		Identity identity = JunitTestHelper.createAndPersistIdentityAsUser("prop-1-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(identity, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+		
 		Property p = pm.createPropertyInstance(identity, group, ores, "catgeneric", "TestProperty", new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
 		dbInstance.commitAndCloseSession();
@@ -119,8 +98,11 @@ public class PropertyTest extends OlatTestCase {
 	
 	@Test
 	public void testFindWithResourceIdList() {
-		//create a property
+		//create resource, identity
 		OLATResource ores = JunitTestHelper.createRandomResource();
+		Identity identity = JunitTestHelper.createAndPersistIdentityAsUser("prop-2-" + UUID.randomUUID().toString());
+		dbInstance.commitAndCloseSession();
+		//create the property
 		Property p = pm.createPropertyInstance(identity, null, ores, "catidlist", "TestProperty", new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
 		dbInstance.commitAndCloseSession();
@@ -142,7 +124,7 @@ public class PropertyTest extends OlatTestCase {
 	
 	@Test
 	public void testFindWithIdentityList() {
-		//create a property
+		//create identities, resource and properties
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsUser("cat-id-1-" + UUID.randomUUID().toString());
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsUser("cat-id-2-" + UUID.randomUUID().toString());
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsUser("cat-id-3-" + UUID.randomUUID().toString());
@@ -177,7 +159,13 @@ public class PropertyTest extends OlatTestCase {
 	 */
 	@Test
 	public void testGetAllResourceTypeNames() {
+		//create resource, identity and group
 		OLATResource ores = JunitTestHelper.createRandomResource();
+		Identity identity = JunitTestHelper.createAndPersistIdentityAsUser("prop-3-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(identity, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+		
+		//create a property
 		Property p = pm.createPropertyInstance(identity, group, ores, "catall", "TestProperty", new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
 		dbInstance.commitAndCloseSession();
@@ -191,8 +179,13 @@ public class PropertyTest extends OlatTestCase {
 	 * testListProperties
 	 */
 	@Test
-	public void testListProperties(){
+	public void testListProperties() {
+		//create resource, identity and group
 		OLATResource ores = JunitTestHelper.createRandomResource();
+		Identity identity = JunitTestHelper.createAndPersistIdentityAsUser("prop-4-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(identity, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+		
 		Property p = pm.createPropertyInstance(identity, group, ores, "cat", "TestProperty", new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
 		
@@ -210,6 +203,7 @@ public class PropertyTest extends OlatTestCase {
 	 */
 	@Test
 	public void testUserInsertFindDelete() {
+		//create identity and property
 		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("user-prop-" + UUID.randomUUID().toString());
 		Property p = pm.createUserPropertyInstance(id, "catuser", "TestProperty", new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
@@ -224,11 +218,12 @@ public class PropertyTest extends OlatTestCase {
 		pm.deleteProperty(p);
 		p = pm.findUserProperty(id, "catuser", "TestProperty");
 		assertNull(p);
+		dbInstance.commitAndCloseSession();
 	}
 	
 	@Test
 	public void testDeleteUserData() {
-		//create some properties
+		//create some identities and properties
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsUser("del-user-1-" + UUID.randomUUID().toString());
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsUser("del-user-2-" + UUID.randomUUID().toString());
 		Property p10 = pm.createPropertyInstance(id1, null, null, "prop-del-1", "TestProperty", new Float(1.1), new Long(123456), "stringValue", "textValue");
@@ -241,6 +236,7 @@ public class PropertyTest extends OlatTestCase {
 		
 		//delete user 1 datas
 		pm.deleteUserData(id1, "del-" + id1.getName());
+		dbInstance.commitAndCloseSession();
 		
 		//check if really deleted
 		Property p10x = pm.findUserProperty(id1, "prop-del-1", "TestProperty");
@@ -259,7 +255,12 @@ public class PropertyTest extends OlatTestCase {
 	 */
 	@Test
 	public void testPerf500Properties() {
-		
+		//create identity, group and resource
+		OLATResource res = JunitTestHelper.createRandomResource();
+		Identity identity = JunitTestHelper.createAndPersistIdentityAsUser("prop-5-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(identity, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+
 
 		long start, stop;
 		long count = 500;
@@ -270,7 +271,7 @@ public class PropertyTest extends OlatTestCase {
 		log.info("CREATE generic property test started...");
 		start = System.currentTimeMillis();
 		for (int i = 0; i < count; i++) {
-			Property p = pm.createPropertyInstance(identity, group, res, "cat", "TestProperty" + i, new Float(1.1), new Long(123456), "stringValue", "textValue");
+			Property p = pm.createPropertyInstance(identity, group, res, "perf500", "TestProperty" + i, new Float(1.1), new Long(123456), "stringValue", "textValue");
 			pm.saveProperty(p);
 			
 			if(i % 50 == 0) {
@@ -282,7 +283,7 @@ public class PropertyTest extends OlatTestCase {
 		stop = System.currentTimeMillis();
 		log.info("CREATE generic property test: " + (stop-start) + " ms (" + (count * 1000 / (stop-start)) + "/sec)");
 		// some find identitites tests
-		List<Identity> ids = pm.findIdentitiesWithProperty(null, null, "cat", "TestProperty", false);
+		List<Identity> ids = pm.findIdentitiesWithProperty(null, null, "perf500", null, false);
 		Assert.assertNotNull("Identities cannot be null", ids);
 		Assert.assertFalse("Identities cannot be empty", ids.isEmpty());
 		Assert.assertTrue("Identities must contains reference identity", ids.contains(identity));
@@ -291,7 +292,7 @@ public class PropertyTest extends OlatTestCase {
 		log.info("Preparing user/group properties test. Creating additional properties..");
 		start = System.currentTimeMillis();
 		for (int i = 0; i < count; i++) {
-			Property pUser = pm.createUserPropertyInstance(identity, "cat", "TestProperty" + i, new Float(1.1), new Long(123456), "stringValue", "textValue");
+			Property pUser = pm.createUserPropertyInstance(identity, "perf500", "TestProperty" + i, new Float(1.1), new Long(123456), "stringValue", "textValue");
 			pm.saveProperty(pUser);
 			if(i % 50 == 0) {
 				dbInstance.commitAndCloseSession();
@@ -307,7 +308,7 @@ public class PropertyTest extends OlatTestCase {
 		log.info("FIND generic property test started...");
 		start = System.currentTimeMillis();
 		for (int i = 0; i < count; i++) {
-			Property p = pm.findProperty(identity, group, res, "cat", "TestProperty" + i);
+			Property p = pm.findProperty(identity, group, res, "perf500", "TestProperty" + i);
 			assertNotNull("Must find the p (count=" + i + ")", p);
 			dbInstance.commitAndCloseSession();
 		}
@@ -318,7 +319,7 @@ public class PropertyTest extends OlatTestCase {
 		log.info("FIND user property test started...");
 		start = System.currentTimeMillis();
 		for (int i = 0; i < count; i++) {
-			Property p = pm.findUserProperty(identity, "cat", "TestProperty" + i);
+			Property p = pm.findUserProperty(identity, "perf500", "TestProperty" + i);
 			assertNotNull("Must find the p (count=" + i + ")", p);
 			dbInstance.commitAndCloseSession();
 		}
@@ -329,7 +330,7 @@ public class PropertyTest extends OlatTestCase {
 		log.info("FIND and DELETE generic property test started...");
 		start = System.currentTimeMillis();
 		for (int i = 0; i < count; i++) {
-			Property p = pm.findUserProperty(identity, "cat", "TestProperty" + i);
+			Property p = pm.findUserProperty(identity, "perf500", "TestProperty" + i);
 			pm.deleteProperty(p);
 		}
 		stop = System.currentTimeMillis();
@@ -346,6 +347,13 @@ public class PropertyTest extends OlatTestCase {
 	 */
 	@Test
 	public void testFloatValues() {
+		//create identity, group and resource
+		OLATResource res = JunitTestHelper.createRandomResource();
+		Identity identity = JunitTestHelper.createAndPersistIdentityAsUser("prop-6-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(identity, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+		
+		
 	  Property original, copy;
 	  //gs:changed to FLOAT(65,30) to be compatible with hsqldb and auto generated ddl
 	  // Define my own MAX float value because the db precision changed from DECIMAL(78,36) to DECIMAL(65,30)   
@@ -418,9 +426,18 @@ public class PropertyTest extends OlatTestCase {
 	
 	@Test
 	public void testFindIdentities() {
+		//create identities, group and resource
+		OLATResource res = JunitTestHelper.createRandomResource();
+		Identity id1 = JunitTestHelper.createAndPersistIdentityAsUser("prop-7-" + UUID.randomUUID().toString());
+		Identity id2 = JunitTestHelper.createAndPersistIdentityAsUser("prop-10-" + UUID.randomUUID().toString());
+		Identity id3 = JunitTestHelper.createAndPersistIdentityAsUser("prop-11-" + UUID.randomUUID().toString());
+		Identity id4 = JunitTestHelper.createAndPersistIdentityAsUser("prop-12-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(id1, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+
 		String propName = UUID.randomUUID().toString();
 		
-		Property p = pm.createPropertyInstance(identity, group, res, "cat", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
+		Property p = pm.createPropertyInstance(id1, group, res, "cat", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
 		p = pm.createPropertyInstance(id2, group, res, "cat", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
@@ -428,7 +445,7 @@ public class PropertyTest extends OlatTestCase {
 		pm.saveProperty(p);
 		p = pm.createPropertyInstance(id4, group, res, "cat", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
-		p = pm.createPropertyInstance(identity, group, res, "cat2", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
+		p = pm.createPropertyInstance(id1, group, res, "cat2", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
 		p = pm.createPropertyInstance(id2, group, res, "cat2", propName, new Float(1.1), new Long(123456), "stringValue", "textValue");
 		pm.saveProperty(p);
@@ -453,18 +470,25 @@ public class PropertyTest extends OlatTestCase {
 	
 	@Test
 	public void testFindProperties() {
+		//create identities, group and resource
+		OLATResource res = JunitTestHelper.createRandomResource();
+		Identity id1 = JunitTestHelper.createAndPersistIdentityAsUser("prop-8-" + UUID.randomUUID().toString());
+		Identity id2 = JunitTestHelper.createAndPersistIdentityAsUser("prop-9-" + UUID.randomUUID().toString());
+		BusinessGroup group = businessGroupService.createBusinessGroup(id1, "a buddygroup", "a desc", -1, -1, false, false, null);
+		dbInstance.commitAndCloseSession();
+		
 		String category = "cat3";
 		String propertyName = "TestProperty3";
 		String textValue = "textValue3";
-		Property p = pm.createPropertyInstance(identity, group, res, category, propertyName, new Float(1.1), new Long(123456), "stringValue", textValue);
+		Property p = pm.createPropertyInstance(id1, group, res, category, propertyName, new Float(1.1), new Long(123456), "stringValue", textValue);
 		pm.saveProperty(p);
 		p = pm.createPropertyInstance(id2, group, res, category, propertyName, new Float(1.1), new Long(123456), "stringValue", textValue);
 		pm.saveProperty(p);
-		List<Property> propertyList = pm.findProperties(identity, group, res.getResourceableTypeName(), res.getResourceableId(), category, propertyName);
+		List<Property> propertyList = pm.findProperties(id1, group, res.getResourceableTypeName(), res.getResourceableId(), category, propertyName);
 		assertEquals(1, propertyList.size());
 		assertEquals(propertyName, ((Property)propertyList.get(0)).getName() );
 		assertEquals(textValue,    ((Property)propertyList.get(0)).getTextValue() );
-		int deletedCount1 = pm.deleteProperties(identity, group, res, category, propertyName);
+		int deletedCount1 = pm.deleteProperties(id1, group, res, category, propertyName);
 		Assert.assertEquals(1, deletedCount1);
 		int deletedCount2 = pm.deleteProperties(id2, group, res, category, propertyName);
 		Assert.assertEquals(1, deletedCount2);
diff --git a/src/test/java/org/olat/registration/RegistrationManagerTest.java b/src/test/java/org/olat/registration/RegistrationManagerTest.java
index bf3098682a0..b930c3ab5c3 100644
--- a/src/test/java/org/olat/registration/RegistrationManagerTest.java
+++ b/src/test/java/org/olat/registration/RegistrationManagerTest.java
@@ -27,13 +27,12 @@
 package org.olat.registration;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.test.OlatTestCase;
@@ -174,12 +173,4 @@ public class RegistrationManagerTest extends OlatTestCase {
 		assertFalse(registrationManager.validateEmailUsername("aoi@cyberia.ch"));
 		assertTrue(registrationManager.validateEmailUsername("aoi@blog.cyberiacafe.ch"));
 	}
-
-	/* (non-Javadoc)
-	 * @see junit.framework.TestCase#tearDown()
-	 */
-	@After public void tearDown() throws Exception {
-		DBFactory.getInstance().closeSession();
-	}
-
 }
diff --git a/src/test/java/org/olat/repository/RepositoryManagerConcurrentTest.java b/src/test/java/org/olat/repository/RepositoryManagerConcurrentTest.java
index 973a4bfeddb..02d0730de93 100644
--- a/src/test/java/org/olat/repository/RepositoryManagerConcurrentTest.java
+++ b/src/test/java/org/olat/repository/RepositoryManagerConcurrentTest.java
@@ -86,7 +86,6 @@ public class RepositoryManagerConcurrentTest extends OlatTestCase {
 	@After public void tearDown() {
 		try {
 			JMSCodePointServerJunitHelper.stopServer();
-			DBFactory.getInstance().closeSession();
 		} catch (Exception e) {
 			log.error("tearDown failed", e);
 		}
diff --git a/src/test/java/org/olat/repository/RepositoryManagerTest.java b/src/test/java/org/olat/repository/RepositoryManagerTest.java
index 48eb8259b13..0f3cc78c852 100644
--- a/src/test/java/org/olat/repository/RepositoryManagerTest.java
+++ b/src/test/java/org/olat/repository/RepositoryManagerTest.java
@@ -104,7 +104,6 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@After public void tearDown() {
 		try {
 			JMSCodePointServerJunitHelper.stopServer();
-			DBFactory.getInstance().closeSession();
 		} catch (Exception e) {
 			log.error("tearDown failed", e);
 		}
diff --git a/src/test/java/org/olat/resource/OLATResourceManagerTest.java b/src/test/java/org/olat/resource/OLATResourceManagerTest.java
index fba636d791b..4e85d9ccb11 100644
--- a/src/test/java/org/olat/resource/OLATResourceManagerTest.java
+++ b/src/test/java/org/olat/resource/OLATResourceManagerTest.java
@@ -248,7 +248,6 @@ public class OLATResourceManagerTest extends OlatTestCase implements OLATResourc
 	 */
 	@After public void tearDown() throws Exception {
 		JMSCodePointServerJunitHelper.stopServer();
-		DBFactory.getInstance().closeSession();
 	}
 
 
diff --git a/src/test/java/org/olat/resource/accesscontrol/ACOrderManagerTest.java b/src/test/java/org/olat/resource/accesscontrol/ACOrderManagerTest.java
index 39eced03619..bbf5d697c2b 100644
--- a/src/test/java/org/olat/resource/accesscontrol/ACOrderManagerTest.java
+++ b/src/test/java/org/olat/resource/accesscontrol/ACOrderManagerTest.java
@@ -28,7 +28,6 @@ import java.math.BigDecimal;
 import java.util.List;
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DB;
@@ -102,11 +101,6 @@ public class ACOrderManagerTest extends OlatTestCase {
 		}
 	}
 	
-	@After
-	public void tearDown() {
-		dbInstance.commitAndCloseSession();
-	}
-	
 	@Test
 	public void testManagers() {
 		assertNotNull(acOfferManager);
diff --git a/src/test/java/org/olat/resource/accesscontrol/ACTransactionManagerTest.java b/src/test/java/org/olat/resource/accesscontrol/ACTransactionManagerTest.java
index dcb04bb3211..17ceae2de03 100644
--- a/src/test/java/org/olat/resource/accesscontrol/ACTransactionManagerTest.java
+++ b/src/test/java/org/olat/resource/accesscontrol/ACTransactionManagerTest.java
@@ -27,7 +27,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DB;
@@ -92,11 +91,6 @@ public class ACTransactionManagerTest extends OlatTestCase {
 		}
 	}
 	
-	@After
-	public void tearDown() {
-		dbInstance.commitAndCloseSession();
-	}
-	
 	@Test
 	public void testManagers() {
 		assertNotNull(acOfferManager);
diff --git a/src/test/java/org/olat/restapi/CatalogTest.java b/src/test/java/org/olat/restapi/CatalogTest.java
index 7de4baf7ff3..9f33e1d515c 100644
--- a/src/test/java/org/olat/restapi/CatalogTest.java
+++ b/src/test/java/org/olat/restapi/CatalogTest.java
@@ -48,7 +48,6 @@ import org.apache.http.client.methods.HttpPut;
 import org.apache.http.message.BasicNameValuePair;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.type.TypeReference;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -148,12 +147,7 @@ public class CatalogTest extends OlatJerseyTestCase {
 		
 		DBFactory.getInstance().intermediateCommit();
 	}
-	
-	@After
-	public void tearDown() throws Exception {
-		DBFactory.getInstance().closeSession();
-	}
-	
+
 	@Test
 	public void testGetRoots() throws IOException, URISyntaxException {
 		RestConnection conn = new RestConnection();
diff --git a/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java b/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java
index 2428751ec16..8e571120d35 100644
--- a/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java
+++ b/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java
@@ -55,7 +55,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.logging.OLog;
@@ -149,7 +148,6 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
 			if(conn != null) {
 				conn.shutdown();
 			}
-      DBFactory.getInstance().closeSession();
 		} catch (Exception e) {
 			log.error("Exception in tearDown(): " + e);
       throw e;
diff --git a/src/test/java/org/olat/restapi/GroupMgmtTest.java b/src/test/java/org/olat/restapi/GroupMgmtTest.java
index 7c298500fd1..6bb98378e8e 100644
--- a/src/test/java/org/olat/restapi/GroupMgmtTest.java
+++ b/src/test/java/org/olat/restapi/GroupMgmtTest.java
@@ -253,7 +253,6 @@ public class GroupMgmtTest extends OlatJerseyTestCase {
 			if(conn != null) {
 				conn.shutdown();
 			}
-      DBFactory.getInstance().closeSession();
 		} catch (Exception e) {
 			log.error("Exception in tearDown(): " + e);
       e.printStackTrace();
diff --git a/src/test/java/org/olat/restapi/RepositoryEntriesTest.java b/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
index e3f4017a492..c735321dd73 100644
--- a/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
+++ b/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
@@ -53,7 +53,6 @@ import org.apache.http.entity.ContentType;
 import org.apache.http.entity.mime.HttpMultipartMode;
 import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.util.EntityUtils;
-import org.apache.log4j.Logger;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.type.TypeReference;
 import org.junit.Assert;
@@ -64,6 +63,8 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Roles;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.resource.OLATResource;
@@ -82,6 +83,8 @@ import org.springframework.beans.factory.annotation.Autowired;
  * @author srosse, stephane.rosse@frentix.com, http:
  */
 public class RepositoryEntriesTest extends OlatJerseyTestCase {
+	
+	private static final OLog log = Tracing.createLoggerFor(RepositoryEntriesTest.class);
 
 	@Autowired
 	private BaseSecurity securityManager;
@@ -307,7 +310,6 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 	
 	@Test
 	public void testImportTest() throws IOException, URISyntaxException {
-		Logger log = Logger.getLogger(getClass().getName());
 		URL cpUrl = RepositoryEntriesTest.class.getResource("qti-demo.zip");
 		assertNotNull(cpUrl);
 		File cp = new File(cpUrl.toURI());
@@ -344,7 +346,6 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 	
 	@Test
 	public void testImportQuestionnaire() throws IOException, URISyntaxException {
-		Logger log = Logger.getLogger(getClass().getName());
 		URL cpUrl = RepositoryEntriesTest.class.getResource("questionnaire-demo.zip");
 		assertNotNull(cpUrl);
 		File cp = new File(cpUrl.toURI());
@@ -381,7 +382,6 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 	
 	@Test
 	public void testImportWiki() throws IOException, URISyntaxException {
-		Logger log = Logger.getLogger(getClass().getName());
 		URL cpUrl = RepositoryEntriesTest.class.getResource("wiki-demo.zip");
 		assertNotNull(cpUrl);
 		File cp = new File(cpUrl.toURI());
@@ -417,7 +417,6 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 	
 	@Test
 	public void testImportBlog() throws IOException, URISyntaxException {
-		Logger log = Logger.getLogger(getClass().getName());
 		URL cpUrl = RepositoryEntriesTest.class.getResource("blog-demo.zip");
 		assertNotNull(cpUrl);
 		File cp = new File(cpUrl.toURI());
diff --git a/src/test/java/org/olat/restapi/UserMgmtTest.java b/src/test/java/org/olat/restapi/UserMgmtTest.java
index 50108dddff3..5935a2aeda3 100644
--- a/src/test/java/org/olat/restapi/UserMgmtTest.java
+++ b/src/test/java/org/olat/restapi/UserMgmtTest.java
@@ -60,7 +60,6 @@ import org.apache.http.client.methods.HttpPut;
 import org.apache.http.util.EntityUtils;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.type.TypeReference;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
@@ -279,16 +278,6 @@ public class UserMgmtTest extends OlatJerseyTestCase {
 		dbInstance.commitAndCloseSession();
 		setuped = true;
 	}
-	
-  @After
-	public void tearDown() throws Exception {
-		try {
-      dbInstance.closeSession();
-		} catch (Exception e) {
-      e.printStackTrace();
-      throw e;
-		}
-	}
 
 	@Test
 	public void testGetUsers() throws IOException, URISyntaxException {
diff --git a/src/test/java/org/olat/search/service/document/file/FileDocumentFactoryTest.java b/src/test/java/org/olat/search/service/document/file/FileDocumentFactoryTest.java
index 7e88352a487..8ef724ff0be 100644
--- a/src/test/java/org/olat/search/service/document/file/FileDocumentFactoryTest.java
+++ b/src/test/java/org/olat/search/service/document/file/FileDocumentFactoryTest.java
@@ -35,15 +35,11 @@ import java.io.IOException;
 import java.net.URISyntaxException;
 import java.net.URL;
 
-import org.apache.log4j.Logger;
 import org.apache.lucene.document.Document;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl;
 import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl;
-import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.core.util.vfs.LocalFileImpl;
@@ -59,7 +55,6 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 public class FileDocumentFactoryTest extends OlatTestCase {
 
-	private static Logger log = Logger.getLogger(FileDocumentFactoryTest.class.getName());
 	// variables for test fixture
 	
 	@Autowired
@@ -69,23 +64,11 @@ public class FileDocumentFactoryTest extends OlatTestCase {
 	/**
 	 * @see junit.framework.TestCase#setUp()
 	 */
-	@Before public void setup()throws Exception {
+	@Before
+	public void setup()throws Exception {
 		//clear database from errors
 		rootPath = "/search_junit_test_folder";
 	}
-
-	/**
-	 * TearDown is called after each test
-	 */
-	@After public void tearDown() {
-		try {
-			DB db = DBFactory.getInstance();
-			db.closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-		}
-	}
-	
 	
 	@Test public void testIsFileSupported() {
 		assertTrue("html must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.html"))));
diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java
index ab4c0ef7f16..7235870dcb1 100644
--- a/src/test/java/org/olat/test/AllTestsJunit4.java
+++ b/src/test/java/org/olat/test/AllTestsJunit4.java
@@ -120,7 +120,6 @@ import org.junit.runners.Suite;
 	org.olat.search.service.document.file.FileDocumentFactoryTest.class,
 	org.olat.search.service.document.file.PDFDocumentTest.class,
 	org.olat.search.service.document.file.OfficeDocumentTest.class,
-	org.olat.catalog.CatalogManagerTest.class,//ok
 	org.olat.notifications.NotificationsManagerTest.class,//fail
 	org.olat.registration.RegistrationManagerTest.class,//ok
 	org.olat.course.nodes.projectbroker.ProjectBrokerManagerTest.class,
diff --git a/src/test/java/org/olat/user/EmailCheckPerformanceTest.java b/src/test/java/org/olat/user/EmailCheckPerformanceTest.java
index ef181f9be2e..2f5423c09d9 100644
--- a/src/test/java/org/olat/user/EmailCheckPerformanceTest.java
+++ b/src/test/java/org/olat/user/EmailCheckPerformanceTest.java
@@ -22,14 +22,12 @@ package org.olat.user;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.AuthHelper;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityManager;
 import org.olat.basesecurity.Constants;
-import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.User;
@@ -56,38 +54,11 @@ public class EmailCheckPerformanceTest extends OlatTestCase {
 	/**
 	 * @see junit.framework.TestCase#setUp()
 	 */
-	@Before public void setup()throws Exception {
+	@Before
+	public void setup()throws Exception {
 			createUsers();
 	}
 
-	/**
-	 * TearDown is called after each test
-	 */
-	@After public void tearDown() {
-		try {
-			DB db = DBFactory.getInstance();
-			db.closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-		}
-	}
-
-	
-	
-//	@Test public void testExistEmailAddress() throws Exception {
-//		System.out.println("testExistEmailAddress...");
-//		int MAX_LOOP = 100;
-//		long startTime = System.currentTimeMillis();
-//		for (int i = 0; i<MAX_LOOP; i++) {
-//			boolean test = ManagerFactory.getManager().existEmailAddress("test_" + i + "@test.ti");
-//			if (test == true) {
-//				System.out.println("TEST EMAIL EXIST 1");
-//			}
-//		}
-//		long endTime = System.currentTimeMillis();
-//		testExistEmailAddressTime = (endTime - startTime);
-//		log.info("testExistEmailAddress takes time=" + (endTime - startTime) );	
-//	}
 
 	@Test public void testUserManger() throws Exception {
 		System.out.println("testUserManger start...");
diff --git a/src/test/java/org/olat/user/UserPropertiesPerformanceTest.java b/src/test/java/org/olat/user/UserPropertiesPerformanceTest.java
index f0d83f16e69..b423a999a20 100644
--- a/src/test/java/org/olat/user/UserPropertiesPerformanceTest.java
+++ b/src/test/java/org/olat/user/UserPropertiesPerformanceTest.java
@@ -27,9 +27,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.AuthHelper;
 import org.olat.basesecurity.BaseSecurity;
@@ -41,6 +38,8 @@ import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.User;
 import org.olat.core.id.UserConstants;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.core.util.StringHelper;
 import org.olat.test.OlatTestCase;
 
@@ -58,26 +57,9 @@ import org.olat.test.OlatTestCase;
  */
 public class UserPropertiesPerformanceTest extends OlatTestCase {
 
-	private static Logger log = Logger.getLogger(UserPropertiesPerformanceTest.class.getName());
+	private static OLog log = Tracing.createLoggerFor(UserPropertiesPerformanceTest.class);
 	
-	@Before
-	public void startup() {
-		System.out.println("test started "+this.getClass().getName());
-	}
-
 
-	/**
-	 * TearDown is called after each test
-	 */
-	@After
-	public void tearDown() {
-		try {
-			DB db = DBFactory.getInstance();
-			db.closeSession();
-		} catch (Exception e) {
-			log.error("Exception in tearDown(): " + e);
-		}
-	}
 
 	/**
 	 * Create 50'000 users and after each step of 10'000 perform some search
-- 
GitLab