Re: [Dev] Prediction - 'skip decoding' query param

2015-12-13 Thread Nirmal Fernando
Hi Rukshani,

We cannot change the v10 API, this is valid only for v11.

On Sun, Dec 13, 2015 at 1:57 PM, Rukshani Weerasinha 
wrote:

> Hi Nirmal,
>
> Now I have added this property in the following APIs.
>
> [1]
> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
> [2]
> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API
> [3] https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API
> [4]
> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API+v10
> [5]
> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API+v10
> [6]
> https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API+v10
>
> Best Regards,
> Rukshani.
>
> On Fri, Dec 11, 2015 at 10:08 PM, Nirmal Fernando  wrote:
>
>> I've added a query param to the prediction API s.t. it would not decode
>> the predicted value if skipDecoding query param set to true.
>>
>>
>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
>>
>> @Rukshani can you replicate the same query param to other predict APIs ?
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>
>> Team Lead - WSO2 Machine Learner
>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>> Mobile: +94715779733
>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>
>
> --
> Rukshani Weerasinha
>
> WSO2 Inc.
> Web:http://wso2.com
> Mobile: 0777 683 738
>
>


-- 

Thanks & regards,
Nirmal

Team Lead - WSO2 Machine Learner
Associate Technical Lead - Data Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Prediction - 'skip decoding' query param

2015-12-13 Thread Rukshani Weerasinha
Hello Nirmal,

Now the change is rolled back for [4], [5], and [6].

Best Regards,
Rukshani.

On Sun, Dec 13, 2015 at 2:59 PM, Nirmal Fernando  wrote:

> Hi Rukshani,
>
> We cannot change the v10 API, this is valid only for v11.
>
> On Sun, Dec 13, 2015 at 1:57 PM, Rukshani Weerasinha 
> wrote:
>
>> Hi Nirmal,
>>
>> Now I have added this property in the following APIs.
>>
>> [1]
>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
>> [2]
>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API
>> [3] https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API
>> [4]
>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API+v10
>> [5]
>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API+v10
>> [6]
>> https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API+v10
>>
>> Best Regards,
>> Rukshani.
>>
>> On Fri, Dec 11, 2015 at 10:08 PM, Nirmal Fernando 
>> wrote:
>>
>>> I've added a query param to the prediction API s.t. it would not decode
>>> the predicted value if skipDecoding query param set to true.
>>>
>>>
>>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
>>>
>>> @Rukshani can you replicate the same query param to other predict APIs ?
>>>
>>> --
>>>
>>> Thanks & regards,
>>> Nirmal
>>>
>>> Team Lead - WSO2 Machine Learner
>>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>>> Mobile: +94715779733
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>>
>>>
>>
>>
>> --
>> Rukshani Weerasinha
>>
>> WSO2 Inc.
>> Web:http://wso2.com
>> Mobile: 0777 683 738
>>
>>
>
>
> --
>
> Thanks & regards,
> Nirmal
>
> Team Lead - WSO2 Machine Learner
> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
>
>


-- 
Rukshani Weerasinha

WSO2 Inc.
Web:http://wso2.com
Mobile: 0777 683 738
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Prediction - 'skip decoding' query param

2015-12-13 Thread Nirmal Fernando
Thanks!

On Sun, Dec 13, 2015 at 3:39 PM, Rukshani Weerasinha 
wrote:

> Hello Nirmal,
>
> Now the change is rolled back for [4], [5], and [6].
>
> Best Regards,
> Rukshani.
>
> On Sun, Dec 13, 2015 at 2:59 PM, Nirmal Fernando  wrote:
>
>> Hi Rukshani,
>>
>> We cannot change the v10 API, this is valid only for v11.
>>
>> On Sun, Dec 13, 2015 at 1:57 PM, Rukshani Weerasinha 
>> wrote:
>>
>>> Hi Nirmal,
>>>
>>> Now I have added this property in the following APIs.
>>>
>>> [1]
>>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
>>> [2]
>>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API
>>> [3] https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API
>>> [4]
>>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API+v10
>>> [5]
>>> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API+v10
>>> [6]
>>> https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API+v10
>>>
>>> Best Regards,
>>> Rukshani.
>>>
>>> On Fri, Dec 11, 2015 at 10:08 PM, Nirmal Fernando 
>>> wrote:
>>>
 I've added a query param to the prediction API s.t. it would not decode
 the predicted value if skipDecoding query param set to true.


 https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API

 @Rukshani can you replicate the same query param to other predict APIs ?

 --

 Thanks & regards,
 Nirmal

 Team Lead - WSO2 Machine Learner
 Associate Technical Lead - Data Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



>>>
>>>
>>> --
>>> Rukshani Weerasinha
>>>
>>> WSO2 Inc.
>>> Web:http://wso2.com
>>> Mobile: 0777 683 738
>>>
>>>
>>
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>
>> Team Lead - WSO2 Machine Learner
>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>> Mobile: +94715779733
>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>
>
> --
> Rukshani Weerasinha
>
> WSO2 Inc.
> Web:http://wso2.com
> Mobile: 0777 683 738
>
>


-- 

Thanks & regards,
Nirmal

Team Lead - WSO2 Machine Learner
Associate Technical Lead - Data Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Cleaning up ML REST API

2015-12-13 Thread Nirmal Fernando
Thanks a lot Frank for taking your time to review a 45pg doc. :) I've
replied to few of your comments.

Unfortunately, I've got an event to attend this Wednesday. Currently, I
have Monday and Tuesday free on my calendar. Please let me know if one of
those days works for you.

On Sun, Dec 13, 2015 at 4:52 PM, Frank Leymann  wrote:

