Examples of Checker


Examples of ca.grimoire.jnoise.modules.basic.Checker

    if (!blackSet)
      throw new BuilderException ("No black value for checker module.");
    if (!whiteSet)
      throw new BuilderException ("No white value for checker module.");

    return new Checker (black, white);
  }
View Full Code Here

Examples of com.adobe.epubcheck.tool.Checker

  @Test
  public void static_class_Test()
  {
    //This will create an instance of classes that have nothing but static methods for the sake of code coverage.
    Checker checker = new Checker();
    Assert.assertTrue("Checker string isn't as expected", checker.toString().startsWith("com.adobe.epubcheck.tool.Checker"));

    HandlerUtil handlerUtil = new HandlerUtil();
    Assert.assertTrue("HandlerUtil string isn't as expected", handlerUtil.toString().startsWith("com.adobe.epubcheck.util.HandlerUtil"));

    PathUtil pathUtil = new PathUtil();
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.creation.area.SensorArea.Checker

      cirFixDA.shape=cirShapeA;
      cirFixDB.shape=cirShapeB;
     
     
      Fixture[] fixtures=new Fixture[]{body.createFixture(recFixD),body.createFixture(cirFixDA),body.createFixture(cirFixDB)};
      checker=new Checker(fixtures);
     
    }
  }
View Full Code Here

Examples of com.pogofish.jadt.checker.Checker

        final ClassBodyEmitter classBodyEmitter = new StandardClassBodyEmitter();
        final ConstructorEmitter constructorEmitter = new StandardConstructorEmitter(classBodyEmitter);
        final DataTypeEmitter dataTypeEmitter = new StandardDataTypeEmitter(classBodyEmitter, constructorEmitter);
        final DocEmitter docEmitter = new StandardDocEmitter(dataTypeEmitter);     
        final Parser parser = new StandardParser(new JavaCCParserImplFactory());
        final Checker checker = new StandardChecker();
        final SinkFactoryFactory factoryFactory = new FileSinkFactoryFactory();
       
        return new JADT(sourceFactory, parser, checker, docEmitter, factoryFactory);
    }
View Full Code Here

