modules/base/src/test/java/test/javafx/beans/property/ListPropertyBaseTest.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.beans.property;
  27 
  28 import java.util.Arrays;
  29 import javafx.beans.InvalidationListenerMock;
  30 import javafx.beans.value.ChangeListenerMock;
  31 import javafx.beans.value.ObservableObjectValueStub;
  32 import javafx.collections.FXCollections;
  33 import javafx.collections.MockListObserver;
  34 import javafx.collections.ObservableList;
  35 import org.junit.Before;
  36 import org.junit.Test;
  37 
  38 import java.util.Collections;
  39 import java.util.List;
  40 import javafx.beans.Observable;
  41 import javafx.collections.Person;



  42 
  43 import static org.junit.Assert.*;
  44 
  45 public class ListPropertyBaseTest {
  46 
  47     private static final Object NO_BEAN = null;
  48     private static final String NO_NAME_1 = null;
  49     private static final String NO_NAME_2 = "";
  50     private static final ObservableList<Object> UNDEFINED = FXCollections.observableArrayList();
  51     private static final ObservableList<Object> VALUE_1a = FXCollections.observableArrayList();
  52     private static final ObservableList<Object> VALUE_1b = FXCollections.observableArrayList(new Object());
  53     private static final ObservableList<Object> VALUE_2a = FXCollections.observableArrayList(new Object(), new Object());
  54     private static final ObservableList<Object> VALUE_2b = FXCollections.observableArrayList(new Object(), new Object(), new Object());
  55     private static final List<Object> EMPTY_LIST = Collections.emptyList();
  56     private ListPropertyMock property;
  57     private InvalidationListenerMock invalidationListener;
  58     private ChangeListenerMock<ObservableList<Object>> changeListener;
  59     private MockListObserver<Object> listChangeListener;
  60 
  61     @Before




   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.beans.property;
  27 
  28 import java.util.Arrays;
  29 import test.javafx.beans.InvalidationListenerMock;
  30 import test.javafx.beans.value.ChangeListenerMock;
  31 import javafx.beans.value.ObservableObjectValueStub;
  32 import javafx.collections.FXCollections;
  33 import test.javafx.collections.MockListObserver;
  34 import javafx.collections.ObservableList;
  35 import org.junit.Before;
  36 import org.junit.Test;
  37 
  38 import java.util.Collections;
  39 import java.util.List;
  40 import javafx.beans.Observable;
  41 import javafx.beans.property.ListProperty;
  42 import javafx.beans.property.ListPropertyBase;
  43 import javafx.beans.property.SimpleListProperty;
  44 import test.javafx.collections.Person;
  45 
  46 import static org.junit.Assert.*;
  47 
  48 public class ListPropertyBaseTest {
  49 
  50     private static final Object NO_BEAN = null;
  51     private static final String NO_NAME_1 = null;
  52     private static final String NO_NAME_2 = "";
  53     private static final ObservableList<Object> UNDEFINED = FXCollections.observableArrayList();
  54     private static final ObservableList<Object> VALUE_1a = FXCollections.observableArrayList();
  55     private static final ObservableList<Object> VALUE_1b = FXCollections.observableArrayList(new Object());
  56     private static final ObservableList<Object> VALUE_2a = FXCollections.observableArrayList(new Object(), new Object());
  57     private static final ObservableList<Object> VALUE_2b = FXCollections.observableArrayList(new Object(), new Object(), new Object());
  58     private static final List<Object> EMPTY_LIST = Collections.emptyList();
  59     private ListPropertyMock property;
  60     private InvalidationListenerMock invalidationListener;
  61     private ChangeListenerMock<ObservableList<Object>> changeListener;
  62     private MockListObserver<Object> listChangeListener;
  63 
  64     @Before