Contributions
Re: howto invoke aws-sdk to verify results?
Hello Rupert, I was thinking about the external wrapper as well but the downside is then the interface towards that wrapper, in a sense that you will need to think of something support certain arguments etc... and also the results are obviously verbose so you'll need to parse the returned json or whatever you get. It's all overhead in this approach, that is actually the beauty of integrating with the sdk; you'll have 'native' access to the interface of the sdk.... Anyway we are rethinking our approach; soapui does not seem to be a tool for automated component/integration testing which includes reading back/comparing responses and i believe it will be much easier to implement something with plain unittest's in python. You simply import the boto3 (sdk) and it'll work :-) If i may advise on scripting capabilities for soapui....: support Python ;-) If you support the runtimes from a virtualenv you will not have the issue's like dependency hell i have been in; that has been proven to work very well for years... Also it could give soapui a boost since the Python community is very big. Paul905Views1like1CommentRe: howto invoke aws-sdk to verify results?
Rupert, It does not seem to work; also it looks like the dependencies fetched via Grape are nto available since it's complaining again the aws classes are not found. All in all it feels not stable to me... I'm switching to the github open source edition to get latest (and hopefully greatest) ;-) but i'm having doubts if i can overcome the dependency hell... The best solutionwould be to have groovy scripts running in a sandbox (alike virtualenv for python if you will), it will make it much more flexible to run whatever version ofjars that you need. For instance i'm seeing that if i replace the httpclient 4.1.1 with the newest version (that aws requires) then soapui does not startup anymore ... :-( Paul2.7KViews0likes4CommentsRe: howto invoke aws-sdk to verify results?
Rupert, I guess i found that version conflict, and i am now more or less stuck.... :( Issue is that soapui and groovy use the same set of libraries which is obviously not a good idea..... So the issue now is that aws-java-sdk-core requires httpclient 4.5.2 is you run a recent version however soapui is shipped with 4.1.1 (5 years old), obviously it makes no sense to run 5yr old aws api's..... I was hoping that Grape.grab(.... would download and override the system loaded library but it does not. I'm getting all kind of wierd problems: -java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.http.conn.ssl.SdkTLSSocketFactory error at line: 14 - I've also seen something with Field INSTANCE missing which i do not understand,..,.. Any tips/advise would be welcome, Can i override/set the lib path groovy is using? Paul2.7KViews0likes6CommentsRe: howto invoke aws-sdk to verify results?
Making progress..... First of all it's important to know i'm running on the open source edition of soapui now (which has .... other dependencies listed in its lib folder). In order to get Grape running i had to manually add some jars to the lib folder (not the ext folder), versions are dependent on the soapui version: SoapUI 5.2.1 => Groovy 2.1.7 =>ivy 2.2.0 =>ant 1.6.2 I downloaded these from maven repo and cp into the lib, then restart soapui and it came alive with this code: import groovy.grape.Grape Grape.grab(group: 'com.amazonaws', module: 'aws-java-sdk', version: '1.11.39') import com.amazonaws.regions.Region; import com.amazonaws.regions.Regions; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.s3.model.Bucket; AmazonS3Client client = new AmazonS3Client(); client.setRegion(Region.getRegion(Regions.EU_WEST_1)); //List<Bucket> buckets = client.listBuckets(); I now run into the next issue which is again a missing dependency; probably httpclient... Error is java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.http.conn.ssl.SdkTLSSocketFactory error at line: 13 So when i can figure out the dependency/version i can get it via Grape... Paul2.7KViews0likes8CommentsRe: howto invoke aws-sdk to verify results?
I may have found the cause of the error; it's probably a version conflict with a jar from ReadyAPI-..../lib since appearently an older version from aws is already present (aws-java-sdk-core-1.10.14.jar). I only found that when i had to switch to the open source edition of soapui (because the pro edition did not show my scripts any more!?!?!? but that's something different). When i succeed in adding grapes support to the open source edition i'll post the results./.... Paul2.7KViews0likes11CommentsRe: howto invoke aws-sdk to verify results?
After doing some more reading my first attempt is to Groovy + aws-java-sdk. To get the dependencies i used grapes (based on this threadhttp://stackoverflow.com/questions/306139/how-do-i-include-jars-in-a-groovy-script). My code: @Grab(group='com.amazonaws', module='aws-java-sdk', version='1.11.39') import com.amazonaws.regions.Region; import com.amazonaws.regions.Regions; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.s3.model.Bucket; import com.amazonaws.services.s3.model.CannedAccessControlList; import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest; import com.amazonaws.services.s3.model.GetObjectRequest; import com.amazonaws.services.s3.model.ObjectListing; import com.amazonaws.services.s3.model.ObjectMetadata; import com.amazonaws.services.s3.model.S3ObjectSummary; AmazonS3Client client = new AmazonS3Client(); client.setRegion(Region.getRegion(Regions.EU_WEST_1)); List<Bucket> buckets = client.listBuckets(); When playing the script it first takes a while (good sign) and actually i do see jars popping up in ~/.groovy/grapes/com.amazonaws/aws-java-sdk/jars But then an error message: java.lang.NoSuchMethodError: com.amazonaws.SDKGlobalConfiguration.isInRegionOptimizedModeEnabled()Z@ line 18 I verified and this method is in fact part of the jar so the import is not working? Also tried to cp the jar into~/SmartBear/ReadyAPI-1.8.5/bin/ext : same result I guess i'm missing something on the import part? Paul2.7KViews0likes12CommentsRe: howto invoke aws-sdk to verify results?
Actually i meant not the sdk for java but either: - awscli (which is in boto3/python) - aws-sdk for javascript (https://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-intro.html) I'm not familiar with groovy and its capabilities to interop with python or js? But i guess it should be feasible to import the .js libraries from a javascript right? What kind of js support does soapui have? Another option could be to run an external (wrapper) script/program? Paul2.5KViews0likes14CommentsRe: howto invoke aws-sdk to verify results?
Hello Rupert, Thank you for the response. In fact we already managed to create/sign a raw rest request, but that is obviously not really scaleable. When you intend to do richer stuff you will quickly need to aws cli or aws sdk. Since it does support javascript and there is in fact an aws sdk for javascript it should be possible to use it. I just have no idea how to add those libraries to soapui? Please note i'm a soapui-newbie... soon to become an expert ;-) Paul2.5KViews0likes20Commentshowto invoke aws-sdk to verify results?
For a project we like to use soapui to test a processing pipeline that is deployed to aws using services such as elasticbeanstalk, kinesis streams and s3. We have succeeded to issue REST requests to the beanstalk application however we are puzzling how to read back the "output" in order to compare it with expected test output. A useful/scalable approach would be to integrate the aws-sdk into a script-step so we could for instance query certain cloudwatch loggings or download data from s3 or get notified of certain system activities. But given the fact the google gives us no hits on blogs or examples of any kind we kind of having doubts if this is the right direction. Any tips/guidance on this topic is greatly appreciated, Paul3.5KViews0likes22Comments