mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126463 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 122275 gjames: Improving the tests git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126807 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -23,7 +23,7 @@ package org.alfresco.rest.api.model;
|
||||
*
|
||||
* @author Gethin James
|
||||
*/
|
||||
public class NodeTarget extends Target
|
||||
public class NodeTarget
|
||||
{
|
||||
String targetParentId;
|
||||
String name;
|
||||
|
@@ -35,18 +35,6 @@ import static org.mockito.Matchers.anyBoolean;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
@@ -66,9 +54,9 @@ import org.alfresco.rest.framework.resource.EntityResource;
|
||||
import org.alfresco.rest.framework.resource.RelationshipResource;
|
||||
import org.alfresco.rest.framework.resource.actions.ActionExecutor.ExecutionCallback;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartResourceAction;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction.Read;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction.ReadById;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartResourceAction;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
||||
import org.alfresco.rest.framework.resource.content.BinaryProperty;
|
||||
import org.alfresco.rest.framework.resource.content.BinaryResource;
|
||||
@@ -84,7 +72,9 @@ import org.alfresco.rest.framework.tests.api.mocks3.Flock;
|
||||
import org.alfresco.rest.framework.tests.api.mocks3.SlimGoat;
|
||||
import org.alfresco.rest.framework.webscripts.AbstractResourceWebScript;
|
||||
import org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.codehaus.jackson.JsonGenerationException;
|
||||
@@ -109,6 +99,19 @@ import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringReader;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { "classpath:test-rest-context.xml" })
|
||||
public class SerializeTests
|
||||
@@ -387,6 +390,17 @@ public class SerializeTests
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerializeCustom() throws IOException
|
||||
{
|
||||
assertNotNull(helper);
|
||||
String uuid = GUID.generate();
|
||||
String out = writeResponse(uuid);
|
||||
NodeRef n = jsonHelper.construct(new StringReader(out),NodeRef.class);
|
||||
assertNotNull(n);
|
||||
assertEquals(uuid, n.getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerializeUniqueId() throws IOException
|
||||
{
|
||||
|
Reference in New Issue
Block a user