This is UGLY : With JUnit 4
BigDecimal actual = new BigDecimal("8.0");
assertTrue(actual.compareTo(new BigDecimal("8.00")) == 0);
assertEquals(0, actual.compareTo(new BigDecimal("8.00")));
That's too verbose...
This is BEAUTIFUL :
import groovyx.net.http.*; | |
import static groovyx.net.http.ContentType.*; | |
import static groovyx.net.http.Method.*; | |
class NexusArtifactCleanup { | |
/** | |
* Settings in which to run script. | |
*/ | |
def settings = [ |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
<title>Index</title> | |
<script type="text/javascript"> | |
var _MsgWindowOpenError = 'Un mécanisme de blocage des fenêtres instantanées a été détecté dans votre navigateur Web. Ce type de mécanisme empêche le bon fonctionnement de cette application. Désactivez le mécanisme de blocage des fenêtres instantanées ou autorisez les fenêtres liées à ce site.'; | |
var _MsgWindowOpenError2 = 'Attention le filtre anti-popups est activé ou le niveau de sécurité de Internet Explorer n\'est pas correctement configuré.'; | |
package fr.husta.ejbutils.servicelocator; | |
import javax.ejb.EJBHome; | |
import javax.ejb.EJBLocalHome; | |
import javax.naming.Context; | |
import javax.naming.InitialContext; | |
import javax.naming.NamingException; | |
import javax.rmi.PortableRemoteObject; | |
/** |
package com.developpez.hugo.ws.adapters; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import javax.xml.bind.annotation.adapters.XmlAdapter; | |
/** | |
* DateAdapter, useful to convert String to Date and conversely, for use with JAXB 2.0. |
package xml.adapters.jodatime; | |
import javax.xml.bind.annotation.adapters.XmlAdapter; | |
import org.joda.time.LocalDate; | |
/** | |
* LocalDateAdapter, useful to convert String to Joda Time's LocalDate and conversely, for use with JAXB 2.0. | |
* <br> | |
* Can be used when customizing XML Schema to Java Representation Binding (XJC). | |
* |
package xml.adapters.jodatime; | |
import javax.xml.bind.annotation.adapters.XmlAdapter; | |
import org.joda.time.LocalDateTime; | |
/** | |
* LocalDateTimeAdapter, useful to convert String to Joda Time's LocalDateTime and conversely, for use with JAXB 2.0. | |
* <br> | |
* Can be used when customizing XML Schema to Java Representation Binding (XJC). |
This is UGLY : With JUnit 4
BigDecimal actual = new BigDecimal("8.0");
assertTrue(actual.compareTo(new BigDecimal("8.00")) == 0);
assertEquals(0, actual.compareTo(new BigDecimal("8.00")));
That's too verbose...
This is BEAUTIFUL :
package fr.husta.collections; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
/** |
package fr.gouv.finances.douane.intercom.outils.lang; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.math.MathContext; | |
import java.math.RoundingMode; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.lang.StringUtils; |
package com...rest.support.interceptors; | |
import java.util.List; | |
import java.util.Locale; | |
import javax.ws.rs.WebApplicationException; | |
import javax.ws.rs.core.HttpHeaders; | |
import javax.ws.rs.ext.Provider; | |
import org.jboss.resteasy.annotations.interception.Precedence; |