Package org.springframework.expression

Examples of org.springframework.expression.PropertyAccessor.canRead()


  @Test
  public void accessingNullPropertyViaReflection_SPR5663() throws AccessException {
    PropertyAccessor propertyAccessor = new ReflectivePropertyAccessor();
    EvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
    assertFalse(propertyAccessor.canRead(context, null, "abc"));
    assertFalse(propertyAccessor.canWrite(context, null, "abc"));
    try {
      propertyAccessor.read(context, null, "abc");
      fail("Should have failed with an AccessException");
    }
View Full Code Here


//    assertTrue(rpr.canRead(ctx, t, "property"));
//    assertEquals("hello",rpr.read(ctx, t, "property").getValue());
//    assertEquals("hello",rpr.read(ctx, t, "property").getValue()); // cached accessor used

    PropertyAccessor optA = rpr.createOptimalAccessor(ctx, t, "property");
    assertTrue(optA.canRead(ctx, t, "property"));
    assertFalse(optA.canRead(ctx, t, "property2"));
    try {
      optA.canWrite(ctx, t, "property");
      fail();
    }
View Full Code Here

//    assertEquals("hello",rpr.read(ctx, t, "property").getValue());
//    assertEquals("hello",rpr.read(ctx, t, "property").getValue()); // cached accessor used

    PropertyAccessor optA = rpr.createOptimalAccessor(ctx, t, "property");
    assertTrue(optA.canRead(ctx, t, "property"));
    assertFalse(optA.canRead(ctx, t, "property2"));
    try {
      optA.canWrite(ctx, t, "property");
      fail();
    }
    catch (UnsupportedOperationException uoe) {
View Full Code Here

    catch (UnsupportedOperationException uoe) {
      // success
    }

    optA = rpr.createOptimalAccessor(ctx, t, "field");
    assertTrue(optA.canRead(ctx, t, "field"));
    assertFalse(optA.canRead(ctx, t, "field2"));
    try {
      optA.canWrite(ctx, t, "field");
      fail();
    }
View Full Code Here

      // success
    }

    optA = rpr.createOptimalAccessor(ctx, t, "field");
    assertTrue(optA.canRead(ctx, t, "field"));
    assertFalse(optA.canRead(ctx, t, "field2"));
    try {
      optA.canWrite(ctx, t, "field");
      fail();
    }
    catch (UnsupportedOperationException uoe) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.