From e9cc3d80757ffc20a8f4e0ba67804622bb262d62 Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Wed, 12 Oct 2022 12:30:01 -0400 Subject: [PATCH] Revert "Temp Doclet WIP." This reverts commit a19c5626f163e5e54f491d1a57f7ec986ab9df9f. --- .../walkers/haplotypecaller/graphs/Path.java | 3 +- .../tools/walkers/vqsr/CNNScoreVariants.java | 2 +- .../tools/walkers/vqsr/CNNVariantTrain.java | 2 +- .../walkers/vqsr/CNNVariantWriteTensors.java | 2 +- .../utils/help/GATKDocWorkUnit.java | 84 ++++--- .../utils/help/GATKGSONWorkUnit.java | 34 +-- .../help/GATKHelpDocWorkUnitHandler.java | 122 +++++------ .../hellbender/utils/help/GATKHelpDoclet.java | 206 +++++++++--------- ...ocumentationGenerationIntegrationTest.java | 145 ++++++------ 9 files changed, 294 insertions(+), 306 deletions(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/Path.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/Path.java index 52040450438..90f80c04dcb 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/Path.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/Path.java @@ -2,6 +2,7 @@ import com.google.common.annotations.VisibleForTesting; import htsjdk.samtools.Cigar; +import joptsimple.internal.Strings; import org.apache.commons.lang3.ArrayUtils; import org.broadinstitute.gatk.nativebindings.smithwaterman.SWOverhangStrategy; import org.broadinstitute.gatk.nativebindings.smithwaterman.SWParameters; @@ -152,7 +153,7 @@ public boolean containsVertex(final V v) { @Override public String toString() { - final String joinedPath = getVertices().stream().map(BaseVertex::getSequenceString).collect(Collectors.joining("->")); + final String joinedPath = Strings.join(getVertices().stream().map(BaseVertex::getSequenceString).collect(Collectors.toList()), "->"); return String.format("Path{path=%s}", joinedPath); } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNScoreVariants.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNScoreVariants.java index f7cf8c9fca9..c9741cc38dc 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNScoreVariants.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNScoreVariants.java @@ -207,7 +207,7 @@ public class CNNScoreVariants extends TwoPassVariantWalker { // Create the Python executor. This doesn't actually start the Python process, but verifies that // the requestedPython executable exists and can be located. - StreamingPythonScriptExecutor pythonExecutor; //= new StreamingPythonScriptExecutor<>(true); + final StreamingPythonScriptExecutor pythonExecutor = new StreamingPythonScriptExecutor<>(true); private List batchList = new ArrayList<>(inferenceBatchSize); diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantTrain.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantTrain.java index 00151091447..169bbe72096 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantTrain.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantTrain.java @@ -130,7 +130,7 @@ public class CNNVariantTrain extends CommandLineProgram { private String annotationSet = "best_practices"; // Start the Python executor. This does not actually start the Python process, but fails if python can't be located - PythonScriptExecutor pythonExecutor; // = new PythonScriptExecutor(true); + final PythonScriptExecutor pythonExecutor = new PythonScriptExecutor(true); @Override diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantWriteTensors.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantWriteTensors.java index 0e7e3ab6954..58618b831f5 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantWriteTensors.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/CNNVariantWriteTensors.java @@ -118,7 +118,7 @@ public class CNNVariantWriteTensors extends CommandLineProgram { private int maxTensors = 1000000; // Start the Python executor. This does not actually start the Python process, but fails if python can't be located - PythonScriptExecutor pythonExecutor;// = new PythonScriptExecutor(true); + final PythonScriptExecutor pythonExecutor = new PythonScriptExecutor(true); @Override protected void onStartup() { diff --git a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKDocWorkUnit.java b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKDocWorkUnit.java index 273e132596e..b94df3c80b8 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKDocWorkUnit.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKDocWorkUnit.java @@ -1,43 +1,41 @@ -package org.broadinstitute.hellbender.utils.help; - -import org.broadinstitute.barclay.help.DocWorkUnit; -import org.broadinstitute.barclay.help.DocWorkUnitHandler; -import org.broadinstitute.barclay.help.DocumentedFeature; - -import org.broadinstitute.hellbender.utils.runtime.RuntimeUtils; - -import javax.lang.model.element.Element; - -/** - * Custom DocWorkUnit used for generating GATK help/documentation. Overrides the defaults to provide tool - * names that are annotated with a " (Picard)" suffix for Picard tools. - * - * NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called - * by methods that are used by the GATK runtime. This class has a dependency on com.sun.javadoc classes, - * which may not be present since they're not provided as part of the normal GATK runtime classpath. - */ -@SuppressWarnings("removal") -public class GATKDocWorkUnit extends DocWorkUnit { - - public GATKDocWorkUnit( - final DocWorkUnitHandler workUnitHandler, - final Element classElement, - final Class clazz, - final DocumentedFeature documentedFeatureAnnotation) { - super(workUnitHandler, classElement, clazz, documentedFeatureAnnotation); - } - - @Override - public String getName() { - // Override getName to return a display name that annotates Picard tool names with " (Picard)" - return RuntimeUtils.toolDisplayName(getClazz()); - } - - /** - * Sort in order of the name of this WorkUnit - */ - @Override - public int compareTo(DocWorkUnit other) { - return this.getName().compareTo(other.getName()); - } -} +//package org.broadinstitute.hellbender.utils.help; +// +//import org.broadinstitute.barclay.help.DocWorkUnit; +//import org.broadinstitute.barclay.help.DocWorkUnitHandler; +//import org.broadinstitute.barclay.help.DocumentedFeature; +// +//import org.broadinstitute.hellbender.utils.runtime.RuntimeUtils; +// +///** +// * Custom DocWorkUnit used for generating GATK help/documentation. Overrides the defaults to provide tool +// * names that are annotated with a " (Picard)" suffix for Picard tools. +// * +// * NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called +// * by methods that are used by the GATK runtime. This class has a dependency on com.sun.javadoc classes, +// * which may not be present since they're not provided as part of the normal GATK runtime classpath. +// */ +//@SuppressWarnings("removal") +//public class GATKDocWorkUnit extends DocWorkUnit { +// +// public GATKDocWorkUnit( +// final DocWorkUnitHandler workUnitHandler, +// final DocumentedFeature documentedFeatureAnnotation, +// final com.sun.javadoc.ClassDoc classDoc, +// final Class clazz) { +// super(workUnitHandler, documentedFeatureAnnotation, classDoc, clazz); +// } +// +// @Override +// public String getName() { +// // Override getName to return a display name that annotates Picard tool names with " (Picard)" +// return RuntimeUtils.toolDisplayName(getClazz()); +// } +// +// /** +// * Sort in order of the name of this WorkUnit +// */ +// @Override +// public int compareTo(DocWorkUnit other) { +// return this.getName().compareTo(other.getName()); +// } +//} diff --git a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKGSONWorkUnit.java b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKGSONWorkUnit.java index 72eeb27aeb6..0216ab9b707 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKGSONWorkUnit.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKGSONWorkUnit.java @@ -1,17 +1,17 @@ -package org.broadinstitute.hellbender.utils.help; - -import org.broadinstitute.barclay.help.GSONWorkUnit; - -/** - * Class representing a GSONWorkUnit for GATK work units. - * - * Adds "walkertype" to the base gson object created by Barclay. - */ -public class GATKGSONWorkUnit extends GSONWorkUnit { - - private String walkerType; - - public void setWalkerType(final String walkerType){ - this.walkerType = walkerType; - } -} +//package org.broadinstitute.hellbender.utils.help; +// +//import org.broadinstitute.barclay.help.GSONWorkUnit; +// +///** +// * Class representing a GSONWorkUnit for GATK work units. +// * +// * Adds "walkertype" to the base gson object created by Barclay. +// */ +//public class GATKGSONWorkUnit extends GSONWorkUnit { +// +// private String walkerType; +// +// public void setWalkerType(final String walkerType){ +// this.walkerType = walkerType; +// } +//} diff --git a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDocWorkUnitHandler.java b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDocWorkUnitHandler.java index ab2cf1a9d06..b31bfcc640a 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDocWorkUnitHandler.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDocWorkUnitHandler.java @@ -1,61 +1,61 @@ -package org.broadinstitute.hellbender.utils.help; - -import org.broadinstitute.barclay.argparser.CommandLineProgramProperties; -import org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler; -import org.broadinstitute.barclay.help.DocWorkUnit; - -import org.broadinstitute.barclay.help.HelpDoclet; - -/** - * The GATK Documentation work unit handler class that is the companion to GATKHelpDoclet. - * - * NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called - * by methods that are used by the GATK runtime, as this class assumes a dependency on com.sun.javadoc classes - * which may not be present. - */ -public class GATKHelpDocWorkUnitHandler extends DefaultDocWorkUnitHandler { - - private final static String GATK_JAVADOC_TAG_PREFIX = "GATK"; // prefix for custom javadoc tags used by GATK - - private final static String GATK_FREEMARKER_TEMPLATE_NAME = "generic.template.html"; - - public GATKHelpDocWorkUnitHandler(final HelpDoclet doclet) { - super(doclet); - } - /** - * @return Prefix for custom GATK tags that should be lifted from the javadoc and stored in the - * FreeMarker map. These will be available in the template returned by {@link #getTemplateName}. - */ - @Override - protected String getTagFilterPrefix() { return GATK_JAVADOC_TAG_PREFIX; } - - /** - * @param workUnit the classdoc object being processed - * @return the name of a the freemarker template to be used for the class being documented. - * Must reside in the folder passed to the Barclay Doclet via the "-settings-dir" parameter to - * Javadoc. - */ - @Override - public String getTemplateName(final DocWorkUnit workUnit) { return GATK_FREEMARKER_TEMPLATE_NAME; } - - - /** - * Add any custom freemarker bindings discovered via custom javadoc tags. Subclasses can override this to - * provide additional custom bindings. - * - * @param currentWorkUnit the work unit for the feature being documented - */ - @Override - protected void addCustomBindings(final DocWorkUnit currentWorkUnit) { - super.addCustomBindings(currentWorkUnit); - - // Picard tools use the summary line for the long overview section, so extract that - // from Picard tools only, and put it in the freemarker map. - Class toolClass = currentWorkUnit.getClazz(); - if (picard.cmdline.CommandLineProgram.class.isAssignableFrom(toolClass)) { - final CommandLineProgramProperties clpProperties = currentWorkUnit.getCommandLineProperties(); - currentWorkUnit.setProperty("picardsummary", clpProperties.summary()); - } - } - -} +//package org.broadinstitute.hellbender.utils.help; +// +//import org.broadinstitute.barclay.argparser.CommandLineProgramProperties; +//import org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler; +//import org.broadinstitute.barclay.help.DocWorkUnit; +// +//import org.broadinstitute.barclay.help.HelpDoclet; +// +///** +// * The GATK Documentation work unit handler class that is the companion to GATKHelpDoclet. +// * +// * NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called +// * by methods that are used by the GATK runtime, as this class assumes a dependency on com.sun.javadoc classes +// * which may not be present. +// */ +//public class GATKHelpDocWorkUnitHandler extends DefaultDocWorkUnitHandler { +// +// private final static String GATK_JAVADOC_TAG_PREFIX = "GATK"; // prefix for custom javadoc tags used by GATK +// +// private final static String GATK_FREEMARKER_TEMPLATE_NAME = "generic.template.html"; +// +// public GATKHelpDocWorkUnitHandler(final HelpDoclet doclet) { +// super(doclet); +// } +// /** +// * @return Prefix for custom GATK tags that should be lifted from the javadoc and stored in the +// * FreeMarker map. These will be available in the template returned by {@link #getTemplateName}. +// */ +// @Override +// protected String getTagFilterPrefix() { return GATK_JAVADOC_TAG_PREFIX; } +// +// /** +// * @param workUnit the classdoc object being processed +// * @return the name of a the freemarker template to be used for the class being documented. +// * Must reside in the folder passed to the Barclay Doclet via the "-settings-dir" parameter to +// * Javadoc. +// */ +// @Override +// public String getTemplateName(final DocWorkUnit workUnit) { return GATK_FREEMARKER_TEMPLATE_NAME; } +// +// +// /** +// * Add any custom freemarker bindings discovered via custom javadoc tags. Subclasses can override this to +// * provide additional custom bindings. +// * +// * @param currentWorkUnit the work unit for the feature being documented +// */ +// @Override +// protected void addCustomBindings(final DocWorkUnit currentWorkUnit) { +// super.addCustomBindings(currentWorkUnit); +// +// // Picard tools use the summary line for the long overview section, so extract that +// // from Picard tools only, and put it in the freemarker map. +// Class toolClass = currentWorkUnit.getClazz(); +// if (picard.cmdline.CommandLineProgram.class.isAssignableFrom(toolClass)) { +// final CommandLineProgramProperties clpProperties = currentWorkUnit.getCommandLineProperties(); +// currentWorkUnit.setProperty("picardsummary", clpProperties.summary()); +// } +// } +// +//} diff --git a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDoclet.java b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDoclet.java index fe2860773bb..9175d6bd557 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDoclet.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/help/GATKHelpDoclet.java @@ -1,100 +1,106 @@ -package org.broadinstitute.hellbender.utils.help; - -import jdk.javadoc.doclet.DocletEnvironment; -import org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler; -import org.broadinstitute.barclay.help.DocumentedFeature; -import org.broadinstitute.barclay.help.DocWorkUnit; -import org.broadinstitute.barclay.help.GSONWorkUnit; -import org.broadinstitute.barclay.help.HelpDoclet; - -import javax.lang.model.element.Element; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Custom Barclay-based Javadoc Doclet used for generating GATK help/documentation. - * - * NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called - * by methods that are used by the GATK runtime. This class has a dependency on com.sun.javadoc classes, - * which may not be present since they're not provided as part of the normal GATK runtime classpath. - */ -@SuppressWarnings("removal") -public class GATKHelpDoclet extends HelpDoclet { - - private final static String GATK_FREEMARKER_INDEX_TEMPLATE_NAME = "generic.index.template.html"; - private final static String WALKER_TYPE_MAP_ENTRY = "walkertype"; // populated from javadoc custom tag - - /** - * Return the name of the freemarker template to be used for the index generated by Barclay. - * Must reside in the folder passed to the Barclay Javadc Doclet via the "-settings-dir" parameter. - * @return name of freemarker index template - */ - @Override - public String getIndexTemplateName() { - return GATK_FREEMARKER_INDEX_TEMPLATE_NAME; - } - - /** - * @return Create and return a DocWorkUnit-derived object to handle documentation - * for the target feature(s) represented by documentedFeature. - * - * @param classElement Element for the target feature - * @param clazz class of the target feature - * @param documentedFeature DocumentedFeature annotation for the target feature - * @return DocWorkUnit to be used for this feature - */ - @Override - public DocWorkUnit createWorkUnit( - final Element classElement, - final Class clazz, - final DocumentedFeature documentedFeature) - { - return new GATKDocWorkUnit( - new GATKHelpDocWorkUnitHandler(this), - classElement, - clazz, - documentedFeature); - } - - /** - * Create a GSONWorkUnit-derived object that holds our custom data. This method should create the object, and - * propagate any custom javadoc tags from the template map to the newly created GSON object; specifically - * "walkertype", which is pulled from a custom javadoc tag. - * - * @param workUnit work unit for which a GSON object is required - * @param groupMaps - * @param featureMaps - * @return a GSONWorkUnit-derived object for this work unit, populated with any custom values - */ - @Override - protected GSONWorkUnit createGSONWorkUnit( - final DocWorkUnit workUnit, - final List> groupMaps, - final List> featureMaps) - { - GATKGSONWorkUnit gatkGSONWorkUnit = new GATKGSONWorkUnit(); - gatkGSONWorkUnit.setWalkerType((String)workUnit.getRootMap().get(WALKER_TYPE_MAP_ENTRY)); - return gatkGSONWorkUnit; - } - - /** - * Adds a super-category so that we can custom-order the categories in the doc index - * - * @param docWorkUnit - * @return - */ - @Override - protected final Map getGroupMap(final DocWorkUnit docWorkUnit) { - final Map root = super.getGroupMap(docWorkUnit); - - /** - * Add-on super-category definitions. The super-category and spark value strings need to be the - * same as used in the Freemarker template. - */ - root.put("supercat", HelpConstants.getSuperCategoryProperty(docWorkUnit.getGroupName())); - - return root; - } - -} +//package org.broadinstitute.hellbender.utils.help; +// +//import org.broadinstitute.barclay.help.DocumentedFeature; +//import org.broadinstitute.barclay.help.DocWorkUnit; +//import org.broadinstitute.barclay.help.GSONWorkUnit; +//import org.broadinstitute.barclay.help.HelpDoclet; +// +//import java.io.IOException; +//import java.util.List; +//import java.util.Map; +// +///** +// * Custom Barclay-based Javadoc Doclet used for generating GATK help/documentation. +// * +// * NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called +// * by methods that are used by the GATK runtime. This class has a dependency on com.sun.javadoc classes, +// * which may not be present since they're not provided as part of the normal GATK runtime classpath. +// */ +//@SuppressWarnings("removal") +//public class GATKHelpDoclet extends HelpDoclet { +// +// private final static String GATK_FREEMARKER_INDEX_TEMPLATE_NAME = "generic.index.template.html"; +// private final static String WALKER_TYPE_MAP_ENTRY = "walkertype"; // populated from javadoc custom tag +// +// /** +// * Create a doclet of the appropriate type and generate the FreeMarker templates properties. +// * @param rootDoc +// * @throws IOException +// */ +// public static boolean start(final com.sun.javadoc.RootDoc rootDoc) throws IOException { +// return new GATKHelpDoclet().startProcessDocs(rootDoc); +// } +// +// /** +// * Return the name of the freemarker template to be used for the index generated by Barclay. +// * Must reside in the folder passed to the Barclay Javadc Doclet via the "-settings-dir" parameter. +// * @return name of freemarker index template +// */ +// @Override +// public String getIndexTemplateName() { +// return GATK_FREEMARKER_INDEX_TEMPLATE_NAME; +// } +// +// /** +// * @return Create and return a DocWorkUnit-derived object to handle documentation +// * for the target feature(s) represented by documentedFeature. +// * +// * @param documentedFeature DocumentedFeature annotation for the target feature +// * @param classDoc javadoc classDoc for the target feature +// * @param clazz class of the target feature +// * @return DocWorkUnit to be used for this feature +// */ +// @Override +// protected DocWorkUnit createWorkUnit( +// final DocumentedFeature documentedFeature, +// final com.sun.javadoc.ClassDoc classDoc, +// final Class clazz) +// { +// return new GATKDocWorkUnit( +// new GATKHelpDocWorkUnitHandler(this), +// documentedFeature, +// classDoc, +// clazz); +// } +// +// /** +// * Create a GSONWorkUnit-derived object that holds our custom data. This method should create the object, and +// * propagate any custom javadoc tags from the template map to the newly created GSON object; specifically +// * "walkertype", which is pulled from a custom javadoc tag. +// * +// * @param workUnit work unit for which a GSON object is required +// * @param groupMaps +// * @param featureMaps +// * @return a GSONWorkUnit-derived object for this work unit, populated with any custom values +// */ +// @Override +// protected GSONWorkUnit createGSONWorkUnit( +// final DocWorkUnit workUnit, +// final List> groupMaps, +// final List> featureMaps) +// { +// GATKGSONWorkUnit gatkGSONWorkUnit = new GATKGSONWorkUnit(); +// gatkGSONWorkUnit.setWalkerType((String)workUnit.getRootMap().get(WALKER_TYPE_MAP_ENTRY)); +// return gatkGSONWorkUnit; +// } +// +// /** +// * Adds a super-category so that we can custom-order the categories in the doc index +// * +// * @param docWorkUnit +// * @return +// */ +// @Override +// protected final Map getGroupMap(final DocWorkUnit docWorkUnit) { +// final Map root = super.getGroupMap(docWorkUnit); +// +// /** +// * Add-on super-category definitions. The super-category and spark value strings need to be the +// * same as used in the Freemarker template. +// */ +// root.put("supercat", HelpConstants.getSuperCategoryProperty(docWorkUnit.getGroupName())); +// +// return root; +// } +// +//} diff --git a/src/test/java/org/broadinstitute/hellbender/utils/help/DocumentationGenerationIntegrationTest.java b/src/test/java/org/broadinstitute/hellbender/utils/help/DocumentationGenerationIntegrationTest.java index 417cc9b3ec9..2b695b4bdc3 100644 --- a/src/test/java/org/broadinstitute/hellbender/utils/help/DocumentationGenerationIntegrationTest.java +++ b/src/test/java/org/broadinstitute/hellbender/utils/help/DocumentationGenerationIntegrationTest.java @@ -1,81 +1,64 @@ -package org.broadinstitute.hellbender.utils.help; - -import org.broadinstitute.hellbender.CommandLineProgramTest; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.ServiceLoader; -import java.util.spi.ToolProvider; - -/** - * Smoke test to run doc gen on a subset of classes to make sure it doesn't regress. - */ -public class DocumentationGenerationIntegrationTest extends CommandLineProgramTest { - /** - * Entry point for manually running the gatkDoc process on a subset of packages from within GATK. - */ - private static String[] docTestPackages = { - "org.broadinstitute.hellbender.cmdline.argumentcollections", - "org.broadinstitute.hellbender.cmdline.GATKPlugin", - "org.broadinstitute.hellbender.engine.filters", - "org.broadinstitute.hellbender.tools", - "org.broadinstitute.hellbender.tools.spark", - "org.broadinstitute.hellbender.tools.spark.pipelines", - "org.broadinstitute.hellbender.tools.spark.pipelines.metrics", - //"org.broadinstitute.hellbender.tools.spark.transforms.bqsr", - "org.broadinstitute.hellbender.tools.spark.transforms.markduplicates", - "org.broadinstitute.hellbender.tools.walkers.bqsr", - "org.broadinstitute.hellbender.tools.walkers.vqsr", - "org.broadinstitute.hellbender.tools.walkers.variantutils", - //"picard.fingerprint", - //"picard.analysis" - }; - - @Test - public static void documentationSmokeTest() { - final File docTestTarget = createTempDir("docgentest"); - final String[] argArray = new String[]{ - //"javadoc", - "-doclet", GATKHelpDoclet.class.getName(), - "-docletpath", System.getProperty("java.class.path"), - "-sourcepath", "src/main/java", - "-settings-dir", "src/main/resources/org/broadinstitute/hellbender/utils/helpTemplates", - "-d", docTestTarget.getAbsolutePath(), // directory must exist - "-output-file-extension", "html", - "-build-timestamp", "2016/11/11 11:11:11", - "-absolute-version", "1.1-111", - "-verbose" - }; - - final List docArgList = new ArrayList<>(); - docArgList.addAll(Arrays.asList(argArray)); - docArgList.add("-cp"); - docArgList.add(System.getProperty("java.class.path")); - docArgList.addAll(Arrays.asList(docTestPackages)); - - // Run javadoc in the current JVM with the custom doclet, and make sure it succeeds (this is a smoke test; - // we just want to make sure it doesn't blow up). - //Assert.assertEquals(com.sun.tools.javadoc.Main.execute(docArgList.toArray(new String[] {})), 0); - - ToolProvider jdProvider = null; - for (final ToolProvider tp : ServiceLoader.load(ToolProvider.class)) { - if (tp.name().equals("javadoc")) { - jdProvider = tp; - break; - } - } - if (jdProvider == null) { - throw new IllegalStateException("Can't find javadoc tool"); - } - - final String[] args = docArgList.toArray(new String[] {}); - - final int retCode = jdProvider.run(System.out, System.err, args); - Assert.assertEquals(retCode, 0); - - } -} +//package org.broadinstitute.hellbender.utils.help; +// +//import org.broadinstitute.hellbender.CommandLineProgramTest; +//import org.testng.Assert; +//import org.testng.annotations.Test; +// +//import java.io.File; +//import java.util.ArrayList; +//import java.util.Arrays; +//import java.util.List; +// +///** +// * Smoke test to run doc gen on a subset of classes to make sure it doesn't regress. +// */ +//public class DocumentationGenerationIntegrationTest extends CommandLineProgramTest { +// /** +// * Entry point for manually running the gatkDoc process on a subset of packages from within GATK. +// */ +// private static String[] docTestPackages = { +// "org.broadinstitute.hellbender.cmdline.argumentcollections", +// "org.broadinstitute.hellbender.cmdline.GATKPlugin", +// "org.broadinstitute.hellbender.engine.filters", +// "org.broadinstitute.hellbender.tools", +// "org.broadinstitute.hellbender.tools.spark", +// "org.broadinstitute.hellbender.tools.spark.pipelines", +// "org.broadinstitute.hellbender.tools.spark.pipelines.metrics", +// "org.broadinstitute.hellbender.tools.spark.transforms.bqsr", +// "org.broadinstitute.hellbender.tools.spark.transforms.markduplicates", +// "org.broadinstitute.hellbender.tools.walkers.bqsr", +// "org.broadinstitute.hellbender.tools.walkers.vqsr", +// "org.broadinstitute.hellbender.tools.walkers.variantutils", +// "picard.fingerprint", +// "picard.analysis" +// }; +// +// // suppress deprecation warning on Java 11 since we're using deprecated javadoc APIs +// @SuppressWarnings({"deprecation","removal"}) +// @Test +// public static void documentationSmokeTest() { +// final File docTestTarget = createTempDir("docgentest"); +// final String[] argArray = new String[]{ +// "javadoc", +// "-doclet", GATKHelpDoclet.class.getName(), +// "-docletpath", System.getProperty("java.class.path"), +// "-sourcepath", "src/main/java", +// "-settings-dir", "src/main/resources/org/broadinstitute/hellbender/utils/helpTemplates", +// "-d", docTestTarget.getAbsolutePath(), // directory must exist +// "-output-file-extension", "html", +// "-build-timestamp", "2016/11/11 11:11:11", +// "-absolute-version", "1.1-111", +// "-verbose" +// }; +// +// final List docArgList = new ArrayList<>(); +// docArgList.addAll(Arrays.asList(argArray)); +// docArgList.add("-cp"); +// docArgList.add(System.getProperty("java.class.path")); +// docArgList.addAll(Arrays.asList(docTestPackages)); +// +// // Run javadoc in the current JVM with the custom doclet, and make sure it succeeds (this is a smoke test; +// // we just want to make sure it doesn't blow up). +// Assert.assertEquals(com.sun.tools.javadoc.Main.execute(docArgList.toArray(new String[] {})), 0); +// } +//}