|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.fr.design.env; |
|
|
|
|
|
|
|
|
|
import com.fr.base.operator.common.CommonOperator; |
|
|
|
|
import com.fr.invoke.ReflectException; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
@ -29,11 +28,8 @@ public class RemoteWorkspaceTest {
|
|
|
|
|
EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); |
|
|
|
|
|
|
|
|
|
CommonOperator operator = EasyMock.createMock(CommonOperator.class); |
|
|
|
|
EasyMock.expect(workspace.get(CommonOperator.class)).andReturn(operator).anyTimes(); |
|
|
|
|
|
|
|
|
|
EasyMock.expect(workspace.get(EasyMock.eq(CommonOperator.class), EasyMock.anyObject())).andReturn(operator); |
|
|
|
|
EasyMock.expect(operator.isWarDeploy()).andReturn(true).once(); |
|
|
|
|
EasyMock.expect(operator.isWarDeploy()).andReturn(false).once(); |
|
|
|
|
EasyMock.expect(operator.isWarDeploy()).andThrow(new ReflectException()).once(); |
|
|
|
|
|
|
|
|
|
EasyMock.replay(workspace, operator); |
|
|
|
|
PowerMock.replayAll(); |
|
|
|
@ -43,8 +39,6 @@ public class RemoteWorkspaceTest {
|
|
|
|
|
RemoteWorkspace remoteWorkspace= new RemoteWorkspace(null, info); |
|
|
|
|
|
|
|
|
|
Assert.assertTrue(remoteWorkspace.isWarDeploy()); |
|
|
|
|
Assert.assertFalse(remoteWorkspace.isWarDeploy()); |
|
|
|
|
Assert.assertFalse(remoteWorkspace.isWarDeploy()); |
|
|
|
|
|
|
|
|
|
EasyMock.verify(workspace, operator); |
|
|
|
|
PowerMock.verifyAll(); |
|
|
|
|