modules/base/src/test/java/test/javafx/binding/MapBindingTest.java

Print this page
rev 9235 : 8134760: Refactor Javafx base 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.binding;
  27 
  28 import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;
  29 import javafx.beans.InvalidationListenerMock;
  30 import javafx.beans.Observable;
  31 import javafx.beans.binding.MapBinding;
  32 import javafx.beans.property.ReadOnlyBooleanProperty;
  33 import javafx.beans.property.ReadOnlyIntegerProperty;
  34 import javafx.beans.value.ChangeListenerMock;
  35 import javafx.beans.value.ObservableValueBase;
  36 import javafx.collections.FXCollections;
  37 import javafx.collections.MockMapObserver;
  38 import javafx.collections.ObservableList;
  39 import javafx.collections.ObservableMap;
  40 import org.junit.Before;
  41 import org.junit.Test;
  42 
  43 import java.util.Collections;
  44 import java.util.HashMap;
  45 import java.util.Map;
  46 
  47 import static javafx.collections.MockMapObserver.Call;
  48 import static org.junit.Assert.*;
  49 
  50 /**
  51  */
  52 public class MapBindingTest {
  53 
  54     private final static Object KEY_1 = new Object();
  55     private final static Object KEY_2_0 = new Object();
  56     private final static Object KEY_2_1 = new Object();
  57     private final static Object DATA_1 = new Object();
  58     private final static Object DATA_2_0 = new Object();
  59     private final static Object DATA_2_1 = new Object();
  60 
  61     private ObservableStub dependency1;
  62     private ObservableStub dependency2;
  63 
  64     private MapBindingImpl binding0;
  65     private MapBindingImpl binding1;
  66     private MapBindingImpl binding2;
  67 




   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.binding;
  27 
  28 import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;
  29 import test.javafx.beans.InvalidationListenerMock;
  30 import javafx.beans.Observable;
  31 import javafx.beans.binding.MapBinding;
  32 import javafx.beans.property.ReadOnlyBooleanProperty;
  33 import javafx.beans.property.ReadOnlyIntegerProperty;
  34 import test.javafx.beans.value.ChangeListenerMock;
  35 import javafx.beans.value.ObservableValueBase;
  36 import javafx.collections.FXCollections;
  37 import test.javafx.collections.MockMapObserver;
  38 import javafx.collections.ObservableList;
  39 import javafx.collections.ObservableMap;
  40 import org.junit.Before;
  41 import org.junit.Test;
  42 
  43 import java.util.Collections;
  44 import java.util.HashMap;
  45 import java.util.Map;
  46 
  47 import static test.javafx.collections.MockMapObserver.Call;
  48 import static org.junit.Assert.*;
  49 
  50 /**
  51  */
  52 public class MapBindingTest {
  53 
  54     private final static Object KEY_1 = new Object();
  55     private final static Object KEY_2_0 = new Object();
  56     private final static Object KEY_2_1 = new Object();
  57     private final static Object DATA_1 = new Object();
  58     private final static Object DATA_2_0 = new Object();
  59     private final static Object DATA_2_1 = new Object();
  60 
  61     private ObservableStub dependency1;
  62     private ObservableStub dependency2;
  63 
  64     private MapBindingImpl binding0;
  65     private MapBindingImpl binding1;
  66     private MapBindingImpl binding2;
  67