You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2018/07/30 17:46:44 UTC

[GitHub] rfscholte closed pull request #6: JXR-135: IT and some refactoring

rfscholte closed pull request #6: JXR-135: IT and some refactoring
URL: https://github.com/apache/maven-jxr/pull/6
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/maven-jxr-plugin/src/it/JXR-135_innerclasses/invoker.properties b/maven-jxr-plugin/src/it/JXR-135_innerclasses/invoker.properties
new file mode 100644
index 0000000..ce2bbb0
--- /dev/null
+++ b/maven-jxr-plugin/src/it/JXR-135_innerclasses/invoker.properties
@@ -0,0 +1,19 @@
+# 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.
+
+invoker.goals=jxr:jxr
+invoker.debug=true
diff --git a/maven-jxr-plugin/src/it/JXR-135_innerclasses/pom.xml b/maven-jxr-plugin/src/it/JXR-135_innerclasses/pom.xml
new file mode 100644
index 0000000..460d365
--- /dev/null
+++ b/maven-jxr-plugin/src/it/JXR-135_innerclasses/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.maven.jxr.it</groupId>
+    <artifactId>jxr135</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+
+    <build>
+      <pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jxr-plugin</artifactId>
+                <version>@project.version@</version>
+            </plugin>
+        </plugins>
+      </pluginManagement>
+    </build>
+</project>
diff --git a/maven-jxr-plugin/src/it/JXR-135_innerclasses/src/main/java/com/mycompany/app/ClassWithNested.java b/maven-jxr-plugin/src/it/JXR-135_innerclasses/src/main/java/com/mycompany/app/ClassWithNested.java
new file mode 100644
index 0000000..4e4ae35
--- /dev/null
+++ b/maven-jxr-plugin/src/it/JXR-135_innerclasses/src/main/java/com/mycompany/app/ClassWithNested.java
@@ -0,0 +1,37 @@
+package com.mycompany.app;
+
+/*
+ * 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.
+ */
+
+public class ClassWithNested
+{
+    public interface NestedInterface {}
+    public static class NestedClassWithEnum {
+        public enum NestedEnum { }
+        public class NestedClass2 {
+        }
+    }
+
+    public static class NestedClassWithEnum2 {
+        public enum NestedEnum { }
+        public class NestedClass2 {
+        }
+    }
+}
+class NotNested {}
diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java
index 1d80e3a..6d5ed92 100644
--- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java
+++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java
@@ -86,7 +86,7 @@ protected String getDestinationDirectory()
             }
         }
 
