modules/graphics/src/test/java/test/javafx/css/PaintTypeTest.java

Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:


   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 javafx.scene.paint.Color;
  29 import javafx.scene.paint.CycleMethod;
  30 import javafx.scene.paint.LinearGradient;
  31 import javafx.scene.paint.Paint;
  32 import javafx.scene.paint.RadialGradient;
  33 import javafx.scene.paint.Stop;
  34 import javafx.scene.text.Font;
  35 import com.sun.javafx.css.ParsedValueImpl;





  36 import javafx.css.converter.PaintConverter;
  37 import javafx.css.converter.StopConverter;
  38 import org.junit.Test;
  39 import static org.junit.Assert.assertEquals;
  40 
  41 
  42 public class PaintTypeTest {
  43 
  44     public PaintTypeTest() {
  45     }
  46 
  47     final Stop[] stops = new Stop[] {
  48         new Stop(0.0f, Color.WHITE),
  49         new Stop(1.0f, Color.BLACK)
  50     };
  51 
  52     final Paint[] paints = new Paint[] {
  53         Color.rgb(0, 128, 255),
  54         new LinearGradient(0.0f, 0.0f, 1.0f, 1.0f, true, CycleMethod.NO_CYCLE, stops),
  55         new RadialGradient(225, 0.28, 1f, 1f, 5.0f, false, CycleMethod.NO_CYCLE, stops)




   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 test.javafx.css;
  27 
  28 import test.javafx.css.TypeTest;
  29 import javafx.scene.paint.Color;
  30 import javafx.scene.paint.CycleMethod;
  31 import javafx.scene.paint.LinearGradient;
  32 import javafx.scene.paint.Paint;
  33 import javafx.scene.paint.RadialGradient;
  34 import javafx.scene.paint.Stop;
  35 import javafx.scene.text.Font;
  36 import com.sun.javafx.css.ParsedValueImpl;
  37 import javafx.css.CssParser;
  38 import javafx.css.ParsedValue;
  39 import javafx.css.Size;
  40 import javafx.css.SizeUnits;
  41 import javafx.css.Stylesheet;
  42 import javafx.css.converter.PaintConverter;
  43 import javafx.css.converter.StopConverter;
  44 import org.junit.Test;
  45 import static org.junit.Assert.assertEquals;
  46 
  47 
  48 public class PaintTypeTest {
  49 
  50     public PaintTypeTest() {
  51     }
  52 
  53     final Stop[] stops = new Stop[] {
  54         new Stop(0.0f, Color.WHITE),
  55         new Stop(1.0f, Color.BLACK)
  56     };
  57 
  58     final Paint[] paints = new Paint[] {
  59         Color.rgb(0, 128, 255),
  60         new LinearGradient(0.0f, 0.0f, 1.0f, 1.0f, true, CycleMethod.NO_CYCLE, stops),
  61         new RadialGradient(225, 0.28, 1f, 1f, 5.0f, false, CycleMethod.NO_CYCLE, stops)