This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 935692746b84a6c54976a37d273438a841de05f3 Author: Josh Tynjala <[email protected]> AuthorDate: Thu Feb 1 10:27:10 2024 -0800 compiler: enable more tests for flex rpc services in sdk.dependent.tests Some WebService and RemoteObject tests are ignored because they result in VerifyErrors --- compiler/src/test/build.xml | 6 +- .../java/mxml/tags/MXMLHTTPServiceTagTests.java | 44 ++++++++++++++- .../java/mxml/tags/MXMLRemoteObjectTagTests.java | 49 +++++++++++++++- .../java/mxml/tags/MXMLWebServiceTagTests.java | 66 ++++++++++++++++++++++ 4 files changed, 158 insertions(+), 7 deletions(-) diff --git a/compiler/src/test/build.xml b/compiler/src/test/build.xml index fa482bc23..2099f7fd2 100644 --- a/compiler/src/test/build.xml +++ b/compiler/src/test/build.xml @@ -369,10 +369,10 @@ <!-- <include name="f/**"/> --> <include name="**/MXMLComponentTagTests.class"/> <include name="**/MXMLComponentNodeTests.class"/> - <!-- <include name="**/MXMLHTTPServiceTagTests.class"/> --> + <include name="**/MXMLHTTPServiceTagTests.class"/> <include name="**/MXMLModelTagTests.class"/> - <!-- <include name="**/MXMLRemoteObjectTagTests.class"/> --> - <!-- <include name="**/MXMLWebServiceTagTests.class"/> --> + <include name="**/MXMLRemoteObjectTagTests.class"/> + <include name="**/MXMLWebServiceTagTests.class"/> <include name="**/MXMLProperty*.class"/> <exclude name="**/MXMLPropertyTestsBase.class"/> <include name="**/MXMLDesignLayerNodeTests.class"/> diff --git a/compiler/src/test/java/mxml/tags/MXMLHTTPServiceTagTests.java b/compiler/src/test/java/mxml/tags/MXMLHTTPServiceTagTests.java index f3a5521a9..98c7ac20b 100644 --- a/compiler/src/test/java/mxml/tags/MXMLHTTPServiceTagTests.java +++ b/compiler/src/test/java/mxml/tags/MXMLHTTPServiceTagTests.java @@ -46,17 +46,56 @@ public class MXMLHTTPServiceTagTests extends MXMLInstanceTagTestsBase return "xmlns:mx='library://ns.adobe.com/flex/mx'"; } + @Test + public void MXMLHTTPServiceTag_withUrlAndMethodAttributes() + { + String[] declarations = new String[] + { + "<mx:HTTPService id='hs1' url='https://example.com' method='POST'>", + "</mx:HTTPService>" + }; + String[] asserts = new String[] + { + "assertEqual('hs1 is HTTPService', hs1 is HTTPService, true);", + "assertEqual('hs1.url', hs1.url, 'https://example.com');", + "assertEqual('hs1.method', hs1.method, 'POST');" + }; + String mxml = getMXML(declarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + + @Test + public void MXMLHTTPServiceTag_withUrlAndMethodTags() + { + String[] declarations = new String[] + { + "<mx:HTTPService id='hs1'>", + " <mx:url>https://example.com</mx:url>", + " <mx:method>POST</mx:method>", + "</mx:HTTPService>" + }; + String[] asserts = new String[] + { + "assertEqual('hs1 is HTTPService', hs1 is HTTPService, true);", + "assertEqual('hs1.url', hs1.url, 'https://example.com');", + "assertEqual('hs1.method', hs1.method, 'POST');" + }; + String mxml = getMXML(declarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + @Test public void MXMLHTTPServiceTag_withRequest() { String[] declarations = new String[] { "<mx:HTTPService id='hs1'>", - " <mx:url>http://whatever</mx:url>", + " <mx:url>https://example.com</mx:url>", " <mx:request xmlns=''>", " <a>abc</a>", " <b>123</b>", " <c>false</c>", + // " <d><d1>456.7</d1></d>", " </mx:request>", " <mx:method>POST</mx:method>", "</mx:HTTPService>" @@ -64,10 +103,11 @@ public class MXMLHTTPServiceTagTests extends MXMLInstanceTagTestsBase String[] asserts = new String[] { "assertEqual('hs1 is HTTPService', hs1 is HTTPService, true);", - "assertEqual('hs1.url', hs1.url, 'http://whatever');", + "assertEqual('hs1.url', hs1.url, 'https://example.com');", "assertEqual('hs1.request.a', hs1.request['a'], 'abc');", "assertEqual('hs1.request.b', hs1.request['b'], 123);", "assertEqual('hs1.request.c', hs1.request['c'], false);", + // "assertEqual('hs1.request.d.d1', hs1.request['d']['d1'], 456.7);", "assertEqual('hs1.method', hs1.method, 'POST');" }; String mxml = getMXML(declarations, asserts); diff --git a/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java b/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java index f612f8162..13288822e 100644 --- a/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java +++ b/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java @@ -19,6 +19,7 @@ package mxml.tags; +import org.junit.Ignore; import org.junit.Test; /** @@ -43,6 +44,50 @@ public class MXMLRemoteObjectTagTests extends MXMLInstanceTagTestsBase return "xmlns:mx='library://ns.adobe.com/flex/mx'"; } + @Test + public void MXMLRemoteObjectTag() + { + String[] declarations = new String[] + { + "<mx:RemoteObject id='ro1'>", + "</mx:RemoteObject>" + }; + String[] scriptDeclarations = new String[] + { + }; + String[] asserts = new String[] + { + "assertEqual('ro1 is RemoteObject', ro1 is RemoteObject, true);", + }; + String mxml = getMXML(declarations, scriptDeclarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + + @Ignore + @Test + public void MXMLRemoteObjectTag_method() + { + String[] declarations = new String[] + { + "<mx:RemoteObject id='ro1'>", + // " <mx:method name='m1'/>", + "</mx:RemoteObject>" + }; + String[] scriptDeclarations = new String[] + { + "import mx.rpc.remoting.mxml.Operation;" + }; + String[] asserts = new String[] + { + "assertEqual('ro1 is RemoteObject', ro1 is RemoteObject, true);", + "assertEqual('ro1.operations.m1', ro1.operations['m1'] is Operation, true);", + "assertEqual('ro1.operations.m1.name', ro1.operations['m1'].name, 'm1');", + }; + String mxml = getMXML(declarations, scriptDeclarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + + @Ignore @Test public void MXMLRemoteObjectTag_twoMethods() { @@ -50,7 +95,7 @@ public class MXMLRemoteObjectTagTests extends MXMLInstanceTagTestsBase { "<mx:RemoteObject id='ro1'>", " <mx:method name='m1'/>", - " <mx:destination>http://whatever</mx:destination>", + " <mx:destination>https://example.com</mx:destination>", " <mx:method name='m2'/>", "</mx:RemoteObject>" }; @@ -61,7 +106,7 @@ public class MXMLRemoteObjectTagTests extends MXMLInstanceTagTestsBase String[] asserts = new String[] { "assertEqual('ro1 is RemoteObject', ro1 is RemoteObject, true);", - "assertEqual('ro1.destination', ro1.destination, 'http://whatever');", + "assertEqual('ro1.destination', ro1.destination, 'https://example.com');", "assertEqual('ro1.operations.m1', ro1.operations['m1'] is Operation, true);", "assertEqual('ro1.operations.m1.name', ro1.operations['m1'].name, 'm1');", "assertEqual('ro1.operations.m2', ro1.operations['m2'] is Operation, true);", diff --git a/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java b/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java index 4777711e6..c3e7ff437 100644 --- a/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java +++ b/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java @@ -19,6 +19,7 @@ package mxml.tags; +import org.junit.Ignore; import org.junit.Test; /** @@ -44,6 +45,71 @@ public class MXMLWebServiceTagTests extends MXMLInstanceTagTestsBase return "xmlns:mx='library://ns.adobe.com/flex/mx'"; } + @Test + public void MXMLWebServiceTag() + { + String[] declarations = new String[] + { + "<mx:WebService id='ws1'>", + "</mx:WebService>" + }; + String[] scriptDeclarations = new String[] + { + }; + String[] asserts = new String[] + { + "assertEqual('ws1 is WebService', ws1 is WebService, true);", + }; + String mxml = getMXML(declarations, scriptDeclarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + + @Test + public void MXMLWebServiceTag_description() + { + String[] declarations = new String[] + { + "<mx:WebService id='ws1'>", + " <mx:description>whatever</mx:description>", + "</mx:WebService>" + }; + String[] scriptDeclarations = new String[] + { + }; + String[] asserts = new String[] + { + "assertEqual('ws1 is WebService', ws1 is WebService, true);", + "assertEqual('ws1.description', ws1.description, 'whatever');", + }; + String mxml = getMXML(declarations, scriptDeclarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + + @Ignore + @Test + public void MXMLWebServiceTag_operation() + { + String[] declarations = new String[] + { + "<mx:WebService id='ws1' wsdl='https://example.com'>", + " <mx:operation name='op1'/>", + "</mx:WebService>" + }; + String[] scriptDeclarations = new String[] + { + "import mx.rpc.soap.mxml.Operation;" + }; + String[] asserts = new String[] + { + "assertEqual('ws1 is WebService', ws1 is WebService, true);", + "assertEqual('ws1.operations.op1', ws1.operations['op1'] is Operation, true);", + "assertEqual('ws1.operations.op1.name', ws1.operations['op1'].name, 'op1');", + }; + String mxml = getMXML(declarations, scriptDeclarations, asserts); + compileAndRun(mxml, true, true, false, null); + } + + @Ignore @Test public void MXMLWebServiceTag_twoOperations() {
