diff --git a/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java index 731093c153..f066ae6896 100644 --- a/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java +++ b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java @@ -4,6 +4,7 @@ import org.junit.Assert; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; /** * @author yaohwu @@ -11,6 +12,18 @@ import static org.junit.Assert.assertEquals; public class RemoteWorkspaceURLTest { + @Test + public void testEqualAndHashCode() { + String a = "https://yaohwu:8080/webroot/app/c/d"; + RemoteWorkspaceURL workspaceURL1 = new RemoteWorkspaceURL(a); + RemoteWorkspaceURL workspaceURL2 = new RemoteWorkspaceURL(a); + assertEquals(workspaceURL1.hashCode(), workspaceURL2.hashCode()); + assertEquals(workspaceURL1, workspaceURL2); + workspaceURL2.resetUrl(); + assertNotEquals(workspaceURL1.hashCode(), workspaceURL2.hashCode()); + assertNotEquals(workspaceURL1, workspaceURL2); + } + @Test public void testUrlReset() {