From 1ad6e86411293606c552c911cb4e0ebd07aeaa54 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 9 Aug 2021 17:36:25 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55795=20=E3=80=9010.0.19=E3=80=91?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E8=A7=84=E8=8C=83=E2=80=94=E2=80=94=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E9=83=A8=E5=88=86=20fix=20=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../env/RemoteDesignerWorkspaceInfoTest.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java b/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java index d6e89cd93f..e5fa7e3095 100644 --- a/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java +++ b/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java @@ -4,7 +4,10 @@ import com.fr.invoke.Reflect; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLReaderHelper; import com.fr.stable.xml.XMLableReader; +import com.fr.workspace.WorkContext; +import com.fr.workspace.connect.WorkspaceClient; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.connect.WorkspaceConnector; import junit.framework.TestCase; import org.junit.Assert; @@ -18,15 +21,31 @@ import java.io.ByteArrayOutputStream; */ public class RemoteDesignerWorkspaceInfoTest extends TestCase { - public void testCheckValid() { + public void testCheckValid() throws Exception { RemoteDesignerWorkspaceInfo workspaceInfo0 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("http://localhost:8075/webroot/decision", "admin", "123", "", "", true)); RemoteDesignerWorkspaceInfo workspaceInfo1 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("http://127.0.0.1:8075/webroot/decision", "admin", "123", "", "", true)); RemoteDesignerWorkspaceInfo workspaceInfo2 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("https://127.0.0.1:8075/webroot/decision", "admin", "123", "", "", true)); RemoteDesignerWorkspaceInfo workspaceInfo3 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("https://localhost:8075/webroot/decision", "admin", "123", "", "", true)); + WorkspaceConnector connector = WorkContext.getConnector(); + + WorkspaceConnector workspaceConnector = new WorkspaceConnector() { + @Override + public boolean testConnection(WorkspaceConnectionInfo connection) throws Exception { + return false; + } + + @Override + public WorkspaceClient connect(WorkspaceConnectionInfo connection) throws Exception { + return null; + } + }; + WorkContext.setConnector(workspaceConnector); + Assert.assertFalse(workspaceInfo0.checkValid()); Assert.assertFalse(workspaceInfo1.checkValid()); Assert.assertFalse(workspaceInfo2.checkValid()); Assert.assertFalse(workspaceInfo3.checkValid()); + WorkContext.setConnector(connector); } public void testReadXml() {