maven - How do I get readyapi (formerly soapui) to respect the values I specify in pom.xml? -


my pom.xml looks

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"          xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelversion>4.0.0</modelversion>     <groupid>com.cvent</groupid>     <artifactid>soa-readyapi</artifactid>     <packaging>pom</packaging>     <version>1.0-snapshot</version>     <name>onsite solutions readyapi tests</name>     <properties>         <soapui.environment/>         <soapui.test-suite/>         <soapui.test-case/>     </properties>     <build>         <plugins>             <plugin>                 <groupid>com.smartbear</groupid>                 <artifactid>ready-api-maven-plugin</artifactid>                 <version>1.2.1</version>                 <executions>                     <execution>                         <phase>test</phase>                         <goals>                             <goal>test</goal>                         </goals>                         <configuration>                             <projectfile>${soapui.projectfile}</projectfile>                              <iface>iorderservice</iface>                             <tool>wsi,axis1,axis2</tool>                             <settingsfile>soapui-settings.xml</settingsfile>                             <!-- <environment>${soapui.environment}</environment> -->                             <outputfolder>output</outputfolder>                             <junitreport>true</junitreport>                             <printreport>true</printreport>                             <projectproperties>                                 <value>one_api="https://someurl:4000"</value>                                 <value>two_api="https://someurl:4001"</value>                                 <!-- <value>environment=${soapui.environment}</value> -->                             </projectproperties>                         </configuration>                     </execution>                 </executions>             </plugin>         </plugins>     </build> </project> 

when attempt run project following command -

mvn clean test -dsoapui.projectfile=smoketest 

the tests appear run whatever last active environment set in readyapi. ignores

   <value>one_api="https://someurl:4000"</value>    <value>two_api="https://someurl:4001"</value> 

i know can use environment feature doesn't me current use case. set @ run time, hardcoding pom.xml see if work has not.

any ideas why readyapi ignoring values setting in pom.xml?

thank you

i make follow test check if works or not.

first create groovy teststep , use follow code expand project properties check if there loaded correctly pom.xml:

log.info context.expand('${#project#one_api}') log.info context.expand('${#project#two_api}') 

then add rest teststep , set ${#project#one_api} endpoint:

enter image description here

finally take pom.xml (as @siking suggest it's necessary drop quotes value, one_api=https://someurl:4000 instead of one_api="https://someurl:4000") , execute mvn clean test -dsoapui.projectfile=./soaptestprj.xml.

the mvn trace show following:

15:16:37,406 info  [soapuiprotestcaserunner] running step [groovy script init] 15:16:37,653 info  [log] https://someurl:4000 15:16:37,653 info  [log] https://someurl:4001 15:16:37,655 info  [soapuiprotestcaserunner] running step [initprocess] 15:16:40,491 error [wsdlsubmit] exception in request: java.net.unknownhostexception: someurl 

despite fact evidently can not resolve someurl, seems plugin passing correctly <projectproperties>.

my guess may problem you're not referencing correctly project property, check you're specifying correctly ${#project#yourproperty}.

hope helps,


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -