modules/graphics/src/test/java/javafx/scene/effect/BlendTest.java

Print this page
rev 6167 : RT-35330 [Monocle] Remove StubToolkit and replace it with headless glass implementation


  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.scene.effect;
  27 
  28 import static com.sun.javafx.test.TestHelper.box;
  29 import static org.junit.Assert.assertEquals;
  30 import static org.junit.Assert.assertNull;
  31 import static org.junit.Assert.fail;


  32 import javafx.beans.property.ObjectProperty;
  33 import javafx.beans.property.SimpleObjectProperty;
  34 
  35 import org.junit.Before;

  36 import org.junit.Test;
  37 
  38 import com.sun.scenario.effect.Blend.Mode;
  39 
  40 public class BlendTest extends EffectsTestBase {




  41     private Blend effect;
  42 
  43     @Before
  44     public void setUp() {
  45         effect = new Blend();
  46         setupTest(effect);
  47     }
  48 
  49     @Test
  50     public void testSetOpacity() {
  51         // try setting correct value
  52         effect.setOpacity(0.5f);
  53         assertEquals(0.5f, effect.getOpacity(), 1e-100);
  54         pulse();
  55         assertEquals(0.5f, ((com.sun.scenario.effect.Blend) effect.impl_getImpl()).getOpacity(), 1e-100);
  56     }
  57 
  58     @Test
  59     public void testDefaultOpacity() {
  60         // default value should be 1




  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.scene.effect;
  27 
  28 import static com.sun.javafx.test.TestHelper.box;
  29 import static org.junit.Assert.assertEquals;
  30 import static org.junit.Assert.assertNull;
  31 import static org.junit.Assert.fail;
  32 
  33 import com.sun.javafx.FXUnit;
  34 import javafx.beans.property.ObjectProperty;
  35 import javafx.beans.property.SimpleObjectProperty;
  36 
  37 import org.junit.Before;
  38 import org.junit.Rule;
  39 import org.junit.Test;
  40 
  41 import com.sun.scenario.effect.Blend.Mode;
  42 
  43 public class BlendTest extends EffectsTestBase {
  44 
  45     @Rule
  46     public FXUnit fx = new FXUnit();
  47 
  48     private Blend effect;
  49 
  50     @Before
  51     public void setUp() {
  52         effect = new Blend();
  53         setupTest(effect);
  54     }
  55 
  56     @Test
  57     public void testSetOpacity() {
  58         // try setting correct value
  59         effect.setOpacity(0.5f);
  60         assertEquals(0.5f, effect.getOpacity(), 1e-100);
  61         pulse();
  62         assertEquals(0.5f, ((com.sun.scenario.effect.Blend) effect.impl_getImpl()).getOpacity(), 1e-100);
  63     }
  64 
  65     @Test
  66     public void testDefaultOpacity() {
  67         // default value should be 1