Google App Engine + GWT + Eclipse: where do your unit tests live? - unit-testing

I'm just getting started with a project that combines GWT, Google App Engine and the Google Eclipse plugin. Where is the best place to store my tests? I normally keep my code organized Maven-style, with src/main/java, and tests in src/test/java. The default setup I get from the plugin dumped my source directly into src, which I'm not too fond of, but I'd prefer not to fight against the tools. What's the "standard" place to put unit tests in such a project?
Solution:
create src/main/java, move the existing code under there
create src/test/java, add your tests here
go to Project -> Properties -> Java Build Path, add the new locations as Source Folders.

I've faced a kind of problem woth GAE testing: Some tests require an appengine-testing.jar wich conflicts with the main appengine-api-xxx.jar of the poject. That way, I was able to run tests for GAE but it conflicted with a normal run/debug launch. To be able to run the app in my local machine, I had to remove the appengine-testing.jar and then, a lot of compilation errors appeared in my test/ clases.
If you want an advice, set your test clases in another project (where you can use the jars without conflict)
Otherwise, if you got make it work, please, tell me how did you do.
Thanks a lot.

Put it where it pains you least.
GWT on Google App Engine is pretty new at this point; you are
optimistic to expect there is a "standard" place, especially since
you've already found an inconsistency in what the tools do.
Since you've already accepted the source starting at "src/", why not
put the test source in "test/"? This is certainly standard in many
contexts.

Related

create a project from a template

I have several project setups in very different languages. For example an android project.
Whenever I want to create a new android project I copy that project, rename everything I need to rename and I have a ready to go project with which I start working.
Since this is very time consuming and I am sure this can be automated I thought about creating a tool that does this for me, but then I thought there are probably thousand solutions out there, which solve the exact same problem already, I am just not aware of.
So my question is, do you know of any tools like this? The requirements I see are, that it has to be os, language, IDE independent and it must support a command line interface. Ideally with less setup effort.
You should try Telosys (https://www.telosys.org) a lightweight code generator that is able to generate any kind of langage with any kind of framework.
This tool is quite simple, free and Open Source.
It provides a Command Line Interface (so it can be used with any environment/IDE).
It is usualy used to boostrap a project and to generated all the repetitive code (CRUD, Controllers, unit tests, HTML pages, etc)
See also :
https://modeling-languages.com/telosys-tools-the-concept-of-lightweight-model-for-code-generation/
https://www.slideshare.net/lguerin/telosys-project-booster-paris-open-source-summit-2019

Unit Testing with Boost and Eclipse

I can't work out how to get unit testing to work with Boost and Eclipse.
I get lots of different errors depending on where I put the source files.
Where are the tests supposed to go? (ie should I create a test folder in root, in src, no folder at all or what)
Do I need to specify something somewhere if I don't intend to have a main(), and just lots of tests?
I'm really confused, and I know I'm being quite lite on the details - hopefully you can show me the proper way to do Unit Testing with Boost in Eclipse rather than whatever I'm currently doing.
Compile your application in eclipse first normal without unit tests.
After that create a new Project and reference it to the former Project with your application.
Than you create a main.cpp and insert your unit tests there.
You should be able to use the other projects classes from the new Project. Therefore, you are able to Instantiate Objects and do your asserts or whatever you like. If you have any further questions, please post your actual error and provide a screen-shot of your current structure.

ColdFusion, and documenting code as well as tools for multiple developer teams

I am beginning a fairly large new project using ColdFusion. This new project will include several developers and as such documentation of code will be key.
Another issue I am hoping to avoid (either with adequate code documentation or some other tool) is the duplication of code. A tool that would be able to "index" the code for searching or diagramming would likely help here.
What are others out there using either specifically for ColdFusion or language agnostic. We will likely be using ColdBox for the underlying framework if that makes a difference.
Thanks for any any all suggestions.
-c
Well, it's impossible to tell you which framework to use without knowing more about your project, but I can list out some tools that will be useful no matter which framework you use.
Language-agnostic tools:
GitHub.com organization+teams
Jenkins continuous integration
Apache ANT build scripts
Apache Maven for project management
Coldfusion-specific tools:
MXunit unit testing framework
MockBox for unit testing (if you use ColdBox: ColdBox-specific tutorial)
ColdDoc documentation generator
Javascript-specific tools:
JSLint or JSHint for JS code cleanup
Jasmine unit testing
Ideally, your Jenkins build server should:
Do a fresh checkout from source control
Run all unit tests and stop the build if they fail
Generate documentation
Generate a production-ready package of your project
At a minimum, I highly recommend using source control, setting up Jenkins with MXunit tests, and scheduling daily automated builds.
We used the Atlassian suite at my last job. Mostly Jira for tracking and Greenhopper for agile but the other tools may help, fisheye, bamboo, and crucible. If you host it yourself I believe they have a one time $10/product price tag that. Depending on your team's size may or may not work. If money is no subject the suite worked really nicely. It also has built in support for svn and maybe more by now.
http://www.atlassian.com/software
Sounds to me what you need is a methodology, not a tool. If you have a clearly defined set of objects/responsibilities. There should be no crossover in scripting, and if you determine a common API for the objects being coded, I would think you'd be fine.

Nexus/Artifactory like maven proxy for unit tests

I am currently working on a testsuite for a relatively large test-project. It's the test-harness of the flexmojos project. I wrote down how the testsuite works in general here: https://flexmojos.atlassian.net/wiki/display/FLEXMOJOS/How+the+flexmojos-test-harness+works
My problem now is that currently a lot of stuff is copied to the test-local-repo in the initialize phase of the build, but not everything (Listing up everything would result in a huge pom). The build is configured to look in my main local repo first and if it can't find it there, to download it. So when the build runs, a lot of stuff is loaded from remote repos. Unfortunately this is done every time the testsuite is executed.
What I would like to do, would be to setup some sort of local nexus/artifactory-like plugin, that serves things from my main local-repo and fetches things it can't find from my main mavens repos (configured in my main settings.xml). I would now like to use this plugin to serve as main repo for my build, so the artifacts it needs are downloaded only the first time the testsuite is executed.
Please tell me there is such a thing available :-)
Chris
The best thing i know is the Mock Repository Manager Maven Plugin which simulates a proxy. The best combination is usually for integration testing of Maven plugins which usually using maven-invoker-plugin. But i think the mrm plugin should fit you needs.

Erlide: how to run all project eunit-tests at once?

I just started to develop (from scratch) a new project in Erlang. I use Erlide, a plugin for Eclipse. I wrote some unit tests (using EUnit) but I find running each of them (one by one) by hand quite annoying. Is there any way to automate this process, so that - with just a couple of clicks - all of my tests are run?
Thanks in advance for your help.
To run all test in a directory you can use the primitive:
{dir, Path::string()}
This tests all object files in the specified directory, as if they had been individually specified using {file, FileName}.
You can also use the fileand application primitive and others to define sets of tests.
You'll find documentation to all these under 1.5 EUnit test representation