You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2013/03/01 16:55:05 UTC
svn commit: r1451623 - in /felix/trunk/inventory/src/src: ./ test/
test/java/ test/java/org/ test/java/org/apache/ test/java/org/apache/felix/
test/java/org/apache/felix/inventory/
test/java/org/apache/felix/inventory/PrinterModeTest.java
Author: fmeschbe
Date: Fri Mar 1 15:55:05 2013
New Revision: 1451623
URL: http://svn.apache.org/r1451623
Log:
Unit test for PrinterMode
Added:
felix/trunk/inventory/src/src/
felix/trunk/inventory/src/src/test/
felix/trunk/inventory/src/src/test/java/
felix/trunk/inventory/src/src/test/java/org/
felix/trunk/inventory/src/src/test/java/org/apache/
felix/trunk/inventory/src/src/test/java/org/apache/felix/
felix/trunk/inventory/src/src/test/java/org/apache/felix/inventory/
felix/trunk/inventory/src/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
Added: felix/trunk/inventory/src/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/inventory/src/src/test/java/org/apache/felix/inventory/PrinterModeTest.java?rev=1451623&view=auto
==============================================================================
--- felix/trunk/inventory/src/src/test/java/org/apache/felix/inventory/PrinterModeTest.java (added)
+++ felix/trunk/inventory/src/src/test/java/org/apache/felix/inventory/PrinterModeTest.java Fri Mar 1 15:55:05 2013
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * ADOBE CONFIDENTIAL
+ * ___________________
+ *
+ * Copyright 2013 Adobe Systems Incorporated
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains
+ * the property of Adobe Systems Incorporated and its suppliers,
+ * if any. The intellectual and technical concepts contained
+ * herein are proprietary to Adobe Systems Incorporated and its
+ * suppliers and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe Systems Incorporated.
+ **************************************************************************/
+package org.apache.felix.inventory;
+
+import org.junit.Test;
+
+import junit.framework.TestCase;
+
+public class PrinterModeTest
+{
+
+ @Test
+ public void test_valueOf()
+ {
+ TestCase.assertSame(PrinterMode.TEXT, PrinterMode.valueOf("TEXT"));
+ TestCase.assertSame(PrinterMode.JSON, PrinterMode.valueOf("JSON"));
+ TestCase.assertSame(PrinterMode.HTML_FRAGMENT, PrinterMode.valueOf("HTML_FRAGMENT"));
+
+ TestCase.assertNull(PrinterMode.valueOf("unsupported_name"));
+ }
+
+ @Test
+ public void test_name()
+ {
+ TestCase.assertEquals("TEXT", PrinterMode.TEXT.name());
+ TestCase.assertEquals("JSON", PrinterMode.JSON.name());
+ TestCase.assertEquals("HTML_FRAGMENT", PrinterMode.HTML_FRAGMENT.name());
+ }
+
+ @Test
+ public void test_equals()
+ {
+ TestCase.assertTrue(PrinterMode.TEXT.equals(PrinterMode.TEXT));
+ TestCase.assertFalse(PrinterMode.TEXT.equals(PrinterMode.JSON));
+ TestCase.assertFalse(PrinterMode.TEXT.equals(PrinterMode.HTML_FRAGMENT));
+
+ TestCase.assertFalse(PrinterMode.JSON.equals(PrinterMode.TEXT));
+ TestCase.assertTrue(PrinterMode.JSON.equals(PrinterMode.JSON));
+ TestCase.assertFalse(PrinterMode.JSON.equals(PrinterMode.HTML_FRAGMENT));
+
+ TestCase.assertFalse(PrinterMode.HTML_FRAGMENT.equals(PrinterMode.TEXT));
+ TestCase.assertFalse(PrinterMode.HTML_FRAGMENT.equals(PrinterMode.JSON));
+ TestCase.assertTrue(PrinterMode.HTML_FRAGMENT.equals(PrinterMode.HTML_FRAGMENT));
+ }
+
+}