Search in sources :

Example 1 with NGCustomJSONObjectType

use of com.servoy.j2db.server.ngclient.property.types.NGCustomJSONObjectType in project servoy-client by Servoy.

the class RhinoMapWrapperTest method setUp.

@Before
public void setUp() {
    Context cx = Context.enter();
    TopLevel toplevelScope = new ImporterTopLevel(cx);
    PropertyDescription pd = new PropertyDescriptionBuilder().withName("myCustomObjectProp").withType(new NGCustomJSONObjectType("myCustomObjectType", null)).build();
    PropertyDescription copd = new PropertyDescriptionBuilder().withName("myCustomObjectType").withType(pd.getType()).withProperty("someInt", new PropertyDescriptionBuilder().withName("someInt").withType(IntPropertyType.INSTANCE).build()).build();
    ((NGCustomJSONObjectType) pd.getType()).setCustomJSONDefinition(copd);
    wrappedMapValue = new HashMap<String, Object>();
    wrappedMapValue.put("someInt", 111);
    w = new RhinoMapOrArrayWrapper(wrappedMapValue, null, pd, toplevelScope);
    Context.exit();
}
Also used : Context(org.mozilla.javascript.Context) PropertyDescription(org.sablo.specification.PropertyDescription) ImporterTopLevel(org.mozilla.javascript.ImporterTopLevel) PropertyDescriptionBuilder(org.sablo.specification.PropertyDescriptionBuilder) NGCustomJSONObjectType(com.servoy.j2db.server.ngclient.property.types.NGCustomJSONObjectType) RhinoMapOrArrayWrapper(com.servoy.j2db.server.ngclient.component.RhinoMapOrArrayWrapper) ScriptableObject(org.mozilla.javascript.ScriptableObject) ImporterTopLevel(org.mozilla.javascript.ImporterTopLevel) TopLevel(org.mozilla.javascript.TopLevel) Before(org.junit.Before)

Aggregations

RhinoMapOrArrayWrapper (com.servoy.j2db.server.ngclient.component.RhinoMapOrArrayWrapper)1 NGCustomJSONObjectType (com.servoy.j2db.server.ngclient.property.types.NGCustomJSONObjectType)1 Before (org.junit.Before)1 Context (org.mozilla.javascript.Context)1 ImporterTopLevel (org.mozilla.javascript.ImporterTopLevel)1 ScriptableObject (org.mozilla.javascript.ScriptableObject)1 TopLevel (org.mozilla.javascript.TopLevel)1 PropertyDescription (org.sablo.specification.PropertyDescription)1 PropertyDescriptionBuilder (org.sablo.specification.PropertyDescriptionBuilder)1