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

pottlinger pushed a commit to branch feature/RAT-336
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git


The following commit(s) were added to refs/heads/feature/RAT-336 by this push:
     new 14e08c5d RAT-336: Start to migrate tests in first module
14e08c5d is described below

commit 14e08c5db6838db7e8691cb106156dc1b41418ea
Author: P. Ottlinger <[email protected]>
AuthorDate: Tue Jun 4 23:13:58 2024 +0200

    RAT-336: Start to migrate tests in first module
---
 .../apache/rat/analysis/license/AbstractLicenseTest.java |  2 --
 .../rat/analysis/license/ApacheSoftwareLicenseTest.java  |  1 -
 .../apache/rat/analysis/license/DirectoryScanner.java    |  4 ++--
 .../apache/rat/analysis/license/OASISLicenseTest.java    | 16 ++++++++++------
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/AbstractLicenseTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/AbstractLicenseTest.java
index 80f94d10..39d512fe 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/AbstractLicenseTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/AbstractLicenseTest.java
@@ -34,7 +34,6 @@ import org.apache.rat.api.MetaData;
 import org.apache.rat.license.ILicense;
 import org.apache.rat.license.LicenseSetFactory;
 import org.apache.rat.license.LicenseSetFactory.LicenseFilter;
-import org.apache.rat.testhelpers.TestingLicense;
 import org.apache.rat.utils.DefaultLog;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -42,7 +41,6 @@ import org.junit.jupiter.params.provider.MethodSource;
 
 /**
  * Test to see if short form license information will be recognized correctly.
- *
  */
 abstract public class AbstractLicenseTest {
     private static int NAME = 0;
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicenseTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicenseTest.java
index ef7692ad..971ffb2a 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicenseTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicenseTest.java
@@ -24,7 +24,6 @@ import org.junit.jupiter.params.provider.Arguments;
 
 /**
  * Apache Software License detection tests.
- *
  */
 public class ApacheSoftwareLicenseTest extends AbstractLicenseTest {
 
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
index 887169b7..bb5e76f0 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/DirectoryScanner.java
@@ -38,11 +38,11 @@ class DirectoryScanner {
      * 
      * @param directory the directory containing the files
      * @param matcher the license matcher
-     * @param expected the expected result of the each scan
+     * @param expected the expected result of each scan
      * @throws Exception
      */
     @Test
-    public static void testFilesInDir(String directory, ILicense license, 
boolean expected) throws Exception {
+    public static void runTestsOnFilesInDir(String directory, ILicense 
license, boolean expected) throws Exception {
         final File[] resourceFiles = Resources.getResourceFiles(directory);
         if (resourceFiles.length == 0) {
             fail("No files found under " + directory);
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
index a439827c..4a7c96d1 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
@@ -20,6 +20,8 @@ package org.apache.rat.analysis.license;
 
 import java.util.stream.Stream;
 
+import org.apache.rat.license.ILicense;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.provider.Arguments;
 
 public class OASISLicenseTest extends AbstractLicenseTest {
@@ -36,15 +38,17 @@ public class OASISLicenseTest extends AbstractLicenseTest {
     public static Stream<Arguments> parameterProvider() {
         return Stream.of(Arguments.of(id, id, name, notes, targets));
     }
-    /*
-    @Test(timeout = 2000) // may need to be adjusted if many more files are 
added
+
+    /* TODO
+    private static ILicense license = ILicense.builder().setId(id).build();
+    @Test // may need to be adjusted if many more files are added
     public void goodFiles() throws Exception {
-        DirectoryScanner.testFilesInDir("oasis/good", license, true);
+        DirectoryScanner.runTestsOnFilesInDir("oasis/good", license, true);
     }
     
-    @Test(timeout = 2000) // may need to be adjusted if many more files are 
added
-    public void baddFiles() throws Exception {
-        DirectoryScanner.testFilesInDir("oasis/bad", license, false);
+    @Test // may need to be adjusted if many more files are added
+    public void badFiles() throws Exception {
+        DirectoryScanner.runTestsOnFilesInDir("oasis/bad", license, false);
     }
     */
 }

Reply via email to