Tuesday, October 16, 2012

Git reminder


Just a git reminder to work with github ...

git checkout master
git fetch upstream
git merge upstream/master


git checkout dashboard
git merge upstream/dashboard

git push --set-upstream origin dashboard


Merge


git mergetool -t kdiff3
git mergetool -t meld
git config --global merge.tool kdiff3

Clean d'un repository :

For example,

git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force 


Revert

  • git checkout path/to/file
  • For a working copy : git reset --hard

Monday, October 8, 2012

Closure Lambda and Java 8


I found a good link about Closure (Lambda project) of Java 8.With this article, you will have a good idea of what is Lamda : http://java.amitph.com/2012/08/at-first-sight-with-closures-in-java.html

Keep in my, that Java 8 come next year !

Saturday, October 6, 2012

Junit @Rule

Recently, I've found an article on Junit about annotation @Rule.I didn’t know this annotation before.I will present you briefly how it works and I will give you some interesting links.

In earlier version of Junit, we need to declare @SetUp and @TearDown for each test class.
Now, with newer version of Junit, it’s possible to define its own rule with @Rule and you will have the possibility to execute code during test (Same thing than AOP).
To help you to understand, here is some standard rules :

  • ExpectedException: check if an exception is thrown during test
  • Timeout: check that one test doesn’t exceed a given time
  • ExternalResource: Open or close a resource.
  • TemporaryFolder: create and destroy a temporary directory.


Ref :
http://blog.objetdirect.com/divers/quoi-de-neuf-chez-junit
http://www.dzone.com/links/r/junit_rules_3.html

Friday, October 5, 2012

Can't import an existing Maven Project with Eclipse Juno and Maven Plugin 1.1.0

Problem

I do the following :
Import -> Maven -> Existing Maven Project
Then I choose My project on disk.





I click Next.I have the Maven Selector Plugin Screen :


If I click on Finish, I wait a long time and I finally I hava an error : Problem occured while performing ...

Solution

In Maven Selector Plugin Screen, just click on resolve All Later button.
It will permit to have the project on Eclipse and after you could resolve problem.


Wednesday, October 3, 2012

org.springframework.web.servlet.PageNotFound No mapping found for HTTP request with URI


Problem

I've met the following error on Jboss (7.1.1) with an application using Spring 3.1.1 :
14:35:03,357 WARN  [org.springframework.web.servlet.PageNotFound] (http--127.0.0.1-8080-1) No mapping found for HTTP request with URI [/sandbox-0.0.1-SNAPSHOT/css/design.css] in DispatcherServlet with name 'sandbox'

Solution

You have to add     <mvc:resources mapping="/resources/**" location="/resources/" />


http://stackoverflow.com/questions/1483063/spring-mvc-3-and-handling-static-content-am-i-missing-something