You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mc...@apache.org on 2021/03/19 17:14:39 UTC

[cassandra] branch cassandra-2.2 updated: Remove ant targets list-jvm-dtests and ant list-jvm-upgrade-dtests

This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch cassandra-2.2
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-2.2 by this push:
     new 730e89e  Remove ant targets list-jvm-dtests and ant list-jvm-upgrade-dtests
730e89e is described below

commit 730e89e22951176eb1982e74edfb3e6b77d7a496
Author: Mick Semb Wever <mc...@apache.org>
AuthorDate: Mon Mar 15 12:22:09 2021 +0100

    Remove ant targets list-jvm-dtests and ant list-jvm-upgrade-dtests
    
     patch by Mick Semb Wever; reviewed by Alex Petrov for CASSANDRA-16519
---
 CHANGES.txt                                        |  1 +
 build.xml                                          | 22 -----
 .../cassandra/distributed/test/TestLocator.java    | 93 ----------------------
 3 files changed, 1 insertion(+), 115 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 7d1d27b..5199140 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.20
+ * Remove ant targets list-jvm-dtests and ant list-jvm-upgrade-dtests (CASSANDRA-16519)
  * Fix centos packaging for arm64, >=4.0 rpm's now require python3 (CASSANDRA-16477)
  * Make TokenMetadata's ring version increments atomic (CASSANDRA-16286)
  * Remove OpenJDK log warning (CASSANDRA-15563)
diff --git a/build.xml b/build.xml
index 1ac8d5d..1b54943 100644
--- a/build.xml
+++ b/build.xml
@@ -67,7 +67,6 @@
     <property name="test.microbench.src" value="${test.dir}/microbench"/>
     <property name="test.pig.src" value="${test.dir}/pig"/>
     <property name="test.distributed.src" value="${test.dir}/distributed"/>
-    <property name="test.distributed.listfile" value = "ant-jvm-dtest-list"/>
     <property name="dist.dir" value="${build.dir}/dist"/>
     <property name="tmp.dir" value="${java.io.tmpdir}"/>
 	
@@ -1868,27 +1867,6 @@
     </testmacro>
   </target>
 
-  <!-- In-JVM dtest targets -->
-  <target name="list-jvm-dtests" depends="build-test">
-    <java classname="org.apache.cassandra.distributed.test.TestLocator" fork="no">
-          <classpath>
-              <path refid="cassandra.classpath"/>
-              <pathelement location="${test.classes}"/>
-              <pathelement location="${test.conf}"/>
-              <fileset dir="${test.lib}">
-                  <include name="**/*.jar" />
-              </fileset>
-          </classpath>
-        <arg value="${test.distributed.listfile}"/>
-    </java>
-  </target>
-
-  <target name="test-jvm-dtest-forking" depends="list-jvm-dtests" description="Execute In-JVM 'distributed' tests" >
-    <chmod file="${test.distributed.listfile}" perm="+x"/>
-    <exec executable="./${test.distributed.listfile}" failonerror="true"/>
-    <delete file="${test.distributed.listfile}"/>
-  </target>
-
   <target name="dtest-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">
       <jar jarfile="${build.dir}/dtest-${base.version}.jar">
           <zipgroupfileset dir="${build.lib}" includes="*.jar" excludes="META-INF/*.SF"/>
diff --git a/test/distributed/org/apache/cassandra/distributed/test/TestLocator.java b/test/distributed/org/apache/cassandra/distributed/test/TestLocator.java
deleted file mode 100644
index a7ad400..0000000
--- a/test/distributed/org/apache/cassandra/distributed/test/TestLocator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.cassandra.distributed.test;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.junit.Test;
-
-public class TestLocator
-{
-    private static final String defaultOutputFileName = "run-jvm-dtests";
-    private static final String testPackage = "org.apache.cassandra.distributed.test";
-    private static final String testCommandFormat = "ant testsome -Dtest.name=%s -Dtest.methods=%s";
-
-    public static void main(String[] args) throws Throwable
-    {
-        String outputFileName = defaultOutputFileName;
-        if (args.length == 1)
-        {
-            outputFileName = args[0];
-        }
-        try (FileWriter fileWriter = new FileWriter(outputFileName);
-             PrintWriter printWriter = new PrintWriter(fileWriter))
-        {
-            printWriter.println("#!/bin/bash");
-            for (Class testClass : locateClasses(testPackage))
-            {
-                for (Method method : testClass.getMethods())
-                {
-                    if (method.getAnnotation(Test.class) == null)
-                        continue;
-
-                    printWriter.println(String.format(testCommandFormat,
-                                                      testClass.getName(),
-                                                      method.getName()));
-                }
-            }
-        }
-    }
-
-    private static List<Class> locateClasses(String packageName) throws ClassNotFoundException, IOException
-    {
-        ClassLoader classLoader = TestLocator.class.getClassLoader();
-
-        Enumeration<URL> resources = classLoader.getResources(packageName.replace('.', '/'));
-        List<Class> classes = new ArrayList<>();
-        while (resources.hasMoreElements())
-        {
-            URL resource = resources.nextElement();
-            loadClassesRecursively(new File(resource.getFile()), packageName, classes);
-        }
-
-        return classes;
-    }
-
-
-    private static void loadClassesRecursively(File directory, String packageName, List<Class> classes) throws ClassNotFoundException
-    {
-        for (File file : directory.listFiles())
-        {
-            if (file.isDirectory())
-                loadClassesRecursively(file, packageName + "." + file.getName(), classes);
-            else if (file.getName().endsWith(".class"))
-            {
-                classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));
-            }
-        }
-    }
-}
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org