Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Manuri
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Kasun Gajasinghe
Hi,

We can introduce a parameter, say, defaultPortOffset, in to the automation.xml. This should be set to 100 in the case of AS. Then, the test cases that need to spin up servers should set the port offset value as "defaultPortOffset + X" where the X could range from 1-100.

On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera <[hidden email]> wrote:
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Kasun Gajasinghe
Senior Software Engineer, WSO2 Inc.
email: kasung AT spamfree wso2.com
linked-in: http://lk.linkedin.com/in/gajasinghe
blog: http://kasunbg.org
 
 

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Kasun Gajasinghe
Software Engineer; WSO2 Inc.
http://kasunbg.org
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Nuwan Wimalasekara
In reply to this post by Manuri
Hi Manuri,
There are some test classes which start a new server with a port offset and those port configuration are kept in automation.xml and referred by a name. 

Ex: if the portOffset is 1, then the config is as bellow. Then the test class refer the post and hot config by referring the name "appServerInstance0002" and generate the server URLs.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
            </instance>

Now you have to increase the port offset in this classes to be 100 + portOffset and according to new port offset you have to change the configuration as well.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9864</port>
                    <port type="https">9544</port>
                </ports>
            </instance>

Thanks,
Nuwanw

On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera <[hidden email]> wrote:
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620




_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Supun Malinga


On Thu, Sep 3, 2015 at 12:24 PM, Nuwan Wimalasekara <[hidden email]> wrote:
Hi Manuri,
There are some test classes which start a new server with a port offset and those port configuration are kept in automation.xml and referred by a name.

This is true Nuwan. But the concern is that in the test cases where we use a offset. We have the offset hardcoded. Instead we need to read it from the config file (automation.xml). 
So what we thought is to put it as a property in the config of the instances. 
eg:
<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
                <properties>
                    <property name="portOffset" value="101"/>
                </properties>
</instance>
 
thanks,

 

Ex: if the portOffset is 1, then the config is as bellow. Then the test class refer the post and hot config by referring the name "appServerInstance0002" and generate the server URLs.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
            </instance>

Now you have to increase the port offset in this classes to be 100 + portOffset and according to new port offset you have to change the configuration as well.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9864</port>
                    <port type="https">9544</port>
                </ports>
            </instance>

Thanks,
Nuwanw

On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera <[hidden email]> wrote:
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: <a href="tel:%2B94%2071%20668%204620" value="+94716684620" target="_blank">+94 71 668 4620






--
Supun Malinga,

Senior Software Engineer,
WSO2 Inc.
http://wso2.com
email: [hidden email]
mobile: +94 (0)71 56 91 321

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Manuri
In reply to this post by Nuwan Wimalasekara
Hi Nuwan,

In this case shifting the values in automation.xml would suffice but where offsets are hard coded we have to look for some other solution right?

On Thu, Sep 3, 2015 at 12:24 PM, Nuwan Wimalasekara <[hidden email]> wrote:
Hi Manuri,
There are some test classes which start a new server with a port offset and those port configuration are kept in automation.xml and referred by a name. 

Ex: if the portOffset is 1, then the config is as bellow. Then the test class refer the post and hot config by referring the name "appServerInstance0002" and generate the server URLs.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
            </instance>

Now you have to increase the port offset in this classes to be 100 + portOffset and according to new port offset you have to change the configuration as well.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9864</port>
                    <port type="https">9544</port>
                </ports>
            </instance>

Thanks,
Nuwanw

On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera <[hidden email]> wrote:
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: <a href="tel:%2B94%2071%20668%204620" value="+94716684620" target="_blank">+94 71 668 4620






--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Nuwan Wimalasekara
In reply to this post by Supun Malinga
HI Supun,


On Thu, Sep 3, 2015 at 12:29 PM, Supun Malinga <[hidden email]> wrote:


On Thu, Sep 3, 2015 at 12:24 PM, Nuwan Wimalasekara <[hidden email]> wrote:
Hi Manuri,
There are some test classes which start a new server with a port offset and those port configuration are kept in automation.xml and referred by a name.

