junit4.0/4.9与testng6.4 pom依赖对比

junit4.0 pom文件:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.0</version>
  <url>http://junit.org</url>

  <dependencies>
  </dependencies>

</project>
junit4.9 pom文件
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.9</version>
    <name>JUnit</name>
    <url>http://junit.org</url>
    <description>
        JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
        It is used by the developer who implements unit tests in Java.
    </description>
    <organization>
        <name>JUnit</name>
        <url>http://www.junit.org</url>
    </organization>
    <mailingLists>
        <mailingList>
            <name>JUnit Mailing List</name>
            <post>junit@yahoogroups.com</post>
            <archive>
                http://tech.groups.yahoo.com/group/junit/
            </archive>
        </mailingList>
    </mailingLists>
    <licenses>
        <license>
            <name>Common Public License Version 1.0</name>
            <url>http://www.opensource.org/licenses/cpl1.0.txt</url>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git://github.com/KentBeck/junit.git</connection>
        <developerConnection>scm:git:git@github.com:KentBeck/junit.git</developerConnection>
        <url>http://github.com/KentBeck/junit/tree/master</url>
    </scm>
    <developers>
      <developer>
        <id>dsaff</id>
        <name>David Saff</name>
        <email>david@saff.net</email>
      </developer>
    </developers>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <encoding>ISO-8859-1</encoding>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
          <version>1.1</version>
          <scope>compile</scope>
        </dependency>
    </dependencies>

    <properties>
         <jdk.version>1.5</jdk.version>
    </properties>
</project>
junit 4.9 比4.0多出了 hamcrest-core 这个包,这个包的作用还未研究。

testng现在比较高的版本是6.12,testng6.4 pom:

<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/maven-v4_0_0.xsd">

  <!-- Refer to the file ./build-with-maven for instruction on how to use this pom.xml -->

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <packaging>jar</packaging>
  <name>TestNG</name>
  <version>6.4</version>
  <description>TestNG is a testing framework.</description>
  <url>http://testng.org</url>
    
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:cbeust/testng.git</connection>
    <developerConnection>scm:git:git@github.com:cbeust/testng.git</developerConnection>
    <url>git@github.com:cbeust/testng.git</url>
  </scm>
    
  <developers>
    <developer>
      <name>Cedric Beust</name>
    </developer>
  </developers>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>3</version>
  </parent>

  <profiles>
    <profile>
      <!-- When activated, download dependencies from the snapshot repo -->
      <id>snapshot</id>

      <repositories>
        <repository>
          <id>snapshot-repository</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
      </repositories>

      <dependencies>
        <dependency>
            <groupId>ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.6.5</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
        </dependency>
        <dependency>
            <groupId>org.beanshell</groupId>
            <artifactId>bsh</artifactId>
            <version>2.0b4</version>
<!--
            <scope>provided</scope>
-->
        </dependency>
        <dependency>
          <groupId>com.google.inject</groupId>
           <artifactId>guice</artifactId>
           <version>2.0</version>
           <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>com.beust</groupId>
          <artifactId>jcommander</artifactId>
          <version>1.5</version>
        </dependency>
      </dependencies>
      
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.6.5</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
    </dependency>

    <dependency>
      <groupId>org.beanshell</groupId>
      <artifactId>bsh</artifactId>
      <version>2.0b4</version>
<!--
      <scope>provided</scope>
-->
    </dependency>

    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>2.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
      <version>1.12</version>
    </dependency>

	  <dependency>
	    <groupId>org.yaml</groupId>
	    <artifactId>snakeyaml</artifactId>
	    <version>1.6</version>
	  </dependency>

  </dependencies>    
    
  <build>
    <plugins>

      <!-- Bundle sources -->

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
        </executions>
      </plugin>

      <!-- Compilation -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <source>1.5</source>
        </configuration>
      </plugin>

      <!-- Resource handling -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <!-- OSGi manifest creation -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.1.0</version>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <_versionpolicy>$(@)</_versionpolicy>
                <Import-Package>
                  bsh.*;version="[2.0.0,3.0.0)";resolution:=optional,
                  com.beust.jcommander.*;version="[1.7.0,3.0.0)";resolution:=optional,
                  com.google.inject.*;version="[1.2,1.3)";resolution:=optional,
                  junit.framework;version="[3.8.1, 4.0.0)";resolution:=optional,
                  org.apache.tools.ant.*;version="[1.6.5, 2.0.0)";resolution:=optional,
                  org.yaml.*;version="[1.6,2.0)";resolution:=optional,
                  !com.sun.*,
                  *
                </Import-Package>
              </instructions>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Add OSGi manifest in JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <!-- Generating Javadoc -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <excludePackageNames>*.internal</excludePackageNames>
        </configuration>
      </plugin>

      <!-- Tests (skipping) -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <skipTests>true</skipTests>
        </configuration>
      </plugin>

      <!-- Signing with gpg -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>

  </build>
</project>
testng 依赖了junit(junit在单测里面做核心工作,有待于研究junit和testng联系和区别,同时依赖:

org.beanshell.bsh
com.google.inject.guice
com.beust.jcommander
org.yaml.snakeyaml

这四个jar 包具体做什么工作,稍后研究。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值