1 /*
   2  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.css;
  27 
  28 import static org.junit.Assert.assertNotNull;
  29 import static org.junit.Assert.fail;
  30 import org.junit.Test;
  31 
  32 
  33 public class TypeTest {
  34 
  35     // Key key = TypeTest.getKeyByName("-fx-cursor", Node.impl_CSS_KEYS);
  36     public static CssMetaData getCssMetaDataByName(String name, CssMetaData[] keys) {
  37         CssMetaData keyForName = null;
  38         for (CssMetaData k : keys) {
  39             if (k.getProperty().equals(name)) {
  40                 keyForName = k;
  41                 break;
  42             }
  43         }
  44         assertNotNull(keyForName);
  45         return keyForName;
  46     }
  47 
  48     // ParsedValue value = TypeTest.getValueFor(stylesheet, "-fx-cursor")
  49     public static ParsedValue getValueFor(Stylesheet stylesheet, String property ) {
  50         for (Rule rule : stylesheet.getRules()) {
  51             // for (Declaration decl : rule.getUnobservedDeclarationList()) {
  52             for (Declaration decl : rule.getDeclarations()) {
  53                 if (property.equals(decl.getProperty())) {
  54                     return decl.getParsedValue();
  55                 }
  56             }
  57         }
  58         fail("getValueFor " + property);
  59         return null;
  60     }
  61 
  62     public TypeTest() {
  63     }
  64 
  65     @Test
  66     public void testType() {
  67         // All the tests have been stubbed out for now (since
  68         // the other tests implicitly or explicitly test Type).
  69         // But a unit test has to have a runnable method.
  70     }
  71 
  72     /**
  73      * Test of ENUM method, of class Type.
  74      */
  75 //    @Test
  76 //    public void testENUM() {
  77 //        System.out.println("ENUM");
  78 //        Class type = null;
  79 //        Type expResult = null;
  80 //        Type result = Type.ENUM(type);
  81 //        assertEquals(expResult, result);
  82 //        // TODO review the generated test code and remove the default call to fail.
  83 //        fail("The test case is a prototype.");
  84 //    }
  85 
  86     /**
  87      * Test of convert method, of class Type.
  88      */
  89 //    @Test
  90 //    public void testConvert_Value_Font() {
  91 //        System.out.println("convert");
  92 //        ParsedValue<Font> value = null;
  93 //        Font font = null;
  94 //        Type instance = new Type();
  95 //        Object expResult = null;
  96 //        Object result = instance.convert(value, font);
  97 //        assertEquals(expResult, result);
  98 //        // TODO review the generated test code and remove the default call to fail.
  99 //        fail("The test case is a prototype.");
 100 //    }
 101 
 102     /**
 103      * Test of convert method, of class Type.
 104      */
 105 //    @Test
 106 //    public void testConvert_KeyArr() {
 107 //        System.out.println("convert");
 108 //        Key[] keys = null;
 109 //        Type instance = new Type();
 110 //        Object expResult = null;
 111 //        Object result = instance.convert(keys);
 112 //        assertEquals(expResult, result);
 113 //        // TODO review the generated test code and remove the default call to fail.
 114 //        fail("The test case is a prototype.");
 115 //    }
 116 
 117     /**
 118      * Test of writeCssSerializable method, of class Type.
 119      */
 120 //    @Test
 121 //    public void testWriteCssSerializable() throws Exception {
 122 //        System.out.println("writeCssSerializable");
 123 //        DataOutputStream stream = null;
 124 //        StringStore ss = null;
 125 //        CssSerializable cs = null;
 126 //        Type instance = new Type();
 127 //        instance.writeCssSerializable(stream, ss, cs);
 128 //        // TODO review the generated test code and remove the default call to fail.
 129 //        fail("The test case is a prototype.");
 130 //    }
 131 
 132     /**
 133      * Test of readCssSerializable method, of class Type.
 134      */
 135 //    @Test
 136 //    public void testReadCssSerializable() throws Exception {
 137 //        System.out.println("readCssSerializable");
 138 //        DataInputStream stream = null;
 139 //        String[] strings = null;
 140 //        Type instance = new Type();
 141 //        Object expResult = null;
 142 //        Object result = instance.readCssSerializable(stream, strings);
 143 //        assertEquals(expResult, result);
 144 //        // TODO review the generated test code and remove the default call to fail.
 145 //        fail("The test case is a prototype.");
 146 //    }
 147 
 148     /**
 149      * Test of writePaint method, of class Type.
 150      */
 151 //    @Test
 152 //    public void testWritePaint() throws Exception {
 153 //        System.out.println("writePaint");
 154 //        DataOutputStream stream = null;
 155 //        Paint paint = null;
 156 //        Type.writePaint(stream, paint);
 157 //        // TODO review the generated test code and remove the default call to fail.
 158 //        fail("The test case is a prototype.");
 159 //    }
 160 
 161     /**
 162      * Test of readPaint method, of class Type.
 163      */
 164 //    @Test
 165 //    public void testReadPaint() throws Exception {
 166 //        System.out.println("readPaint");
 167 //        DataInputStream stream = null;
 168 //        Paint expResult = null;
 169 //        Paint result = Type.readPaint(stream);
 170 //        assertEquals(expResult, result);
 171 //        // TODO review the generated test code and remove the default call to fail.
 172 //        fail("The test case is a prototype.");
 173 //    }
 174 
 175     /**
 176      * Test of writeColor method, of class Type.
 177      */
 178 //    @Test
 179 //    public void testWriteColor() throws Exception {
 180 //        System.out.println("writeColor");
 181 //        DataOutputStream stream = null;
 182 //        Color color = null;
 183 //        Type.writeColor(stream, color);
 184 //        // TODO review the generated test code and remove the default call to fail.
 185 //        fail("The test case is a prototype.");
 186 //    }
 187 
 188     /**
 189      * Test of readColor method, of class Type.
 190      */
 191 //    @Test
 192 //    public void testReadColor() throws Exception {
 193 //        System.out.println("readColor");
 194 //        DataInputStream stream = null;
 195 //        Color expResult = null;
 196 //        Color result = Type.readColor(stream);
 197 //        assertEquals(expResult, result);
 198 //        // TODO review the generated test code and remove the default call to fail.
 199 //        fail("The test case is a prototype.");
 200 //    }
 201 
 202     /**
 203      * Test of writeLinearGradient method, of class Type.
 204      */
 205 //    @Test
 206 //    public void testWriteLinearGradient() throws Exception {
 207 //        System.out.println("writeLinearGradient");
 208 //        DataOutputStream stream = null;
 209 //        LinearGradient lg = null;
 210 //        Type.writeLinearGradient(stream, lg);
 211 //        // TODO review the generated test code and remove the default call to fail.
 212 //        fail("The test case is a prototype.");
 213 //    }
 214 
 215     /**
 216      * Test of readLinearGradient method, of class Type.
 217      */
 218 //    @Test
 219 //    public void testReadLinearGradient() throws Exception {
 220 //        System.out.println("readLinearGradient");
 221 //        DataInputStream stream = null;
 222 //        LinearGradient expResult = null;
 223 //        LinearGradient result = Type.readLinearGradient(stream);
 224 //        assertEquals(expResult, result);
 225 //        // TODO review the generated test code and remove the default call to fail.
 226 //        fail("The test case is a prototype.");
 227 //    }
 228 
 229     /**
 230      * Test of writeRadialGradient method, of class Type.
 231      */
 232 //    @Test
 233 //    public void testWriteRadialGradient() throws Exception {
 234 //        System.out.println("writeRadialGradient");
 235 //        DataOutputStream stream = null;
 236 //        RadialGradient rg = null;
 237 //        Type.writeRadialGradient(stream, rg);
 238 //        // TODO review the generated test code and remove the default call to fail.
 239 //        fail("The test case is a prototype.");
 240 //    }
 241 
 242     /**
 243      * Test of readRadialGradient method, of class Type.
 244      */
 245 //    @Test
 246 //    public void testReadRadialGradient() throws Exception {
 247 //        System.out.println("readRadialGradient");
 248 //        DataInputStream stream = null;
 249 //        RadialGradient expResult = null;
 250 //        RadialGradient result = Type.readRadialGradient(stream);
 251 //        assertEquals(expResult, result);
 252 //        // TODO review the generated test code and remove the default call to fail.
 253 //        fail("The test case is a prototype.");
 254 //    }
 255 
 256     /**
 257      * Test of readCycleMethod method, of class Type.
 258      */
 259 //    @Test
 260 //    public void testReadCycleMethod() throws Exception {
 261 //        System.out.println("readCycleMethod");
 262 //        DataInputStream stream = null;
 263 //        CycleMethod expResult = null;
 264 //        CycleMethod result = Type.readCycleMethod(stream);
 265 //        assertEquals(expResult, result);
 266 //        // TODO review the generated test code and remove the default call to fail.
 267 //        fail("The test case is a prototype.");
 268 //    }
 269 
 270     /**
 271      * Test of writeStop method, of class Type.
 272      */
 273 //    @Test
 274 //    public void testWriteStop() throws Exception {
 275 //        System.out.println("writeStop");
 276 //        DataOutputStream stream = null;
 277 //        Stop stop = null;
 278 //        Type.writeStop(stream, stop);
 279 //        // TODO review the generated test code and remove the default call to fail.
 280 //        fail("The test case is a prototype.");
 281 //    }
 282 
 283     /**
 284      * Test of readStop method, of class Type.
 285      */
 286 //    @Test
 287 //    public void testReadStop() throws Exception {
 288 //        System.out.println("readStop");
 289 //        DataInputStream stream = null;
 290 //        Stop expResult = null;
 291 //        Stop result = Type.readStop(stream);
 292 //        assertEquals(expResult, result);
 293 //        // TODO review the generated test code and remove the default call to fail.
 294 //        fail("The test case is a prototype.");
 295 //    }
 296 
 297     /**
 298      * Test of isMightHaveLookups method, of class Type.
 299      */
 300 //    @Test
 301 //    public void testIsMightHaveLookups() {
 302 //        System.out.println("isMightHaveLookups");
 303 //        Type instance = new Type();
 304 //        boolean expResult = false;
 305 //        boolean result = instance.isMightHaveLookups();
 306 //        assertEquals(expResult, result);
 307 //        // TODO review the generated test code and remove the default call to fail.
 308 //        fail("The test case is a prototype.");
 309 //    }
 310 
 311 }