Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.Model


    public void testConfiguredObjectWithChildAndDepth1()
    {
        final String childAttributeName = "childattribute";
        final String childAttributeValue = "childvalue";

        Model model = createTestModel();
        _converter.setModel(model);

        TestChild mockChild = mock(TestChild.class);
        configureMockToReturnOneAttribute(mockChild, childAttributeName, childAttributeValue);
        when(_configuredObject.getChildren(TestChild.class)).thenReturn(Arrays.asList(mockChild));
View Full Code Here


        assertEquals("Unexpected child attribute value", childAttributeValue, childMap.get(childAttributeName));
    }

    private Model createTestModel()
    {
        Model model = mock(Model.class);
        final List<Class<? extends ConfiguredObject>> list = new ArrayList<Class<? extends ConfiguredObject>>();
        list.add(TestChild.class);
        when(model.getChildTypes(ConfiguredObject.class)).thenReturn(list);
        return model;
    }
View Full Code Here

    public void testConfiguredObjectWithChildAndDepth1()
    {
        final String childAttributeName = "childattribute";
        final String childAttributeValue = "childvalue";

        Model model = createTestModel();
        _converter.setModel(model);

        TestChild mockChild = mock(TestChild.class);
        configureMockToReturnOneAttribute(mockChild, childAttributeName, childAttributeValue);
        when(_configuredObject.getChildren(TestChild.class)).thenReturn(Arrays.asList(mockChild));
View Full Code Here

        assertEquals("Unexpected child attribute value", childAttributeValue, childMap.get(childAttributeName));
    }

    private Model createTestModel()
    {
        Model model = mock(Model.class);
        final List<Class<? extends ConfiguredObject>> list = new ArrayList<Class<? extends ConfiguredObject>>();
        list.add(TestChild.class);
        when(model.getChildTypes(ConfiguredObject.class)).thenReturn(list);
        return model;
    }
View Full Code Here

    {
    }

    private ProtocolType getProtocolType(Map<String, Object> portAttributes, Broker<?> broker)
    {
        Model model = broker.getModel();
        ConfiguredObjectTypeRegistry typeRegistry = model.getTypeRegistry();
        Map<String, ConfiguredObjectAttribute<?, ?>> attributeTypes =
                typeRegistry.getAttributeTypes(Port.class);
        ConfiguredObjectAttribute protocolsAttribute = attributeTypes.get(Port.PROTOCOLS);
        Set<Protocol> protocols = (Set<Protocol>) protocolsAttribute.convert(portAttributes.get(Port.PROTOCOLS),broker);
        ProtocolType protocolType = null;
View Full Code Here

    public void testConfiguredObjectWithChildAndDepth1()
    {
        final String childAttributeName = "childattribute";
        final String childAttributeValue = "childvalue";

        Model model = createTestModel();

        TestChild mockChild = mock(TestChild.class);
        when(mockChild.getModel()).thenReturn(model);
        when(_configuredObject.getModel()).thenReturn(model);
        configureMockToReturnOneAttribute(mockChild, childAttributeName, childAttributeValue);
View Full Code Here

        final String childAttributeValue = "childvalue";
        final String childActualAttributeValue = "${actualvalue}";
        final Map<String,Object> actualContext = Collections.<String,Object>singletonMap("key","value");
        final Set<String> inheritedKeys = new HashSet<>(Arrays.asList("key","inheritedkey"));

        Model model = createTestModel();

        TestChild mockChild = mock(TestChild.class);
        when(mockChild.getModel()).thenReturn(model);
        when(_configuredObject.getModel()).thenReturn(model);
        when(_configuredObject.getAttributeNames()).thenReturn(Collections.singletonList(ConfiguredObject.CONTEXT));
View Full Code Here

    }

    private Model createTestModel()
    {
        Model model = mock(Model.class);
        final List<Class<? extends ConfiguredObject>> list = new ArrayList<Class<? extends ConfiguredObject>>();
        list.add(TestChild.class);
        when(model.getChildTypes(ConfiguredObject.class)).thenReturn(list);
        return model;
    }
View Full Code Here

        Object object = attributes.get(Port.PROTOCOLS);
        if (object == null)
        {
            return null;
        }
        Model model = _parent.getModel();
        ConfiguredObjectTypeRegistry typeRegistry = model.getTypeRegistry();
        Map<String, ConfiguredObjectAttribute<?, ?>> attributeTypes =
                typeRegistry.getAttributeTypes(Port.class);
        ConfiguredObjectAttribute protocolsAttribute = attributeTypes.get(Port.PROTOCOLS);
        return (Set<Protocol>) protocolsAttribute.convert(object,_parent);
View Full Code Here

        Object object = attributes.get(Port.PROTOCOLS);
        if (object == null)
        {
            return null;
        }
        Model model = _parent.getModel();
        ConfiguredObjectTypeRegistry typeRegistry = model.getTypeRegistry();
        Map<String, ConfiguredObjectAttribute<?, ?>> attributeTypes =
                typeRegistry.getAttributeTypes(Port.class);
        ConfiguredObjectAttribute protocolsAttribute = attributeTypes.get(Port.PROTOCOLS);
        return (Set<Protocol>) protocolsAttribute.convert(object,_parent);
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.Model

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.