Hi All, It needs some explanation ;-> I am using testng to test an application against different env. (Dev, qa, uat, prod). Now there are certain groups to be included and excluded. And env to be added and removed. So I am using simple testng task like sourcedir="${test.src.dir}" outputdir="${test.output}/${env}/${touch.time}" groups="${groups.included}" excludedgroups="${groups.excluded}" verbose="2"> I have one env.properties where I have defined all the provider.url and groups includedexcluded information. env.list simply holds the e
More>>
Hi All,
It needs some explanation ;->
I am using testng to test an application against different env. (Dev, qa, uat, prod).
Now there are certain groups to be included and excluded. And env to be added and removed.
So I am using simple testng task like
sourcedir="${test.src.dir}"
outputdir="${test.output}/${env}/${touch.time}"
groups="${groups.included}"
excludedgroups="${groups.excluded}"
verbose="2">
I have one env.properties where I have defined all the provider.url and groups includedexcluded information. env.list simply holds the env that I want my test to run against so that I need to change only env.list to include/exclude env.
And groupsincluded/groupsexcluded for changing the groups in that env.
That looks something like
env.list=jabberwocky.dev,jabberwocky.qa
all.test=foo_test,bar_test
jabberwocky.dev.provider.url=t3://localhost:7001
jabberwocky.dev.groupsincluded=foo_test
jabberwocky.dev.groupsexcluded=
jabberwocky.qa.provider.url=t3://localhost:7002
jabberwocky.qa.groupsincluded=bar_test
jabberwocky.qa.groupsexcluded=
jabberwocky.uat.provider.url=t3://localhost:7002
jabberwocky.uat.groupsincluded=${all.test}
jabberwocky.uat.groupsexcluded=
I am importing this file
in ant and
To iterate through these and run test against each server I am using
antcontrib
's
foreach
the test target simply executes the testng task where I set group and provider url information regarding the test to be run and also setting a system property with name test.url so that I can get it later to use in one of the test case.
touch.time=${touch.time}
groups.included=${groups.included}
java.naming.provider.url=${java.naming.provider.url}
sourcedir="${test.src.dir}"
outputdir="${test.output}/${env}/${touch.time}"
groups="${groups.included}"
verbose="2"
>
test.url=${test.url}
Now this
test.url
is being used in one of my test(webservice test)
To get the url for creating the port
String provider_url=System.getProperty("test.url");
Reporter.log(provider_url.replaceFirst("t3","http")+"/jabberwocky/jabberwocky?W SDL");
I am not able to get test.url in my test I tried sysproperty and jvmarg both but to no avail.
The other tests are running fine and I am getting result against each env based on the timestamp
I don't know whether I am missing something on ANT or TestNG or ant-contrib please help?
version ANT 1.6.5
testNG 5.1jdk1.4
ant-contrib-1.0b2
<<Less