Hi Pradeep, thanks for the info - I'll take a look into your web mock. If it looks like a mock library is the way to go for the CLI, is there anything stopping us from using a mock library like easymock?
On Wed, Apr 30, 2014 at 5:34 PM, Pradeep Fernando <[email protected]> wrote: > Hi Chris, > > We dont use mock libs. However i wrote a mock backend for SM REST api. It > manipulates the input using a in-memory object model (you can deploy > partition/subscribe to cartridges/etc). To build the mock webapp you have to > pass the > > -Denv=test > > property while building the components/org.apache.stratos.rest.endpoint > module. > > copy the resulting war (you get the war file with same name, but the content > is different - cxf-servlet.xml) to repositoty/deployment/server/webapps and > test CLI or UI > > thanks. > > > On Wed, Apr 30, 2014 at 7:13 PM, Nirmal Fernando <[email protected]> > wrote: >> >> Chris, >> >> AFAIK Stratos Manager uses a mock library. >> >> >> On Wed, Apr 30, 2014 at 12:46 PM, chris snow <[email protected]> wrote: >>> >>> Yep, that's what I found too. >>> >>> I'm going to take a look at fixing this. I think the first step is >>> adding some unit tests. >>> >>> Do we have a preference over mock libraries? I had a quick scan in >>> the source and couldn't see any other mock libraries being used. >>> >>> >>> On Wed, Apr 30, 2014 at 7:53 AM, Manula Chathurika Thantriwatte >>> <[email protected]> wrote: >>> > Hi, >>> > >>> > This works for commands which haven't options. Ex : ./stratos.sh -u >>> > admin -p >>> > admin list-autoscaling-policies works for me. >>> > >>> > >>> > On Tue, Apr 29, 2014 at 11:59 PM, chris snow <[email protected]> >>> > wrote: >>> >> >>> >> Np, I've wrapped it with an expect script for the time being. >>> >> >>> >> If I get a chance, I'll have a look at the bugs at some point. >>> >> >>> >> On Tue, Apr 29, 2014 at 7:23 PM, Nirmal Fernando >>> >> <[email protected]> >>> >> wrote: >>> >> > Yes, I was suggesting the work-around, since you claimed it's not >>> >> > working >>> >> > :-) >>> >> > >>> >> > >>> >> > On Tue, Apr 29, 2014 at 11:46 PM, Isuru Perera <[email protected]> >>> >> > wrote: >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> On Tue, Apr 29, 2014 at 11:14 AM, Nirmal Fernando >>> >> >> <[email protected]> >>> >> >> wrote: >>> >> >>> >>> >> >>> Hi Chris, >>> >> >>> >>> >> >>> I think you need to run the deploy-partition command inside the >>> >> >>> stratos >>> >> >>> CLI console. >>> >> >> >>> >> >> Yes. That's the workaround. However what Chris needs is to run it >>> >> >> as an >>> >> >> external commands. The way Chris tried is supposed to work and >>> >> >> that's >>> >> >> how >>> >> >> the CLI was designed. >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> On Tue, Apr 29, 2014 at 11:14 PM, chris snow <[email protected]> >>> >> >>> wrote: >>> >> >>>> >>> >> >>>> I'm trying to deploy a partition using the following command: >>> >> >>>> >>> >> >>>> vagrant@puppet:~$ java -jar >>> >> >>>> $CLI_HOME/org.apache.stratos.cli-4.0.0-incubating-Tool.jar >>> >> >>>> -username >>> >> >>>> admin -password admin deploy-partition -p >>> >> >>>> /vagrant/openstack-qemu/example_partition.json >>> >> >>>> >>> >> >>>> The response is: >>> >> >>>> >>> >> >>>> Username: admin >>> >> >>>> usage: deploy-partition [-p <resource path>] >>> >> >>>> >>> >> >>>> For some reason, the CLI is not recognising the '-p' option. >>> >> >>>> >>> >> >>>> Any ideas? >>> >> >>>> >>> >> >>>> Many thanks, >>> >> >>>> >>> >> >>>> Chris >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> -- >>> >> >>> Best Regards, >>> >> >>> Nirmal >>> >> >>> >>> >> >>> Nirmal Fernando. >>> >> >>> PPMC Member & Committer of Apache Stratos, >>> >> >>> Senior Software Engineer, WSO2 Inc. >>> >> >>> >>> >> >>> Blog: http://nirmalfdo.blogspot.com/ >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> -- >>> >> >> Isuru Perera >>> >> >> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>> >> >> Lean . Enterprise . Middleware >>> >> >> >>> >> >> about.me/chrishantha >>> >> > >>> >> > >>> >> > >>> >> > >>> >> > -- >>> >> > Best Regards, >>> >> > Nirmal >>> >> > >>> >> > Nirmal Fernando. >>> >> > PPMC Member & Committer of Apache Stratos, >>> >> > Senior Software Engineer, WSO2 Inc. >>> >> > >>> >> > Blog: http://nirmalfdo.blogspot.com/ >>> >> >>> >> >>> >> >>> >> -- >>> >> Check out my professional profile and connect with me on LinkedIn. >>> >> http://lnkd.in/cw5k69 >>> > >>> > >>> > >>> > >>> > -- >>> > Regards, >>> > Manula Chathurika Thantriwatte >>> > Software Engineer >>> > WSO2 Inc. : http://wso2.com >>> > lean . enterprise . middleware >>> > >>> > email : [email protected] / [email protected] >>> > phone : +94 772492511 >>> > blog : http://manulachathurika.blogspot.com/ >>> > >>> > >>> > >>> >>> >>> >>> -- >>> Check out my professional profile and connect with me on LinkedIn. >>> http://lnkd.in/cw5k69 >> >> >> >> >> -- >> Best Regards, >> Nirmal >> >> Nirmal Fernando. >> PPMC Member & Committer of Apache Stratos, >> Senior Software Engineer, WSO2 Inc. >> >> Blog: http://nirmalfdo.blogspot.com/ > > > > > -- > Pradeep Fernando. > http://pradeepfernando.blogspot.com/ -- Check out my professional profile and connect with me on LinkedIn. http://lnkd.in/cw5k69
