[lsc-changes] r522 - in lsc/trunk/src: main/java/org/lsc test/java/org/lsc

rschermesser at lsc-project.org rschermesser at lsc-project.org
Mon Nov 30 21:28:18 CET 2009


Author: rschermesser
Date: 2009-11-30 21:28:18 +0100 (Mon, 30 Nov 2009)
New Revision: 522

Modified:
   lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java
   lsc/trunk/src/test/java/org/lsc/Ldap2LdapSyncTest.java
Log:
Simplifying logging, cleaning tests

Modified: lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java	2009-11-30 20:20:33 UTC (rev 521)
+++ lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java	2009-11-30 20:28:18 UTC (rev 522)
@@ -415,14 +415,11 @@
 		}
 
 		String totalsLogMessage = "All entries: {}, to modify entries: {}, modified entries: {}, errors: {}";
+		Object[] objects = new Object[] { countAll, countInitiated, countCompleted, countError };
 		if (countError > 0) {
-			LSCStructuralLogger.DESTINATION.error(totalsLogMessage, new Object[]{
-							countAll, countInitiated, countCompleted,
-							countError});
+			LSCStructuralLogger.DESTINATION.error(totalsLogMessage, objects);
 		} else {
-			LSCStructuralLogger.DESTINATION.warn(totalsLogMessage, new Object[]{
-							countAll, countInitiated, countCompleted,
-							countError});
+			LSCStructuralLogger.DESTINATION.warn(totalsLogMessage, objects);
 		}
 	}
 
@@ -480,17 +477,17 @@
 
 			case MODRDN_ENTRY:
 				LSCStructuralLogger.DESTINATION.info("# Renaming entry {} for {}",
-									jm.getDistinguishName(), syncName);
+								jm.getDistinguishName(), syncName);
 				break;
 
 			case DELETE_ENTRY:
 				LSCStructuralLogger.DESTINATION.info("# Removing entry {} for {}",
-									jm.getDistinguishName(), syncName);
+								jm.getDistinguishName(), syncName);
 				break;
 
 			default:
 				LSCStructuralLogger.DESTINATION.info("Error: unknown changetype ({} for {})",
-									jm.getDistinguishName(), syncName);
+								jm.getDistinguishName(), syncName);
 		}
 
 		LSCStructuralLogger.DESTINATION.info(jm.toString());
@@ -506,24 +503,28 @@
 					final String syncName) {
 		switch (jm.getOperation()) {
 			case ADD_ENTRY:
-				LSCStructuralLogger.DESTINATION.debug("Create condition false. Should have added object " + jm.getDistinguishName());
+				LSCStructuralLogger.DESTINATION.debug("Create condition false. Should have added object {}",
+								jm.getDistinguishName());
 				break;
 
 			case MODIFY_ENTRY:
-				LSCStructuralLogger.DESTINATION.debug("Update condition false. Should have modified object " + jm.getDistinguishName());
+				LSCStructuralLogger.DESTINATION.debug("Update condition false. Should have modified object {}",
+								jm.getDistinguishName());
 				break;
 
 			case MODRDN_ENTRY:
-				LSCStructuralLogger.DESTINATION.debug("ModRDN condition false. Should have renamed object " + jm.getDistinguishName());
+				LSCStructuralLogger.DESTINATION.debug("ModRDN condition false. Should have renamed object {}",
+								jm.getDistinguishName());
 				break;
 
 			case DELETE_ENTRY:
-				LSCStructuralLogger.DESTINATION.debug("Delete condition false. Should have removed object " + jm.getDistinguishName());
+				LSCStructuralLogger.DESTINATION.debug("Delete condition false. Should have removed object {}",
+								jm.getDistinguishName());
 				break;
 
 			default:
 				LSCStructuralLogger.DESTINATION.debug("Error: unknown changetype ({} for {})",
-									jm.getDistinguishName(), syncName);
+								jm.getDistinguishName(), syncName);
 		}
 
 		LSCStructuralLogger.DESTINATION.debug(jm.toString());

Modified: lsc/trunk/src/test/java/org/lsc/Ldap2LdapSyncTest.java
===================================================================
--- lsc/trunk/src/test/java/org/lsc/Ldap2LdapSyncTest.java	2009-11-30 20:20:33 UTC (rev 521)
+++ lsc/trunk/src/test/java/org/lsc/Ldap2LdapSyncTest.java	2009-11-30 20:28:18 UTC (rev 522)
@@ -87,11 +87,6 @@
 	private final String DN_MODRDN_DST_BEFORE = "cn=CommonName0002,ou=ldap2ldap2TestTaskDst,ou=Test Data,dc=lsc-project,dc=org";
 	private final String DN_MODRDN_DST_AFTER = "cn=CN0002,ou=ldap2ldap2TestTaskDst,ou=Test Data,dc=lsc-project,dc=org";
 
-	@Override
-	protected void setUp() throws Exception {
-		super.setUp();
-	}
-
 	/**
 	 * Test reading the userPassword attribute from our source directory through Object
 	 * and Bean. This attribute has a binary syntax, so we must confirm we can parse it as a String.



More information about the lsc-changes mailing list