Examples of com.pogofish.jadt.checker.Checker

        final SourceFactory sourceFactory = new StringSourceFactory(TEST_STRING);
        final Doc doc = new Doc(TEST_SRC_INFO, Pkg._Pkg(NO_COMMENTS, "pkg"), Util.<Imprt> list(), Util.<DataType> list());
        final ParseResult parseResult = new ParseResult(doc, syntaxErrors);
        final DocEmitter docEmitter = new DummyDocEmitter(doc,  TEST_CLASS_NAME);
        final Parser parser = new DummyParser(parseResult, testSrcInfo, TEST_STRING);
        final Checker checker = new DummyChecker(semanticErrors);
        final JADT jadt = new JADT(sourceFactory, parser, checker, docEmitter, factory);
        return jadt;
    }   
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

        }

        final String suppressionsFilePath = getSuppressionsFilePath( request );
        FilterSet filterSet = getSuppressionsFilterSet( suppressionsFilePath );

        Checker checker = new Checker();

        // setup classloader, needed to avoid "Unable to get class information
        // for ..." errors
        List<String> classPathStrings = new ArrayList<String>();
        List<String> outputDirectories = new ArrayList<String>();
        File sourceDirectory = request.getSourceDirectory();
        File testSourceDirectory = request.getTestSourceDirectory();
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                prepareCheckstylePaths( request, childProject, classPathStrings, outputDirectories,
                                        new File( childProject.getBuild().getSourceDirectory() ),
                                        new File( childProject.getBuild().getTestSourceDirectory() ) );
            }
        }
        else
        {
            prepareCheckstylePaths( request, project, classPathStrings, outputDirectories, sourceDirectory,
                                    testSourceDirectory );
        }

        List<URL> urls = new ArrayList<URL>( classPathStrings.size() );

        for ( String path : classPathStrings )
        {
            try
            {
                urls.add( new File( path ).toURL() );
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        for ( String outputDirectoryString : outputDirectories )
        {
            try
            {
                if ( outputDirectoryString != null )
                {
                    File outputDirectoryFile = new File( outputDirectoryString );
                    if ( outputDirectoryFile.exists() )
                    {
                        URL outputDirectoryUrl = outputDirectoryFile.toURL();
                        request.getLog().debug(
                                                "Adding the outputDirectory " + outputDirectoryUrl.toString()
                                                    + " to the Checkstyle class path" );
                        urls.add( outputDirectoryUrl );
                    }
                }
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        URLClassLoader projectClassLoader = new URLClassLoader( urls.toArray( new URL[urls.size()] ), null );
        checker.setClassloader( projectClassLoader );

        checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );

        if ( filterSet != null )
        {
            checker.addFilter( filterSet );
        }
        Configuration configuration = getConfiguration( request );
        checker.configure( configuration );

        AuditListener listener = request.getListener();

        if ( listener != null )
        {
            checker.addListener( listener );
        }

        if ( request.isConsoleOutput() )
        {
            checker.addListener( request.getConsoleListener() );
        }

        CheckstyleReportListener sinkListener = new CheckstyleReportListener( configuration );
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                addSourceDirectory( sinkListener, new File( childProject.getBuild().getSourceDirectory() ),
                                    new File( childProject.getBuild().getTestSourceDirectory() ),
                                    childProject.getResources(), request );
            }
        }
        else
        {
            addSourceDirectory( sinkListener, sourceDirectory, testSourceDirectory, request.getResources(), request );
        }

        checker.addListener( sinkListener );

        List<File> filesList = Arrays.asList( files );
        int nbErrors = checker.process( filesList );

        checker.destroy();

        if ( projectClassLoader instanceof Closeable )
        {
            try
            {
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

            throw new CheckstyleExecutorException( "Error getting files to process", e );
        }

        FilterSet filterSet = getSuppressions( request );

        Checker checker = new Checker();

        // setup classloader, needed to avoid "Unable to get class information
        // for ..." errors
        List<String> classPathStrings = new ArrayList<String>();
        List<String> outputDirectories = new ArrayList<String>();
        File sourceDirectory = request.getSourceDirectory();
        File testSourceDirectory = request.getTestSourceDirectory();
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                prepareCheckstylePaths( request, childProject, classPathStrings, outputDirectories,
                                        new File( childProject.getBuild().getSourceDirectory() ),
                                        new File( childProject.getBuild().getTestSourceDirectory() ) );
            }
        }
        else
        {
            prepareCheckstylePaths( request, project, classPathStrings, outputDirectories, sourceDirectory,
                                    testSourceDirectory );
        }

        List<URL> urls = new ArrayList<URL>( classPathStrings.size() );

        for ( String path : classPathStrings )
        {
            try
            {
                urls.add( new File( path ).toURL() );
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        for ( String outputDirectoryString : outputDirectories )
        {
            try
            {
                if ( outputDirectoryString != null )
                {
                    File outputDirectoryFile = new File( outputDirectoryString );
                    if ( outputDirectoryFile.exists() )
                    {
                        URL outputDirectoryUrl = outputDirectoryFile.toURL();
                        request.getLog().debug(
                                                "Adding the outputDirectory " + outputDirectoryUrl.toString()
                                                    + " to the Checkstyle class path" );
                        urls.add( outputDirectoryUrl );
                    }
                }
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        URLClassLoader projectClassLoader = new URLClassLoader(urls.toArray( new URL[urls.size()] ), null );
        checker.setClassloader( projectClassLoader );

        checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );

        if ( filterSet != null )
        {
            checker.addFilter( filterSet );
        }
        Configuration configuration = getConfiguration( request );
        checker.configure( configuration );

        AuditListener listener = request.getListener();

        if ( listener != null )
        {
            checker.addListener( listener );
        }

        if ( request.isConsoleOutput() )
        {
            checker.addListener( request.getConsoleListener() );
        }

        CheckstyleReportListener sinkListener = new CheckstyleReportListener( configuration );
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                addSourceDirectory( sinkListener, new File( childProject.getBuild().getSourceDirectory() ),
                                    new File( childProject.getBuild().getTestSourceDirectory() ),
                                    childProject.getResources(), request );
            }
        }
        else
        {
            addSourceDirectory( sinkListener, sourceDirectory, testSourceDirectory, request.getResources(), request );
        }

        checker.addListener( sinkListener );

        List<File> filesList = Arrays.asList( files );
        int nbErrors = checker.process( filesList );

        checker.destroy();

        if ( request.getStringOutputStream() != null )
        {
            request.getLog().info( request.getStringOutputStream().toString() );
        }
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

    document.setDocType(new DefaultDocumentType("module", "-//Puppy Crawl//DTD Check Configuration 1.2//EN", "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"));
    //logger.debug("Configuring checkstyle: " + document.asXML());
    com.puppycrawl.tools.checkstyle.api.Configuration csc = ConfigurationLoader.loadConfiguration(
        new ByteArrayInputStream(document.asXML().getBytes()),
        new PropertiesExpander(new Properties()), true);
    checker = new Checker();
    // must be done before calling configure method on checker, otherwise locale setting will not be used
    checker.setLocaleCountry("en");
    checker.setLocaleLanguage("en");
    checker.setModuleClassLoader(CheckstyleAgent.class.getClassLoader());
    checker.addListener(this);
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

            throw new CheckstyleExecutorException( "Error getting files to process", e );
        }

        FilterSet filterSet = getSuppressions( request );

        Checker checker = new Checker();

        // setup classloader, needed to avoid "Unable to get class information
        // for ..." errors
        List<String> classPathStrings = new ArrayList<String>();
        List<String> outputDirectories = new ArrayList<String>();
        File sourceDirectory = request.getSourceDirectory();
        File testSourceDirectory = request.getTestSourceDirectory();
        prepareCheckstylePaths( request, project, classPathStrings, outputDirectories, sourceDirectory,
                                testSourceDirectory );
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                prepareCheckstylePaths( request, childProject, classPathStrings, outputDirectories,
                                        new File( childProject.getBuild().getSourceDirectory() ),
                                        new File( childProject.getBuild().getTestSourceDirectory() ) );
            }
        }

        List<URL> urls = new ArrayList<URL>( classPathStrings.size() );

        for ( String path : classPathStrings )
        {
            try
            {
                urls.add( new File( path ).toURL() );
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        for ( String outputDirectoryString : outputDirectories )
        {
            try
            {
                if ( outputDirectoryString != null )
                {
                    File outputDirectoryFile = new File( outputDirectoryString );
                    if ( outputDirectoryFile.exists() )
                    {
                        URL outputDirectoryUrl = outputDirectoryFile.toURL();
                        request.getLog().debug(
                                                "Adding the outputDirectory " + outputDirectoryUrl.toString()
                                                    + " to the Checkstyle class path" );
                        urls.add( outputDirectoryUrl );
                    }
                }
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        URLClassLoader projectClassLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), null );
        checker.setClassloader( projectClassLoader );

        checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );

        if ( filterSet != null )
        {
            checker.addFilter( filterSet );
        }
        Configuration configuration = getConfiguration( request );
        checker.configure( configuration );

        AuditListener listener = request.getListener();

        if ( listener != null )
        {
            checker.addListener( listener );
        }

        if ( request.isConsoleOutput() )
        {
            checker.addListener( request.getConsoleListener() );
        }

        CheckstyleReportListener sinkListener = new CheckstyleReportListener( configuration );
        addSourceDirectory( sinkListener, sourceDirectory, testSourceDirectory, request );
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                addSourceDirectory( sinkListener, new File( childProject.getBuild().getSourceDirectory() ),
                                    new File( childProject.getBuild().getSourceDirectory() ), request );
            }
        }

        checker.addListener( sinkListener );

        List<File> filesList = Arrays.asList( files );
        int nbErrors = checker.process( filesList );

        checker.destroy();

        if ( request.getStringOutputStream() != null )
        {
            request.getLog().info( request.getStringOutputStream().toString() );
        }
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

            throw new CheckstyleExecutorException( "Error getting files to process", e );
        }

        FilterSet filterSet = getSuppressions( request );

        Checker checker = new Checker();

        // setup classloader, needed to avoid "Unable to get class information
        // for ..." errors
        List<String> classPathStrings = new ArrayList<String>();
        List<String> outputDirectories = new ArrayList<String>();
        File sourceDirectory = request.getSourceDirectory();
        File testSourceDirectory = request.getTestSourceDirectory();
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                prepareCheckstylePaths( request, childProject, classPathStrings, outputDirectories,
                                        new File( childProject.getBuild().getSourceDirectory() ),
                                        new File( childProject.getBuild().getTestSourceDirectory() ) );
            }
        }
        else
        {
            prepareCheckstylePaths( request, project, classPathStrings, outputDirectories, sourceDirectory,
                                    testSourceDirectory );
        }

        List<URL> urls = new ArrayList<URL>( classPathStrings.size() );

        for ( String path : classPathStrings )
        {
            try
            {
                urls.add( new File( path ).toURL() );
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        for ( String outputDirectoryString : outputDirectories )
        {
            try
            {
                if ( outputDirectoryString != null )
                {
                    File outputDirectoryFile = new File( outputDirectoryString );
                    if ( outputDirectoryFile.exists() )
                    {
                        URL outputDirectoryUrl = outputDirectoryFile.toURL();
                        request.getLog().debug(
                                                "Adding the outputDirectory " + outputDirectoryUrl.toString()
                                                    + " to the Checkstyle class path" );
                        urls.add( outputDirectoryUrl );
                    }
                }
            }
            catch ( MalformedURLException e )
            {
                throw new CheckstyleExecutorException( e.getMessage(), e );
            }
        }

        URLClassLoader projectClassLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), null );
        checker.setClassloader( projectClassLoader );

        checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );

        if ( filterSet != null )
        {
            checker.addFilter( filterSet );
        }
        Configuration configuration = getConfiguration( request );
        checker.configure( configuration );

        AuditListener listener = request.getListener();

        if ( listener != null )
        {
            checker.addListener( listener );
        }

        if ( request.isConsoleOutput() )
        {
            checker.addListener( request.getConsoleListener() );
        }

        CheckstyleReportListener sinkListener = new CheckstyleReportListener( configuration );
        if ( request.isAggregate() )
        {
            for ( MavenProject childProject : request.getReactorProjects() )
            {
                addSourceDirectory( sinkListener, new File( childProject.getBuild().getSourceDirectory() ),
                                    new File( childProject.getBuild().getTestSourceDirectory() ),
                                    childProject.getResources(), request );
            }
        }
        else
        {
            addSourceDirectory( sinkListener, sourceDirectory, testSourceDirectory, request.getResources(), request );
        }

        checker.addListener( sinkListener );

        List<File> filesList = Arrays.asList( files );
        int nbErrors = checker.process( filesList );

        checker.destroy();

        if ( request.getStringOutputStream() != null )
        {
            request.getLog().info( request.getStringOutputStream().toString() );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.