Mojo's Axis Tools Maven Plugin
  1. Mojo's Axis Tools Maven Plugin
  2. MAXISTOOLS-19

Problem with package name of generated test cases

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: wsdl2java
    • Labels:
      None
    • Environment:
      axistools-maven-plugin : 1-1-SNAPSHOT
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      <testCases>true</testCases>
      <runTestCasesAsUnitTests>true</runTestCasesAsUnitTests>
      

      The generated test-cases are not generated in the correct dir : the dir doesn't match the package of the class files. It seems package space is partially used

        Activity

        Hide
        Dominique Jean-Prost added a comment -

        Please find patch here. You can find below the new method that handles correctly the destination dir of generated test cases, so that mvn eclipse:eclipse will work correctly

        private void migrateTestSource()
        throws AxisPluginException
        {

        String path = StringUtils.replace(packageSpace, '.', File.separatorChar);
        File testSourceDirectoryIncludingPackageName = new File(testSourceDirectory, path);

        if ( !testSourceDirectoryIncludingPackageName.exists() )

        { testSourceDirectoryIncludingPackageName.mkdirs(); }

        Set testSources = locateTestSources();

        for ( Iterator iter = testSources.iterator(); iter.hasNext(); )
        {
        File source = (File) iter.next();

        try

        { FileUtils.copyFileToDirectory( source, testSourceDirectoryIncludingPackageName ); FileUtils.fileDelete( source.getAbsolutePath() ); }

        catch ( IOException ioe )

        { throw new AxisPluginException( "error copying test sources", ioe ); }

        }

        project.addTestCompileSourceRoot( testSourceDirectory.getPath() );
        }

        Show
        Dominique Jean-Prost added a comment - Please find patch here. You can find below the new method that handles correctly the destination dir of generated test cases, so that mvn eclipse:eclipse will work correctly private void migrateTestSource() throws AxisPluginException { String path = StringUtils.replace(packageSpace, '.', File.separatorChar); File testSourceDirectoryIncludingPackageName = new File(testSourceDirectory, path); if ( !testSourceDirectoryIncludingPackageName.exists() ) { testSourceDirectoryIncludingPackageName.mkdirs(); } Set testSources = locateTestSources(); for ( Iterator iter = testSources.iterator(); iter.hasNext(); ) { File source = (File) iter.next(); try { FileUtils.copyFileToDirectory( source, testSourceDirectoryIncludingPackageName ); FileUtils.fileDelete( source.getAbsolutePath() ); } catch ( IOException ioe ) { throw new AxisPluginException( "error copying test sources", ioe ); } } project.addTestCompileSourceRoot( testSourceDirectory.getPath() ); }
        Dennis Lundberg made changes -
        Field Original Value New Value
        Key MOJO-715 MAXISTOOLS-19
        Component/s axistools [ 12076 ]
        Project Mojo [ 11062 ] Maven 2.x Axis Tools Plugin [ 11697 ]
        Carlos Sanchez made changes -
        Patch Submitted [Yes]
        Hide
        David Pilato added a comment -

        Thanks Dominique for the Patch.
        I attached here the Patched JAR if it could be useful for someone.

        Show
        David Pilato added a comment - Thanks Dominique for the Patch. I attached here the Patched JAR if it could be useful for someone.
        David Pilato made changes -
        Hide
        David Pilato added a comment -

        Here is also the Patch File

        Show
        David Pilato added a comment - Here is also the Patch File
        David Pilato made changes -
        Attachment axis-19-patch.txt [ 48235 ]
        Dennis Lundberg made changes -
        Description <testCases>true</testCases>
        <runTestCasesAsUnitTests>true</runTestCasesAsUnitTests>

        The generated test-cases are not generated in the correct dir : the dir doesn't match the package of the class files. It seems package space is partially used
        {code:xml}
        <testCases>true</testCases>
        <runTestCasesAsUnitTests>true</runTestCasesAsUnitTests>
        {code}

        The generated test-cases are not generated in the correct dir : the dir doesn't match the package of the class files. It seems package space is partially used
        Component/s wsdl2java [ 14500 ]
        Hide
        Dennis Lundberg added a comment -

        The problem is that the plugin doesn't take into account the package directory of test source files when they are copied. So your patch will not work for test source files that belong to a package.

        Show
        Dennis Lundberg added a comment - The problem is that the plugin doesn't take into account the package directory of test source files when they are copied. So your patch will not work for test source files that belong to a package.
        Hide
        Dennis Lundberg added a comment -

        Fixed in r12405.
        I will deploy a 1.4-SNAPSHOT within 24 hours. Please test that the new version solves the problem for you.

        Show
        Dennis Lundberg added a comment - Fixed in r12405. I will deploy a 1.4-SNAPSHOT within 24 hours. Please test that the new version solves the problem for you.
        Dennis Lundberg made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Dennis Lundberg [ dennislundberg ]
        Fix Version/s 1.4 [ 14915 ]
        Resolution Fixed [ 1 ]
        Hide
        Dennis Lundberg added a comment -

        The 1.4-SNAPSHOT has now been deployed.

        Show
        Dennis Lundberg added a comment - The 1.4-SNAPSHOT has now been deployed.

          People

          • Assignee:
            Dennis Lundberg
            Reporter:
            Dominique Jean-Prost
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: