You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kw...@apache.org on 2023/02/20 09:53:16 UTC

[maven-doxia-converter] branch feature/doxia-2 created (now 3c549f4)

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

kwin pushed a change to branch feature/doxia-2
in repository https://gitbox.apache.org/repos/asf/maven-doxia-converter.git


      at 3c549f4  [DOXIATOOLS-80] Update to Doxia 2.0.0-M5

This branch includes the following new commits:

     new 3c549f4  [DOXIATOOLS-80] Update to Doxia 2.0.0-M5

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-doxia-converter] 01/01: [DOXIATOOLS-80] Update to Doxia 2.0.0-M5

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/doxia-2
in repository https://gitbox.apache.org/repos/asf/maven-doxia-converter.git

commit 3c549f4f1124c6812ff1a1c2a5aff5064912210a
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Feb 20 10:53:10 2023 +0100

    [DOXIATOOLS-80] Update to Doxia 2.0.0-M5
---
 pom.xml                                            | 117 ++++++------
 .../java/org/apache/maven/doxia/Converter.java     |   2 -
 .../org/apache/maven/doxia/DefaultConverter.java   |  96 ++--------
 .../org/apache/maven/doxia/cli/ConverterCli.java   |  11 +-
 .../java/org/apache/maven/doxia/ConverterTest.java | 202 ++-------------------
 5 files changed, 87 insertions(+), 341 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9f91aec..7381358 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,21 +57,23 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <doxiaVersion>1.12.0</doxiaVersion>
+    <doxiaVersion>2.0.0-M5</doxiaVersion>
     <javaVersion>8</javaVersion>
     <project.build.outputTimestamp>2023-01-09T21:24:22Z</project.build.outputTimestamp>
   </properties>
   <dependencyManagement>
     <dependencies>
       <dependency>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-utils</artifactId>
-        <version>3.4.2</version><!-- 3.4.0 have issues with BOM -->
+        <groupId>org.junit</groupId>
+        <artifactId>junit-bom</artifactId>
+        <version>5.9.1</version>
+        <type>pom</type>
+        <scope>import</scope>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-container-default</artifactId>
-        <version>2.1.1</version>
+        <artifactId>plexus-utils</artifactId>
+        <version>3.4.2</version><!-- 3.4.0 have issues with BOM -->
       </dependency>
     </dependencies>
   </dependencyManagement>
@@ -82,11 +84,6 @@ under the License.
       <artifactId>doxia-core</artifactId>
       <version>${doxiaVersion}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-logging-api</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-sink-api</artifactId>
@@ -99,66 +96,16 @@ under the License.
       <artifactId>doxia-module-apt</artifactId>
       <version>${doxiaVersion}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-confluence</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-docbook-simple</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-module-fml</artifactId>
       <version>${doxiaVersion}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-fo</artifactId>
-      <version>${doxiaVersion}</version>
-      <exclusions><!-- remove with update to 1.9.2 -->
-        <exclusion>
-          <groupId>javax.media</groupId>
-          <artifactId>jai-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>com.sun.media</groupId>
-          <artifactId>jai-codec</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-latex</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-itext</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-rtf</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-twiki</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-module-xdoc</artifactId>
       <version>${doxiaVersion}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-xhtml</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-module-xhtml5</artifactId>
@@ -185,17 +132,40 @@ under the License.
       <artifactId>icu4j</artifactId>
       <version>71.1</version>
     </dependency>
-
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.36</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.36</version>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>1.2.11</version>
+    </dependency>
     <!-- Plexus -->
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-container-default</artifactId>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.plexus</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
+      <version>4.2.3</version>
+      <classifier>no_aop</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.inject</artifactId>
     </dependency>
-
     <!-- Test -->
     <dependency>
       <groupId>junit</groupId>
@@ -203,6 +173,23 @@ under the License.
       <version>4.13.2</version>
       <scope>test</scope>
     </dependency>
+    <!--
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-testing</artifactId>
+      <version>1.1.0</version>
+      <scope>test</scope>
+    </dependency>  -->
   </dependencies>
 
   <build>
diff --git a/src/main/java/org/apache/maven/doxia/Converter.java b/src/main/java/org/apache/maven/doxia/Converter.java
index bd16840..b755953 100644
--- a/src/main/java/org/apache/maven/doxia/Converter.java
+++ b/src/main/java/org/apache/maven/doxia/Converter.java
@@ -19,7 +19,6 @@ package org.apache.maven.doxia;
  * under the License.
  */
 
