Giter VIP home page Giter VIP logo

howenx / play-example-quality-assurance Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ics-software-engineering/play-example-quality-assurance

0.0 2.0 0.0 859 KB

Automated quality assurance tool integration (checkstyle, pmd, jacoco, findbugs, javadoc/scaladoc) for the Play Framework

Home Page: http://ics-software-engineering.github.io/play-example-quality-assurance

Java 21.30% HTML 5.41% Scala 73.28%

play-example-quality-assurance's Introduction

Overview

This system illustrates how to integrate the following quality assurance tools with Play applications:

The code is designed to allow you to add only those tools that you need for your project. Installation and running of each tool is discussed separately below.

PMD

Installation

Note that the current implementation of PMD conflicts with the current implementation of Jacoco. Only one or the other can be installed. See the Jacoco documentation below for more details.

Invocation

[~/projecthosting/github/play-example-quality-assurance]-> play pmd
[info] Loading project definition from /Users/johnson/projecthosting/github/play-example-quality-assurance/project
[info] Set current project to play-example-quality-assurance (in build file:/Users/johnson/projecthosting/github/play-example-quality-assurance/)
[info] Running PMD...
[info] <?xml version="1.0" encoding="UTF-8"?>
[info] <pmd version="5.0.0" timestamp="2014-01-10T13:05:53.566">
[info] </pmd>
[success] Total time: 1 s, completed Jan 10, 2014 1:05:53 PM

The output file is in target/pmd/pmd-report.xml and echoed to the console. For Play's default application, no PMD warnings are generated.

Checkstyle

Installation

Invocation

[~/projecthosting/github/play-example-quality-assurance]-> play checkstyle
[info] Loading project definition from /Users/johnson/projecthosting/github/play-example-quality-assurance/project
[info] Set current project to play-example-quality-assurance (in build file:/Users/johnson/projecthosting/github/play-example-quality-assurance/)
[info] Running checkstyle...
[info] <?xml version="1.0" encoding="UTF-8"?>
[info] <checkstyle version="5.5">
[info] <file name="/Users/johnson/projecthosting/github/play-example-quality-assurance/app/controllers/Application.java">
[info] <error line="0" severity="error" message="Missing package-info.java file." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck"/>
[info] <error line="3" severity="error" message="Using the &apos;.*&apos; form of import should be avoided - play.*." source="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
[info] <error line="4" severity="error" message="Using the &apos;.*&apos; form of import should be avoided - play.mvc.*." source="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
[info] <error line="6" severity="error" message="Using the &apos;.*&apos; form of import should be avoided - views.html.*." source="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
[info] <error line="8" severity="error" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"/>
[info] <error line="10" column="5" severity="error" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
[info] </file>
[info] <file name="/Users/johnson/projecthosting/github/play-example-quality-assurance/app/views/index.scala.html">
[info] </file>
[info] <file name="/Users/johnson/projecthosting/github/play-example-quality-assurance/app/views/main.scala.html">
[info] </file>
[info] </checkstyle>
[success] Total time: 1 s, completed Jan 10, 2014 1:08:06 PM

The output file is in target/checkstyle/checkstyle-report.xml and also echoed to the console. For Play's default application, 6 Checkstyle warnings are generated.

FindBugs

Installation

Invocation

[~/projecthosting/github/play-example-quality-assurance]-> play findbugs
[info] Loading project definition from /Users/johnson/projecthosting/github/play-example-quality-assurance/project
[info] Set current project to play-example-quality-assurance (in build file:/Users/johnson/projecthosting/github/play-example-quality-assurance/)
[success] Total time: 7 s, completed Jun 10, 2013 1:45:10 PM

The output file is in target/findbugs/findbugs.xml.
For Play's default application, no FindBug errors are generated, but the plugin will output the number of warnings found if non-zero.

Jacoco

Installation

Note: Due to ASM library incompatibilities (?), you cannot install both Jacoco and PMD. If you do, then Jacoco will report the following error:

