Package npanday.vendor

Examples of npanday.vendor.Vendor


    public void execute()
        throws MojoExecutionException
    {
        for ( WebReference webreference : webreferences )
        {
            Vendor vendor = getCompilerVendor();
            List<String> commands = getCommandsFor( vendor, webreference );

            getLog().debug( "NPANDAY-1300-000: Commands = " + commands.toString() );
            CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
            try
            {
                commandExecutor.executeCommand( getExecutableFor( vendor, netHome ), commands );
                getLog().info(
                               "NPANDAY-1300-008: Generated WSDL: File = "
                                   + project.getBuild().getSourceDirectory()
                                   + File.separator
                                   + project.getBuild().getSourceDirectory()
                                   + File.separator
                                   + webreference.getOutput()
                                   + File.separator
                                   + getFileNameFor( project.getBuild().getSourceDirectory() + File.separator
                                       + webreference.getPath() ) );

            }
            catch ( ExecutionException e )
            {
                // TODO: This is a hack to get around the fact that MONO returns a result=1 on warnings and MS returns a
                // result=1 on errors.
                // I don't want to fail on MONO warning here.
                if ( ( vendor.equals( Vendor.MONO ) && commandExecutor.getResult() > 1 )
                    || vendor.equals( Vendor.MICROSOFT ) )
                {
                    throw new MojoExecutionException( "NPANDAY-1300-001: Result = " + commandExecutor.getResult(), e );
                }
            }
        }
View Full Code Here


    }

    private Vendor getCompilerVendor()
        throws MojoExecutionException
    {
        Vendor vendor;
        PlatformDetector platformDetector = PlatformDetector.Factory.createDefaultPlatformDetector();
        if ( isEmpty( netHome ) )
        {
            try
            {
                vendor = platformDetector.getVendorFor( "wsdl", null );
            }
            catch ( PlatformUnsupportedException e )
            {
                throw new MojoExecutionException( "NPANDAY-1300-009", e );
            }
        }
        else
        {
            File file = new File( netHome );
            if ( !file.exists() )
            {
                throw new MojoExecutionException(
                                                  "NPANDAY-1300-006: Unable to locate netHome - make sure that it exists:"
                                                      + " Home = " + netHome );
            }
            try
            {
                vendor =
                    platformDetector.getVendorFor( null, new File( file.getAbsolutePath() + File.separator + "bin"
                        + File.separator + "wsdl" ) );
            }
            catch ( PlatformUnsupportedException e )
            {
                throw new MojoExecutionException( "NPANDAY-1300-010", e );
            }

        }
        getLog().info( "NPANDAY-1300-007: WSDL Vendor found: " + vendor.getVendorName() );
        return vendor;
    }
View Full Code Here

            // nunit-console-x86 is included since 2.4.2 (August 2007, http://www.nunit.org/index.php?p=releaseNotes&r=2.4.3)
            exe = "nunit-console" + (forceX86 ? "-x86" : "");

            if ( vendorInfo != null )
            {
                Vendor vendor = vendorInfo.getVendor();
                String frameworkVersion = vendorInfo.getFrameworkVersion();
                if ( "MONO".equals( vendor.getVendorName() ) )
                {
                    if ( frameworkVersion == null || !frameworkVersion.startsWith( "1.1" ) )
                    {
                        exe = "nunit-console2";
                    }
View Full Code Here

            + exe : exe;
    }

    private List<String> getCommandsFor( VendorInfo vendorInfo )   
    {
        Vendor vendor = vendorInfo.getVendor();
        String finalName = project.getBuild().getFinalName();
        List<String> commands = new ArrayList<String>();
        if ( testAssemblyPath.startsWith( "/" ) )// nunit-console thinks *nix file format /home/user/ is an option
                                                    // due to / and fails.
        {
            testAssemblyPath = "/" + testAssemblyPath;
        }



        if(integrationTest)
        {
            // use the artifact itself if its an integration
            commands.add( testAssemblyPath + File.separator + project.getArtifactId() + ".dll" );
        }
        else
        {
            // if not use the commpiled test
            commands.add( testAssemblyPath + File.separator + project.getArtifactId() + "-test.dll" );
        }

        String switchChar = "/";

        String vendorName = vendor.getVendorName();
        if ( vendor != null && "MONO".equals( vendorName ) )       
        {
            switchChar = "-";
        }
        commands.add( switchChar + "xml:" + nUnitXmlFilePath.getAbsolutePath() );
View Full Code Here

TOP

Related Classes of npanday.vendor.Vendor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.