-import org.apache.maven.doxia.logging.LogEnabled;
 import org.apache.maven.doxia.wrapper.InputFileWrapper;
 import org.apache.maven.doxia.wrapper.InputReaderWrapper;
 import org.apache.maven.doxia.wrapper.OutputFileWrapper;
@@ -31,7 +30,6 @@ import org.apache.maven.doxia.wrapper.OutputStreamWrapper;
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
  */
 public interface Converter
-    extends LogEnabled
 {
     /**
      * @param input an input file wrapper, not null.
diff --git a/src/main/java/org/apache/maven/doxia/DefaultConverter.java b/src/main/java/org/apache/maven/doxia/DefaultConverter.java
index 4970977..4dfbe4a 100644
--- a/src/main/java/org/apache/maven/doxia/DefaultConverter.java
+++ b/src/main/java/org/apache/maven/doxia/DefaultConverter.java
@@ -36,8 +36,9 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 
-import org.apache.maven.doxia.logging.Log;
-import org.apache.maven.doxia.logging.SystemStreamLog;
+import com.ibm.icu.text.CharsetDetector;
+import com.ibm.icu.text.CharsetMatch;
+import org.apache.commons.io.input.XmlStreamReader;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.Sink;
@@ -49,6 +50,7 @@ import org.apache.maven.doxia.wrapper.OutputStreamWrapper;
 import org.codehaus.plexus.ContainerConfiguration;
 import org.codehaus.plexus.DefaultContainerConfiguration;
 import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.PlexusContainerException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -58,14 +60,12 @@ import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.SelectorUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.WriterFactory;
-import org.apache.commons.io.input.XmlStreamReader;
 import org.codehaus.plexus.util.xml.XmlUtil;
 import org.codehaus.plexus.util.xml.pull.MXParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-import com.ibm.icu.text.CharsetDetector;
-import com.ibm.icu.text.CharsetMatch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static java.lang.String.format;
 
@@ -83,17 +83,9 @@ public class DefaultConverter
     public enum DoxiaFormat
     {
         APT( "apt", "apt", true, true ),
-        CONFLUENCE( "confluence", "confluence", true, true ),
-        DOCBOOK( "docbook", "xml", "article", true, true ),
         FML( "fml", "fml", "faqs", true, false ),
-        FO( "fo", "fo", false, true ),
-        ITEXT( "itext", "itext", false, true ),
-        LATEX( "latex", "tex", false, true ),
-        TWIKI( "twiki", "twiki", true, true ),
-        RTF( "rtf", "rtf", false, true ),
         XDOC( "xdoc", "xml", "document", true, true ),
-        XHTML( "xhtml", "html", "html", true, true ),
-        XHTML5( "xhtml5", "html", true, true ), // no autodetect support
+        XHTML5( "xhtml5", "html", "html", true, true ),
         MARKDOWN( "markdown", "md", false, true );
 
         /** Plexus role hint for Doxia sink/parser */
@@ -161,7 +153,7 @@ public class DefaultConverter
             }
             Objects.requireNonNull( plexus, "plexus is required" );
 
-            return (Parser) plexus.lookup( Parser.ROLE, roleHint );
+            return (Parser) plexus.lookup( Parser.class, roleHint );
         }
 
         /**
@@ -179,7 +171,7 @@ public class DefaultConverter
             }
             Objects.requireNonNull( plexus, "plexus is required" );
 
-            return (SinkFactory) plexus.lookup( SinkFactory.ROLE, roleHint );
+            return (SinkFactory) plexus.lookup( SinkFactory.class, roleHint );
         }
 
         /**
@@ -239,30 +231,7 @@ public class DefaultConverter
     private PlexusContainer plexus;
 
     /** Doxia logger */
-    private Log log;
-
-    /** {@inheritDoc} */
-    @Override
-    public void enableLogging( Log log )
-    {
-        this.log = log;
-    }
-
-    /**
-     * Returns a logger for this sink.
-     * If no logger has been configured, a new SystemStreamLog is returned.
-     *
-     * @return Log
-     */
-    protected Log getLog()
-    {
-        if ( log == null )
-        {
-            log = new SystemStreamLog();
-        }
-
-        return log;
-    }
+    private static final Logger log = LoggerFactory.getLogger(DefaultConverter.class);
 
     /** {@inheritDoc} */
     @Override
