Package org.auraframework.def

Examples of org.auraframework.def.InterfaceDef


    public void testInterfaceDefHandlerWithInvalidChildTag() throws Exception {
        XMLParser parser = XMLParser.getInstance();
        DefDescriptor<InterfaceDef> descriptor = DefDescriptorImpl.getInstance("test:fakeparser", InterfaceDef.class);
        StringSource<InterfaceDef> source = new StringSource<>(descriptor,
                "<aura:interface><aura:foo/></aura:interface>", "myID", Format.XML);
        InterfaceDef id = parser.parse(descriptor, source);
        try {
            id.validateDefinition();
            fail("Should have thrown AuraException aura:foo isn't a valid child tag for aura:interface");
        } catch (InvalidDefinitionException e) {

        }
    }
View Full Code Here


    public void testInterfaceDefHandlerWithTextBetweenTag() throws Exception {
        XMLParser parser = XMLParser.getInstance();
        DefDescriptor<InterfaceDef> descriptor = DefDescriptorImpl.getInstance("test:fakeparser", InterfaceDef.class);
        StringSource<InterfaceDef> source = new StringSource<>(descriptor,
                "<aura:interface>Invalid text</aura:interface>", "myID", Format.XML);
        InterfaceDef id = parser.parse(descriptor, source);
        try {
            id.validateDefinition();
            fail("Should have thrown AuraException because text is between aura:interface tags");
        } catch (InvalidDefinitionException e) {

        }
    }
View Full Code Here

        }
    }

    public void testValidateReferences() throws Exception {
        FakeRegistry fake = createFakeRegistry();
        InterfaceDef ed = vendor.makeInterfaceDef();
        InterfaceDef extendsID = vendor.makeInterfaceDef(vendor.getParentInterfaceDefDescriptor());
        fake.putDefinition(extendsID);
        fake.putDefinition(vendor.makeEventDef());
        ed.validateReferences();
    }
View Full Code Here

    }

    public void testGetAttributeDefs() throws Exception {
        Set<DefDescriptor<InterfaceDef>> extendsIntf = new HashSet<>();
        extendsIntf.add(vendor.makeInterfaceDefDescriptor("test:testinterfaceparent"));
        InterfaceDef id = vendor.makeInterfaceDef(extendsIntf);
        Map<DefDescriptor<AttributeDef>, AttributeDef> attributes = id.getAttributeDefs();
        assertEquals(2, attributes.size());
        assertTrue("Attribute from parent should be in the map",
                attributes.containsKey(DefDescriptorImpl.getInstance("mystring", AttributeDef.class)));
        assertTrue("Attribute from child should be in the map",
                attributes.containsKey(DefDescriptorImpl.getInstance(vendor.getAttributeName(), AttributeDef.class)));
View Full Code Here

        DefDescriptor<InterfaceDef> extendsSelf = addSourceAutoCleanup(InterfaceDef.class, "");
        StringSource<?> source = (StringSource<?>) getSource(extendsSelf);
        source.addOrUpdate(String.format("<aura:interface extends='%s'> </aura:interface>",
                extendsSelf.getDescriptorName()));
        try {
            InterfaceDef def = extendsSelf.getDef();
            def.validateReferences();
            fail("An interface should not be able to extend itself.");
        } catch (InvalidDefinitionException expected) {
            assertEquals(extendsSelf.getQualifiedName() + " cannot extend itself", expected.getMessage());
        }
    }
View Full Code Here

    public void testExtendsNonExistent() {
        DefDescriptor<InterfaceDef> cmpDesc = addSourceAutoCleanup(InterfaceDef.class,
                "<aura:interface extends='aura:iDontExist'></aura:interface>");
        try {
            // Aura.getInstanceService().getInstance(cmpDesc.getDescriptorName(), ComponentDef.class);
            InterfaceDef def = cmpDesc.getDef();
            def.validateReferences();
            fail("Did not get expected exception: " + DefinitionNotFoundException.class.getName());
        } catch (Exception e) {
            checkExceptionFull(e, DefinitionNotFoundException.class,
                    "No INTERFACE named markup://aura:iDontExist found : [" + cmpDesc.getQualifiedName()+"]",
                    cmpDesc.getQualifiedName());
View Full Code Here

TOP

Related Classes of org.auraframework.def.InterfaceDef

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.