Package org.auraframework.impl.expression

Examples of org.auraframework.impl.expression.PropertyReferenceImpl$Serializer


        LocaleValueProvider lvp = new LocaleValueProvider();
        for (LocaleProperty lp : LocaleProperty.values()) {
            lvp.validate(lp.getRef());
        }

        PropertyReference property = new PropertyReferenceImpl("badProperty", null);
        try {
            lvp.validate(property);
            fail("Expected InvalidExpressionException for " + property);
        } catch (InvalidExpressionException e) {
            assertEquals("No property on $Locale for key: " + property,
View Full Code Here


  public void testGetValueUndefinedProperty() throws Exception {
    AuraContext context = Aura.getContextService().getCurrentContext();
        context.setRequestedLocales(Arrays.asList(Locale.UK));
      LocaleValueProvider lvp = new LocaleValueProvider();
      assertEquals(null,
                lvp.getValue(new PropertyReferenceImpl("ISO3Language", null))); // undefined
                                                                                // property
    }
View Full Code Here

        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

    }

    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

    }

    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

        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

        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

        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

        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

        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

TOP

Related Classes of org.auraframework.impl.expression.PropertyReferenceImpl$Serializer

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.