@@ -341,17 +310,13 @@ public class DefaultConverter
             try
             {
                 parser = input.getFormat().getParser( plexus );
-                parser.enableLogging( log );
             }
             catch ( ComponentLookupException e )
             {
                 throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
             }
 
-            if ( getLog().isDebugEnabled() )
-            {
-                getLog().debug( "Parser used: " + parser.getClass().getName() );
-            }
+            log.debug( "Parser used: {}", parser.getClass().getName() );
 
             SinkFactory sinkFactory;
             try
@@ -372,12 +337,8 @@ public class DefaultConverter
             {
                 throw new ConverterException( "IOException: " + e.getMessage(), e );
             }
-            sink.enableLogging( log );
 
-            if ( getLog().isDebugEnabled() )
-            {
-                getLog().debug( "Sink used: " + sink.getClass().getName() );
-            }
+            log.debug( "Sink used: {}", sink.getClass().getName() );
 
             parse( parser, input.getReader(), sink );
         }
@@ -428,21 +389,14 @@ public class DefaultConverter
         File outputDirectoryOrFile = relativeOutputDirectory != null 
                 ? new File( output.getFile(), relativeOutputDirectory.getPath() ) 
                 : output.getFile();
-        if ( getLog().isDebugEnabled() )
-        {
-            getLog().debug(
-                            "Parsing file from '" + inputFile.getAbsolutePath() + "' with the encoding '"
-                                + inputEncoding + "' to '" + outputDirectoryOrFile.getAbsolutePath()
-                                + "' with the encoding '" + output.getEncoding() + "'" );
-        }
+        log.debug("Parsing file from '{}' with the encoding '{}'"
+                   + " to '{}' with the encoding '{}'", 
+                   inputFile.getAbsolutePath(), inputEncoding, outputDirectoryOrFile.getAbsolutePath(), output.getEncoding() );
 
         if ( InputFileWrapper.AUTO_ENCODING.equals( inputEncoding ) )
         {
             inputEncoding = autoDetectEncoding( inputFile );
-            if ( getLog().isDebugEnabled() )
-            {
-                getLog().debug( "Auto detect encoding: " + inputEncoding );
-            }
+            log.debug( "Auto detected encoding: '{}'", inputEncoding );
         }
 
 
@@ -450,7 +404,6 @@ public class DefaultConverter
         try
         {
             parser = parserFormat.getParser( plexus );
-            parser.enableLogging( log );
         }
         catch ( ComponentLookupException e )
         {
@@ -529,24 +482,11 @@ public class DefaultConverter
             throw new ConverterException( "IOException: " + e.getMessage(), e );
         }
 
-        sink.enableLogging( log );
-
-        if ( getLog().isDebugEnabled() )
-        {
-            getLog().debug( "Sink used: " + sink.getClass().getName() );
-        }
-
+        log.debug( "Sink used: {}", sink.getClass().getName() );
         parse( parser, reader, sink );
 
         if ( formatOutput && output.getFormat().isXml() )
         {
-            // format all xml files excluding docbook which is buggy
-            // TODO Add doc book format
-            if ( DoxiaFormat.DOCBOOK.equals( output.getFormat() ) )
-            {
-                return;
-            }
-            
             try ( Reader r = ReaderFactory.newXmlReader( outputFile );
                   Writer w = WriterFactory.newXmlWriter( outputFile ) )
             {
@@ -604,6 +544,8 @@ public class DefaultConverter
         ContainerConfiguration containerConfiguration = new DefaultContainerConfiguration();
         containerConfiguration.setName( "Doxia" );
         containerConfiguration.setContext( context );
+        containerConfiguration.setAutoWiring( true );
+        containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
 
         plexus = new DefaultPlexusContainer( containerConfiguration );
     }
diff --git a/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java b/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
index 057883c..92f6ff7 100644
--- a/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
+++ b/src/main/java/org/apache/maven/doxia/cli/ConverterCli.java
@@ -33,8 +33,6 @@ import org.apache.maven.doxia.Converter;
 import org.apache.maven.doxia.ConverterException;
 import org.apache.maven.doxia.DefaultConverter;
 import org.apache.maven.doxia.UnsupportedFormatException;
-import org.apache.maven.doxia.logging.Log;
-import org.apache.maven.doxia.logging.SystemStreamLog;
 import org.apache.maven.doxia.parser.AbstractParser;
 import org.apache.maven.doxia.wrapper.InputFileWrapper;
 import org.apache.maven.doxia.wrapper.OutputFileWrapper;
@@ -111,12 +109,11 @@ public class ConverterCli
         }
 
         Converter converter = new DefaultConverter();
