Package org.springframework.data.mapping.context.AbstractMappingContext.PersistentPropertyFilter

Examples of org.springframework.data.mapping.context.AbstractMappingContext.PersistentPropertyFilter.PropertyMatch


*/
public class PropertyMatchUnitTests {

  @Test(expected = IllegalArgumentException.class)
  public void rejectsBothParametersBeingNull() {
    new PropertyMatch(null, null);
  }
View Full Code Here


  }

  @Test
  public void matchesFieldByConcreteNameAndType() throws Exception {

    PropertyMatch match = new PropertyMatch("name", "java.lang.String");
    assertThat(match.matches("this$0", Object.class), is(false));
    assertThat(match.matches("this$1", Object.class), is(false));
    assertThat(match.matches("name", String.class), is(true));
  }
View Full Code Here

  }

  @Test
  public void matchesFieldByNamePattern() throws Exception {

    PropertyMatch match = new PropertyMatch("this\\$.*", "java.lang.Object");
    assertThat(match.matches("this$0", Object.class), is(true));
    assertThat(match.matches("this$1", Object.class), is(true));
    assertThat(match.matches("name", String.class), is(false));
  }
View Full Code Here

  }

  @Test
  public void matchesFieldByNameOnly() throws Exception {

    PropertyMatch match = new PropertyMatch("this\\$.*", null);
    assertThat(match.matches("this$0", Object.class), is(true));
    assertThat(match.matches("this$1", Object.class), is(true));
    assertThat(match.matches("name", String.class), is(false));
  }
View Full Code Here

  }

  @Test
  public void matchesFieldByTypeNameOnly() throws Exception {

    PropertyMatch match = new PropertyMatch(null, "java.lang.Object");
    assertThat(match.matches("this$0", Object.class), is(true));
    assertThat(match.matches("this$1", Object.class), is(true));
    assertThat(match.matches("name", String.class), is(false));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.mapping.context.AbstractMappingContext.PersistentPropertyFilter.PropertyMatch

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.