Search This Blog

Loading...

Skipping Cobertura Code Check when skipping tests

My Co-works and a few people online has been asking on how to skip Cobertura code check, when they are trying to do an mvn install -Dmaven.test.skip.

The default config of the cobertura-maven-plugin does not let you do that. You will get the following error

[ERROR] Project failed check. Total line coverage rate of 0.0% is below 80.0%

One way is to keep updating you pom.xml haltOnFailure for the plugin to false, that is not a long term fix. (See my cobertura-maven-plugin blog)



http://blog.dawouds.com/2008/09/using-maven-to-test-your-code-coverage.html

The following is an example of my long term fix

1. Add the following to the pom.xml (I put in my parent pom.xml)

<properties>
<cobertura.runtests>true</cobertura.runtests>
</properties>


2. Everywhere where you config the cobertura-maven-plugin do the following

<configuration>
<check>
<haltOnFailure>${cobertura.runtests}</haltOnFailure>
<totalLineRate>80</totalLineRate>
</check>
</configuration>


To skip the unit test and the code coverage check now run the following command

mvn install -Dmaven.test.skip -Dcobertura.runtests=false

That is it... let me know if you have issues with this way of fixing the issue or if you have a better way of archiving the goal

Nikon D90 DSLR And Lens Video Review

Setup Ubuntu for Java/Tomcast Development

When it snows in Seattle, i stay at home and try new things... This year it is Installing Ubuntu on an old desktop that is not really used so that I can turn that none preforming vista box into a nice fast PC for my SON and Server for me.

Here is what i had to do to get my PC to work under ubuntu so that i can develop and deploy java apps to tomcat.

  1. Download and install the ubuntu OS.

  2. enable SSH
    sudo apt-get install openssh-server openssh-client

  3. Install Java
    sudo apt-get install sun-java5-jdk

  4. install SVN
    sudo apt-get install subversion

  5. install VNC Server
    sudo apt-get install x11vnc vnc-java
    x11vnc -storepasswd
    i shutdown the firewall - Local Lan so i don't need it ...

  6. install mysql server

  7. install tomcat

  8. install eclipse



Remove Garmin GPS Custom POI

I got a new Garmin GPS and installed software on my Mac and PC and now i have an issue..

POI that installed Using the Mac POI Loader can't be deleted, that Said, POI installed using the Windows Software of POI Loader can be removed by the Windows POI Loader.

Here are the steps to remove POI using the windows POI Loader from Garmin

  1. Install the POI Loader Software - Windows Version
  2. Connect GPS to the computer user the USB cable
  3. Open the POI Loader program
  4. Follow instruction about finding the device
  5. After finding the device click next, the software will let you install or Remove ALL  previously installed custom POIs from your device, select Remove ALL then click Next
  6. Your POI will now be removed. 

you can then reinstall only the POI that you want.

That said, i still can't remove the POI that i installed using the Mac POI Loader.... DON"T Use the Mac Version if you can... I had to reset the device to factory setting to get these POI Off.

Removing MyStoreRewards paypal API auth

So i been on ebay for years, i buy and i sell, last month I bought a product from a seller that is using MyStoreRewards.com which is a site that helps sellers give a % of the sale back to the buyer to keep they happy and sell more items... So i got something back like $.04 so i said i'll try it out... That said, a month later I find an invoice for $7.99. Since i have seller account as well, they started sending my buyers cashback.

Anyway Now i don't want that service anymore, i could not find a way to move the paypal API Auth from paypal, too me a while but i find it. Here is the steps to do so.

  1. Login to paypal
  2. Click My Account Tab
  3. Click Profile Sub Section
  4. Click API Access under Account Info.
  5. Under Grand API Permission click view or change
  6. select the MyStoreRewards permission 
  7. click remove.

Now you are all done

Maven 2 - Couldn't find the release X among the supplied releases

In my Blog about maven-changes-plugin. I made the following comment



Note: The changes plugin has an issue where if the changes.xmldoes not include an entry for a release matching the build releaseversion, the build will fail after deploying the war/jar/etc to themaven repository.
Here is an example of that error...

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Couldn't find the release '1.14.2' among the supplied releases.
[INFO] ------------------------------------------------------------------------