-        Log log = new SystemStreamLog();
+        
         if ( debug )
         {
-            log.setLogLevel( Log.LEVEL_DEBUG );
+            // TODO: programmatically adjust log level
         }
-        converter.enableLogging( log );
 
         InputFileWrapper input;
         OutputFileWrapper output;
@@ -128,10 +125,10 @@ public class ConverterCli
             {
                 File inputFile = new File( commandLine.getOptionValue( CLIManager.IN ) );
                 parserFormat = DefaultConverter.DoxiaFormat.autoDetectFormat( inputFile );
-                if ( log.isDebugEnabled() )
+                /*if ( log.isDebugEnabled() )
                 {
                     log.debug( "Auto detected input format: " + parserFormat );
-                }
+                }*/
             }
             else 
             {
diff --git a/src/test/java/org/apache/maven/doxia/ConverterTest.java b/src/test/java/org/apache/maven/doxia/ConverterTest.java
index ab067fa..5b243e0 100644
--- a/src/test/java/org/apache/maven/doxia/ConverterTest.java
+++ b/src/test/java/org/apache/maven/doxia/ConverterTest.java
@@ -85,7 +85,7 @@ public class ConverterTest
         String out = getBasedir() + "/target/unit/";
 
         InputFileWrapper input =
-                InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
+                InputFileWrapper.valueOf( in, DoxiaFormat.XHTML5, ReaderFactory.UTF_8 );
         OutputFileWrapper output =
                 OutputFileWrapper.valueOf( out, DoxiaFormat.APT, WriterFactory.UTF_8 );
 
@@ -137,7 +137,7 @@ public class ConverterTest
         String out = getBasedir() + "/target/unit/Doxia.apt";
 
         InputFileWrapper input =
-            InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
+            InputFileWrapper.valueOf( in, DoxiaFormat.XHTML5, ReaderFactory.UTF_8 );
         OutputFileWrapper output =
             OutputFileWrapper.valueOf( out, DoxiaFormat.APT, WriterFactory.UTF_8 );
 
@@ -164,7 +164,7 @@ public class ConverterTest
         InputFileWrapper input =
             InputFileWrapper.valueOf( in, DoxiaFormat.APT, ReaderFactory.UTF_8 );
         OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
+            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML5, WriterFactory.UTF_8 );
 
         converter.setFormatOutput( formatOutput );
         converter.convert( input, output );
@@ -174,7 +174,7 @@ public class ConverterTest
         in = getBasedir() + "/target/unit/file/apt/test.apt.xhtml";
         out = getBasedir() + "/target/unit/file/apt/test.apt";
 
-        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
+        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML5, ReaderFactory.UTF_8 );
         output = OutputFileWrapper.valueOf( out, DoxiaFormat.APT, WriterFactory.UTF_8 );
 
         converter.setFormatOutput( formatOutput );
@@ -183,71 +183,6 @@ public class ConverterTest
         assertTrue( new File( out ).length() != 0 );
     }
 
