Coder Social home page Coder Social logo

quizzo-angular-roo's Introduction

Quizzo - Angular

This is a project that is a demonstration of the Angular.js framework.

Getting up and running

The project uses Maven for builds, hypersonic sql (for this installation) for database access, and Spring Roo to configure and manage everything.

The Maven commands are:

  • package - configure the WAR file to run the application
  • jetty:run - execute the Jetty web server

About testing

I've configured several levels of tests:

  • Unit tests (java) - these can be tested by using mvn test
  • Unit tests (jasmine / Javascript) - these can be executed by the test runner script, from src/main/webapp: ./scripts/test.sh - this will run repeatedly until stopped. You need to install the testacular test framework.
  • Integration tests (java) - these can be run by a very specific command. All tests ending in 'IT' will be executed by booting the web application, and then running these tests against the container. The command is: mvn verify -Dspring.profiles.active=integration
  • Integration tests (angularjs) - these are also run with the same command as above, but adding a Maven profile to activate the e2e test runner - it is mvn verify -Dspring.profiles.active=integration -Pjsintegration

The Roo/Spring Side

I am busy integrating various features. For now, I just have the scaffolded Roo web app for testing the RESTful data objects. I plan on doing data resets in the future for the end-to-end testing with a different database.

For Roo, I'm using the following annotations on my entities:

    @RooJavaBean
    @RooToString
    @RooJpaActiveRecord
    @RooJson
    @RooPlural("Quizzes")
    public class Quiz {

        private String name;

        private String short_name;

        private String description;
    }

This allows me to properly control the name of the object when scaffolding both the utility (Roo) UI, and the Angular.js UI. The controller:

    @RequestMapping("/quizzes")
    @Controller
    @RooWebScaffold(path = "quizzes", formBackingObject = Quiz.class)
    @RooWebJson(jsonObject = com.chariot.quizzo.model.Quiz.class)
    @RooPlural("quizzes")
        public class QuizController {
    }

I am scaffolding both the traditional Roo web app and the Angular RESTful services.

The Angular.js side

I'm using as my basis the angular-seed project. I have worked the scripts into the maven build, although I'm not liking where they live at the moment and plan on moving them out of the web app.

I will be integrating Twitter Bootstrap too, and likely portions of AngularJS UI.

To hit the Angular app once the server is started, do this:

http://localhost:8080/quizzo/app/index.html

To run end-to-end tests, either execute mvn verify or run the script src/main/webapp/scripts/e2e-test.sh. Either approach will work, but the mvn verify will lauch the app server, run tests, then shut it down.

To run the Jasmine unit tests, run the script src/main/webrapp/scripts/test.sh - this is an interactive test runner. It does not need the Maven system nor the Roo web app - it has its own launcher.

quizzo-angular-roo's People

Contributors

krimple avatar

Watchers

 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.