Package com.webobjects.foundation.NSKeyValueCoding

Examples of com.webobjects.foundation.NSKeyValueCoding._KeyBinding


  }

  public void testDefaultImplementation$_keySetBindingForKey$integerMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "integerMethod");
    assertEquals(Integer.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO, obj);
    assertEquals(FORTY_TWO, obj.integerField);

    kb = DefaultImplementation._keySetBindingForKey(obj, "intMethod");
    assertEquals(Integer.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO, obj);
    assertEquals(FORTY_TWO.intValue(), obj.intField);
  }
View Full Code Here


  }

  public void testDefaultImplementation$_keySetBindingForKey$longMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "longObjectMethod");
    assertEquals(Long.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_LONG, obj);
    assertEquals(FORTY_TWO_LONG, obj.longObjectField);

    kb = DefaultImplementation._keySetBindingForKey(obj, "longMethod");
    assertEquals(Long.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_LONG, obj);
    assertEquals(FORTY_TWO_LONG.longValue(), obj.longField);

  }
View Full Code Here

  }

  public void testDefaultImplementation$_keySetBindingForKey$floatMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "floatObjectMethod");
    assertEquals(Float.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_FLOAT, obj);
    assertEquals(FORTY_TWO_FLOAT, obj.floatObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "floatMethod");
    assertEquals(Float.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_FLOAT, obj);
    assertEquals(FORTY_TWO_FLOAT, obj.floatField);
  }
View Full Code Here

  }

  public void testDefaultImplementation$_keySetBindingForKey$doubleMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "doubleObjectMethod");
    assertEquals(Double.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_DOUBLE, obj);
    assertEquals(FORTY_TWO_DOUBLE, obj.doubleObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "doubleMethod");
    assertEquals(Double.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_DOUBLE, obj);
    assertEquals(FORTY_TWO_DOUBLE, obj.doubleField);
  }
View Full Code Here

  }

  public void testDefaultImplementation$_keySetBindingForKey$booleanMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "booleanObjectMethod");
    assertEquals(Boolean.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(true, obj);
    assertTrue(obj.booleanObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "booleanMethod");
    assertEquals(Boolean.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(true, obj);
    assertTrue(obj.booleanField);
  }
View Full Code Here

  }
 
  public void testDefaultImplementation$_keySetBindingForKey$stringMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "stringMethod");
    assertEquals(String.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_STRING, obj);
    assertEquals(FORTY_TWO_STRING, obj.stringField);
  }
View Full Code Here

        _KeyBindingFactory.FieldLookup,
        _KeyBindingFactory.MethodLookup,
        _KeyBindingFactory.UnderbarMethodLookup,
        _KeyBindingFactory.UnderbarFieldLookup,
        _KeyBindingFactory.OtherStorageLookup };
    _KeyBinding binding = NSKeyValueCoding.DefaultImplementation._createKeyGetBindingForKey(obj, "knownKey", lookupOrder);
    assertEquals(4, binding.valueInObject(obj));
  }
View Full Code Here

  }
 
  public void testDefaultImplementation$_keySetBindingForKey$floatField() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "floatObjectField");
    assertEquals(Float.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_FLOAT, obj);
    assertEquals(FORTY_TWO_FLOAT, obj.floatObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "floatField");
    assertEquals(Float.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_FLOAT, obj);
    assertEquals(FORTY_TWO_FLOAT.floatValue(), obj.floatField);
  }
View Full Code Here

  }
 
  public void testDefaultImplementation$_keySetBindingForKey$doubleField() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "doubleObjectField");
    assertEquals(Double.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_DOUBLE, obj);
    assertEquals(FORTY_TWO_DOUBLE, obj.doubleObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "doubleField");
    assertEquals(Double.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_DOUBLE, obj);
    assertEquals(FORTY_TWO_DOUBLE.doubleValue(), obj.doubleField);
  }
View Full Code Here

  }
 
  public void testDefaultImplementation$_keySetBindingForKey$booleanField() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "booleanObjectField");
    assertEquals(Boolean.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(true, obj);
    assertTrue(obj.booleanObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "booleanField");
    assertEquals(Boolean.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(true, obj);
    assertTrue(obj.booleanField);
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSKeyValueCoding._KeyBinding

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.