摘要: 世界邦超級自由行,廣募天下英雄豪杰
如果你想找的不僅僅是一個工作機(jī)會,不僅僅是一份薪水,而是一個共同為之奮斗的事業(yè),如果你偏偏對旅行又情有獨(dú)鐘,從內(nèi)心地?zé)釔勐眯?,并擁有?chuàng)業(yè)的激情,那么世界邦會是你不二的最佳選擇。
一、旅游產(chǎn)品銷售 (電話銷售)
職位職責(zé):
1、通過電話與客戶進(jìn)行有效溝通了解客戶需求, 尋找銷售機(jī)會;
2、對... 閱讀全文
2012年4月21日 #
高工資后面意味著高能力,高付出,高責(zé)任感,高壓力,高考核,高績效。高產(chǎn)出
web應(yīng)用集成測試的時候,各位還需要啟動web容器,然后打開瀏覽器,輸入ulr,然后看到瀏覽器的輸出嗎?
建議:以上的代碼可以加入到父類的pom中,以后繼承此父pom后,只需要按以上2步,就可以做到web應(yīng)用測試自動化了。
下面我們用maven做到自動化!
我們利用maven的生命周期和jetty插件來實(shí)現(xiàn)。
下面描述下做的自動化web集成測試實(shí)現(xiàn)的原理。
1,在生命周期pre-integration-test啟動jetty容器
2,在生命周期integration-test中測試我們寫的***IT.java類
3,在post-integration-test shutdow jetty容器。
在pom.xml中加入代碼如下:
<profiles>
<profile>
<id>ittest</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>run-integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<contextPath>/</contextPath>
<stopPort>9966</stopPort>
<stopKey>stop-jetty-for-it</stopKey>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>6211</port>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>start-it-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-it-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<profile>
<id>ittest</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>run-integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<contextPath>/</contextPath>
<stopPort>9966</stopPort>
<stopKey>stop-jetty-for-it</stopKey>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>6211</port>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>start-it-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-it-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
然后就可以編寫測試用例了
步驟如下:
1,定義一個以此命名的****IT的測試類(integration test縮寫), 在里面華麗的寫好你的測試邏輯。
再此不舉例了,主要一個思路可以用httpclint來實(shí)現(xiàn)里面的測試代碼。
2,然后 執(zhí)行 mvn clean post-integration-test -Pittest
好了 就可以看到我們測試用例是否通過。