This is true Nuwan. But the concern is that in the test cases where we use a offset. We have the offset hardcoded. Instead we need to read it from the config file (automation.xml). 
So what we thought is to put it as a property in the config of the instances. 
eg:
<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
                <properties>
                    <property name="portOffset" value="101"/>
                </properties>
</instance>
+1. This is better approach.  Then we can read the offset from the config property and set

Thanks,
Nuwanw
 
thanks,

 

Ex: if the portOffset is 1, then the config is as bellow. Then the test class refer the post and hot config by referring the name "appServerInstance0002" and generate the server URLs.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
            </instance>

Now you have to increase the port offset in this classes to be 100 + portOffset and according to new port offset you have to change the configuration as well.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9864</port>
                    <port type="https">9544</port>
                </ports>
            </instance>

Thanks,
Nuwanw

On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera <[hidden email]> wrote:
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: <a href="tel:%2B94%2071%20668%204620" value="+94716684620" target="_blank">+94 71 668 4620






--
Supun Malinga,

Senior Software Engineer,
WSO2 Inc.
http://wso2.com
email: [hidden email]
mobile: +94 (0)71 56 91 321



--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620




_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [AS] [Tests] Port offset change in test cases where offset values are hardcoded

Manuri
Hi,

Thank you for the suggestions. 

The property was added as follows.

eg:
<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9864</port>
                    <port type="https">9544</port>
                </ports>
                <properties>
                    <property name="portOffset">101</property>
                </properties>
            </instance>


On Thu, Sep 3, 2015 at 12:34 PM, Nuwan Wimalasekara <[hidden email]> wrote:
HI Supun,


On Thu, Sep 3, 2015 at 12:29 PM, Supun Malinga <[hidden email]> wrote:


On Thu, Sep 3, 2015 at 12:24 PM, Nuwan Wimalasekara <[hidden email]> wrote:
Hi Manuri,
There are some test classes which start a new server with a port offset and those port configuration are kept in automation.xml and referred by a name.

This is true Nuwan. But the concern is that in the test cases where we use a offset. We have the offset hardcoded. Instead we need to read it from the config file (automation.xml). 
So what we thought is to put it as a property in the config of the instances. 
eg:
<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
                <properties>
                    <property name="portOffset" value="101"/>
                </properties>
</instance>
+1. This is better approach.  Then we can read the offset from the config property and set

Thanks,
Nuwanw
 
thanks,

 

Ex: if the portOffset is 1, then the config is as bellow. Then the test class refer the post and hot config by referring the name "appServerInstance0002" and generate the server URLs.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9764</port>
                    <port type="https">9444</port>
                </ports>
            </instance>

Now you have to increase the port offset in this classes to be 100 + portOffset and according to new port offset you have to change the configuration as well.

<instance name="appServerInstance0002" type="standalone" nonBlockingTransportEnabled="false">
                <hosts>
                    <host type="default">localhost</host>
                </hosts>
                <ports>
                    <port type="http">9864</port>
                    <port type="https">9544</port>
                </ports>
            </instance>

Thanks,
Nuwanw

On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera <[hidden email]> wrote:
Adding Dev

On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera <[hidden email]> wrote:
Hi,

At the moment, in automation.xml in test modules, the -DportOffset parameter has been set to 100 and the port values in relevant instances also have been changed accordingly.  

But in the test cases where internally a server is set up, the port offset values are being hard coded. These values also need to be moved forward by 100. A configuration can be added to automation.xml which can be read and used to do this.

I'd like to discuss the best way to address this problem.

Thank you.

--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.




--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: <a href="tel:%2B94%2071%20668%204620" value="+94716684620" target="_blank">+94 71 668 4620






--
Supun Malinga,

Senior Software Engineer,
WSO2 Inc.
http://wso2.com
email: [hidden email]
mobile: +94 (0)71 56 91 321



--
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: <a href="tel:%2B94%2071%20668%204620" value="+94716684620" target="_blank">+94 71 668 4620






--
Manuri Amaya Perera
Software Engineer
WSO2 Inc.


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev