cialis senza ricetta svizzera acht c a du viagra cialis 5mg generika combien coute de viagra en france vardenafil 20 mg médicament cialis en pharmacie sans ordonnance vendita cialis cialis comprimidos mejores paginas web compra levitra en español barato viagra vrai viagra sans ordonnance inde viagra rezeptfrei bestellen prix cialis 5 cialis barato cialis recept
viagra francais 
prix du viagra 50 
cialis discount 
cialis sans ordonnance en belgique 
viagra en espagne 
societe belge pour vente viagra en ligne 
viagra generique livraison h 
allemagne cialis 
cialis sur ordonnance 
pharmacie en ligne belgique viagra 
cialis generique belgique 
vente medicament cialis 
sildenafil generique 
viagra riddim 
cialis mg 
where to buy viagra buy levitra paypal low cost cialis canadian pharmacy propecia cheapest cialis online levitra pharmacy order wellbutrin online no prescription cialis store bupropion no prescription purchase kamagra online viagra online without prescription uk priligy avis bupropion discount without prescription buy finasteride mg levitra best price

IntelliJ Structural Search to Convert from JUnit3 to Junit4

Just a quick tip for intellij users. For an old project i wanted to convert JUnit 3 testcases to JUnit4 format. Most stuff was already in place, but after the conversion, i found that some of the old “assertTrue”, “assertFalse”, and “assertEquals” statements were failing.

So i ended up with some short search/replace, which are really handy in IntelliJ.

Replace “assertTrue” and “assertFalse” with “assertThat”

Search template

assertTrue($msg$, $actual$);

Replacement template:

org.junit.Assert.assertThat.assertThat($msg$, $actual$, org.hamcrest.core.Is.is(true));

Remove “assertEquals” with delta values

Search template

assertEquals($msg$, $expected$, $actual$, $delta$);

Replacement template:

org.junit.Assert.assertThat($msg$, $actual$, org.hamcrest.core.Is.is($expected$));

Optional Replace “assertEquals” with “assertThat”

Search template

assertEquals($msg$, $expected$, $actual$);

Replacement template:

org.junit.Assert.assertThat.assertThat($msg$, $actual$, org.hamcrest.core.Is.is($expected$));

Comments are closed.