[testng] 43/160: Remove examples

Eugene Zhukov eugene-guest at moszumanska.debian.org
Tue Aug 18 10:22:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

eugene-guest pushed a commit to annotated tag testng-6.9.5
in repository testng.

commit 4cb6decf26202049adb0de060c0d288cd3ab5cc0
Author: Julien Herr <julien.herr at alcatel-lucent.com>
Date:   Sun May 31 14:24:39 2015 +0200

    Remove examples
---
 examples/.cvsignore                            |   4 -
 examples/build.xml                             | 146 -------------------------
 examples/src/example1/Test1.java               |  85 --------------
 examples/src/priority/Priority.java            |  13 ---
 examples/src/priority/PriorityInterceptor.java |  46 --------
 examples/src/priority/PriorityTest.java        |  31 ------
 examples/testng.xml                            |  32 ------
 7 files changed, 357 deletions(-)

diff --git a/examples/.cvsignore b/examples/.cvsignore
deleted file mode 100644
index 5aa92e9..0000000
--- a/examples/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build
-test-output
-test-report
-*.jar
diff --git a/examples/build.xml b/examples/build.xml
deleted file mode 100644
index fbad0f3..0000000
--- a/examples/build.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<project name="testng" default="all" basedir="..">
-
-   <property file="build.properties"/>
-
-   <property name="debug" value="true"/>
-   <property name="optimize" value="false"/>
-   <property name="build.compiler" value="javac1.5" />
-
-   <!-- dirs for test output -->
-   <property name="test.output" value="${example.dir}/build/test-output"/>
-   <property name="test.report" value="${example.dir}/build/test-report"/>
-
-   <target name="all" depends="prepare,compile,run"/>
-
-
-   <!-- ==================================================================== -->
-   <!-- Compile                                                              -->
-   <!-- ==================================================================== -->
-   <path id="compile.cp">
-      <pathelement location="${testng.jar}"/>
-   </path>
-
-   <target name="compile"
-           description="compile the examples"
-           depends="prepare">
-      <echo message="                                 -- testng-compile-examples --"/>
-
-     <javac   debug="true"
-              fork="true"
-              source="1.5"
-              classpathref="compile.cp"
-              srcdir="${example.dir}/src"
-              destdir="${example.dir}/build/classes"
-      />
-   </target>
-
-   <target name="prepare">
-      <mkdir dir="${example.dir}/build/classes"/>
-      <mkdir dir="${test.output}"/>
-      <mkdir dir="${test.report}"/>
-   </target>
-
-   <!-- ==================================================================== -->
-   <!-- Run                                                             -->
-   <!-- ==================================================================== -->
-
-   <path id="run.cp">
-      <pathelement location="${testng.jar}" />
-      <path refid="compile.cp"/>
-      <pathelement location="${example.dir}/build/classes"/>
-   </path>
-
-   <target  name="run"
-            description="run examples with java"
-            depends="compile">
-
-      <echo message="                                  testng-run "/>
-      <java fork="yes"
-            classpathref="run.cp"
-            classname="org.testng.TestNG">
-         <arg value="-d"/>
-         <arg value="${test.output}"/>
-         <arg value="${example.dir}/testng.xml"/>
-         <jvmarg value="-ea"/>
-      </java>
-      <echo>Some of these tests should have failed.  Statistics are available at</echo>
-      <echo>${test.output}\index.html for a TestNG HTML report</echo>
-   </target>
-
-   <target  name="run-task"
-            description="run examples using testng task"
-            depends="compile">
-      <echo message="                                 -- testng-run using the testng task--"/>
-     
-      <taskdef classpathref="compile.cp" name="testng" classname="com.beust.testng.TestNGAntTask"/>
-     
-      <testng
-               fork="yes"
-               classpathref="run.cp"
-               outputdir="${test.output}">
-         <fileset dir="${example.dir}" includes="testng.xml"/>
-      </testng>
-
-      <echo>Some of these tests should have failed, see the file test.out for the details</echo>
-      <junitreport todir="${test.report}">
-         <fileset dir="${test.output}">
-            <include name="*.xml"/>
-         </fileset>
-         <report format="noframes" todir="${test.report}"/>
-      </junitreport>
-   </target>
-
-   <target  name="run-task-noxml"
-            depends="compile"
-            description="run examples using testng task with just -testclass and no xml">
-      <testng
-               fork="yes"
-               classpathref="run.cp"
-               outputdir="${test.output}"
-               testclass="example1.Test1">
-      </testng>
-      <echo>Some of these tests should have failed, see the file test.out for the details</echo>
-      <antcall target="report"/>
-   </target>
-
-   <target  name="run-task-jar"
-            depends="compile,testjar"
-            description="run examples using testng task with just -testjar and no xml">
-      <!-- note that this invocation does not have build/ in the path -->
-      <testng
-               fork="yes"
-               classpathref="compile.cp"
-               outputdir="${test.output}"
-               testjar="${example.dir}/example.jar">
-      </testng>
-      <antcall target="report"/>
-      <echo>Some of these tests should have failed, see the file test.out for the details</echo>
-   </target>
-
-   <target name="testjar"
-      description="make a test jar with the property file and the classes we need in it">
-      <jar destfile="${example.dir}/example.jar">
-         <fileset dir="${example.dir}/build/classes" includes="**/*.class"/>
-         <fileset file="${example.dir}/testng.xml"/>
-      </jar>
-   </target>
-
-   <target name="report"
-      description="generate reports using junireport">
-      <junitreport todir="${test.report}">
-         <fileset dir="${test.output}">
-            <include name="*.xml"/>
-         </fileset>
-         <report format="noframes" todir="${test.report}"/>
-      </junitreport>
-   </target>
-
-   <target  name="clean"
-            description="clean up example results">
-      <delete dir="${example.dir}/build/classes"/>
-      <delete dir="${test.output}"/>
-      <delete dir="${test.report}"/>
-      <antcall target="prepare"/>
-   </target>
-
-</project>
diff --git a/examples/src/example1/Test1.java b/examples/src/example1/Test1.java
deleted file mode 100644
index 4e3d509..0000000
--- a/examples/src/example1/Test1.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package example1;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.ExpectedExceptions;
-import org.testng.annotations.Test;
-
-/**
- * This class
- *
- * @author Cedric Beust, Apr 26, 2004
- * 
- */
-
- at Test(groups = { "functest" }, enabled = true )
-public class Test1 {
-  
-  @BeforeClass
-  public static void setupClass() {
-    ppp("SETTING UP THE CLASS");
-  }
-
-  @AfterClass
-  public static void tearDownClass1() {
-    ppp("TEARING DOWN THE CLASS PART 1");
-  }
-
-  @AfterClass
-  public static void tearDownClass2() {
-    ppp("TEARING DOWN THE CLASS PART 2");
-  }
-
-  @BeforeMethod
-  public void beforeTestMethod() {
-    ppp("BEFORE METHOD");  
-  }
-  
-  @AfterMethod
-  public void afterTestMethod() {
-    ppp("AFTER METHOD");  
-  }
-
-  @Test(groups = { "odd" })
-  public void testMethod1() {
-    ppp(".....  TESTING1");
-  }
-  
-  @Test(groups = {"even"} )
-  public void testMethod2() {
-    ppp(".....  TESTING2");
-  }
-  
-  @Test(groups = { "odd" })
-  public void testMethod3() {
-    ppp(".....  TESTING3");
-  }
-
-  @Test(groups = { "odd" }, enabled = false)
-  public void testMethod5() {
-    ppp(".....  TESTING5");
-  }
-  
-  @Test(groups = { "broken" })
-  public void testBroken() {
-    ppp(".....  TEST BROKEN");
-  }
-  
-  @Test(groups = { "fail" }, expectedExceptions =
-      { NumberFormatException.class, ArithmeticException.class } )
-  public void throwExpectedException1ShouldPass() {
-    throw new NumberFormatException();
-  }
-
-  @Test(groups = { "fail" }, expectedExceptions = 
-    { NumberFormatException.class, ArithmeticException.class } )
-  public void throwExpectedException2ShouldPass() {
-    throw new ArithmeticException();
-  }
-  
-  private static void ppp(String s) {
-  System.out.println("[Test1] " + s);
-}
-}
diff --git a/examples/src/priority/Priority.java b/examples/src/priority/Priority.java
deleted file mode 100644
index 9acac7a..0000000
--- a/examples/src/priority/Priority.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package priority;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
- at Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
- at Target({METHOD, TYPE})
-public @interface Priority {
-  int value() default 0;
-}
diff --git a/examples/src/priority/PriorityInterceptor.java b/examples/src/priority/PriorityInterceptor.java
deleted file mode 100644
index 45b3e3a..0000000
--- a/examples/src/priority/PriorityInterceptor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package priority;
-
-import org.testng.IMethodInstance;
-import org.testng.IMethodInterceptor;
-import org.testng.ITestContext;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-public class PriorityInterceptor implements IMethodInterceptor {
-
-  public List<IMethodInstance> intercept(List<IMethodInstance> methods,
-      ITestContext context)
-  {
-    Comparator<IMethodInstance> comparator = new Comparator<IMethodInstance>() {
-      
-      private int getPriority(IMethodInstance mi) {
-        int result = 0;
-        Method method = mi.getMethod().getMethod();
-        Priority a1 = method.getAnnotation(Priority.class);
-        if (a1 != null) {
-          result = a1.value();
-        } else {
-          Class<?> cls = method.getDeclaringClass();
-          Priority classPriority = cls.getAnnotation(Priority.class);
-          if (classPriority != null) {
-            result = classPriority.value();
-          }
-        }
-        return result;
-      }
-
-      public int compare(IMethodInstance m1, IMethodInstance m2) {
-        return getPriority(m1) - getPriority(m2);
-      }
-      
-    };
-    IMethodInstance[] array = methods.toArray(new IMethodInstance[methods.size()]);
-    Arrays.sort(array, comparator);
-
-    return Arrays.asList(array);
-  }
-
-}
diff --git a/examples/src/priority/PriorityTest.java b/examples/src/priority/PriorityTest.java
deleted file mode 100644
index 864cafb..0000000
--- a/examples/src/priority/PriorityTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package priority;
-
-import org.testng.annotations.Test;
-
-import priority.Priority;
-
-public class PriorityTest {
-
-  @Test
-  public void b1() { System.out.println("Default priority");}
-  
-  @Priority(-3)
-  @Test
-  public void a1()  { System.out.println("Priority -3");}
-  
-  @Priority(-3)
-  @Test
-  public void a2()  { System.out.println("Priority -3");}
-
-  @Priority(3)
-  @Test
-  public void c1()  { System.out.println("Priority 3");}
-
-  @Priority(3)
-  @Test
-  public void c2()  { System.out.println("Priority 3");}
-
-  @Priority(4)
-  @Test
-  public void d1()  { System.out.println("Priority 4");}
-}
diff --git a/examples/testng.xml b/examples/testng.xml
deleted file mode 100644
index ef60d3a..0000000
--- a/examples/testng.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-  
-<suite name="Example" verbose="1">
-
-  <listeners>
-    <listener class-name="priority.PriorityInterceptor" />
-  </listeners>
-  
-  <test name="Simple example" >
-<!--
-      <groups>
-      <run>
-        <include name="assert" />
-        <include name="fail" />
-        <include name="odd" />
-        <include name="even" />
-        <exclude name="broken" />
-      </run>        
-    </groups>
--->
-    <classes>
-      <class name="example1.Test1" />
-    </classes>
-  </test>
-  
-  <test name="Method interceptor example" >
-    <classes>
-      <class name="priority.PriorityTest" />
-    </classes>
-  </test>
-
-</suite>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git



More information about the pkg-java-commits mailing list