Again the fix is to make sure that the changes.xml has a release with the same number that you are building... and to fix that after the maven has tagged your source code is to check in an updatedchanges.xml with a matching release and retag it with the release tagthen call cvs update and mvn release:prepare again

New FaceBook Outlook Sync Software - Fonebook

For a while i been using OutSync (see blog entry) but it stopped working and there is no new updates... While trying to find updates i found a posting that people are now starting to use FoneBook. I gave it a try.


Fonebook is used to transfer contacts photos and infomation from Facebook™ to Outlook®. If your phone then supports Outlook® synchronization you should be able to have your contacts photos on your phone when they call you!

I works, i let me sync up everything windows starts. Hope it works for you..

Change Mac OS X Hostname

So at my company the number of Mac Desktops and Laptops has been in inscreasing and everytime i turn on my laptop i get a message that the hostname is in use and the hostname after a year or use is not at Macintosh-10.local.

To fix this issue i ran the following command.

sudo scutil --set HostName myname-macbook-pro

restart type in your password, restart terminal and you should see the new name

m2eclipse 0.9.6.2 breaks Ant Lanucher - FIX NOT Working

After installing m2eclipse 0.9.6.2 i keep hitting the following error when i try to run ant scripts

Unsupported launch configuratio type org.eclipse.ant.AntLaunchConfigurationType.

This is a bug that is fixed in 0.9.7 which is not released yet but can be downloaded from the Dev Update Site http://m2eclipse.sonatype.org/update-dev

but for me it does not work :(








Spring WebFow Testing - How to add objects to the session

While spring has a good framework for testing webflows, we found out that you need to add objects to the session which the webflow action expect.

Some may think that this is a bad practive but we had a need and that is how we coded it.

To add items to the session do the follwoing

  1. Create a Test Base Class BaseFlowTest which extends AbstractXmlFlowExecutionTests
  2. override the following methods 
@Override
protected ViewSelection startFlow(MutableAttributeMap input) {
  ExternalContext context = createExternalContext(null);
  context.getSessionMap().put("myObjectName",  new SessionObject());
  return startFlow(input, context);
} 
@Override
protected ViewSelection signalEvent(String eventId, ParameterMap requestParameters) throws FlowExecutionException {
   ExternalContext context = createExternalContext(requestParameters);
   context.getSessionMap().put("myObjectName",  new SessionObject());
   return signalEvent(eventId, context);
}

Test Code

@Test
public void testStartFlow() {
   ViewSelection o = startFlow(setAttributes());
   ApplicationView view = applicationView(o);
   assertCurrentStateEquals(STATE_LOGIN_PAGE);
   assertViewNameEquals(getLoginPageView(), view);
} 

Slides from ReST vs SOA(P) presentation... yawn

Overview of ReST Web Services is explained by confusing existing name brands and sharing facts.

ReST Vs SOA(P) ... Yawn
View SlideShare presentation or Upload your own. (tags: web services)

Article: Spring customizing annotation configs

The annotation driven approach is maturing.  Take a look at the examples here.  the apsectj stuff is especially impressive.

http://blog.interface21.com/main/2007/05/29/customizing-annotation-configuration-and-component-detection-in-spring-21/

Article: Eric Evans on Domain Driven Design

This is a good short interview with Eric Evans.  He has some good insight on how to bring together customers and developers- promoting concepts of "ubiquitous language" and a "bounded context" as communication tools.

http://www.infoq.com/interviews/domain-driven-design-eric-evans

Article: Good article on concurrency testing

This article follows up on Brian Goetz’s book: Java Concurrency in Practice. It is advocating the use of Glassbox as a performance and concurrency testing tool. We saw a demo of Glassbox during one of the sessions in the recent NFJS.

http://www.theserverside.com/tt/knowledgecente/knowledgecenter.tss?l=ConcurrencyTestingJavaApps&asrc=EM_NLN_2350350&uid=2693243

Article: Rod recently published a good overview of Spring 2.5




http://www.theserverside.com/tt/articles/article.tss?l=IntrotoSpring25

Article: Security Advisory Issued for Spring MVC

Security Advisory Issued for Spring MVC

http://www.infoq.com/news/2008/07/spring-mvc-advisory