lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r883079 - /lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java
Date Sun, 22 Nov 2009 13:59:47 GMT
Author: uschindler
Date: Sun Nov 22 13:59:47 2009
New Revision: 883079

URL: http://svn.apache.org/viewvc?rev=883079&view=rev
Log:
LUCENE-2088: add extra test

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java?rev=883079&r1=883078&r2=883079&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java Sun Nov 22
13:59:47 2009
@@ -142,6 +142,7 @@
       src.addAttribute(TypeAttribute.class) instanceof TypeAttributeImpl);
   }
   
+  @SuppressWarnings("unchecked")
   public void testInvalidArguments() throws Exception {
     try {
       AttributeSource src = new AttributeSource();
@@ -154,5 +155,12 @@
       src.addAttribute(Token.class);
       fail("Should throw IllegalArgumentException");
     } catch (IllegalArgumentException iae) {}
+    
+    try {
+      AttributeSource src = new AttributeSource();
+      // break this by unsafe cast
+      src.addAttribute((Class) Iterator.class);
+      fail("Should throw IllegalArgumentException");
+    } catch (IllegalArgumentException iae) {}
   }
 }



Mime
View raw message