Examples of PropertyReferenceImpl


Examples of org.auraframework.impl.expression.PropertyReferenceImpl

        assertEquals("Incorrect value returned from asValue()", testText[0], o.toString());

        tokenizer = TextTokenizer.tokenize(testText[1], null);
        o = tokenizer.asValue(cdh);
        assertTrue("Token value is of wrong type", o instanceof PropertyReferenceImpl);
        PropertyReferenceImpl e = (PropertyReferenceImpl) o;
        assertEquals("Incorrect value returned from asValue()", testText[1], e.toString(true));
    }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

    }

    public void testInvalidLiteralTypeAnnotationInJavaModel() throws Exception {
        Model model = getJavaModelByQualifiedName("java://org.auraframework.impl.java.model.TestModelWithLiteralTypeAnnotation");
        try {
            model.getValue(new PropertyReferenceImpl("string", null));
            fail("Failed to catch invalid type specified for member method in model.");
        } catch (AuraRuntimeException expected) {
        }

    }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

    }

    public void testAuraComponentTypeAnnotationInJavaModel() throws Exception {
        Model model = getJavaModelByQualifiedName("java://org.auraframework.impl.java.model.TestModelWithAuraTypeAnnotation");
        Object value = model.getValue(new PropertyReferenceImpl("auraComponent", null));
        assertTrue(value instanceof Component);
        assertEquals("markup://test:text", ((Component) value).getDescriptor().getQualifiedName());

        /**
         * TODO:W-967767
 
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

        ss6.add(s6);
        assertEachModelMember(model, "setOfSet", ss6);
    }

    private void assertEachModelMember(Model model, String memberName, Object expectedResult) throws Exception {
        Object value = model.getValue(new PropertyReferenceImpl(memberName, null));
        assertEquals("Expected model method to return " + expectedResult.getClass() + " type object.",
                expectedResult.getClass(), value.getClass());
        assertEquals("Model returned unexpected object.", expectedResult, value);
    }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

        Mockito.doReturn(GLOBAL_ACCESS).when(parentDef).getAccess();
        Mockito.doReturn(parentDef).when(this.extendsDescriptor).getDef();
        Mockito.doReturn(DefType.COMPONENT).when(this.extendsDescriptor).getDefType();
       
        this.expressionRefs = Sets.newHashSet();
        this.expressionRefs.add(new PropertyReferenceImpl("v.privateAttribute", null));
        this.attributeDefs = ImmutableMap.of(attrDesc, attrDef);

        buildDefinition().validateReferences();
    }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

        Mockito.doReturn(GLOBAL_ACCESS).when(parentDef).getAccess();
        Mockito.doReturn(DefType.COMPONENT).when(this.extendsDescriptor).getDefType();

        Location exprLocation = new Location("expression", 0);
        this.expressionRefs = Sets.newHashSet();
        this.expressionRefs.add(new PropertyReferenceImpl("v.privateAttribute", exprLocation));
        this.attributeDefs = ImmutableMap.of();

        try {
            buildDefinition().validateReferences();
            fail("Expected an exception when trying to refer to a private attribute in an expression");
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

        Mockito.doReturn(parentDef).when(this.extendsDescriptor).getDef();
        Mockito.doReturn(GLOBAL_ACCESS).when(parentDef).getAccess();
        Mockito.doReturn(DefType.COMPONENT).when(this.extendsDescriptor).getDefType();

        this.expressionRefs = Sets.newHashSet();
        this.expressionRefs.add(new PropertyReferenceImpl("v.privateAttribute", null));
        this.attributeDefs = ImmutableMap.of(attrDesc, attrDef);

        buildDefinition().validateReferences();
    }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

        ModelDef def = javaModelDefDesc.getDef();
        assertNotNull(def);
        Model model = def.newInstance();
        ValueDef vd = def.getMemberByName("nextThing");

        PropertyReferenceImpl refNextThing = new PropertyReferenceImpl("nextThing", new Location("test", 0));
        assertNotNull("Unable to find value def for 'nextThing'", vd);
        assertEquals("nextThing", model.getValue(refNextThing));

        vd = def.getMemberByName("firstThing");
        PropertyReferenceImpl refFirstThing = new PropertyReferenceImpl("firstThing", new Location("test", 1));
        assertNotNull("Unable to find value def for 'firstThing'", vd);
        assertEquals("firstThingDefault", model.getValue(refFirstThing));
    }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

                "java://org.auraframework.impl.java.model.TestModel", ModelDef.class);
        ModelDef mDef = javaModelDefDesc.getDef();
        assertNotNull(mDef);
        Model model = mDef.newInstance();
        try {
            model.getValue(new PropertyReferenceImpl("fooBar", new Location("test", 0)));
            fail("Model should not be able to getValue of a non existing property.");
        } catch (Exception e) {
            checkExceptionStart(e, AuraExecutionException.class, "TestModel: no such property: fooBar",
                    javaModelDefDesc.getName());
        }
        try {
            model.getValue(new PropertyReferenceImpl("firstThi", new Location("test", 0)));
            fail("Model.getValue() on partial matches of property names should not be successful.");
        } catch (Exception e) {
            checkExceptionStart(e, AuraExecutionException.class, "TestModel: no such property: firstThi",
                    javaModelDefDesc.getName());
        }
View Full Code Here

Examples of org.auraframework.impl.expression.PropertyReferenceImpl

    }
   
    public void testReinitializeModel() throws Exception {
        Component cmp = vendor.makeComponent("test:child1", "meh");

        PropertyReferenceImpl propRef = new PropertyReferenceImpl("value", null);
    assertEquals(null, cmp.getModel().getValue(propRef));
       
        setAttribute(cmp, "attr", "some value");

    assertEquals(null, cmp.getModel().getValue(propRef));
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.