-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC4J-618 WIP Add WsECL testsuite #719
base: candidate-9.6.x
Are you sure you want to change the base?
HPCC4J-618 WIP Add WsECL testsuite #719
Conversation
@asselitx please take a look at this work in progress. |
@@ -486,12 +486,27 @@ private void setProtocol(String protocol_) | |||
* @param port_ | |||
* the new port | |||
*/ | |||
private void setPort(String port_) | |||
public void setPort(String port_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Adds WsECL test suite - Adds published query setup logic - Adds simple ECL query file - Adds wsdl, xsd, req, resp request logic - Changes Utils.connection to allow post init changs of conn Signed-off-by: Rodrigo Pastrana <[email protected]>
32cd624
to
4768ca4
Compare
Jira Issue: https://hpccsystems.atlassian.net/browse/HPCC4J-618 Jirabot Action Result: |
@@ -0,0 +1,181 @@ | |||
/*############################################################################## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asselitx this is the wsecl test suite, any wsecl related tests would be hosted here
import org.junit.Test; | ||
import org.junit.runners.MethodSorters; | ||
|
||
public class WSECLTests extends BaseRemoteTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseRemoteTests initializes wseclwatch connection, based on optional env vars
@BeforeClass | ||
public static void setup() throws Exception | ||
{ | ||
wswuclient = wsclient.getWsWorkunitsClient(); //for publishing queries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method runs before the tests.
Here we try to publish an ecl query, then confirm it was actually published, and setup the wsecl connection
@Test | ||
public void testWsECLGetWSDL() | ||
{ | ||
assumeTrue("WsECL connection not available", wseclConn != null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ignore the test if any of these conditions fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might there be a way to common-up these 'assumeTrue' pre-checks, or always run one test with them first that all other tests are contingent upon? After finishing the review, this might not be as important as I thought. It looks like I won't be creating multiple new functions that need to follow the same pattern, rather filling in the meat of these four here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ofcourse, we can create a new method with all necessary prereq tests and manually call it directly before each test, or simply annotate it as
"BeforeEach":
https://stackoverflow.com/questions/63819472/how-can-i-use-the-beforeeach-method-for-testing-in-java
{ | ||
String wsdlURI = "/WsEcl/definitions/query/" + thorclustername + "/" + eclScriptName + "/main/" + eclScriptName + ".wsdl"; | ||
|
||
String wsdlResponse = wseclConn.sendGetRequest(wsdlURI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple http get request based on the wsecl connection setup above, and the target URI constructed here.
String wsdlResponse = wseclConn.sendGetRequest(wsdlURI); | ||
Assert.assertNotNull("Unexpected Null response", wsdlResponse); | ||
//TODO determine good way to confirm success/failure | ||
//Assert.assertArrayEquals(expectedWsdlResponse, wsdlResponse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can add expected responses under tests/resources and compare here
@@ -0,0 +1,3 @@ | |||
import $.esdl_example; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abandoning this ecl query since it requires esdl_example, opting for the simple ecl query below
@@ -0,0 +1,19 @@ | |||
MyFunc(STRING DataIn, STRING1 SearchChar) := FUNCTION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the content of the query matters, we can figure out how to publish RoxieEchoPersonInfo instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Rodrigo this all looks nicely set up, thanks! Take my comments as starting points for our call when I return.
WorkunitWrapper wu = new WorkunitWrapper(); | ||
wu.setECL(ecl); | ||
wu.setJobname(eclScriptName); | ||
wu.setCluster(thorclustername); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My experience has been with queries deployed to roxies, so this question may be naive. Are we able to test all the sample XML, XSD and WSDL features by targeting thor? I may need a quick explanation or pointer to relevant docs explaining how thor handles soap features if its different from roxie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current assumption is that the target engine doesn't affect the presence/absence of the wsecl features for req/resp/xsd/wsdl. But targeting thor is not necessary, it was just convenient. We can target Roxie if preferred/necessary but you'll need to target a configurable (or discoverable) roxie name.
@Test | ||
public void testWsECLGetWSDL() | ||
{ | ||
assumeTrue("WsECL connection not available", wseclConn != null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might there be a way to common-up these 'assumeTrue' pre-checks, or always run one test with them first that all other tests are contingent upon? After finishing the review, this might not be as important as I thought. It looks like I won't be creating multiple new functions that need to follow the same pattern, rather filling in the meat of these four here.
Type of change:
Checklist:
Testing: