You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/01/22 14:33:25 UTC
svn commit: r1436910 [3/3] - in /syncope/trunk: client/
common/src/main/java/org/apache/syncope/common/services/
common/src/main/java/org/apache/syncope/common/to/
common/src/main/java/org/apache/syncope/common/types/
common/src/main/java/org/apache/sy...
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/DummyHTTPServletResponse.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/DummyHTTPServletResponse.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/DummyHTTPServletResponse.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/DummyHTTPServletResponse.java Tue Jan 22 13:33:22 2013
@@ -21,15 +21,18 @@ package org.apache.syncope.core.services
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;
-
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
+/**
+ * Dummy (empty) HttpServletResponse.
+ */
public class DummyHTTPServletResponse implements HttpServletResponse {
@Override
public void flushBuffer() throws IOException {
+ // No action.
}
@Override
@@ -69,103 +72,124 @@ public class DummyHTTPServletResponse im
@Override
public void reset() {
+ // No action.
}
@Override
public void resetBuffer() {
+ // No action.
}
@Override
- public void setBufferSize(int arg0) {
+ public void setBufferSize(final int arg0) {
+ // No action.
}
@Override
- public void setCharacterEncoding(String arg0) {
+ public void setCharacterEncoding(final String arg0) {
+ // No action.
}
@Override
- public void setContentLength(int arg0) {
+ public void setContentLength(final int arg0) {
+ // No action.
}
@Override
- public void setContentType(String arg0) {
+ public void setContentType(final String arg0) {
+ // No action.
}
@Override
- public void setLocale(Locale arg0) {
+ public void setLocale(final Locale arg0) {
+ // No action.
}
@Override
- public void addCookie(Cookie arg0) {
+ public void addCookie(final Cookie arg0) {
+ // No action.
}
@Override
- public void addDateHeader(String arg0, long arg1) {
+ public void addDateHeader(final String arg0, final long arg1) {
+ // No action.
}
@Override
- public void addHeader(String arg0, String arg1) {
+ public void addHeader(final String arg0, final String arg1) {
+ // No action.
}
@Override
- public void addIntHeader(String arg0, int arg1) {
+ public void addIntHeader(final String arg0, final int arg1) {
+ // No action.
}
@Override
- public boolean containsHeader(String arg0) {
+ public boolean containsHeader(final String arg0) {
return false;
}
@Override
- public String encodeRedirectURL(String arg0) {
- return null;
+ public String encodeRedirectURL(final String arg0) {
+ return arg0;
}
@Override
- public String encodeRedirectUrl(String arg0) {
- return null;
+ @Deprecated
+ public String encodeRedirectUrl(final String arg0) {
+ return arg0;
}
@Override
- public String encodeURL(String arg0) {
- return null;
+ public String encodeURL(final String arg0) {
+ return arg0;
}
@Override
- public String encodeUrl(String arg0) {
- return null;
+ @Deprecated
+ public String encodeUrl(final String arg0) {
+ return arg0;
}
@Override
- public void sendError(int arg0) throws IOException {
+ public void sendError(final int arg0) throws IOException {
+ // No action.
}
@Override
- public void sendError(int arg0, String arg1) throws IOException {
+ public void sendError(final int arg0, final String arg1) throws IOException {
+ // No action.
}
@Override
- public void sendRedirect(String arg0) throws IOException {
+ public void sendRedirect(final String arg0) throws IOException {
+ // No action.
}
@Override
- public void setDateHeader(String arg0, long arg1) {
+ public void setDateHeader(final String arg0, final long arg1) {
+ // No action.
}
@Override
- public void setHeader(String arg0, String arg1) {
+ public void setHeader(final String arg0, final String arg1) {
+ // No action.
}
@Override
- public void setIntHeader(String arg0, int arg1) {
+ public void setIntHeader(final String arg0, final int arg1) {
+ // No action.
}
@Override
- public void setStatus(int arg0) {
+ public void setStatus(final int arg0) {
+ // No action.
}
@Override
- public void setStatus(int arg0, String arg1) {
+ @Deprecated
+ public void setStatus(final int arg0, final String arg1) {
+ // No action.
}
-
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java Tue Jan 22 13:33:22 2013
@@ -20,11 +20,9 @@ package org.apache.syncope.core.services
import java.net.URI;
import java.util.List;
-
import javax.ws.rs.BadRequestException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-
import org.apache.syncope.common.services.SchemaService;
import org.apache.syncope.common.to.AbstractSchemaTO;
import org.apache.syncope.common.to.DerivedSchemaTO;
@@ -85,12 +83,15 @@ public class SchemaServiceImpl implement
switch (type) {
case NORMAL:
normalSchemaController.delete(kind.toString(), schemaName);
+ break;
case DERIVED:
derivedSchemaController.delete(kind.toString(), schemaName);
+ break;
case VIRTUAL:
virtualSchemaController.delete(kind.toString(), schemaName);
+ break;
default:
throw new BadRequestException();
@@ -142,18 +143,21 @@ public class SchemaServiceImpl implement
}
@Override
- public <T extends AbstractSchemaTO> void update(final AttributableType kind, final SchemaType type,
+ public <T extends AbstractSchemaTO> void update(final AttributableType kind, final SchemaType type,
final String schemaName, final T schemaTO) {
try {
switch (type) {
case NORMAL:
normalSchemaController.update((SchemaTO) schemaTO, kind.toString());
+ break;
case DERIVED:
derivedSchemaController.update((DerivedSchemaTO) schemaTO, kind.toString());
+ break;
case VIRTUAL:
virtualSchemaController.update((VirtualSchemaTO) schemaTO, kind.toString());
+ break;
default:
throw new BadRequestException();
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java Tue Jan 22 13:33:22 2013
@@ -24,7 +24,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import org.apache.syncope.common.mod.AbstractAttributableMod;
import org.apache.syncope.common.mod.RoleMod;
import org.apache.syncope.common.mod.UserMod;
@@ -390,12 +389,12 @@ public class SyncopeSyncResultHandler im
: findByAttributableSearch(connObj, policySpec, attrUtil);
}
- protected List<SyncResult> create(SyncDelta delta, final AttributableUtil attrUtil,
- final boolean dryRun) throws JobExecutionException {
+ protected List<SyncResult> create(SyncDelta delta, final AttributableUtil attrUtil, final boolean dryRun)
+ throws JobExecutionException {
if (!syncTask.isPerformCreate()) {
LOG.debug("SyncTask not configured for create");
- return Collections.EMPTY_LIST;
+ return Collections.<SyncResult>emptyList();
}
final SyncResult result = new SyncResult();
@@ -486,7 +485,7 @@ public class SyncopeSyncResultHandler im
if (!syncTask.isPerformUpdate()) {
LOG.debug("SyncTask not configured for update");
- return Collections.EMPTY_LIST;
+ return Collections.<SyncResult>emptyList();
}
LOG.debug("About to update {}", subjects);
@@ -568,7 +567,7 @@ public class SyncopeSyncResultHandler im
if (!syncTask.isPerformDelete()) {
LOG.debug("SyncTask not configured for delete");
- return Collections.EMPTY_LIST;
+ return Collections.<SyncResult>emptyList();
}
LOG.debug("About to delete {}", subjects);
@@ -596,10 +595,10 @@ public class SyncopeSyncResultHandler im
if (!dryRun) {
try {
- List<PropagationTask> tasks = Collections.EMPTY_LIST;
+ List<PropagationTask> tasks = Collections.<PropagationTask>emptyList();
if (AttributableType.USER == attrUtil.getType()) {
tasks = propagationManager.getUserDeleteTaskIds(id, syncTask.getResource().getName());
- notificationManager.createTasks(id, Collections.singleton("delete"));
+ notificationManager.createTasks(id, Collections.<String>singleton("delete"));
}
if (AttributableType.ROLE == attrUtil.getType()) {
tasks = propagationManager.getRoleDeleteTaskIds(id, syncTask.getResource().getName());
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java Tue Jan 22 13:33:22 2013
@@ -20,7 +20,6 @@ package org.apache.syncope.core.util;
import java.util.Collections;
import java.util.List;
-
import org.apache.syncope.common.to.AbstractAttributableTO;
import org.apache.syncope.common.to.MembershipTO;
import org.apache.syncope.common.to.RoleTO;
@@ -69,6 +68,7 @@ import org.apache.syncope.core.persisten
import org.apache.syncope.core.persistence.beans.user.UVirSchema;
import org.identityconnectors.framework.common.objects.ObjectClass;
+@SuppressWarnings("unchecked")
public class AttributableUtil {
private final AttributableType type;
@@ -127,12 +127,14 @@ public class AttributableUtil {
case ROLE:
result = SyncopeRole.class;
break;
+
case MEMBERSHIP:
result = Membership.class;
+ break;
+
case USER:
default:
result = SyncopeUser.class;
- break;
}
return result;
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ImportExport.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ImportExport.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ImportExport.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ImportExport.java Tue Jan 22 13:33:22 2013
@@ -42,7 +42,6 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
-
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.TemporalType;
@@ -53,7 +52,6 @@ import javax.xml.transform.TransformerCo
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamResult;
-
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.syncope.common.SyncopeConstants;
@@ -123,22 +121,23 @@ public class ImportExport extends Defaul
}
private void setParameters(final String tableName, final Attributes attrs, final Query query) {
-
Map<String, Integer> colTypes = new HashMap<String, Integer>();
- Connection conn = DataSourceUtils.getConnection(dataSource);
+ Connection conn = null;
ResultSet rs = null;
PreparedStatement stmt = null;
-
try {
+ conn = DataSourceUtils.getConnection(dataSource);
+
final String queryString = "SELECT * FROM " + tableName;
stmt = conn.prepareStatement(queryString);
rs = stmt.executeQuery();
for (int i = 0; i < rs.getMetaData().getColumnCount(); i++) {
- colTypes.put(rs.getMetaData().getColumnName(i + 1).toUpperCase(), rs.getMetaData().getColumnType(i + 1));
+ colTypes.put(rs.getMetaData().getColumnName(i + 1).toUpperCase(),
+ rs.getMetaData().getColumnType(i + 1));
}
} catch (SQLException e) {
- LOG.error("While", e);
+ LOG.error("While setting column types", e);
} finally {
if (stmt != null) {
try {
@@ -154,7 +153,17 @@ public class ImportExport extends Defaul
LOG.error("While closing result set", e);
}
}
+
DataSourceUtils.releaseConnection(conn, dataSource);
+ if (conn != null) {
+ try {
+ if (!conn.isClosed()) {
+ conn.close();
+ }
+ } catch (SQLException e) {
+ LOG.error("While releasing connection", e);
+ }
+ }
}
for (int i = 0; i < attrs.getLength(); i++) {
@@ -392,7 +401,6 @@ public class ImportExport extends Defaul
while (rs.next()) {
pkTableNames.add(rs.getString("PKTABLE_NAME"));
}
-
} finally {
if (rs != null) {
try {
@@ -404,7 +412,6 @@ public class ImportExport extends Defaul
}
for (String pkTableName : pkTableNames) {
-
if (!tableName.equalsIgnoreCase(pkTableName)) {
MultiParentNode<String> pkNode = exploited.get(pkTableName);
@@ -445,11 +452,10 @@ public class ImportExport extends Defaul
handler.startDocument();
handler.startElement("", "", ROOT_ELEMENT, new AttributesImpl());
- final Connection conn = DataSourceUtils.getConnection(dataSource);
-
+ Connection conn = null;
ResultSet rs = null;
-
try {
+ conn = DataSourceUtils.getConnection(dataSource);
final DatabaseMetaData meta = conn.getMetaData();
final String schema = readSchema();
@@ -481,7 +487,17 @@ public class ImportExport extends Defaul
LOG.error("While closing tables result set", e);
}
}
+
DataSourceUtils.releaseConnection(conn, dataSource);
+ if (conn != null) {
+ try {
+ if (!conn.isClosed()) {
+ conn.close();
+ }
+ } catch (SQLException e) {
+ LOG.error("While releasing connection", e);
+ }
+ }
}
handler.endElement("", "", ROOT_ELEMENT);
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java Tue Jan 22 13:33:22 2013
@@ -113,6 +113,7 @@ public final class MappingUtil {
* @return account link + prepared attribute
* @throws ClassNotFoundException if schema type for given mapping does not exists in current class loader
*/
+ @SuppressWarnings("unchecked")
public static <T extends AbstractAttributable> Map.Entry<String, Attribute> prepareAttribute(
final ExternalResource resource, final AbstractMappingItem mapItem,
final T subject, final String password,
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/TaskUtil.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/TaskUtil.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/TaskUtil.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/TaskUtil.java Tue Jan 22 13:33:22 2013
@@ -29,6 +29,7 @@ import org.apache.syncope.core.persisten
import org.apache.syncope.core.persistence.beans.SyncTask;
import org.apache.syncope.core.persistence.beans.Task;
+@SuppressWarnings("unchecked")
public enum TaskUtil {
PROPAGATION,
@@ -43,15 +44,20 @@ public enum TaskUtil {
case PROPAGATION:
result = PropagationTask.class;
break;
+
case SCHED:
result = SchedTask.class;
break;
+
case SYNC:
result = SyncTask.class;
break;
+
case NOTIFICATION:
result = NotificationTask.class;
break;
+
+ default:
}
return result;
@@ -64,15 +70,20 @@ public enum TaskUtil {
case PROPAGATION:
result = (T) new PropagationTask();
break;
+
case SCHED:
result = (T) new SchedTask();
break;
+
case SYNC:
result = (T) new SyncTask();
break;
+
case NOTIFICATION:
result = (T) new NotificationTask();
break;
+
+ default:
}
return result;
@@ -85,15 +96,20 @@ public enum TaskUtil {
case PROPAGATION:
result = PropagationTaskTO.class;
break;
+
case SCHED:
result = SchedTaskTO.class;
break;
+
case SYNC:
result = SyncTaskTO.class;
break;
+
case NOTIFICATION:
result = NotificationTaskTO.class;
break;
+
+ default:
}
return result;
@@ -106,14 +122,20 @@ public enum TaskUtil {
case PROPAGATION:
result = (T) new PropagationTaskTO();
break;
+
case SCHED:
result = (T) new SchedTaskTO();
break;
+
case SYNC:
result = (T) new SyncTaskTO();
break;
+
case NOTIFICATION:
result = (T) new NotificationTaskTO();
+ break;
+
+ default:
}
return result;
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java Tue Jan 22 13:33:22 2013
@@ -34,14 +34,12 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-
import javax.annotation.Resource;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
-
import org.activiti.engine.ActivitiException;
import org.activiti.engine.FormService;
import org.activiti.engine.HistoryService;
@@ -504,6 +502,7 @@ public class ActivitiUserWorkflowAdapter
return result;
}
+ @SuppressWarnings("unchecked")
private WorkflowFormTO getFormTO(final Task task, final TaskFormData formData) {
WorkflowFormTO formTO = new WorkflowFormTO();
formTO.setTaskId(task.getId());
Modified: syncope/trunk/core/src/main/resources/logback.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/logback.xml?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/logback.xml (original)
+++ syncope/trunk/core/src/main/resources/logback.xml Tue Jan 22 13:33:22 2013
@@ -90,10 +90,6 @@ under the License.
<level value="INFO"/>
<appender-ref ref="persistence"/>
</logger>
- <logger name="org.apache.syncope.core.persistence.propagation.ConnectorFacadeProxy" additivity="false">
- <level value="INFO"/>
- <appender-ref ref="persistence"/>
- </logger>
<logger name="org.apache.syncope.core.security" additivity="false">
<level value="INFO"/>
Modified: syncope/trunk/core/src/main/resources/persistenceContextEMFactory.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/persistenceContextEMFactory.xml?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/persistenceContextEMFactory.xml (original)
+++ syncope/trunk/core/src/main/resources/persistenceContextEMFactory.xml Tue Jan 22 13:33:22 2013
@@ -37,8 +37,8 @@ under the License.
<property name="jpaPropertyMap">
<map>
<!--<entry key="openjpa.Log" value="SQL=TRACE"/>
- <entry key="openjpa.ConnectionFactoryProperties"
- value="PrintParameters=true, PrettyPrint=true, PrettyPrintLineLength=80"/>-->
+ <entry key="openjpa.ConnectionFactoryProperties"
+ value="PrintParameters=true, PrettyPrint=true, PrettyPrintLineLength=80"/>-->
<entry key="openjpa.NontransactionalWrite" value="false"/>
<entry key="openjpa.AutoDetach" value="close, commit, nontx-read, rollback"/>
Added: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java?rev=1436910&view=auto
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java (added)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java Tue Jan 22 13:33:22 2013
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.syncope.core;
+
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = {"classpath:syncopeContext.xml", "classpath:persistenceContext.xml",
+ "classpath:schedulingContext.xml", "classpath:workflowContext.xml"})
+public abstract class AbstractNonDAOTest extends AbstractTest {
+}
Propchange: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractNonDAOTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java Tue Jan 22 13:33:22 2013
@@ -23,17 +23,10 @@ import static org.junit.Assert.assertNot
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
-
import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {"classpath:syncopeContext.xml", "classpath:persistenceContext.xml",
- "classpath:schedulingContext.xml", "classpath:workflowContext.xml"})
public abstract class AbstractTest {
/**
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/connid/PasswordGeneratorTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/connid/PasswordGeneratorTest.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/connid/PasswordGeneratorTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/connid/PasswordGeneratorTest.java Tue Jan 22 13:33:22 2013
@@ -24,10 +24,9 @@ import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
-
import org.apache.syncope.common.types.CipherAlgorithm;
import org.apache.syncope.common.types.PasswordPolicySpec;
-import org.apache.syncope.core.AbstractTest;
+import org.apache.syncope.core.AbstractNonDAOTest;
import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
import org.apache.syncope.core.persistence.dao.UserDAO;
import org.apache.syncope.core.policy.PolicyPattern;
@@ -37,7 +36,7 @@ import org.springframework.beans.factory
import org.springframework.transaction.annotation.Transactional;
@Transactional
-public class PasswordGeneratorTest extends AbstractTest {
+public class PasswordGeneratorTest extends AbstractNonDAOTest {
@Autowired
private PasswordGenerator passwordGenerator;
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java Tue Jan 22 13:33:22 2013
@@ -20,7 +20,7 @@ package org.apache.syncope.core.init;
import static org.junit.Assert.assertEquals;
-import org.apache.syncope.core.AbstractTest;
+import org.apache.syncope.core.AbstractNonDAOTest;
import org.apache.syncope.core.persistence.dao.ResourceDAO;
import org.apache.syncope.core.propagation.SyncopeConnector;
import org.apache.syncope.core.rest.data.ResourceDataBinder;
@@ -33,7 +33,7 @@ import org.springframework.test.util.Ref
import org.springframework.transaction.annotation.Transactional;
@Transactional
-public class ConnInstanceLoaderTest extends AbstractTest {
+public class ConnInstanceLoaderTest extends AbstractNonDAOTest {
private ConnInstanceLoader cil;
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/notification/NotificationTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/notification/NotificationTest.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/notification/NotificationTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/notification/NotificationTest.java Tue Jan 22 13:33:22 2013
@@ -21,17 +21,17 @@ package org.apache.syncope.core.notifica
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import com.icegreen.greenmail.util.GreenMail;
+import com.icegreen.greenmail.util.ServerSetup;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
-
import javax.annotation.Resource;
import javax.mail.Flags.Flag;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Store;
-
import org.apache.commons.lang.StringUtils;
import org.apache.syncope.common.search.MembershipCond;
import org.apache.syncope.common.search.NodeCond;
@@ -71,9 +71,6 @@ import org.springframework.test.context.
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
-import com.icegreen.greenmail.util.GreenMail;
-import com.icegreen.greenmail.util.ServerSetup;
-
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
"classpath:syncopeContext.xml",
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/AbstractDAOTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/AbstractDAOTest.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/AbstractDAOTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/AbstractDAOTest.java Tue Jan 22 13:33:22 2013
@@ -18,50 +18,12 @@
*/
package org.apache.syncope.core.persistence.dao;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.junit.BeforeClass;
+import org.apache.syncope.core.AbstractTest;
import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:persistenceTestEnv.xml"})
-public abstract class AbstractDAOTest {
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractDAOTest.class);
-
- protected static String connidSoapVersion;
-
- protected static String bundlesDirectory;
-
- @BeforeClass
- public static void setUpIdentityConnectorsBundles() throws IOException {
- Properties props = new Properties();
- InputStream propStream = null;
- try {
- propStream = AbstractDAOTest.class.getResourceAsStream("/bundles.properties");
- props.load(propStream);
- connidSoapVersion = props.getProperty("connid.soap.version");
- bundlesDirectory = props.getProperty("bundles.directory");
- } catch (Exception e) {
- LOG.error("Could not load bundles.properties", e);
- } finally {
- if (propStream != null) {
- propStream.close();
- }
- }
- assertNotNull(connidSoapVersion);
- assertNotNull(bundlesDirectory);
- }
+public abstract class AbstractDAOTest extends AbstractTest {
}
-
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/impl/TestDbInitializer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/impl/TestDbInitializer.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/impl/TestDbInitializer.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/impl/TestDbInitializer.java Tue Jan 22 13:33:22 2013
@@ -19,17 +19,17 @@
package org.apache.syncope.core.persistence.dao.impl;
import javax.servlet.ServletContext;
-
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;
/**
- * Take care of all initializations needed by Syncope to run up and safe.
+ * Take care of all initializations needed by Syncope to run up and safe for tests.
*/
@Component
public class TestDbInitializer implements ServletContextAware, InitializingBean {
+
@Autowired
private ContentLoader contentLoader;
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/data/ResourceDataTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/data/ResourceDataTest.java?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/data/ResourceDataTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/data/ResourceDataTest.java Tue Jan 22 13:33:22 2013
@@ -28,13 +28,12 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import org.apache.syncope.common.to.MappingItemTO;
import org.apache.syncope.common.to.MappingTO;
import org.apache.syncope.common.to.ResourceTO;
import org.apache.syncope.common.types.IntMappingType;
import org.apache.syncope.common.types.PropagationMode;
-import org.apache.syncope.core.AbstractTest;
+import org.apache.syncope.core.AbstractNonDAOTest;
import org.apache.syncope.core.persistence.beans.AbstractMappingItem;
import org.apache.syncope.core.persistence.beans.ExternalResource;
import org.apache.syncope.core.persistence.beans.user.USchema;
@@ -46,7 +45,7 @@ import org.springframework.beans.factory
import org.springframework.transaction.annotation.Transactional;
@Transactional
-public class ResourceDataTest extends AbstractTest {
+public class ResourceDataTest extends AbstractNonDAOTest {
@Autowired
private ResourceDAO resourceDAO;
Modified: syncope/trunk/core/src/test/resources/persistenceTestEnv.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/resources/persistenceTestEnv.xml?rev=1436910&r1=1436909&r2=1436910&view=diff
==============================================================================
--- syncope/trunk/core/src/test/resources/persistenceTestEnv.xml (original)
+++ syncope/trunk/core/src/test/resources/persistenceTestEnv.xml Tue Jan 22 13:33:22 2013
@@ -33,10 +33,8 @@ under the License.
http://www.springframework.org/schema/aop/spring-aop.xsd">
<bean class="org.apache.syncope.core.persistence.dao.impl.TestDbInitializer"/>
- <bean class="org.apache.syncope.core.persistence.dao.DummyConnectorRegistry">
- </bean>
- <bean class="org.apache.syncope.core.persistence.dao.impl.ContentLoader">
- </bean>
+ <bean class="org.apache.syncope.core.persistence.dao.DummyConnectorRegistry"/>
+ <bean class="org.apache.syncope.core.persistence.dao.impl.ContentLoader"/>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">