Package ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory

Examples of ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory.Callback


  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "stringMethod");
    assertEquals(String.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.stringField = FORTY_TWO_STRING;
    assertEquals(FORTY_TWO_STRING, kb.valueInObject(obj));
  }
View Full Code Here


   * Tests for _KeyBinding Setter method bindings
   */
  public void testDefaultImplementation$_keySetBindingForKey$byteMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

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

    kb.setValueInObject(FORTY_TWO_BYTE, obj);
    assertEquals(FORTY_TWO_BYTE, obj.byteObjectField);

    kb = DefaultImplementation._keySetBindingForKey(obj, "byteMethod");
    assertEquals(Byte.TYPE, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_BYTE, obj);
    assertEquals(FORTY_TWO_BYTE.byteValue(), obj.byteField);
  }
View Full Code Here

  }

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

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

    kb.setValueInObject(FORTY_TWO_CHAR, obj);
    assertEquals(FORTY_TWO_CHAR, obj.charObjectField);

    kb = DefaultImplementation._keySetBindingForKey(obj, "charMethod");
    assertEquals(Character.TYPE, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_CHAR, obj);
    assertEquals(FORTY_TWO_CHAR.charValue(), obj.charField);

  }
View Full Code Here

  }

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

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

    kb.setValueInObject(FORTY_TWO_SHORT, obj);
    assertEquals(FORTY_TWO_SHORT, obj.shortObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "shortMethod");
    assertEquals(Short.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_SHORT, obj);
    assertEquals(FORTY_TWO_SHORT.shortValue(), obj.shortField);

  }
View Full Code Here

  }

  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

TOP

Related Classes of ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory.Callback

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.