Fixed several failing Publishing tests.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28961 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2011-07-12 16:08:06 +00:00
parent 90102ca33e
commit a750e322f7
5 changed files with 32 additions and 19 deletions

View File

@@ -19,11 +19,6 @@
package org.alfresco.repo.publishing;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static org.alfresco.model.ContentModel.ASPECT_GEOGRAPHIC;
import static org.alfresco.model.ContentModel.ASPECT_TEMPORARY;
import static org.alfresco.model.ContentModel.PROP_CONTENT;
@@ -67,6 +62,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
/**
@@ -139,7 +135,7 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
assertEquals(publishEventNode, assocs.get(0).getChildRef());
}
public void xtestUpdatePublishedNode() throws Exception
public void testUpdatePublishedNode() throws Exception
{
// Create content node without aspects
NodeRef source = createContentNode(contentNodeName, content);
@@ -152,8 +148,8 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
// Verify properties set correctly.
Map<QName, Serializable> publishedProps = nodeService.getProperties(publishedNode);
assertNull(publishedProps.containsKey(PROP_LATITUDE));
assertNull(publishedProps.containsKey(PROP_LONGITUDE));
assertFalse(publishedProps.containsKey(PROP_LATITUDE));
assertFalse(publishedProps.containsKey(PROP_LONGITUDE));
assertEquals(contentNodeName, publishedProps.get(PROP_NAME));
assertEquals(content, readContent(source));
@@ -235,7 +231,7 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
}
@SuppressWarnings("unchecked")
public void xtestChannelTypePublishIsCalledOnUpdate() throws Exception
public void testChannelTypePublishIsCalledOnUpdate() throws Exception
{
// Create content node with appropriate aspects added.
NodeRef source = createContentNode(contentNodeName, content);
@@ -327,7 +323,7 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
}
@SuppressWarnings("unchecked")
public void xtestStatusUpdate() throws Exception
public void testStatusUpdate() throws Exception
{
NodeRef source = createContentNode(contentNodeName, content);
@@ -336,6 +332,8 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
StatusUpdate status = queue.createStatusUpdate(message, source, channelName);
String url = "http://test/url";
when(channelType.getNodeUrl(any(NodeRef.class))).thenReturn(url);
when(channelType.canPublishStatusUpdates()).thenReturn(true);
publishNode(source, status);
@@ -414,6 +412,11 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
this.channelType = mockChannelType();
channelService.register(channelType);
}
else
{
Mockito.reset(channelType);
mockChannelTypeBehaviour(channelType);
}
channelService.createChannel(siteId, channelTypeId, channelName, null);
this.channel = channelHelper.getChannelNodeForEnvironment(environment.getNodeRef(), channelName);