Author: jverhaeg(a)redhat.com
Date: 2008-06-02 16:11:36 -0400 (Mon, 02 Jun 2008)
New Revision: 232
Modified:
trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/impl/BasicNameTest.java
Log:
DNA-94: Changed to throw IAE if name is null or empty
Modified: trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/impl/BasicNameTest.java
===================================================================
--- trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/impl/BasicNameTest.java 2008-06-02
20:08:01 UTC (rev 231)
+++ trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/impl/BasicNameTest.java 2008-06-02
20:11:36 UTC (rev 232)
@@ -2,7 +2,7 @@
* JBoss, Home of Professional Open Source.
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
+ * distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
@@ -32,6 +32,7 @@
/**
* @author Randall Hauch
+ * @author John Verhaeg
*/
public class BasicNameTest {
@@ -74,16 +75,14 @@
assertThat(name.getNamespaceUri(), is(""));
}
- @Test
- public void shouldAllowNullLocalNameInConstructorAndConvertToEmptyString() {
- name = new BasicName(validNamespaceUri, null);
- assertThat(name.getLocalName(), is(""));
+ @Test( expected = IllegalArgumentException.class )
+ public void shouldNotAllowNullLocalNameInConstructor() {
+ new BasicName(validNamespaceUri, null);
}
- @Test
- public void shouldAllowEmptyLocalNameInConstructorAndConvertToEmptyString() {
- name = new BasicName(validNamespaceUri, "");
- assertThat(name.getLocalName(), is(""));
+ @Test( expected = IllegalArgumentException.class )
+ public void shouldAllowEmptyLocalNameInConstructor() {
+ new BasicName(validNamespaceUri, "");
}
@Test
Show replies by date