Class WsTool


  • public abstract class WsTool
    extends junit.framework.Assert
    Interface to the wsimport or wsgen command-line tool.
    Author:
    Kohsuke Kawaguchi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static WsTool NOOP
      WsTool that does nothing.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected WsTool​(boolean dumpParameters)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static WsTool createWsGen​(File externalWsGen, boolean dumpParameters, String extraWsToolsArgs)
      Determines which wsgen to use.
      static WsTool createWsImport​(File externalWsImport, boolean dumpParameters, String extraWsToolsArgs)
      Determines which compiler to use.
      protected boolean dumpParams()  
      protected void dumpWsParams​(List<String> params)  
      abstract void invoke​(String... args)
      Invokes wsimport with the given arguments.
      boolean isNoop()
      Returns true if the '-skip' mode is on and the tool invocation is skipped.
      • Methods inherited from class junit.framework.Assert

        assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
    • Field Detail

      • NOOP

        public static WsTool NOOP
        WsTool that does nothing.

        This assumes that files that are supposed to be generated are already generated.

    • Constructor Detail

      • WsTool

        protected WsTool​(boolean dumpParameters)
    • Method Detail

      • invoke

        public abstract void invoke​(String... args)
                             throws Exception
        Invokes wsimport with the given arguments.
        Throws:
        Exception - if the compilation fails. alternatively, JUnit Assertions can be used to detect error conditions.
      • isNoop

        public boolean isNoop()
        Returns true if the '-skip' mode is on and the tool invocation is skipped.
      • createWsImport

        public static WsTool createWsImport​(File externalWsImport,
                                            boolean dumpParameters,
                                            String extraWsToolsArgs)
        Determines which compiler to use.
        Parameters:
        externalWsImport - null to run WsTool from World.tool. Otherwise this file will be the path to the script.
        extraWsToolsArgs -
      • createWsGen

        public static WsTool createWsGen​(File externalWsGen,
                                         boolean dumpParameters,
                                         String extraWsToolsArgs)
        Determines which wsgen to use.
        Parameters:
        externalWsGen - null to run WsTool from World.tool. Otherwise this file will be the path to the script.
        extraWsToolsArgs -
      • dumpWsParams

        protected void dumpWsParams​(List<String> params)
      • dumpParams

        protected boolean dumpParams()