成就梦想

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  21 随笔 :: 22 文章 :: 6 评论 :: 0 Trackbacks

2012年4月21日 #

     摘要: 世界邦超级自由行,广募天下英雄豪杰 如果你想找的不仅仅是一个工作机会,不仅仅是一份薪水,而是一个共同为之奋斗的事业,如果你偏偏对旅行又情有独钟,从内心地热爱旅行,并拥有创业的激情,那么世界邦会是你不二的最佳选择。   一、旅游产品销售 (电话销售)  职位职责: 1、通过电话与客户进行有效沟通了解客户需求, 寻找销售机会; 2、对...  阅读全文
posted @ 2014-05-22 11:02 iamct 阅读(265) | 评论 (0)编辑 收藏

高工资后面意味着高能力,高付出,高责任感,高压力,高考核,高绩效。高产出
posted @ 2012-11-06 13:19 iamct 阅读(354) | 评论 (0)编辑 收藏

        web应用集成测试的时候,各位还需要启动web容器,然后打开浏览器,输入ulr,然后看到浏览器的输出吗?

下面我们用maven做到自动化!


 

我们利用maven的生命周期和jetty插件来实现。

 

下面描述下做的自动化web集成测试实现的原理。

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来实现里面的测试代码。

2,然后 执行 mvn clean post-integration-test -Pittest

好了 就可以看到我们测试用例是否通过。

建议:以上的代码可以加入到父类的pom中,以后继承此父pom后,只需要按以上2步,就可以做到web应用测试自动化了。

 



posted @ 2012-04-21 11:57 iamct 阅读(3073) | 评论 (0)编辑 收藏