Initial import.
[clinton/mirror/jspi/.git] / jspi / src / main / java / de / lohndirekt / print / attribute / IppAttributeNameTest.java
diff --git a/jspi/src/main/java/de/lohndirekt/print/attribute/IppAttributeNameTest.java b/jspi/src/main/java/de/lohndirekt/print/attribute/IppAttributeNameTest.java
new file mode 100644 (file)
index 0000000..a0d41c7
--- /dev/null
@@ -0,0 +1,60 @@
+/**\r
+ * Copyright (C) 2003 <a href="http://www.lohndirekt.de/">lohndirekt.de</a>\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ * \r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+ * Lesser General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ *  \r
+ */\r
+package de.lohndirekt.print.attribute;\r
+\r
+import java.util.Locale;\r
+\r
+import junit.framework.TestCase;\r
+import de.lohndirekt.print.attribute.ipp.UnknownAttribute;\r
+\r
+/**\r
+ * @author bpusch\r
+ *\r
+ * \r
+ */\r
+public class IppAttributeNameTest extends TestCase {\r
+\r
+    /**\r
+     * Constructor for IppAttributeNameTest.\r
+     * @param name\r
+     */\r
+    public IppAttributeNameTest(String name) {\r
+        super(name);\r
+    }\r
+\r
+    \r
+    /*\r
+     * Test for IppAttributeName get(String)\r
+     */\r
+    public void testGetString() {\r
+        IppAttributeName attributeName = IppAttributeName.get("attribute-does-not-exist");\r
+        assertNotNull("IppAttributeName is null",attributeName);\r
+        assertEquals("IppAttributeName should be UNKNOWN_ATTRIBUTE", attributeName.getCategory(), new UnknownAttribute("x",Locale.getDefault()).getCategory());\r
+    }\r
+\r
+    /*\r
+     * Test for IppAttributeName get(Class)\r
+     */\r
+    public void testGetClass() {\r
+        IppAttributeName attributeName = IppAttributeName.get(String.class);\r
+                assertNotNull("IppAttributeName is null",attributeName);\r
+                assertEquals("IppAttributeName should be UNKNOWN_ATTRIBUTE", attributeName.getCategory(), new UnknownAttribute("x",Locale.getDefault()).getCategory());\r
+    }\r
+\r
+}\r