-        List<String> l = new ArrayList<String>();
+        List<String> l = new ArrayList<>();
 
         if ( !"pom".equals( getProject().getPackaging().toLowerCase() ) )
         {
@@ -107,7 +107,7 @@ protected String getDestinationDirectory()
     @Override
     protected List<String> getSourceRoots( MavenProject project )
     {
-        List<String> l = new ArrayList<String>();
+        List<String> l = new ArrayList<>();
 
         if ( !"pom".equals( project.getPackaging().toLowerCase() ) )
         {
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java b/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java
index a622f6c..2a3cb8f 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java
@@ -243,12 +243,12 @@ public void process( Log log )
         Iterator<Map<String, ?>> iter = ( (Map) info.get( "allPackages" ) ).values().iterator();
         while ( iter.hasNext() )
         {
-            Map pkgInfo = (Map) iter.next();
+            Map pkgInfo = iter.next();
 
             VelocityContext subContext = new VelocityContext( context );
             subContext.put( "pkgInfo", pkgInfo );
 
-            String outDir = root + '/' + (String) pkgInfo.get( "dir" );
+            String outDir = root + '/' + pkgInfo.get( "dir" );
             doVelocity( "package-summary", outDir, subContext, engine );
             doVelocity( "package-frame", outDir, subContext, engine );
         }
@@ -353,7 +353,7 @@ private void doVelocity( String templateName, String outDir, VelocityContext con
                 rootRef = "./";
             }
 
-            Map<String, Map<String, String>> pkgClasses = new TreeMap<String, Map<String, String>>();
+            Map<String, Map<String, String>> pkgClasses = new TreeMap<>();
             Enumeration<ClassType> classes = pkg.getClassTypes();
             while ( classes.hasMoreElements() )
             {
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/JXR.java b/maven-jxr/src/main/java/org/apache/maven/jxr/JXR.java
index 5b06700..83d9dcc 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/JXR.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/JXR.java
@@ -89,7 +89,7 @@
      * Now that we have instantiated everything. Process this JXR task.
      *
      * @param packageManager
-     * @param source
+     * @param sourceDir
      * @param bottom
      * @throws IOException
      */
@@ -259,8 +259,8 @@ public void xref( List<String> sourceDirs, String templateDir, String windowTitl
      * Given a source file transform it into HTML and write it to the
      * destination (dest) file.
      *
-     * @param source The java source file
-     * @param destDir The directory to put the HTML into
+     * @param sourceFile The java source file
+     * @param destFile The directory to put the HTML into
      * @param bottom The bottom footer text just as in the package pages
      * @throws IOException Thrown if the transform can't happen for some reason.
      */
@@ -287,10 +287,8 @@ private void transform( Path sourceFile, Path destFile, String bottom )
      * @param fromDir The directory from which the link is relative.
      * @param toDir The directory into which the link points.
      * @return a String of format <code>"../../schmoo/"</code>
-     * @throws java.io.IOException If a problem is encountered while navigating through the directories.
      */
     private static Path getRelativeLink( Path fromDir, Path toDir )
-        throws IOException
     {
         return fromDir.relativize( toDir );
     }
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java b/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java
index e4b9004..3f2feae 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java
@@ -99,63 +99,63 @@
     /**
      * show line numbers
      */
-    public static final boolean LINE_NUMBERS = true;
+    private static final boolean LINE_NUMBERS = true;
 
     /**
      * start comment delimiter
      */
-    public static final String COMMENT_START = "<em class=\"jxr_comment\">";
+    private static final String COMMENT_START = "<em class=\"jxr_comment\">";
 
     /**
      * end comment delimiter
      */
-    public static final String COMMENT_END = "</em>";
+    private static final String COMMENT_END = "</em>";
 
     /**
      * start javadoc comment delimiter
      */
-    public static final String JAVADOC_COMMENT_START = "<em class=\"jxr_javadoccomment\">";
+    private static final String JAVADOC_COMMENT_START = "<em class=\"jxr_javadoccomment\">";
 
     /**
      * end javadoc comment delimiter
      */
-    public static final String JAVADOC_COMMENT_END = "</em>";
+    private static final String JAVADOC_COMMENT_END = "</em>";
 
     /**
      * start String delimiter
      */
-    public static final String STRING_START = "<span class=\"jxr_string\">";
+    private static final String STRING_START = "<span class=\"jxr_string\">";
 
     /**
      * end String delimiter
      */
-    public static final String STRING_END = "</span>";
+    private static final String STRING_END = "</span>";
 
     /**
      * start reserved word delimiter
      */
-    public static final String RESERVED_WORD_START = "<strong class=\"jxr_keyword\">";
+    private static final String RESERVED_WORD_START = "<strong class=\"jxr_keyword\">";
 
     /**
      * end reserved word delimiter
      */
-    public static final String RESERVED_WORD_END = "</strong>";
+    private static final String RESERVED_WORD_END = "</strong>";
 
     /**
      * stylesheet file name
      */
-    public static final String STYLESHEET_FILENAME = "stylesheet.css";
+    private static final String STYLESHEET_FILENAME = "stylesheet.css";
 
     /**
      * Description of the Field
      */
-    public static final String[] VALID_URI_SCHEMES = { "http://", "mailto:" };
+    private static final String[] VALID_URI_SCHEMES = { "http://", "mailto:" };
 
     /**
      * Specify the only characters that are allowed in a URI besides alpha and numeric characters. Refer RFC2396 -
      * http://www.ietf.org/rfc/rfc2396.txt
      */
-    public static final char[] VALID_URI_CHARS = { '?', '+', '%', '&', ':', '/', '.', '@', '_', ';', '=', '$', ',',
+    private static final char[] VALID_URI_CHARS = { '?', '+', '%', '&', ':', '/', '.', '@', '_', ';', '=', '$', ',',
         '-', '!', '~', '*', '\'', '(', ')' };
 
     // ----------------------------------------------------------------------
@@ -165,7 +165,7 @@
     /**
      * HashTable containing java reserved words
      */
-    private Hashtable<String, String> reservedWords = new Hashtable<String, String>();
+    private Hashtable<String, String> reservedWords = new Hashtable<>();
 
     /**
      * flag set to true when a multi-line comment is started
@@ -243,7 +243,7 @@ public JavaCodeTransform( PackageManager packageManager )
      * @param line String
      * @return filtered line of code
      */
-    public final String syntaxHighlight( String line )
+    private String syntaxHighlight( String line )
     {
         return htmlFilter( line );
     }
@@ -254,7 +254,7 @@ public final String syntaxHighlight( String line )
      * @param out the writer where the header is appended to
      * @return String
      */
-    public void appendHeader( PrintWriter out )
+    private void appendHeader( PrintWriter out )
     {
         String outputEncoding = this.outputEncoding;
         if ( outputEncoding == null )
@@ -321,7 +321,7 @@ public void appendHeader( PrintWriter out )
      * @param bottom the bottom text
      * @return String
      */
-    public final void appendFooter( PrintWriter out, String bottom )
+    private void appendFooter( PrintWriter out, String bottom )
     {
         out.println( "</pre>" );
         out.println( "<hr/>" );
@@ -345,7 +345,7 @@ public final void appendFooter( PrintWriter out, String bottom )
      * @param bottom string
      * @throws IOException
      */
-    public final void transform( Reader sourceReader, Writer destWriter, Locale locale, String inputEncoding,
+    private void transform( Reader sourceReader, Writer destWriter, Locale locale, String inputEncoding,
                                  String outputEncoding, Path javadocLinkDir, String revision, String bottom )
         throws IOException
     {
@@ -450,7 +450,7 @@ private Reader getReader( Path sourcefile, String inputEncoding )
      *
      * @return String
      */
-    public final Path getCurrentFilename()
+    private Path getCurrentFilename()
     {
         return this.currentFilename;
     }
@@ -460,7 +460,7 @@ public final Path getCurrentFilename()
      *
      * @param filename String
      */
-    public final void setCurrentFilename( Path filename )
+    private void setCurrentFilename( Path filename )
     {
         this.currentFilename = filename;
     }
@@ -470,7 +470,7 @@ public final void setCurrentFilename( Path filename )
      *
      * @return String
      */
-    public final String getPackageRoot()
+    private String getPackageRoot()
     {
         StringBuilder buff = new StringBuilder();
 
@@ -504,7 +504,7 @@ public final String getPackageRoot()
      * @param line String
      * @return String
      */
-    public final String uriFilter( String line )
+    private final String uriFilter( String line )
     {
         for ( int i = 0; i < VALID_URI_SCHEMES.length; ++i )
         {
@@ -571,7 +571,7 @@ public final String getRevision()
      * @param classType ClassType
      * @return String
      */
-    public final String xrLine( String line, String packageName, ClassType classType )
+    private String xrLine( String line, String packageName, ClassType classType )
     {
         StringBuilder buff = new StringBuilder( line );
 
@@ -616,25 +616,6 @@ public final String xrLine( String line, String packageName, ClassType classType
         return buff.toString();
     }
 
-    /**
-     * Highlight the package in this line.
-     *
-     * @param line input line
-     * @param packageName package name
-     * @return input line with linked package
-     */
-    public final String xrLine( String line, String packageName )
-    {
-        String href = this.getHREF( packageName );
-
-        String find = packageName;
-
-        // build out what the link would be.
-        String link = "<a href=\"" + href + "\">" + find + "</a>";
-
-        return StringUtils.replace( line, find, link );
-    }
-
     // ----------------------------------------------------------------------
     // private methods
     // ----------------------------------------------------------------------
@@ -1297,7 +1278,7 @@ private String importFilter( String line )
             // specify the classname of this import if any.
             String classname = null;
 
-            if ( pkg.indexOf( ".*" ) != -1 )
+            if (pkg.contains(".*"))
             {
                 pkg = StringUtils.replace( pkg, ".*", "" );
             }
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFile.java b/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFile.java
index 78518ad..f6a90c9 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFile.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFile.java
@@ -34,9 +34,9 @@
  */
 public abstract class JavaFile
 {
-    private Set<ImportType> imports = new HashSet<ImportType>();
+    private Set<ImportType> imports = new HashSet<>();
 
-    private List<ClassType> classTypes = new ArrayList<ClassType>();
+    private List<ClassType> classTypes = new ArrayList<>();
 
     private PackageType packageType = new PackageType();
 
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFileImpl.java b/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFileImpl.java
index 923154d..9a30db5 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFileImpl.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/JavaFileImpl.java
@@ -41,7 +41,8 @@
     /**
      * Create a new JavaFileImpl that points to a given file...
      *
-     * @param filename
+     * @param path
+     * @param encoding
      * @throws IOException
      */
     public JavaFileImpl( Path path, String encoding )
@@ -165,7 +166,6 @@ private static String getFilenameWithoutPathOrExtension( Path path )
      * Get a StreamTokenizer for this file.
      */
     private StreamTokenizer getTokenizer( Reader reader )
-        throws IOException
     {
         StreamTokenizer stok = new StreamTokenizer( reader );
         //int tok;
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/PackageManager.java b/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/PackageManager.java
index 395e767..4330ede 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/PackageManager.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/pacman/PackageManager.java
@@ -43,7 +43,7 @@
     /**
      * All the packages that have been parsed
      */
-    private Hashtable<String, PackageType> packages = new Hashtable<String, PackageType>();
+    private Hashtable<String, PackageType> packages = new Hashtable<>();
 
     /**
      * The default Java package.
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/util/SimpleWordTokenizer.java b/maven-jxr/src/main/java/org/apache/maven/jxr/util/SimpleWordTokenizer.java
index 12fc16b..51c26a4 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/util/SimpleWordTokenizer.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/util/SimpleWordTokenizer.java
@@ -38,7 +38,7 @@
     /**
      * Description of the Field
      */
-    public static final char[] BREAKERS = { '(', ')', '[', ' ', '{', '}' };
+    private static final char[] BREAKERS = { '(', ')', '[', ' ', '{', '}' };
 
     /**
      * Break the given line into multiple StringUtils
@@ -71,7 +71,7 @@
     public static List<StringEntry> tokenize( String line, String find )
     {
 
-        List<StringEntry> foundTokens = new ArrayList<StringEntry>();
+        List<StringEntry> foundTokens = new ArrayList<>();
 
         for ( StringEntry se : tokenize( line ) )
         {
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java b/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java
index 67a76f5..85b9977 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java
@@ -69,18 +69,7 @@ public int compareTo( StringEntry se )
     {
         //right now only sort by the index.
 
-        if ( se.getIndex() < this.getIndex() )
-        {
-            return -1;
-        }
-        else if ( se.getIndex() == this.getIndex() )
-        {
-            return 0;
-        }
-        else
-        {
-            return 1;
-        }
+        return Integer.compare( se.getIndex(), this.getIndex() );
 
     }
 
diff --git a/maven-jxr/src/test/java/org/apache/maven/jxr/DirectoryIndexerTest.java b/maven-jxr/src/test/java/org/apache/maven/jxr/DirectoryIndexerTest.java
index aaf6c7d..7a16bfe 100644
--- a/maven-jxr/src/test/java/org/apache/maven/jxr/DirectoryIndexerTest.java
+++ b/maven-jxr/src/test/java/org/apache/maven/jxr/DirectoryIndexerTest.java
@@ -34,11 +34,9 @@
     /**
      * Parse the files in test/resources/jxr68 packages, ensure all are present in the allClasses Map,
      * in the correct order.
-     *
-     * @throws Exception
      */
     @Test
-    public void testJXR_68() throws Exception
+    public void testJXR_68()
     {
         FileManager fileManager = FileManager.getInstance();
         PackageManager packageManager = new PackageManager( new DummyLog(), fileManager );
diff --git a/maven-jxr/src/test/java/org/apache/maven/jxr/IncludeExcludeTest.java b/maven-jxr/src/test/java/org/apache/maven/jxr/IncludeExcludeTest.java
index 5a19cbd..992cb8e 100644
--- a/maven-jxr/src/test/java/org/apache/maven/jxr/IncludeExcludeTest.java
+++ b/maven-jxr/src/test/java/org/apache/maven/jxr/IncludeExcludeTest.java
@@ -19,27 +19,30 @@
  * under the License.
  */
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Collections;
 
+import org.junit.Before;
+import org.junit.Test;
+
 /**
  * Test include/exclude patterns.
  *
  * @author <a href="mailto:dennisl@apache.org">Dennis Lundberg</a>
  * @version $Id$
  */
-public class IncludeExcludeTest extends TestCase
+public class IncludeExcludeTest
 {
     private JXR jxr;
 
-    protected void setUp()
-        throws Exception
+    @Before
+    public void setUp()
     {
-        super.setUp();
         jxr = new JXR();
         jxr.setDest( Paths.get( "target" ) );
         jxr.setInputEncoding( "ISO-8859-1" );
@@ -48,6 +51,7 @@ protected void setUp()
         jxr.setLog( new DummyLog() );
     }
 
+    @Test
     public void testIncludeExclude()
         throws Exception
     {
diff --git a/maven-jxr/src/test/java/org/apache/maven/jxr/JavaCodeTransformTest.java b/maven-jxr/src/test/java/org/apache/maven/jxr/JavaCodeTransformTest.java
index c27942e..e076e6f 100644
--- a/maven-jxr/src/test/java/org/apache/maven/jxr/JavaCodeTransformTest.java
+++ b/maven-jxr/src/test/java/org/apache/maven/jxr/JavaCodeTransformTest.java
@@ -19,20 +19,22 @@
  * under the License.
  */
 
-import junit.framework.TestCase;
-import org.apache.maven.jxr.pacman.PackageManager;
-import org.apache.maven.jxr.pacman.FileManager;
+import static org.junit.Assert.assertTrue;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Locale;
 
+import org.apache.maven.jxr.pacman.FileManager;
+import org.apache.maven.jxr.pacman.PackageManager;
+import org.junit.Before;
+import org.junit.Test;
+
 /**
  * JUnit test for {@link JavaCodeTransform}.
  */
 public class JavaCodeTransformTest
-    extends TestCase
 {
     /** JavaCodeTransform object under test */
     private JavaCodeTransform codeTransform;
@@ -43,11 +45,9 @@
     /**
      * Set up this test.
      */
-    @Override
-    protected void setUp()
-        throws Exception
+    @Before
+    public void setUp()
     {
-        super.setUp();
         packageManager = new PackageManager( new DummyLog(), new FileManager() );
         codeTransform = new JavaCodeTransform( packageManager );
     }
@@ -55,6 +55,7 @@ protected void setUp()
     /**
      * Test basic transformation of a java source file.
      */
+    @Test
     public void testTransform()
         //test transforms its own sourcefile, so add some comments
         throws Exception // single line despite /*
@@ -72,6 +73,7 @@ public void testTransform()
     /**
      * Test what happens with an empty sourcefile.
      */
+    @Test
     public void testTransformWithEmptyClassFile()
         throws Exception
     {
diff --git a/maven-jxr/src/test/java/org/apache/maven/jxr/JxrBeanTest.java b/maven-jxr/src/test/java/org/apache/maven/jxr/JxrBeanTest.java
index 1f19822..02a7bc2 100644
--- a/maven-jxr/src/test/java/org/apache/maven/jxr/JxrBeanTest.java
+++ b/maven-jxr/src/test/java/org/apache/maven/jxr/JxrBeanTest.java
@@ -19,21 +19,20 @@
  * under the License.
  */
 
-import junit.framework.TestCase;
-
 import java.nio.file.Paths;
 import java.util.Collections;
 
+import org.junit.Before;
+import org.junit.Test;
+
 public class JxrBeanTest
-    extends TestCase
 {
 
     private JXR jxrBean;
 
-    protected void setUp()
-        throws Exception
+    @Before
+    public void setUp()
     {
-        super.setUp();
         jxrBean = new JXR();
         jxrBean.setDest( Paths.get( "target" ) );
         jxrBean.setInputEncoding( "ISO-8859-1" );
@@ -42,6 +41,7 @@ protected void setUp()
         jxrBean.setLog( new DummyLog() );
     }
 
+    @Test
     public void testXref()
         throws Exception
     {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services