Skip to content
Spring + JAWR + Ext3 Java Web Sample Project
JavaScript Java HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Karma Jawr Sample

Build Status Coverage Status

The focus point is: Providing a way to show: how to write graceful javascript unittest in server render template engine.


  • Spring Framework
  • Spring MVC
  • JAWR
  • JAWR Locale Message Generator
  • Ext3


  • Karma + Mocha + Chai
  • Sinon
  • Integration with CI System


  • How to load necessary JS files into runtime easily? Because Java side uses JAWR as assets bundling tool to compact multiple JS files into one. Then Front-end uses <script> tags to include those bundles. This make it difficult to get the correct dependencies JS files.
  • How to mock the Locale Message Generator in global? Currently the JAWR Locale Message Generator is assigned as a property of the global object(We use it like locale.namesapce.field.a()). We need to construct this object when running test cases otherwise a lot of code will throw exception.
  • No best practice for Ext3 can be found from Internet

Plan: outline


Install Dependencies

mvn install && npm install

Build War & Deploy

You can deploy you war file in target/karma-jawr.war to your webapp container.(Tomcat, JBoss, Weblogic...)

Install Frontend UnitTest Dependencies

npm install

For China User, since puppeteer v0.13.0 support CHROMIUM binary download mirror.

Please export environment variables PUPPETEER_DOWNLOAD_HOST= before npm install

For Windows Run


Since 2018-03-13 network issue, found another mirror on So you can also use this

For Unix Run


Frontend UnitTest

npm test
You can’t perform that action at this time.