-    /**
-     * Input confluence file / output file
-     *
-     * @see Converter#convert(InputFileWrapper, OutputFileWrapper)
-     * @throws Exception if any
-     */
-    public void testConfluenceFileConverter()
-        throws Exception
-    {
-        String in = getBasedir() + "/src/test/resources/unit/confluence/test.confluence";
-        String out = getBasedir() + "/target/unit/file/confluence/test.confluence.xhtml";
-
-        InputFileWrapper input =
-            InputFileWrapper.valueOf( in, DoxiaFormat.CONFLUENCE, ReaderFactory.UTF_8 );
-        OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-        assertTrue( new File( out ).exists() );
-        assertTrue( new File( out ).length() != 0 );
-
-        in = getBasedir() + "/target/unit/file/confluence/test.confluence.xhtml";
-        out = getBasedir() + "/target/unit/file/confluence/test.confluence";
-
-        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
-        output = OutputFileWrapper.valueOf( out, DoxiaFormat.CONFLUENCE, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-    }
-
-    /**
-     * Input docbook file / output file
-     *
-     * @see Converter#convert(InputFileWrapper, OutputFileWrapper)
-     * @throws Exception if any
-     */
-    public void testDocbookFileConverter()
-        throws Exception
-    {
-        String in = getBasedir() + "/src/test/resources/unit/docbook/test.xml";
-        String out = getBasedir() + "/target/unit/file/docbook/test.docbook.xhtml";
-
-        InputFileWrapper input =
-            InputFileWrapper.valueOf( in, DoxiaFormat.DOCBOOK, ReaderFactory.UTF_8 );
-        OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-        assertTrue( new File( out ).exists() );
-        assertTrue( new File( out ).length() != 0 );
-
-         in = getBasedir() + "/target/unit/file/docbook/test.docbook.xhtml";
-         out = getBasedir() + "/target/unit/file/docbook/test.docbook";
-
-         input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML );
-         output = OutputFileWrapper.valueOf( out, DoxiaFormat.DOCBOOK );
-
-         converter.setFormatOutput( formatOutput );
-         converter.convert( input, output );
-         assertTrue( new File( out ).exists() );
-    }
-
     /**
      * Input fml dir / output dir
      *
@@ -263,7 +198,7 @@ public class ConverterTest
         InputFileWrapper input =
             InputFileWrapper.valueOf( in, DoxiaFormat.FML, ReaderFactory.UTF_8 );
         OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
+            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML5, WriterFactory.UTF_8 );
 
         converter.setFormatOutput( formatOutput );
         converter.convert( input, output );
@@ -273,48 +208,6 @@ public class ConverterTest
         // opposite conversion not supported
     }
 
-    /**
-     * Input twiki file / output file
-     *
-     * @see Converter#convert(InputFileWrapper, OutputFileWrapper)
-     * @throws Exception if any
-     */
-    public void testTwikiFileConverter()
-        throws Exception
-    {
-        String in = getBasedir() + "/src/test/resources/unit/twiki/test.twiki";
-        String out = getBasedir() + "/target/unit/file/twiki/test.twiki.xhtml";
-
-        InputFileWrapper input =
-            InputFileWrapper.valueOf( in, DoxiaFormat.TWIKI, ReaderFactory.UTF_8 );
-        OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-        assertTrue( new File( out ).exists() );
-        assertTrue( new File( out ).length() != 0 );
-
-        in = getBasedir() + "/target/unit/file/twiki/test.twiki.xhtml";
-        out = getBasedir() + "/target/unit/file/twiki/test.twiki";
-
-        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
-        output = OutputFileWrapper.valueOf( out, DoxiaFormat.TWIKI, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        try
-        {
-            converter.convert( input, output );
-        }
-        catch ( ConverterException e )
-        {
-            // The TWiki parser is wrong for *  <pre>some text</pre>
-            if ( !e.getMessage().contains( "Error validating the model" ) )
-            {
-                throw e;
-            }
-        }
-    }
 
     /**
      * Input xdoc file / output dir
@@ -331,7 +224,7 @@ public class ConverterTest
         InputFileWrapper input =
             InputFileWrapper.valueOf( in, DoxiaFormat.XDOC, ReaderFactory.UTF_8 );
         OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
+            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML5, WriterFactory.UTF_8 );
 
         converter.setFormatOutput( formatOutput );
         converter.convert( input, output );
@@ -341,7 +234,7 @@ public class ConverterTest
         in = getBasedir() + "/target/unit/file/xdoc/test.xdoc.xhtml";
         out = getBasedir() + "/target/unit/file/xdoc/test.xdoc";
 
-        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
+        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML5, ReaderFactory.UTF_8 );
         output = OutputFileWrapper.valueOf( out, DoxiaFormat.XDOC, WriterFactory.UTF_8 );
 
         converter.setFormatOutput( formatOutput );
@@ -350,39 +243,6 @@ public class ConverterTest
         assertTrue( new File( out ).length() != 0 );
     }
 
-    /**
-     * Input xhtml file / output dir
-     *
-     * @see Converter#convert(InputFileWrapper, OutputFileWrapper)
-     * @throws Exception if any
-     */
-    public void testXhtmlFileConverter()
-        throws Exception
-    {
-        String in = getBasedir() + "/src/test/resources/unit/xhtml/test.xhtml";
-        String out = getBasedir() + "/target/unit/file/xhtml/test.xhtml.xhtml";
-
-        InputFileWrapper input =
-            InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
-        OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-        assertTrue( new File( out ).exists() );
-        assertTrue( new File( out ).length() != 0 );
-
-        in = getBasedir() + "/target/unit/file/xhtml/test.xhtml.xhtml";
-        out = getBasedir() + "/target/unit/file/xhtml/test.xhtml";
-
-        input = InputFileWrapper.valueOf( in, DoxiaFormat.XHTML, ReaderFactory.UTF_8 );
-        output = OutputFileWrapper.valueOf( out, DoxiaFormat.XHTML, WriterFactory.UTF_8 );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-        assertTrue( new File( out ).exists() );
-        assertTrue( new File( out ).length() != 0 );
-    }
     /**
      * Input xhtml5 file / output dir
      *
@@ -429,42 +289,7 @@ public class ConverterTest
         String in = getBasedir() + "/src/test/resources/unit/apt/test.apt";
         String from = "apt";
         String out = getBasedir() + "/target/unit/writer/apt/test.apt.xhtml";
-        String to = "xhtml";
-
-        File inFile = new File( in );
-        File outFile = new File( out );
-        outFile.getParentFile().mkdirs();
-
-        try ( OutputStream fo = new FileOutputStream( outFile ) )
-        {
-            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
-            InputReaderWrapper input = InputReaderWrapper.valueOf( new FileReader( inFile ), from );
-            OutputStreamWrapper output = OutputStreamWrapper.valueOf( outputStream, to, "UTF-8" );
-
-            converter.setFormatOutput( formatOutput );
-            converter.convert( input, output );
-
-            IOUtil.copy( outputStream.toByteArray(), fo );
-        }
-
-        assertTrue( outFile.exists() );
-        assertTrue( outFile.length() != 0 );
-    }
-
-    /**
-     * Input confluence reader / output writer
-     *
-     * @see Converter#convert(InputReaderWrapper, OutputStreamWrapper)
-     * @throws Exception if any
-     */
-    public void testConfluenceWriterConverter()
-        throws Exception
-    {
-        String in = getBasedir() + "/src/test/resources/unit/confluence/test.confluence";
-        String from = "confluence";
-        String out = getBasedir() + "/target/unit/writer/confluence/test.confluence.xhtml";
-        String to = "xhtml";
+        String to = "xhtml5";
 
         File inFile = new File( in );
         File outFile = new File( out );
@@ -510,7 +335,7 @@ public class ConverterTest
             InputFileWrapper input =
                 InputFileWrapper.valueOf( inFile.getAbsolutePath(), DoxiaFormat.autoDetectFormat( inFile ) );
             OutputFileWrapper output =
-                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), DoxiaFormat.XHTML );
+                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), DoxiaFormat.XHTML5 );
 
             converter.setFormatOutput( formatOutput );
             converter.convert( input, output );
