Package de.danielbechler.diff.access

Examples of de.danielbechler.diff.access.Accessor


  }

  @Test
  public void testAssertThat_child_at_property_names_does_exist_succeeds_when_child_exists()
  {
    final Accessor accessor = mock(Accessor.class);
    when(accessor.getElementSelector()).thenReturn(new BeanPropertyElementSelector("value"));
    final DiffNode node = new DiffNode(ObjectWithString.class);
    final DiffNode child = new DiffNode(node, accessor, String.class);
    node.addChild(child);
    assertThat(node).child("value").doesExist();
  }
View Full Code Here


    comparisonStrategy.compare(collectionNode, collectionInstances.getType(), collectionInstances.getWorking(Collection.class), collectionInstances.getBase(Collection.class));
  }

  private static DiffNode newNode(final DiffNode parentNode, final Instances collectionInstances)
  {
    final Accessor accessor = collectionInstances.getSourceAccessor();
    final Class<?> type = collectionInstances.getType();
    return new DiffNode(parentNode, accessor, type);
  }
View Full Code Here

                final Instances collectionInstances,
                final Iterable<?> items)
  {
    for (final Object item : items)
    {
      final Accessor itemAccessor = new CollectionItemAccessor(item);
      differDispatcher.dispatch(collectionNode, collectionInstances, itemAccessor);
    }
  }
View Full Code Here

  }

  @Test
  public void getPropertyAnnotation_should_return_null_if_accessor_is_not_property_accessor()
  {
    final Accessor propertyAccessor = Mockito.mock(Accessor.class);

    final ObjectDiffTest annotation = new DiffNode(propertyAccessor, Object.class).getPropertyAnnotation(ObjectDiffTest.class);

    assertThat(annotation).isNull();
  }
View Full Code Here

  }

  @Test
  public void isPropertyAware_returns_false()
  {
    final Accessor notAPropertyAwareAccessor = Mockito.mock(Accessor.class);

    final DiffNode node = new DiffNode(notAPropertyAwareAccessor, Object.class);

    assertThat(node.isPropertyAware()).isFalse();
  }
View Full Code Here

TOP

Related Classes of de.danielbechler.diff.access.Accessor

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.