> Dear Thamali,
>
> I added a bunch of comments.  For each of the methods (get, post,) I
> suggested modifications to your API that you may want to use as template
> for the other APIs; of course, I argued why I suggested individual pieces.
> I also started to make use of Swagger Paramters: and Definitions: sections
> to better ensure reuse of the different declarations of the API.
>
> Finally: I need to much better understand the ML data model. See my
> comments for clarification need I have :-)  This understanding is key to be
> able to recommend the use of "processing function resources" or not.
>
> I am looking forward to our discussion on Wednesday...
>
>
> Best regards,
> Frank
>
> 2015-12-01 12:55 GMT+01:00 Thamali Wijewardhana :
>
>> Link for the swagger definition:
>>
>>
>> https://docs.google.com/a/wso2.com/document/d/1KYmXyuEFJMhFMy6p-SjRztVrgW8mr83LZR2U4BK4d-M/edit?usp=sharing
>>
>>
>> On Tue, Dec 1, 2015 at 4:32 PM, Thamali Wijewardhana 
>> wrote:
>>
>>>
>>>
>>> On Thu, Nov 26, 2015 at 7:40 PM, Frank Leymann  wrote:
>>>
 Dear all, sorry for the delay  :-(

 What about one of the following time slots:

 Tuesday, Dec 1, 4pm Colombo Time
 Wednesday, Dec 2, 4pm Colombo Time
 Friday, Dec 4, 4pm Colombo Time

 I will be available later than 4pm but this won't be convenient for you
 in Colombo.



 Best regards,
 Frank

 2015-11-25 8:43 GMT+01:00 Nirmal Fernando :

> Hi Frank,
>
> Could you please let us know few time slots?
>
> On Mon, Nov 23, 2015 at 9:29 AM, Nirmal Fernando 
> wrote:
>
>> Absolutely. We'll wait till Frank confirms a time. Thanks.
>>
>> On Sun, Nov 22, 2015 at 10:18 PM, Sanjeewa Malalgoda <
>> sanje...@wso2.com> wrote:
>>
>>> Hi nirmal,
>>> please invite apim rest api team as well. we would like to join this
>>> discussion.
>>>
>>> Thanks
>>> sanjeewa.
>>>
>>> sent from my phone
>>> On Nov 22, 2015 7:00 PM, "Nirmal Fernando"  wrote:
>>>
 Thanks Frank for the response. +1 for having a call. Could you
 please propose few time slots?

 On Sun, Nov 22, 2015 at 6:55 PM, Frank Leymann 
 wrote:

> Dear Thamali,
>
> we (APIM, ES Publisher,... teams) developed some guidelines on
> making all of our APIs more consistent. For example, versioning 
> (major,
> minor, patch) as part of the URL context etc.  Also, you are not 
> using PUT
> but always POST - this has some implications a bunch of REST-folks are
> serious about. Similarly, the use of proper HTTP headers is a REST 
> issue to
> reduce the amount of data transferred, to avoid potential concurrency
> problems etc.
>
> Should we have a call to discuss the API and check where we can
> help?
>
>
>
> Best regards,
> Frank
>
> 2015-11-18 12:10 GMT+01:00 Nirmal Fernando :
>
>> Thanks Thamali! Please try to generate the Swagger definition for
>> ML API as the next step.
>>
>> On Wed, Nov 18, 2015 at 12:21 PM, Thamali Wijewardhana <
>> tham...@wso2.com> wrote:
>>
>>> REST API standards define the way to produce a RESTful API. For
>>> an API to become a RESTful API, it should confirm to those REST
>>> standards.This document includes a set of  improvements to make the 
>>> WSO2
>>> API, a RESTful API.
>>>
>>>
>>>
>>> https://docs.google.com/spreadsheets/d/1HYiS-TpqYaZTtBLLSIeYZ_nvZkbt7zAFwetnHLe4vg8/edit#gid=0
>>>
>>>
>>>
>>
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>
>> Team Lead - WSO2 Machine Learner
>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>> Mobile: +94715779733
>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>


 --

 Thanks & regards,
 Nirmal

 Team Lead - WSO2 Machine Learner
 Associate Technical Lead - Data Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



>>
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>

Re: [Dev] Prediction - 'skip decoding' query param

2015-12-13 Thread Rukshani Weerasinha
Hi Nirmal,

Now I have added this property in the following APIs.

[1]
https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
[2]
https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API
[3] https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API
[4]
https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API+v10
[5]
https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+CSV+or+TSV+File+via+REST+API+v10
[6] https://docs.wso2.com/display/ML110/Predicting+a+Model+via+REST+API+v10

Best Regards,
Rukshani.

On Fri, Dec 11, 2015 at 10:08 PM, Nirmal Fernando  wrote:

> I've added a query param to the prediction API s.t. it would not decode
> the predicted value if skipDecoding query param set to true.
>
>
> https://docs.wso2.com/display/ML110/Making+a+Prediction+Using+a+Model+via+REST+API
>
> @Rukshani can you replicate the same query param to other predict APIs ?
>
> --
>
> Thanks & regards,
> Nirmal
>
> Team Lead - WSO2 Machine Learner
> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
>
>


-- 
Rukshani Weerasinha

WSO2 Inc.
Web:http://wso2.com
Mobile: 0777 683 738
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.3 RC3

2015-12-13 Thread Maheshakya Wijewardena
Hi,

I have built ML 1.1.0 Beta pack including all tests with kernel 4.4.3 RC3.
No issues found.

[x] Stable - Go ahead and release.

Best regards.

On Mon, Dec 14, 2015 at 8:21 AM, Hasitha Aravinda  wrote:

> Hi
>
> I have tested BPS 3.5.1-SNAPSHOT with kernel 4.4.3
> ​ RC3​
> ​
> . No issue found.
>
> [x] Stable - Go ahead and release.
>
> Thanks
> Hasitha.
>
> On Fri, Dec 11, 2015 at 8:15 PM, Nipuni Perera  wrote:
>
>>
>> Hi Devs,
>>
>> This is the RC3 release candidate of WSO2 Carbon Kernel 4.4.3.
>>
>> This release fixes the following issues:
>> https://wso2.org/jira/issues/?filter=12540
>>
>> Please download and test your products with kernel 4.4.3 RC3
>> and vote. Vote will be open for 72 hours or as longer as needed.
>>
>> *​Source and binary distribution files:*
>> http://svn.wso2.org/repos/wso2/people/nipuni/4.4.3-rc3/
>>
>> *Maven staging repository:*
>> http://maven.wso2.org/nexus/content/repositories/orgwso2carbon-168/
>>
>> *The tag to be voted upon:*
>> https://github.com/wso2/carbon-kernel/releases/tag/v4.4.3-RC3
>>
>>
>> [ ] Broken - do not release (explain why)
>> [ ] Stable - go ahead and release
>>
>> Thank you
>> Carbon Team
>>
>> --
>> Nipuni Perera
>> Software Engineer; WSO2 Inc.; http://wso2.com
>> Email: nip...@wso2.com
>> Git hub profile: https://github.com/nipuni
>> Blog : http://nipunipererablog.blogspot.com/
>> Mobile: +94 (71) 5626680
>> 
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> --
> Hasitha Aravinda,
> Senior Software Engineer,
> WSO2 Inc.
> Email: hasi...@wso2.com
> Mobile : +94 718 210 200
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Pruthuvi Maheshakya Wijewardena
Software Engineer
WSO2 : http://wso2.com/
Email: mahesha...@wso2.com
Mobile: +94711228855
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Application Server 6.0.0, Customized Class Loader

2015-12-13 Thread Miraj Abeysekara
Hi all,

Since the Application Server 6.0.0 is moving out from the Carbon platform,
the carbon dependencies of the old Application Server's class loader will
get removed. The class loader of the new Application Server 6.0.0 is
implemented using Java 8 by expecting the performance improvements and
better code maintainability. Currently the following features are available
in the Application Server 6.0.0's class loader.


   - Load the global class-loading configurations from
*{APP_SERVER.HOME}/conf/AppLoader/
   *directory. (currently supported configurations: set parent fist
   loading behavior, add globally available runtimes and exclusive runtimes,
   set minimal startup runtime)
   - If any webapp is deployed with its own class-loading configurations
   (specified in *{Webapp.dir}/{Webapp.name}/META-INF/* directory) the
   global values for that webapp were overridden when deploying.
   - Default runtimes are stored in *{APP_SERVER.HOME}/lib/runtimes/ *directory
   which are loaded by the class-loader if required.
   - A webapp can specify a exclusive runtimes which only loaded for that
   webapp


Any other requirements or suggestions are highly appreciated.

Thanks.

-- 
Miraj Abeysekara
Intern (Software Engineering)
Mobile: +94775690822
Twitter: https://twitter.com/MiRAGECreator
GooglePlus: https://plus.google.com/u/0/+MirageAbeysekara
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.3 RC3

2015-12-13 Thread Hasitha Aravinda
Hi

I have tested BPS 3.5.1-SNAPSHOT with kernel 4.4.3
​ RC3​
​
. No issue found.

[x] Stable - Go ahead and release.

Thanks
Hasitha.

On Fri, Dec 11, 2015 at 8:15 PM, Nipuni Perera  wrote:

>
> Hi Devs,
>
> This is the RC3 release candidate of WSO2 Carbon Kernel 4.4.3.
>
> This release fixes the following issues:
> https://wso2.org/jira/issues/?filter=12540
>
> Please download and test your products with kernel 4.4.3 RC3
> and vote. Vote will be open for 72 hours or as longer as needed.
>
> *​Source and binary distribution files:*
> http://svn.wso2.org/repos/wso2/people/nipuni/4.4.3-rc3/
>
> *Maven staging repository:*
> http://maven.wso2.org/nexus/content/repositories/orgwso2carbon-168/
>
> *The tag to be voted upon:*
> https://github.com/wso2/carbon-kernel/releases/tag/v4.4.3-RC3
>
>
> [ ] Broken - do not release (explain why)
> [ ] Stable - go ahead and release
>
> Thank you
> Carbon Team
>
> --
> Nipuni Perera
> Software Engineer; WSO2 Inc.; http://wso2.com
> Email: nip...@wso2.com
> Git hub profile: https://github.com/nipuni
> Blog : http://nipunipererablog.blogspot.com/
> Mobile: +94 (71) 5626680
> 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
--
Hasitha Aravinda,
Senior Software Engineer,
WSO2 Inc.
Email: hasi...@wso2.com
Mobile : +94 718 210 200
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Analytics JavaScript API : Fails due to not being able to build the request

2015-12-13 Thread Anjana Fernando
[Adding Gimantha].

On Sun, Dec 13, 2015 at 1:01 PM, Supun Sethunga  wrote:

> Hi,
>
> I was trying to do a drillDownSearch using [1]. This operation always
> returned *"{"status" : "failed", "message" : "drilldownSearch parameters
> are not provided"}"*. Further debugging, found out out that, this happens
> due to the "request" is not getting build at the
> https://localhost:9443/portal/controllers/apis/analytics.jag, hence
> contentAsString = stringify(content); always resolve to null, resulting the
> above error.
>
> I could overcome this by adding the following to the "analytics.jag" file
> [2]:
>
> *if(request.getMethod() == "POST") {*
>
> *log.debug(request.getContent());*
>
> *}  *
>
>
> Further, I also had to change [3] to follow:
>
> contentAsString = content;
>
>
> It seemed like to me, the request was not getting built. Any idea what
> would be the reason for this?
>
> btw, in the doc [1]  var client = new AnalyticsClient().init(); should be
> changed to var client = new AnalyticsClient() it seems (no *init()* part).
>
> [1] https://docs.wso2.com/display/DAS300/Analytics+JavaScript+(JS)+API
> [2]
> https://github.com/wso2/carbon-dashboards/blob/master/apps/portal/controllers/apis/analytics.jag
> [3]
> https://github.com/wso2/carbon-dashboards/blob/master/apps/portal/controllers/apis/analytics.jag#L151
>
> Thanks,
> Supun
> --
> *Supun Sethunga*
> Software Engineer
> WSO2, Inc.
> http://wso2.com/
> lean | enterprise | middleware
> Mobile : +94 716546324
>



-- 
*Anjana Fernando*
Senior Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] Implement unit/integration test cases for API Manager JAX-RS Rest API

2015-12-13 Thread Chamin Dias
Hi,

We have come up with a mechanism to include automated tests for the REST
API which is going to be shipped with APIM 1.10.0. This is a data driven
test mechanism. The purpose of this E-Mail is to communicate the method
that we used to do the required task.

The test automation process has several java files, data files (in JSON
format)


*Data file*

Data for each scenario is stored in JSON format. Here is an example.

{
"testCase": [
{
"init": {
"scope": ""
},
"data": {
"method": "",
"url": "",
"query-parameters": "",
"request-headers": {
"Authorization": "Bearer"
},
"request-payload": "",
"response-headers": "",
"response-payload": ""
},
"asserts": {
"header-asserts": {
"status-code": ""
},
"body-asserts": ""
}
}
]
}


In a test case, there are three main sections named "init", "data" and
"asserts". Init section is used to store the user scope which is needed to
register the OAuth app and generate the access token. Data section will
store the required data for the corresponding request. It includes the HTTP
method, URL, query parameters (in nested JSON element), request-headers,
request-payload and response-headers. Asserts section is there to hold the
fields that are going to be validated against the response. Values that are
in header/body or both header and body can be compared to verify the
response.

In addition to that, we are going to include another section called
"preserve-list", if we need to take some of the values from the current
response to the next request. If this section is there, then the parameter
is stored in a Map (in the code) , as it needs to be used in subsequent
request(s).

Example : If we add (POST) a new API from the first request and if are
going to fetch it at the next request (GET), then we need to store the UUID
of the created API in the second request. In those kind of scenarios, this
"preserve-list" will be used. It contains the name of the attribute to be
preserved and the location of that attribute in the response, which is
represented in JSON format. For example, the following "preserve-list" says
that, it is needed to preserve the "apiId", which can be found in "id"
element in the response.

 "preserve-list":[
{
"attribute-name":"apiId",
"response-location":"id"

}
]


If there is a resource URL like /api/am/publisher/v1//apis/{apiId}, then
the {apiId} will be fetched from the preserved list and the URL for the
request is constructed accordingly. Please note that this "preserve-list"
is optional. It is *only* needed if we need to take some value for the next
request.

The next important section is the "asserts" section. This is mainly for the
verification process to evaluate wether the test has succeeded or not.
"header-asserts" section contains the elements that should be compared
against the header of the response, while "body-asserts"


*Util Java files*

We have created util classes that can be used in any test scenario. The
util classes do the following tasks.

i) Read the data file
ii) Parse the data (i.e JSON)
iii) Register an OAuth application
iv) Generate access token (using token API)
v) Put the attributes to the preserve attribute list(if needed)
vi) Send the request to the REST API
vii) Identify the type of the request and make the relevant call (GET,POST
etc..)
viii) Get the response

These util methods are used in all test scenarios. If all the test cases
for a given scenario is successful, then we evaluate the test has passed.

Eg : If the test scenario is manipulating tiers, we first add a tier, GET
the tier, update the tier and delete the tier via the REST API. If all of
them are succeeded, we assert that the tier manipulation test has passed.


*Some more facts about this model*

If we need to add a new test scenario, all we need to do is, add a java
file only for the corresponding test, add the corresponding JSON data file
and run it. If we need to add/remove a request to/from a test scenario, all
we need to do is add/remove the required JSON configuration, save it and
run the test. Util classes won't change.

We have done R and discussions on selection this mechanism and we have
found that this is the most flexible approach to write test cases for the
REST API. In addition to that, we think this data driven approach can be
used in similar situations in other products as well. Eventually, we hope
this model will be beneficial when trying to come up with a automation
mechanism for all WSO2 products.

Thanks.
ChaminD

On Tue, Nov 24, 2015 at 11:47 AM, Dharshana 

Re: [Dev] Cleaning up ML REST API

2015-12-13 Thread Nirmal Fernando
Hi Frank,

I'm celebrating X'mas so probably not be around :-( Shall we synch up in
the new year? We're on holiday till 4th Jan :)

On Sun, Dec 13, 2015 at 10:23 PM, Frank Leymann  wrote:

> Hi Nirmal,
>
> sure, if you can't make Wednesday we should defer the meeting.  I am fully
> booked on Monday and Tuesday, and after Wednesday I have a bunch of
> personal commitments.
>
> I would be available on the 25th (yes! it's Xmas, but I am more than happy
> to discuss with you!), but I am not sure whether you are working that
> day... Otherwise, I could make Tuesday the 29th (4pm Colombo time) or
> Wednesday 30th (2:30pm Colombo time).
>
> Just let me know :-))
>
>
> Best regards,
> Frank
>
> 2015-12-13 13:00 GMT+01:00 Nirmal Fernando :
>
>> Thanks a lot Frank for taking your time to review a 45pg doc. :) I've
>> replied to few of your comments.
>>
>> Unfortunately, I've got an event to attend this Wednesday. Currently, I
>> have Monday and Tuesday free on my calendar. Please let me know if one of
>> those days works for you.
>>
>> On Sun, Dec 13, 2015 at 4:52 PM, Frank Leymann  wrote:
>>
>>> Dear Thamali,
>>>
>>> I added a bunch of comments.  For each of the methods (get, post,) I
>>> suggested modifications to your API that you may want to use as template
>>> for the other APIs; of course, I argued why I suggested individual pieces.
>>> I also started to make use of Swagger Paramters: and Definitions: sections
>>> to better ensure reuse of the different declarations of the API.
>>>
>>> Finally: I need to much better understand the ML data model. See my
>>> comments for clarification need I have :-)  This understanding is key to be
>>> able to recommend the use of "processing function resources" or not.
>>>
>>> I am looking forward to our discussion on Wednesday...
>>>
>>>
>>> Best regards,
>>> Frank
>>>
>>> 2015-12-01 12:55 GMT+01:00 Thamali Wijewardhana :
>>>
 Link for the swagger definition:


 https://docs.google.com/a/wso2.com/document/d/1KYmXyuEFJMhFMy6p-SjRztVrgW8mr83LZR2U4BK4d-M/edit?usp=sharing


 On Tue, Dec 1, 2015 at 4:32 PM, Thamali Wijewardhana 
 wrote:

>
>
> On Thu, Nov 26, 2015 at 7:40 PM, Frank Leymann  wrote:
>
>> Dear all, sorry for the delay  :-(
>>
>> What about one of the following time slots:
>>
>> Tuesday, Dec 1, 4pm Colombo Time
>> Wednesday, Dec 2, 4pm Colombo Time
>> Friday, Dec 4, 4pm Colombo Time
>>
>> I will be available later than 4pm but this won't be convenient for
>> you in Colombo.
>>
>>
>>
>> Best regards,
>> Frank
>>
>> 2015-11-25 8:43 GMT+01:00 Nirmal Fernando :
>>
>>> Hi Frank,
>>>
>>> Could you please let us know few time slots?
>>>
>>> On Mon, Nov 23, 2015 at 9:29 AM, Nirmal Fernando 
>>> wrote:
>>>
 Absolutely. We'll wait till Frank confirms a time. Thanks.

 On Sun, Nov 22, 2015 at 10:18 PM, Sanjeewa Malalgoda <
 sanje...@wso2.com> wrote:

> Hi nirmal,
> please invite apim rest api team as well. we would like to join
> this discussion.
>
> Thanks
> sanjeewa.
>
> sent from my phone
> On Nov 22, 2015 7:00 PM, "Nirmal Fernando" 
> wrote:
>
>> Thanks Frank for the response. +1 for having a call. Could you
>> please propose few time slots?
>>
>> On Sun, Nov 22, 2015 at 6:55 PM, Frank Leymann 
>> wrote:
>>
>>> Dear Thamali,
>>>
>>> we (APIM, ES Publisher,... teams) developed some guidelines on
>>> making all of our APIs more consistent. For example, versioning 
>>> (major,
>>> minor, patch) as part of the URL context etc.  Also, you are not 
>>> using PUT
>>> but always POST - this has some implications a bunch of REST-folks 
>>> are
>>> serious about. Similarly, the use of proper HTTP headers is a REST 
>>> issue to
>>> reduce the amount of data transferred, to avoid potential 
>>> concurrency
>>> problems etc.
>>>
>>> Should we have a call to discuss the API and check where we can
>>> help?
>>>
>>>
>>>
>>> Best regards,
>>> Frank
>>>
>>> 2015-11-18 12:10 GMT+01:00 Nirmal Fernando :
>>>
 Thanks Thamali! Please try to generate the Swagger definition
 for ML API as the next step.

 On Wed, Nov 18, 2015 at 12:21 PM, Thamali Wijewardhana <
 tham...@wso2.com> wrote:

> REST API standards define the way to produce a RESTful API.
> For an API to become a RESTful API, it should 

Re: [Dev] Difference between driver.close() and driver.quit()

2015-12-13 Thread Rajeenthini Satkunam
Adding [ wso2Dev,Krishantha,Nuwan,Irham ]

Hi nipuna,

IMHO driver.quit() will make sure that we properly terminates the test
class and quit all the driver instance and running the the next test class
with a new instance of driver.

On Fri, Dec 11, 2015 at 5:30 PM, Nipuna Chandradasa 
wrote:

> Hi rajeenthini
>
> If this is the case why don't we close the opened extra browser windows
> within each test. If we do this we will end up having one browser window at
> the end of the test case
>
> I will look in to this as I  refactoring the braking tests.
>
> Regards
> On 11 Dec 2015 5:13 p.m., "Rajeenthini Satkunam" 
> wrote:
>
>> Hi all,
>>
>> I have search through the web above $subject.The way I understand is we
>> can refine our test code since we are handle multiple browser window or
>> single browser window.If we are handle one and only one window we don't
>> need to explicitly do driver.quit() , But In case of multiple windows we
>> should use driver.quit() because driver.close will close only the window it
>> has focused.
>>
>> Please find references.
>> [1] - http://www.testingdiaries.com/driver-close-and-driver-quit/
>> [2] - https://www.youtube.com/watch?v=3vxBBlvxcKE
>>
>> Correct me if I am wrong.
>>
>> --
>>
>> *Thank You.*
>>
>> *Rajeenthini Satkunam*
>>
>> *Associate Software Engineer | WSO2*
>>
>>
>> *E:rajeenth...@wso2.com *
>>
>> *M :+94770832823 <%2B94770832823>   *
>>
>>


-- 

*Thank You.*

*Rajeenthini Satkunam*

*Associate Software Engineer | WSO2*


*E:rajeenth...@wso2.com *

*M :+94770832823   *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Unable to download wso2 agent for android device

2015-12-13 Thread Sashika Wijesinghe
Hi Kasun,

When I changed the host entry to HTTP, download link redirects to 'No data
received' error page. Is there any other configuration change required to
get the enrollment successful?

Thanks & Regards,

On Sun, Dec 13, 2015 at 1:12 PM, Kasun Dananjaya Delgolla 
wrote:

> Hi Shashika,
>
> This is because you have given https your for generalConfig->host entry in
> config.json in emm-web-agent. It should be HTTP. Android doesn't allow
> HTTPS unless server has a trusted CA installed. Please change the config to
> HTTP and re-check.
>
> @Shavindri - This needs to be changed in the documentation as well. (Also
> mention in prod mode, change this to HTTPS)
>
> Thanks
>
> On Sat, Dec 12, 2015 at 5:12 PM, Sashika Wijesinghe 
> wrote:
>
>> Hi,
>>
>> I was unable to download wso2 agent for android device due to agent
>> download failure. In the download link it appears as 'unknown' (image
>> attached).
>>
>> Before starting the server I have configured below files with domain ip
>> address. (Configuration files attached )
>> May I know whether I missed any mandatory configurations?
>>
>>- cdm-config.xml
>>- carbon.xml
>>- config.json file at
>>'/repository/deployment/server/jaggeryapps/emm/config' location
>>- config.json file at
>>'/repository/deployment/server/jaggeryapps/emm-web-agent/config'
>>location
>>
>> Any help is highly appreciated.
>>
>> Thanks & Regards,
>> --
>>
>> *Sashika WijesingheSoftware Engineer - QA Team*
>> Mobile : +94 (0) 774537487
>> sash...@wso2.com
>>
>
>
>
> --
> Kasun Dananjaya Delgolla
>
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> Tel:  +94 11 214 5345
> Fax: +94 11 2145300
> Mob: + 94 771 771 015
> Blog: http://kddcodingparadise.blogspot.com
> Linkedin: *http://lk.linkedin.com/in/kasundananjaya
> *
>



-- 

*Sashika WijesingheSoftware Engineer - QA Team*
Mobile : +94 (0) 774537487
sash...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Difference between driver.close() and driver.quit()

2015-12-13 Thread Manuranga Perera
drive.quit is causing build breaks [1] so there is no point using it.
other option is to wrap it with try-catch.

https://wso2.org/jenkins/job/product-ues/601/

On Mon, Dec 14, 2015 at 9:46 AM, Rajeenthini Satkunam 
wrote:

> Adding [ wso2Dev,Krishantha,Nuwan,Irham ]
>
> Hi nipuna,
>
> IMHO driver.quit() will make sure that we properly terminates the test
> class and quit all the driver instance and running the the next test class
> with a new instance of driver.
>
> On Fri, Dec 11, 2015 at 5:30 PM, Nipuna Chandradasa 
> wrote:
>
>> Hi rajeenthini
>>
>> If this is the case why don't we close the opened extra browser windows
>> within each test. If we do this we will end up having one browser window at
>> the end of the test case
>>
>> I will look in to this as I  refactoring the braking tests.
>>
>> Regards
>> On 11 Dec 2015 5:13 p.m., "Rajeenthini Satkunam" 
>> wrote:
>>
>>> Hi all,
>>>
>>> I have search through the web above $subject.The way I understand is we
>>> can refine our test code since we are handle multiple browser window or
>>> single browser window.If we are handle one and only one window we don't
>>> need to explicitly do driver.quit() , But In case of multiple windows we
>>> should use driver.quit() because driver.close will close only the window it
>>> has focused.
>>>
>>> Please find references.
>>> [1] - http://www.testingdiaries.com/driver-close-and-driver-quit/
>>> [2] - https://www.youtube.com/watch?v=3vxBBlvxcKE
>>>
>>> Correct me if I am wrong.
>>>
>>> --
>>>
>>> *Thank You.*
>>>
>>> *Rajeenthini Satkunam*
>>>
>>> *Associate Software Engineer | WSO2*
>>>
>>>
>>> *E:rajeenth...@wso2.com *
>>>
>>> *M :+94770832823 <%2B94770832823>   *
>>>
>>>
>
>
> --
>
> *Thank You.*
>
> *Rajeenthini Satkunam*
>
> *Associate Software Engineer | WSO2*
>
>
> *E:rajeenth...@wso2.com *
>
> *M :+94770832823 <%2B94770832823>   *
>
>


-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.3 RC3

2015-12-13 Thread Jagath Sisirakumara Ariyarathne
Hi,

Built latest ESB pack with all integration tests. No issues observed.

[x] Stable - go ahead and release

Thanks.

On Mon, Dec 14, 2015 at 10:08 AM, Maheshakya Wijewardena <
mahesha...@wso2.com> wrote:

> Hi,
>
> I have built ML 1.1.0 Beta pack including all tests with kernel 4.4.3 RC3.
> No issues found.
>
> [x] Stable - Go ahead and release.
>
> Best regards.
>
> On Mon, Dec 14, 2015 at 8:21 AM, Hasitha Aravinda 
> wrote:
>
>> Hi
>>
>> I have tested BPS 3.5.1-SNAPSHOT with kernel 4.4.3
>> ​ RC3​
>> ​
>> . No issue found.
>>
>> [x] Stable - Go ahead and release.
>>
>> Thanks
>> Hasitha.
>>
>> On Fri, Dec 11, 2015 at 8:15 PM, Nipuni Perera  wrote:
>>
>>>
>>> Hi Devs,
>>>
>>> This is the RC3 release candidate of WSO2 Carbon Kernel 4.4.3.
>>>
>>> This release fixes the following issues:
>>> https://wso2.org/jira/issues/?filter=12540
>>>
>>> Please download and test your products with kernel 4.4.3 RC3
>>> and vote. Vote will be open for 72 hours or as longer as needed.
>>>
>>> *​Source and binary distribution files:*
>>> http://svn.wso2.org/repos/wso2/people/nipuni/4.4.3-rc3/
>>>
>>> *Maven staging repository:*
>>> http://maven.wso2.org/nexus/content/repositories/orgwso2carbon-168/
>>>
>>> *The tag to be voted upon:*
>>> https://github.com/wso2/carbon-kernel/releases/tag/v4.4.3-RC3
>>>
>>>
>>> [ ] Broken - do not release (explain why)
>>> [ ] Stable - go ahead and release
>>>
>>> Thank you
>>> Carbon Team
>>>
>>> --
>>> Nipuni Perera
>>> Software Engineer; WSO2 Inc.; http://wso2.com
>>> Email: nip...@wso2.com
>>> Git hub profile: https://github.com/nipuni
>>> Blog : http://nipunipererablog.blogspot.com/
>>> Mobile: +94 (71) 5626680
>>> 
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> --
>> Hasitha Aravinda,
>> Senior Software Engineer,
>> WSO2 Inc.
>> Email: hasi...@wso2.com
>> Mobile : +94 718 210 200
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Pruthuvi Maheshakya Wijewardena
> Software Engineer
> WSO2 : http://wso2.com/
> Email: mahesha...@wso2.com
> Mobile: +94711228855
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Jagath Ariyarathne
Technical Lead
WSO2 Inc.  http://wso2.com/
Email: jaga...@wso2.com
Mob  : +94 77 386 7048
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.3 RC3

2015-12-13 Thread Milinda Perera
Hi,

Tested WSO BRS-2.2.0-SNAPSHOT with kernel 4.4.3-RC3, Build with integration
test get success and BRS basic functionalities also works fine.

[x] Stable - Go ahead and release

Thanks,
Milinda

On Mon, Dec 14, 2015 at 10:30 AM, Jagath Sisirakumara Ariyarathne <
jaga...@wso2.com> wrote:

> Hi,
>
> Built latest ESB pack with all integration tests. No issues observed.
>
> [x] Stable - go ahead and release
>
> Thanks.
>
> On Mon, Dec 14, 2015 at 10:08 AM, Maheshakya Wijewardena <
> mahesha...@wso2.com> wrote:
>
>> Hi,
>>
>> I have built ML 1.1.0 Beta pack including all tests with kernel 4.4.3
>> RC3. No issues found.
>>
>> [x] Stable - Go ahead and release.
>>
>> Best regards.
>>
>> On Mon, Dec 14, 2015 at 8:21 AM, Hasitha Aravinda 
>> wrote:
>>
>>> Hi
>>>
>>> I have tested BPS 3.5.1-SNAPSHOT with kernel 4.4.3
>>> ​ RC3​
>>> ​
>>> . No issue found.
>>>
>>> [x] Stable - Go ahead and release.
>>>
>>> Thanks
>>> Hasitha.
>>>
>>> On Fri, Dec 11, 2015 at 8:15 PM, Nipuni Perera  wrote:
>>>

 Hi Devs,

 This is the RC3 release candidate of WSO2 Carbon Kernel 4.4.3.

 This release fixes the following issues:
 https://wso2.org/jira/issues/?filter=12540

 Please download and test your products with kernel 4.4.3 RC3
 and vote. Vote will be open for 72 hours or as longer as needed.

 *​Source and binary distribution files:*
 http://svn.wso2.org/repos/wso2/people/nipuni/4.4.3-rc3/

 *Maven staging repository:*
 http://maven.wso2.org/nexus/content/repositories/orgwso2carbon-168/

 *The tag to be voted upon:*
 https://github.com/wso2/carbon-kernel/releases/tag/v4.4.3-RC3


 [ ] Broken - do not release (explain why)
 [ ] Stable - go ahead and release

 Thank you
 Carbon Team

 --
 Nipuni Perera
 Software Engineer; WSO2 Inc.; http://wso2.com
 Email: nip...@wso2.com
 Git hub profile: https://github.com/nipuni
 Blog : http://nipunipererablog.blogspot.com/
 Mobile: +94 (71) 5626680
 


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> --
>>> Hasitha Aravinda,
>>> Senior Software Engineer,
>>> WSO2 Inc.
>>> Email: hasi...@wso2.com
>>> Mobile : +94 718 210 200
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Pruthuvi Maheshakya Wijewardena
>> Software Engineer
>> WSO2 : http://wso2.com/
>> Email: mahesha...@wso2.com
>> Mobile: +94711228855
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Jagath Ariyarathne
> Technical Lead
> WSO2 Inc.  http://wso2.com/
> Email: jaga...@wso2.com
> Mob  : +94 77 386 7048
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Milinda Perera
Software Engineer;
WSO2 Inc. http://wso2.com ,
Mobile: (+94) 714 115 032
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to get Maven Home for java implementation

2015-12-13 Thread Rajjaz Mohammed
export M2_HOME=/usr/local/apache-maven-3.2.5
> export M2=$M2_HOME/bin
> export PATH=$M2/bin:$PATH
>
> Hi Nuwan,
why you use M2 variable?
its seems like /usr/local/apache-maven-3.2.5/bin/bin

try
export M2_HOME=/usr/local/apache-maven-3.2.5
export PATH=$M2_HOME/bin:$PATH

-- 
Thank you
Best Regards

*Rajjaz HM*
Associate Software Engineer
WSO2 Inc. 
lean | enterprise | middleware
Mobile | +94752833834
Email   | raj...@wso2.com
LinkedIn | Blogger | WSO2 Profile

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to get Maven Home for java implementation

2015-12-13 Thread Nuwan Pallewela
Hi Devs,

Found the reason. Environment variable was not  registered at that point.
After restarting the system it got updated.

@Rajjaz thanks. You are correct. Modified the config.

Thanks,
Nuwan

On Mon, Dec 14, 2015 at 12:25 PM, Rajjaz Mohammed  wrote:

>
>
>
> export M2_HOME=/usr/local/apache-maven-3.2.5
>> export M2=$M2_HOME/bin
>> export PATH=$M2/bin:$PATH
>>
>> Hi Nuwan,
> why you use M2 variable?
> its seems like /usr/local/apache-maven-3.2.5/bin/bin
>
> try
> export M2_HOME=/usr/local/apache-maven-3.2.5
> export PATH=$M2_HOME/bin:$PATH
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> WSO2 Inc. 
> lean | enterprise | middleware
> Mobile | +94752833834
> Email   | raj...@wso2.com
> LinkedIn | Blogger | WSO2 Profile
> 
>



-- 
--

*Nuwan Chamara Pallewela*


*Software Engineer*

*WSO2, Inc. *http://wso2.com
*lean . enterprise . middleware*

Email   *nuw...@wso2.com *
Mobile  *+94719079739@*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] Implement unit/integration test cases for API Manager JAX-RS Rest API

2015-12-13 Thread Sanjeewa Malalgoda
Excellent job Chamin.
This will be really cool module and we can use it for all REST API test
scenarios across platform.

Thanks,
sanjeewa.



On Mon, Dec 14, 2015 at 11:00 AM, Chamin Dias  wrote:

> Hi,
>
> We have come up with a mechanism to include automated tests for the REST
> API which is going to be shipped with APIM 1.10.0. This is a data driven
> test mechanism. The purpose of this E-Mail is to communicate the method
> that we used to do the required task.
>
> The test automation process has several java files, data files (in JSON
> format)
>
>
> *Data file*
>
> Data for each scenario is stored in JSON format. Here is an example.
>
> {
> "testCase": [
> {
> "init": {
> "scope": ""
> },
> "data": {
> "method": "",
> "url": "",
> "query-parameters": "",
> "request-headers": {
> "Authorization": "Bearer"
> },
> "request-payload": "",
> "response-headers": "",
> "response-payload": ""
> },
> "asserts": {
> "header-asserts": {
> "status-code": ""
> },
> "body-asserts": ""
> }
> }
> ]
> }
>
>
> In a test case, there are three main sections named "init", "data" and
> "asserts". Init section is used to store the user scope which is needed to
> register the OAuth app and generate the access token. Data section will
> store the required data for the corresponding request. It includes the HTTP
> method, URL, query parameters (in nested JSON element), request-headers,
> request-payload and response-headers. Asserts section is there to hold the
> fields that are going to be validated against the response. Values that are
> in header/body or both header and body can be compared to verify the
> response.
>
> In addition to that, we are going to include another section called
> "preserve-list", if we need to take some of the values from the current
> response to the next request. If this section is there, then the parameter
> is stored in a Map (in the code) , as it needs to be used in subsequent
> request(s).
>
> Example : If we add (POST) a new API from the first request and if are
> going to fetch it at the next request (GET), then we need to store the UUID
> of the created API in the second request. In those kind of scenarios, this
> "preserve-list" will be used. It contains the name of the attribute to be
> preserved and the location of that attribute in the response, which is
> represented in JSON format. For example, the following "preserve-list" says
> that, it is needed to preserve the "apiId", which can be found in "id"
> element in the response.
>
>  "preserve-list":[
> {
> "attribute-name":"apiId",
> "response-location":"id"
>
> }
> ]
>
>
> If there is a resource URL like /api/am/publisher/v1//apis/{apiId}, then
> the {apiId} will be fetched from the preserved list and the URL for the
> request is constructed accordingly. Please note that this "preserve-list"
> is optional. It is *only* needed if we need to take some value for the
> next request.
>
> The next important section is the "asserts" section. This is mainly for
> the verification process to evaluate wether the test has succeeded or not.
> "header-asserts" section contains the elements that should be compared
> against the header of the response, while "body-asserts"
>
>
> *Util Java files*
>
> We have created util classes that can be used in any test scenario. The
> util classes do the following tasks.
>
> i) Read the data file
> ii) Parse the data (i.e JSON)
> iii) Register an OAuth application
> iv) Generate access token (using token API)
> v) Put the attributes to the preserve attribute list(if needed)
> vi) Send the request to the REST API
> vii) Identify the type of the request and make the relevant call (GET,POST
> etc..)
> viii) Get the response
>
> These util methods are used in all test scenarios. If all the test cases
> for a given scenario is successful, then we evaluate the test has passed.
>
> Eg : If the test scenario is manipulating tiers, we first add a tier, GET
> the tier, update the tier and delete the tier via the REST API. If all of
> them are succeeded, we assert that the tier manipulation test has passed.
>
>
> *Some more facts about this model*
>
> If we need to add a new test scenario, all we need to do is, add a java
> file only for the corresponding test, add the corresponding JSON data file
> and run it. If we need to add/remove a request to/from a test scenario, all
> we need to do is add/remove the required JSON configuration, save it and
> run the test. Util classes won't change.
>
> We have done R and 

Re: [Dev] How to get Maven Home for java implementation

2015-12-13 Thread Kamidu Punchihewa
Hi Nuwan,

System.getenv() is working fine with windows environment but not so well in
linux environments.
Please utilize System.getProperty() and check again.

If the above change didn't work try getting all the available properties
using the code given below.

public static void main(String[] args) {
> RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
>
> Map systemProperties =
> runtimeBean.getSystemProperties();
> Set keys = systemProperties.keySet();
> for (String key : keys) {
> String value = systemProperties.get(key);
> System.out.printf("[%s] = %s.\n", key, value);
> }
> }

If you can't not see the $M2_HOME in the property list that means the
system property is not set in the scope where java searches for the system
variables.

Hope this wil solve the issue.

Note: Its better if you can set the $M2_HOME home in /etc/environments
rather then ~/.bashrc. Since /etc/environment does not depend on the logged
user.

Thanks and Regards.

Kamidu Sachith Punchihewa
*Software Engineer*
WSO2, Inc.
lean . enterprise . middleware
Mobile : +94 (0) 770566749 <%2B94%20%280%29%20773%20451194>


Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
retransmit, disseminate, or otherwise use the information contained in this
communication. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.

On Mon, Dec 14, 2015 at 12:00 PM, Nuwan Pallewela  wrote:

> Hi Devs,
>
> I need to get the *Maven Home* value to execute maven goal
> eclipse:eclipse for a created project. I tried to use *java.lang.System*
> class to retrieve it by executing following code. But Maven Home in not
> listed in there either properties or process environment.
>
> if (System.getenv("M2_HOME") != null) {
> return System.getenv("M2_HOME");
> } else if (System.getenv("MAVEN_HOME") != null) {
> return System.getenv("MAVEN_HOME");
> } else if (System.getenv("M3_HOME") != null) {
> return System.getenv("M3_HOME");
> } else if (System.getProperty("maven.home") != null) {
> return System.getProperty("maven.home");
> } else {
> log.error("Maven Home variable value is not found in system
> properties");
> throw new IllegalStateException("Maven Home variable is not
> set ");
> }
>
> Maven is correctly installed in the system and following is the result
> when I run "mvn --version"
>
> nuwan@nuwan-ThinkPad-T540p:~$ mvn --version
> Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1;
> 2014-12-14T22:59:23+05:30)
> Maven home: /usr/local/apache-maven-3.2.5
> Java version: 1.8.0_66, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/java-8-oracle/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.13.0-68-generic", arch: "amd64", family:
> "unix"
>
> I have also had edit the .bashrc file by adding following lines.
>
> export M2_HOME=/usr/local/apache-maven-3.2.5
> export M2=$M2_HOME/bin
> export PATH=$M2/bin:$PATH
>
> But still I can't read M2_HOME from java.lang.System class.
>
> Any help would be hugely appreciated.
>
> Thanks,
> Nuwan
>
> --
> --
>
> *Nuwan Chamara Pallewela*
>
>
> *Software Engineer*
>
> *WSO2, Inc. *http://wso2.com
> *lean . enterprise . middleware*
>
> Email   *nuw...@wso2.com *
> Mobile  *+94719079739 <%2B94719079739>@*
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Error when embedding oauth apps to WSO2 DS

2015-12-13 Thread Ruwan Yatawara
Hi Lalanke,

I am not certain exactly what is going on here, this is different from what
i faced. However this sounds like a problem encountered due to different
versions of the same interface packed by alternate Jar files, as indicated
by the following error.

ERROR {org.apache.catalina.core.ApplicationContext} -
StandardWrapper.Throwable
java.lang.LinkageError: loader constraint violation: when resolving
interface method "javax.servlet.jsp.JspApplicationContext.
getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader
(instance of org/apache/jasper/servlet/JasperLoader) of the current class,
org/apache/jsp/login_jsp, and the class loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved
class, javax/servlet/jsp/JspApplicationContext, have different Class
objects for the type avax/el/ExpressionFactory; used in the signature.

Might i suggest you run, the OSGI verifier by RuwanA [1] and check for
duplicates. This might shed some light.

[1] - https://github.com/ruwanta/CarbonOSGI-Bundle-Verifier


Thanks and Regards,

Ruwan Yatawara

Senior Software Engineer,
WSO2 Inc.

email : ruw...@wso2.com
mobile : +94 77 9110413
blog : http://ruwansrants.blogspot.com/
www: :http://wso2.com


On Wed, Dec 9, 2015 at 11:05 AM, Lalanke Athauda  wrote:

> Hi Ruwan,
> Currently I'm in the process of embedding authentication features to DS.
> I added following lines of codes in modules/distribution/assembly/bin.xml
> file to include oauth2.war and authenticationendpoint.war apps.
>
> 
> 
>
> ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
> 
>
> ${pom.artifactId}-${pom.version}/repository/deployment/server/webapps
> 
> oauth2.war
> 
> 
> 
> 
>
> ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
> 
>
> ${pom.artifactId}-${pom.version}/repository/deployment/server/webapps
> 
> authenticationendpoint.war
> 
> 
>
> We can build the source without errors, but when running, it gives
> following errors.
>
> [2015-12-09 10:50:48,321] ERROR
> {org.apache.catalina.core.ApplicationContext} -  StandardWrapper.Throwable
> java.lang.LinkageError: loader constraint violation: when resolving
> interface method
> "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;"
> the class loader (instance of org/apache/jasper/servlet/JasperLoader) of
> the current class, org/apache/jsp/oauth2_005fconsent_jsp, and the class
> loader (instance of
> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved
> class, javax/servlet/jsp/JspApplicationContext, have different Class
> objects for the type avax/el/ExpressionFactory; used in the signature
> at
> org.apache.jsp.oauth2_005fconsent_jsp._jspInit(oauth2_005fconsent_jsp.java:33)
> at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
> at
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:180)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
> at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:138)
> at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262)
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
> at
> org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:290)
> at
> org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:198)
> at
> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:311)
> at
> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:209)
> at
> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.java:176)
> at
> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:141)
> at
> org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deployThisWebApp(AbstractWebappDeployer.java:224)
> 

[Dev] How to get Maven Home for java implementation

2015-12-13 Thread Nuwan Pallewela
Hi Devs,

I need to get the *Maven Home* value to execute maven goal eclipse:eclipse
for a created project. I tried to use *java.lang.System* class to retrieve
it by executing following code. But Maven Home in not listed in there
either properties or process environment.

if (System.getenv("M2_HOME") != null) {
return System.getenv("M2_HOME");
} else if (System.getenv("MAVEN_HOME") != null) {
return System.getenv("MAVEN_HOME");
} else if (System.getenv("M3_HOME") != null) {
return System.getenv("M3_HOME");
} else if (System.getProperty("maven.home") != null) {
return System.getProperty("maven.home");
} else {
log.error("Maven Home variable value is not found in system
properties");
throw new IllegalStateException("Maven Home variable is not set
");
}

Maven is correctly installed in the system and following is the result when
I run "mvn --version"

nuwan@nuwan-ThinkPad-T540p:~$ mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1;
2014-12-14T22:59:23+05:30)
Maven home: /usr/local/apache-maven-3.2.5
Java version: 1.8.0_66, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-68-generic", arch: "amd64", family:
"unix"

I have also had edit the .bashrc file by adding following lines.

export M2_HOME=/usr/local/apache-maven-3.2.5
export M2=$M2_HOME/bin
export PATH=$M2/bin:$PATH

But still I can't read M2_HOME from java.lang.System class.

Any help would be hugely appreciated.

Thanks,
Nuwan

-- 
--

*Nuwan Chamara Pallewela*


*Software Engineer*

*WSO2, Inc. *http://wso2.com
*lean . enterprise . middleware*

Email   *nuw...@wso2.com *
Mobile  *+94719079739@*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DAS] Need help to update table

2015-12-13 Thread Nethaji Chandrasiri
@Inosh - Thanks

I'm facing another issue [1] when I try to update DAS table from a
different domain. Please correct me if I'm wrong, as far as I know there's
a way to enable CORS for REST API but is there a proper way to do it when
using HTTP event receiver ?

[1] XMLHttpRequest cannot load
http://10.100.4.112:9766/endpoints/EventReceiverMov. No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://10.100.4.112:9763' is therefore not allowed access.

Appreciate if someone can help me with this.

Thanks

On Fri, Dec 11, 2015 at 2:07 PM, Inosh Goonewardena  wrote:

> Hi Nethaji,
>
> You can publish data through HTTP transport [1]. Also please keep in mind
> that if you want to update the record you have to configure the primary
> keys for the table.
>
> [1] https://docs.wso2.com/display/DAS300/HTTP+Event+Receiver
>
>
> On Fri, Dec 11, 2015 at 11:15 AM, Nirmal Fernando  wrote:
>
>>
>> On Fri, Dec 11, 2015 at 11:07 AM, Nethaji Chandrasiri 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm currently working on a website to demonstrate a recommender system
>>> using ML. As per chosen scenario when users rate movies I want to update
>>> DAS table (as a new record). Can someone please help me with this? (Data
>>> will be taken from UI).
>>>
>>>
>>> Thanks
>>> --
>>> *Nethaji Chandrasiri*
>>> *Software Engineering* *Intern; WSO2, Inc.; http://wso2.com
>>> *
>>> Mobile : +94 (0) 779171059 <%2B94%20%280%29%20778%20800570>
>>> Email  : neth...@wso2.com
>>>
>>
>>
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>
>> Team Lead - WSO2 Machine Learner
>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>> Mobile: +94715779733
>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>
>
> --
> Thanks & Regards,
>
> Inosh Goonewardena
> Associate Technical Lead- WSO2 Inc.
> Mobile: +94779966317
>



-- 
*Nethaji Chandrasiri*
*Software Engineering* *Intern; WSO2, Inc.; http://wso2.com
*
Mobile : +94 (0) 779171059 <%2B94%20%280%29%20778%20800570>
Email  : neth...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Application Server 6.0.0, Customized Class Loader

2015-12-13 Thread Sagara Gunathunga
On Sun, Dec 13, 2015 at 10:57 PM, Miraj Abeysekara  wrote:

> Hi all,
>
> Since the Application Server 6.0.0 is moving out from the Carbon platform,
> the carbon dependencies of the old Application Server's class loader will
> get removed. The class loader of the new Application Server 6.0.0 is
> implemented using Java 8 by expecting the performance improvements and
> better code maintainability. Currently the following features are available
> in the Application Server 6.0.0's class loader.
>
>
>- Load the global class-loading configurations from 
> *{APP_SERVER.HOME}/conf/AppLoader/
>*directory. (currently supported configurations: set parent fist
>loading behavior, add globally available runtimes and exclusive runtimes,
>set minimal startup runtime)
>- If any webapp is deployed with its own class-loading configurations
>(specified in *{Webapp.dir}/{Webapp.name}/META-INF/* directory) the
>global values for that webapp were overridden when deploying.
>- Default runtimes are stored in *{APP_SERVER.HOME}/lib/runtimes/ 
> *directory
>which are loaded by the class-loader if required.
>- A webapp can specify a exclusive runtimes which only loaded for that
>webapp
>
>
> Any other requirements or suggestions are highly appreciated.
>

1.) Are we support any runtime other than 'Tomcat' OOTB ?

2.) With current C4 we use P2 to install additional runtimes such as CXF,
JavaEE etc. what is our approach to install WSO2 provided additional
runtimes into AS6 ? ( Specially we need to think about UX, in C4 with
P2 this was a one step approach and very convenient )

Thanks !

>
> Thanks.
>
> --
> Miraj Abeysekara
> Intern (Software Engineering)
> Mobile: +94775690822
> Twitter: https://twitter.com/MiRAGECreator
> GooglePlus: https://plus.google.com/u/0/+MirageAbeysekara
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sagara Gunathunga

Architect; WSO2, Inc.;  http://wso2.com
V.P Apache Web Services;http://ws.apache.org/
Linkedin; http://www.linkedin.com/in/ssagara
Blog ;  http://ssagara.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev