Package com.eclipsesource.tabris.passepartout

Examples of com.eclipsesource.tabris.passepartout.QueryListener


  }

  @Test
  public void testNotifiesListenerActivated() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    notifier.addQueryListener( query, listener );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 0, 0 ) ) );
View Full Code Here


  }

  @Test
  public void testNotifiesMultipleValidListenerActivated() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryListener listener2 = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    Query query2 = new QueryImpl( new AlwaysTrueContidtion() ).and( new MaxWidthCondition( px( 99 ) ) );
    notifier.addQueryListener( query, listener );
    notifier.addQueryListener( query2, listener2 );
View Full Code Here

  }

  @Test
  public void testNotifiesListenerActivatedOnce() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    notifier.addQueryListener( query, listener );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 0, 0 ) ) );
    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 0, 0 ) ) );
View Full Code Here

  }

  @Test
  public void testDeactivatesListenerOnQueryChange() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new MaxWidthCondition( px( 100 ) ) );
    notifier.addQueryListener( query, listener );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 99, 0 ) ) );
    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 199, 0 ) ) );
View Full Code Here

  }

  @Test
  public void testDeactivatesListenerOnQueryChangeAndActivatesValidOne() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryListener listener2 = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new MaxWidthCondition( px( 100 ) ) );
    QueryImpl query2 = new QueryImpl( new MinWidthCondition( px( 101 ) ) );
    notifier.addQueryListener( query, listener );
    notifier.addQueryListener( query2, listener2 );
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.passepartout.QueryListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.