Leiningen Not Running JUnit Test Cases - junit

I support a mixed Clojure/Java application that uses Leiningen for build. Everything works correctly except that lein test is not executing any Java JUnit test cases. The Clojure test cases are run, however. Is this possible using Leiningen?
I understand that the clojure-maven-plugin might work for this use case, but I was hoping to not rewrite the build.
I am using this structure:
└── test
├── clj
│   └── example_service
└── java
└── com
└── example
└── service
I have this in my project.clj Leiningen build:
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:test-paths ["test/clj"]
I do not see a :java-test-paths ["test/java"] option available in Leiningen which makes me think this is not possible. Any guidance is much appreciated!

Related

Is the gemfile.lock file needed in a Jekyll site hosted with Github Pages?

Lately I've gotten into Jekyll for building documentation sites and hosting them on Github Pages. I understand Github Pages has a very limited list of what is allowed plugin wise. While doing some vulnerability testing I found out the file Gemfile.lock is vulnerable to XML External Entity (XXE) Injection.
In my research I've read:
Should Gemfile.lock be included in .gitignore?
A Gem's Gemfile.lock should NOT be in source control.
Setting up your GitHub Pages site locally with Jekyll
After reading the accepted answer of:
Assuming you're not writing a rubygem, Gemfile.lock should be in your repository. It's used as a snapshot of all your required gems and their dependencies. This way bundler doesn't have to recalculate all the gem dependencies each time you deploy, etc.
but I have no control over the Jekyll site. Please correct me if I'm understanding the process but Github Pages builds the site and if the Gemfile.lock is for development of Gems and that isn't something I can control it's ok to remove the file and add to the .gitignore?
GitHub Pages doesn't look for a Gemfile.lock file nor the Gemfile itself.
All it needs is a proper config file to load gems / plugins.

what exactly is build the site (jekyll)?

this's a super noob question but, what exactly is "build the site" running this command:
`~/myblog $ bundle exec jekyll serve`
is this to start the server?, because I'm currently using $ jekyll serve :s
As mentioned in its Quick-start guide, this command will build the site on the preview server.
Update:
There is a difference between jekyll serve and bundle exec jekyll serve:
The Gemfile and Gemfile.lock files inform Bundler about the gem requirements in your site. If your site doesn’t have these Gemfiles, you can omit bundle exec and just run jekyll serve.
When you run bundle exec jekyll serve, Bundler uses the gems and versions as specified in Gemfile.lock to ensure your Jekyll site builds with no compatibility or dependency conflicts.
Update 2:
In simple words, "build the site" means the Bundler will use the gems and versions specified in Gemfile.lock to ensure your Jekyll site builds with no compatibility or dependency conflicts and then will run your site on the preview or local server.
The serve command is actually an extension of the build command.
i.e., when a Jekyll user runs jekyll serve or bundle exec jekyll serve, Jekyll first runs the jekyll build command internally and then starts the local server to host the generated site.
So what exactly is this build the site? Well, Jekyll being a static-site generator generates your site using the build command.
Therefore, whether you run jekyll build or jekyll serve, a default jekyll site gets built or generated into the ./_site folder. The minor difference with running the serve command being Jekyll will proceed to start a local web-server and mount the built / generated site onto the server so that you can navigate the site via http://localhost:4000

How do I build a Polymer 2.x project with Polymer CLI?

