Notes for developers working on schedule-appengine...
npm install -g karma
npm install -g karma-cli
On the command line you should be able to run
cd jas/schedule/schedule-appengine
gulp
Also on the command line, with gulp running*:
cd jas/schedule/schedule-appengine
karma start src/test/javascript/karma.conf.js
You can run most of the tasks from intelliJ
- Run -> Edit Configurations
- Click on the "+" sign
- Select Gulp.js
- Name: gulp (jasify), Tasks: empty, Gulp Package: <JAS_ROOT>/schedule/schedule-appengine/node_modules/gulp
- Plugins
- Browser repository
- Search for karma
- Install and restart
Now add a new run configuration
- Run -> Edit Configurations
- Click on the "+" sign
- Select Karma
- Name: karma (jasify), Configuration file: <JAS_ROOT>/schedule/schedule-appengine/src/test/javascript/karma.conf.js, Karma package: /Users/krico/Projects/jas/schedule/schedule-appengine/node_modules/karma
In your development environment it is possible to configure jasify to write a file (e.g.: 2015-08-16_22-03-52.eml
)
for every e-mail message that is sent. Of course this feature only works on development environment...
To enable this feature, just set the system property jasify.emailDebug=true
.
The best way of doing this is to add a VM parameter to the startup configuration of your AppEngine devserver. Like
-Djasify.emailDebug=true
Then, you will see a line every time an e-mail is sent that looks like:
INFO: E-mail available at: http://localhost:8080/download/ATT477/2015-08-17_01-12-12.eml
Now you can open that URL and view the e-mail on your preferred e-mail reader.
To run your dev env you need to create a file called jasify.json inside your user home. It should look something like (you need to replace REAL_CLIENT_ID and REAL_CLIENT_SECRET with, duh...), but if you are not using oauth with google, you can put any value there:
{
"ApplicationConfig" : {
"OAuth2ProviderConfig.Google.ClientId" : "REAL_CLIENT_ID",
"OAuth2ProviderConfig.Google.ClientSecret" : "REAL_CLIENT_SECRET",
"com.jasify.schedule.appengine.model.SchemaMigration.InitialLoadType": null
}
}
If you want the dev system to be initialized with some values to ease your testing (organizations, etc) you can control
that with com.jasify.schedule.appengine.model.SchemaMigration.InitialLoadType
. The types are implemented in
com.jasify.schedule.appengine.model.SchemaMigrationInitialLoad
. For example, set it to
{
"ApplicationConfig" : {
...
"com.jasify.schedule.appengine.model.SchemaMigration.InitialLoadType": "samples"
}
}
You need to decide if you want ConsistencyGuard.UseCache or not. This value MUST be specified to either true
or false
.
true
: use cached data fromtarget/schedule-appengine-1.0.3-SNAPSHOT/WEB-INF/classes/META-INF/ConsistencyGuard.json
. If you set it to true, you need to remember to build on the command line every time you change consistency guard things...false
: dynamically discover classes used by ConsistencyGuard, this causes appengine in dev to log several exceptions, but has the advantage that changes are picked up as you make them.
{
"ApplicationConfig" : {...},
"DevConfig": {
"ConsistencyGuard.UseCache": "true"
}
}
- You MUST read this
- If you get problems missing classes named *Meta (e.g. UserMeta) you need to run
mvn apt:process
- If you change any class annotated with @Model (usually under com.jasify.schedule.appengine.model.users) you MUST
run
mvn apt:process
To generate the jasify endpoint provider (providers/jasify.provider.js
) just run on the
command line:
npm run generate
This will run mvn package
followed by endpoints.sh
to generate discovery doc and then
run the endpoints-angular-client-generator
.
- To run only the jasmine tests, you need to run
mvn phantomjs:install jasmine:test
. Another option is to run a webserver and run your tests in the browser. Then you can simply reload the browser to test again. For this, runmvn jasmine:bdd
. - Checkout Jasmine Documentation
- To get protractor going, have a look at the tutorial. If you don't want to install anything and rely only on jasify, you can do
# download selenium binaries
./node_modules/.bin/webdriver-manager update
# start selenium server (http://localhost:4444/wd/hub)
./node_modules/.bin/webdriver-manager start
# on another terminal, run
./node_modules/.bin/protractor src/test/e2e/protractor.cfg.js
- I've also setup a run configuration on intellij, for that you need to install the "NodeJS" plugin. Then it's quite simple:
- Edit Configurations -> Click on the "+" and choose run type "Node.js"
- Name: Jasify Protractor
- Working Dir: PATH_TO_CHECKOUT/schedule/schedule-appengine
- Javascript file: node_modules/protractor/lib/cli.js
- Application: src/test/e2e/protractor.cfg.js
- PayPal WebCheckout dev
- angular-spinner and spin.js
- Bootstrap CSS
- E2E HTTP Backend Mock for backend less development
- Angular Service
- Angular Forms
- HTTP status codes
- Angular locale support
- AppEngine java stuff
- Slim3 our data store framework
- Unit Testing Google Cloud unit tests for AppEngine
- ServletUnit part of HttpUnit to unit test servlets
- Boostrap columns of same height
- Edit ~/.m2/settings.xml (to find out the real path, run
mvn -X
and check the first few lines to see where your settings come from. - To use the GitHub plugins, add this to the settings.xml
<servers>
<server>
<id>github</id>
<password>OAUTH2TOKEN</password>
</server>
</servers>