[error] (jacoco:fullClasspath) java.lang.IncompatibleClassChangeError: class org.jacoco.core.internal.flow.ClassProbesVisitor has interface org.objectweb.asm.ClassVisitor as super class

Invocation

[~/projecthosting/github/play-example-quality-assurance]-> play jacoco:cover
[info] Loading project definition from /Users/johnson/projecthosting/github/play-example-quality-assurance/project
[info] Set current project to play-example-quality-assurance (in build file:/Users/johnson/projecthosting/github/play-example-quality-assurance/)
[info] ApplicationTest
[info] + ApplicationTest.simpleCheck
[info] + ApplicationTest.renderTemplate
[info] 
[info] 
[info] Total for test ApplicationTest
[info] Finished in 0.239 seconds
[info] 2 tests, 0 failures, 0 errors
[info] IntegrationTest
[info] + IntegrationTest.test
[info] 
[info] 
[info] Total for test IntegrationTest
[info] Finished in 2.875 seconds
[info] 1 tests, 0 failures, 0 errors
[info] Passed: : Total 3, Failed 0, Errors 0, Passed 3, Skipped 0
[success] Total time: 4 s, completed Jun 10, 2013 1:51:29 PM

The output report is available in target/jacoco/html/index.html.
For Play's default application, statement coverage is 57%.

JavaDoc and ScalaDoc

Installation

Invocation

[~/projecthosting/github/play-example-quality-assurance]-> play api-doc
[info] Loading project definition from /Users/johnson/projecthosting/github/play-example-quality-assurance/project
[info] Set current project to play-example-quality-assurance (in build file:/Users/johnson/projecthosting/github/play-example-quality-assurance/)
[info] No sources available, skipping Scala API documentation...
[info] Creating destination directory: "target/doc/api/java/"
[info] Loading source files for package controllers...
[info] Loading source files for package tests...
[info] Constructing Javadoc information...
[info] Standard Doclet version 1.7.0_10
[info] Building tree for all the packages and classes...
[info] Generating target/doc/api/java/controllers/Application.html...
[info] Generating target/doc/api/java/tests/ApplicationTest.html...
[info] Generating target/doc/api/java/tests/IntegrationTest.html...
[info] Generating target/doc/api/java/overview-frame.html...
[info] Generating target/doc/api/java/controllers/package-frame.html...
[info] Generating target/doc/api/java/controllers/package-summary.html...
[info] Generating target/doc/api/java/controllers/package-tree.html...
[info] Generating target/doc/api/java/tests/package-frame.html...
[info] Generating target/doc/api/java/tests/package-summary.html...
[info] Generating target/doc/api/java/tests/package-tree.html...
[info] Generating target/doc/api/java/constant-values.html...
[info] Generating target/doc/api/java/src-html/controllers/Application.html...
[info] Generating target/doc/api/java/src-html/tests/IntegrationTest.html...
[info] Generating target/doc/api/java/src-html/tests/ApplicationTest.html...
[info] Building index for all the packages and classes...
[info] Generating target/doc/api/java/overview-tree.html...
[info] Generating target/doc/api/java/index-all.html...
[info] Generating target/doc/api/java/deprecated-list.html...
[info] Building index for all classes...
[info] Generating target/doc/api/java/allclasses-frame.html...
[info] Generating target/doc/api/java/allclasses-noframe.html...
[info] Generating target/doc/api/java/index.html...
[info] Generating target/doc/api/java/overview-summary.html...
[info] Generating target/doc/api/java/help-doc.html...
API documentation in target/doc/api

[success] Total time: 2 s, completed Jun 10, 2013 1:55:36 PM

The API documentation can be found in target/doc/api.

NOTE: With this approach, in order for test code to be documented by JavaDoc, you must locate them a package called "tests" inside the top-level test/ directory. See this repo for an example. This is a change from the "play new" command, which puts the sample tests in the default package. Creating a "tests" package creates consistency with the existing Play convention of "controllers", "models", and "views" packages.

Credits

Play version

Last tested on Play 2.2.0

play-example-quality-assurance's People

Contributors

mslinn avatar philipmjohnson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.