I am using Apache Wicket as my web application framework in Eclipse.
Currently I have eCobertura as an eclipse plugin installed.
But it needs a main() method to run. I do not have one.
So how can I run code coverage within a web application?
Regards...
Or you can try out EclEmma, it is available in the Eclipse Marketplace and is really easy to use. It gives you a right click option on your project, package or file: "Coverage -> JUnit test".
I use it with Wicket and you don't need any running server or such to run the tests.
Related
I am trying to create a Spring boot based MVC application using eclipse.
I created a starter template from spring's starter website and i have imported the maven package into eclipse.
I created a controller and a view and I am able to run the application by going to "debug as" or "run as" and selecting Java Application and then selecting the spring boot application main method from the list.
However with this approach, Eclipse does not seem to auto build my changes in my java classes nor the changes in my template views. (I use Thymeleaf btw) on the fly even though "auto build" is switched on in eclipse.
This forces me to stop the application in eclipse and re run the application for every small change i make and its very difficult.
Is this the only way on eclipse or is there a better way for eclipse would auto build the java and template files on the way so that I can code and debug simultaneously.
Eclipse is most likely compiling because that's what Eclipse does, but maybe you need to install the dev tools so that you get live reloading enabled.
I'm trying to run the JHipster application via my Eclipse Juno, using jdk 1.7.
The app seems to be loading properly (no console errors), but when i'm trying to reach the server with the client side (or via Postman, by sending a request to the REST servlets in port 8080), it's not responding.
However, when i'm running "mvn spring-boot:run" in the command shell, the server is loaded successfully and is responding to the exact same requests. Also, I managed to run the same command via eclipse with some maven configuration but it seems to be running only the target files (jars) and not the source code. I still haven't been able to run the source code of this app using eclipse in order to properly debug it.
Any suggestions?
Thanks!
So the answer is quite trivial, but since I spent several hours to reach it, it might save some time for others-
Download & install STS IDE.
Import the project as existing Maven project.
Run/Debug the project.
I tried to run it via Eclipse the whole time (wasn't familiar with STS to be honest) and this probably needs some extra configuration (another comment with explanations on eclipse configuration will be much appreciated). Once you work with STS, it's easy.
You should not need STS, just Eclipse with the J2EE stuff.
I've imported the sample jhipster in Eclipse (without STS) as a Maven project and everything was OK, after installing the maven dependencies.
To run the project, run as an application and search for the Application (com.mycompany.myapp.Application)
This app works for me: https://github.com/jhipster/jhipster-sample-app. It is stuck on Boot RC5 which probably means it's a bit old. Maybe Julien can comment on that (or update it)?
I have to test a web app using Selenium test cases/test suites that will run through Maven. I am new to it all. Can anyone outline the simple basic steps to run my first test successfully? I have everything installed (Eclipse, Maven, Selenium). Thanks.
Might help to see an active example and working integration between jUnit, eclipse, Maven and Selenium.
You can download a working project here
or you can check it out from GitHub from here.
If you read the readme on that project, it states that you can run the tests individually by right clicking the method names, and clicking Run As->jUnit tests or you can run the class suite.
I have a GWT project and I can run it via hosted mode of build.xml.
But in case I don't have it(projects that I created by eclipse plugin) I run it by running com.google.gwt.dev.DevMode.class file but it says :
Plugin failed to connect to Development Mode server at 127.0.0.1:9997
why? :(
Well if you have the Eclipse plugin, you can use it to run your project as a GWT app. Right click on your project or module.gwt.xml file > Run as > GWT Application. If you have multiple modules, it will let you pick a module, and it might ask you to pick the hosted html file.
Doing that will use the Devmode class to run your app.
Honestly I've started this small maven webapp using eclipse 3.6 (STS) and i found it so complicated that i had to switch to netbeans.I really wanted to use eclipse but these are reality on the ground.So at the end of everything I'll like to have an eclipse version of the same project. thanks
I set up the maven webapp using the embedded archetype, and use cargo plugin to take care of the deployment.basically there is only hello world index.jsp in the project.after picking pom configuration here and there my pom finally is like this .
while it started publishing after i restart the IDE, it's publishing to http://localhost:8080/ but for me I'm expecting it at http://localhost:8080/mvnTestWebap
so here are my questions
Question 1 : How can i correct that?
Question 2 : I believe my pom is tied to netbeans too much, how can i achieve the publishing to tomcat result but having a portable pom?Can anyone suggest a rewrite that can run on eclipse?
Question 3 : what correspond to netbeans "run" in eclipse?
probably by some deployment descriptor editing.
don't really understand the point. by default netbeans uses it's own embedded IDE way of deployment. That's not creating a pom tied to netbeans in any way. You can use that in eclipse or IDE or command line to build the project. The deployment part of the web app is specific to the server being used and the IDE being used.
You can also tell netbeans to execute your cargo plugin on executing the Run/Debug/Profile action (bypassing the netbeans default behaviour)
run basically performs a redeploy of the app on the server of choice. There has to be an equivalent on eclipse.