Can anyone point me to a tutorial that uses Polymer 2 and polymer-build from Polymer CLI? When I use any example in the polymer-starter-kit and use polymer serve, it works fine; but when I use polymer build and serve the bundled or unbundled directory, I get 404 errors. I have even updated to the newest alpha version of polymer-cli.
Also, using https://github.com/tony19/generator-polymer-init-2-x-app generators have the same problem.
I also spent quit a bit of time to figure this one out. Please use the polymer-cli#next instead of polymer-cli
Plain polymer-cli doesn't seem to have the latest build and optimizations to support Polymer 2.0#Preview related functionality.
You can install polymer-cli#next. In Ubuntu, you can simply use npm install -g polymer-cli#next
Then on, the bundled and unbundled versions of the application generated through polymer build would just works fine.
Edit:
You can find my sample Polymer2.0#Preview version of the code at https://github.com/phani1kumar/phani1kumar.github.io branch is "devmaster".
the sw-precache-config.js is initial render-blocking. This will load all the resources that the main page needs to make the app available for offline use. src/lazy-resources.html loads resources for the next routes.
You would need to get a proper configuration based on your layout and main page in the following 3 files:
sw-precache-config.js, polymer.json, src/lazy-resources.html. This is a practice followed in the shop app from Polymer team, you may opt to a different mechanism for lazy loading. The bottom-line for lazy loading is to load the resources after Polymer.RenderStatus.afterNextRender.
You may also find the following article interesting: https://medium.com/#marcushellberg/how-i-sped-up-the-initial-render-of-my-polymer-app-by-86-eeff648a3dc0#.pi2iucwzi
I noticed a bug in the generator in that the starter-kit subgenerator was missing a dependency on webcomponentsjs, which would cause an error with polymer-build. And as you discovered, polymer.json was also missing dependencies for the polyfill support of webcomponentsjs, which caused 404s on polyfilled browsers (such as Linux Chrome). That's all fixed now in v0.0.6.
You'll also need a version of polymer-build that does not try to uglify the JavaScript, which would fail due to its inability to recognize ES6. The new-build-flags branch of the polymer-cli repo replaces uglify with babili for ES6 minification (added in PR#525). You could check out that branch and build it yourself, or you could install it from here:
npm i -g tony19-contrib/polymer-cli#dist-new-build-flags
For convenience, this branch is added as a devDependency when generating the 2.0 starter kit with generator-polymer-init-2-x-app.
To build and serve a Polymer 2.0 Starter Kit project:
Generate a 2.0 Starter Kit (using generator-polymer-init-2-x-app, v0.0.6 or newer) by selecting 2-x-app - starter application template:
$ polymer init
? Which starter template would you like to use?
...
2-x-app - (2.0 preview) blank application template
2-x-app - (2.0 preview) blank element template
❯ 2-x-app - (2.0 preview) starter application template
After the project generator finishes, build the project with yarn build:
$ yarn build
info: Deleting build/ directory...
info: Generating build/ directory...
info: Build complete!
Note that the output is only build/, and no longer build/bundled/ and build/unbundled/.
Serve up the contents of the build directory, and automatically open a browser to it:
$ polymer serve build -o
You could also serve it with a different tool to verify that the build output would work outside of the context of any Polymer tools. Start a Python server in build/, and manually open a browser to it:
$ cd build
$ python -m SimpleHTTPServer

Use an older generator-angular-fullstack version

I want to generate a project with generator-angular-fullstack, but I don't want to use ECMAScript 6. Do you know how I can downgrade the generator? or do you have a better solution for generating a project with angular node and mysql?
Thanks.
A little bit weird that we have to downgrade just to be able to using javascript and CSS by default, not only choose between typescript, babel and various :) Check the current version :
npm list -g generator-angular-fullstack
you will probably see something like
/home/<user>/npm/lib
└── generator-angular-fullstack#3.1.1
Check if you have another local version installed (very likely if you not have been strictly globally from scratch) list without -g :
npm list generator-angular-fullstack
/some/other/dir
└── generator-angular-fullstack#3.3.0
Now, if you have a local version as shown above, uninstall it
npm uninstall generator-angular-fullstack
Finally install the release of generator-angular-fullstack you want. My prefered versions for javascript, HTML, CSS, mongodb, express etc is 2.0.13 and 2.1.1
npm install -g generator-angular-fullstack#2.1.1
check version again to see if you actually have switched releases :
npm list -g generator-angular-fullstack
should now show
/home/<user>/npm/lib
└── generator-angular-fullstack#2.1.1
go to your working directory and run the generator
yo angular-fullstack
..release 2.1.1 is executed. NB: If you now and then see some UNMET PEER DEPENDENCY bower#>=1.0.0 etc, ignore it! It has not so much to do with the generator itself, and everything works fine - so dont worry about that.

Where is the source code for Polymer 1.0 Topeka App?

Here is the Topeka app as it's found on Google App Engine Appspot.
Here is the (purported) Github index.html file.
Note: the app's source code is minified.
Question
Where is the un-minified source code for the Topeka app?
If it's the Github repository, then where (for example) is the file that's imported by <link rel="import" href="components/topeka-elements/topeka-app.html"> and the others in in lines 46-51 of index.html? I don't see any /contents/ directory in the repository.
If the source code is not the Github repository, where is it?
What's the deal with this minified build.js file, etc.? That's different from the customary index.html file. I haven't seen Polymer apps use that before.
Notes:
#bpowers says on 9-14-2015 in Polymer Slack Site:
it looks like they updated the build files a month ago, but its still old 0.5. I was able to build it by opening up a terminal and doing:
git clone https://github.com/Polymer/topeka && cd topeka && npm install && bower install && ./node_modules/vulcanize/bin/vulcanize -o build.html index.html --strip --inline --csp -- clone it, move into the dir, install the deps, and then run vulcanize. The vulcanize command is from the deploy.sh script in the repo.
if I run a web server in that directory, the build.html runs
That Github repo is the web application. The topeka elements are listed as a dependency in the bower.json - "topeka-elements": "Polymer/topeka-elements#^0.5.0"
Find the source here
Looks like they've checked in the vulcanized build output from the deployment - see deploy.sh