@@ -535,7 +360,7 @@ public class ConverterTest
             InputFileWrapper input =
                 InputFileWrapper.valueOf( inFile.getAbsolutePath(), DoxiaFormat.autoDetectFormat( inFile ) );
             OutputFileWrapper output =
-                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), DoxiaFormat.XHTML );
+                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), DoxiaFormat.XHTML5 );
 
             converter.setFormatOutput( formatOutput );
             converter.convert( input, output );
@@ -558,7 +383,7 @@ public class ConverterTest
             InputFileWrapper input =
                 InputFileWrapper.valueOf( inFile.getAbsolutePath(), DoxiaFormat.autoDetectFormat( inFile ) );
             OutputFileWrapper output =
-                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), DoxiaFormat.XHTML );
+                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), DoxiaFormat.XHTML5 );
 
             converter.setFormatOutput( formatOutput );
             converter.convert( input, output );
@@ -649,10 +474,7 @@ public class ConverterTest
             assertTrue( true );
         }
 
-        assertEquals( autoDetectFormat( "confluence/test.confluence" ), DoxiaFormat.CONFLUENCE );
-        assertEquals( autoDetectFormat( "docbook/test.xml" ), DoxiaFormat.DOCBOOK );
         assertEquals( autoDetectFormat( "fml/test.fml" ), DoxiaFormat.FML );
-        assertEquals( autoDetectFormat( "twiki/test.twiki" ), DoxiaFormat.TWIKI );
-        assertEquals( autoDetectFormat( "xhtml/test.xhtml" ), DoxiaFormat.XHTML );
+        assertEquals( autoDetectFormat( "xhtml/test.xhtml" ), DoxiaFormat.XHTML5 );
     }
 }