成就夢想

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            21 隨筆 :: 22 文章 :: 6 評論 :: 0 Trackbacks

          2012年4月21日 #

               摘要: 世界邦超級自由行,廣募天下英雄豪杰 如果你想找的不僅僅是一個工作機(jī)會,不僅僅是一份薪水,而是一個共同為之奮斗的事業(yè),如果你偏偏對旅行又情有獨(dú)鐘,從內(nèi)心地?zé)釔勐眯?,并擁有?chuàng)業(yè)的激情,那么世界邦會是你不二的最佳選擇。   一、旅游產(chǎn)品銷售 (電話銷售)  職位職責(zé): 1、通過電話與客戶進(jìn)行有效溝通了解客戶需求, 尋找銷售機(jī)會; 2、對...  閱讀全文
          posted @ 2014-05-22 11:02 iamct 閱讀(284) | 評論 (0)編輯 收藏

          高工資后面意味著高能力,高付出,高責(zé)任感,高壓力,高考核,高績效。高產(chǎn)出
          posted @ 2012-11-06 13:19 iamct 閱讀(411) | 評論 (0)編輯 收藏

                  web應(yīng)用集成測試的時候,各位還需要啟動web容器,然后打開瀏覽器,輸入ulr,然后看到瀏覽器的輸出嗎?

          下面我們用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>

           

          然后就可以編寫測試用例了

           

           步驟如下:

          1,定義一個以此命名的****IT的測試類(integration test縮寫), 在里面華麗的寫好你的測試邏輯。

          再此不舉例了,主要一個思路可以用httpclint來實(shí)現(xiàn)里面的測試代碼。

          2,然后 執(zhí)行 mvn clean post-integration-test -Pittest

          好了 就可以看到我們測試用例是否通過。

          建議:以上的代碼可以加入到父類的pom中,以后繼承此父pom后,只需要按以上2步,就可以做到web應(yīng)用測試自動化了。

           



          posted @ 2012-04-21 11:57 iamct 閱讀(3118) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 塘沽区| 香港 | 伊川县| 聂拉木县| 临颍县| 江口县| 大安市| 石渠县| 石狮市| 聂拉木县| 东城区| 沂水县| 莎车县| 青阳县| 剑河县| 河北省| 九台市| 襄城县| 肥城市| 石渠县| 清新县| 高密市| 太湖县| 天镇县| 长治县| 青铜峡市| 如皋市| 定远县| 平泉县| 楚雄市| 柘荣县| 南阳市| 固安县| 安乡县| 吉安市| 沁水县| 东明县| 水城县| 尼勒克县| 文昌市| 甘谷县|