mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
TransferService:
- Fixed test that broke when HttpClientTransmitterImpl required a NodeService - Corrected NodeService reference in transfer-service-context.xml to be "NodeService" rather than "nodeService" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29675 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
<bean id="transferTransmitter" class="org.alfresco.repo.transfer.HttpClientTransmitterImpl"
|
||||
init-method="init">
|
||||
<property name="contentService" ref="ContentService" />
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
</bean>
|
||||
|
||||
<bean id="transferVersionChecker" class="org.alfresco.repo.transfer.TransferVersionCheckerImpl">
|
||||
|
@@ -29,9 +29,12 @@ import java.util.Arrays;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.transfer.TransferException;
|
||||
import org.alfresco.service.cmr.transfer.TransferProgress;
|
||||
import org.alfresco.service.cmr.transfer.TransferProgress.Status;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.json.ExceptionJsonSerializer;
|
||||
import org.apache.commons.httpclient.ConnectTimeoutException;
|
||||
import org.apache.commons.httpclient.HostConfiguration;
|
||||
@@ -68,6 +71,7 @@ public class HttpClientTransmitterImplTest extends TestCase
|
||||
private HttpClient mockedHttpClient;
|
||||
private TransferTargetImpl target;
|
||||
private MockableHttpMethodFactory mockedHttpMethodFactory;
|
||||
private NodeService mockedNodeService;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see junit.framework.TestCase#setUp()
|
||||
@@ -83,6 +87,11 @@ public class HttpClientTransmitterImplTest extends TestCase
|
||||
transmitter.setHttpClient(mockedHttpClient);
|
||||
transmitter.setHttpMethodFactory(mockedHttpMethodFactory);
|
||||
|
||||
this.mockedNodeService = mock(NodeService.class);
|
||||
when(mockedNodeService.hasAspect(any(NodeRef.class),
|
||||
eq(TransferModel.ASPECT_FILE_TRANSFER_TARGET))).thenReturn(false);
|
||||
transmitter.setNodeService(mockedNodeService);
|
||||
|
||||
this.target = new TransferTargetImpl();
|
||||
target.setEndpointHost(TARGET_HOST);
|
||||
target.setEndpointProtocol(HTTP_PROTOCOL);
|
||||
|
Reference in New Issue
Block a user