Examples of FeatureDescriptor


Examples of com.jcloisterzone.ui.theme.FeatureDescriptor

        ImmutablePoint point = pluginGeometry.getMeeplePlacement(tile, piece.getClass(), loc);
        if (point == null) {
            point = defaultGeometry.getMeeplePlacement(tile, piece.getClass(), piece.getLocation());
        }
        if (point == null) {
            logger.warn("No point defined for <" + (new FeatureDescriptor(tile, piece.getClass(), loc)) + ">");
            point =  new ImmutablePoint(0, 0);
        }
        return point;
    }
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

     */
    public FeatureDescriptor getFeatureDescriptor(final String name)
    {
        for (final PropertyReader reader : propertyReaders)
        {
            final FeatureDescriptor descriptor = reader.getFeatureDescriptor(name);
            if (descriptor != null)
            {
                return descriptor;
            }
        }
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

    public FeatureState getFeatureState(final String name)
    {
        FeatureState result;
        try
        {
            final FeatureDescriptor featureDescriptor = propertyManager.getFeatureDescriptor(name);
            result = featureDescriptor.process(contextManager);
        }
        catch (final FlipException ex)
        {
            logger.log(
                    Level.WARNING,
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        featureService = new FeatureServiceImpl(environment);
    }
   
    @Test
    public void testInvokeFeature() {
        FeatureDescriptor featureDescriptor = mock(FeatureDescriptor.class);
        when(featureDescriptor.process(any(ContextManager.class))).thenReturn(FeatureState.ENABLED);
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(featureDescriptor);
       
        assertEquals(FeatureState.ENABLED, featureService.getFeatureState("test"));
       
        verify(propertyReader).getFeatureDescriptor(eq("test"));
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        verify(propertyReader).getFeatureDescriptor(eq("test"));
    }
   
    @Test
    public void testInvokeFeatureDisabled() {
        FeatureDescriptor featureDescriptor = mock(FeatureDescriptor.class);
        when(featureDescriptor.process(any(ContextManager.class))).thenReturn(FeatureState.DISABLED);
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(featureDescriptor);
       
        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test"));
       
        verify(propertyReader).getFeatureDescriptor(eq("test"));
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        verify(propertyReader).getFeatureDescriptor(eq("test"));
    }
   
    @Test
    public void testInvokeFeatureUnknownProperty() {
        FeatureDescriptor featureDescriptor = mock(FeatureDescriptor.class);
        when(featureDescriptor.process(any(ContextManager.class))).thenThrow(new UnknownContextPropertyException());
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(featureDescriptor);
       
        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test"));
    }
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test"));
    }
   
    @Test
    public void testHieraclicalFeaturesChildFailed() {
        FeatureDescriptor item = mock(FeatureDescriptor.class);
        when(item.process(any(ContextManager.class))).thenThrow(new UnknownContextPropertyException());
        when(propertyReader.getFeatureDescriptor(eq("test.item"))).thenReturn(item);

        FeatureDescriptor parent = mock(FeatureDescriptor.class);
        when(parent.process(any(ContextManager.class))).thenReturn(FeatureState.ENABLED);
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(parent);
       
        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test.item"));
    }
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test.item"));
    }
   
    @Test
    public void testHieraclicalFeaturesChildAndParentHaveTheSameStatus() {
        FeatureDescriptor item = mock(FeatureDescriptor.class);
        when(item.process(any(ContextManager.class))).thenReturn(FeatureState.ENABLED);
        when(propertyReader.getFeatureDescriptor(eq("test.item"))).thenReturn(item);

        FeatureDescriptor parent = mock(FeatureDescriptor.class);
        when(parent.process(any(ContextManager.class))).thenReturn(FeatureState.ENABLED);
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(parent);
       
        assertEquals(FeatureState.ENABLED, featureService.getFeatureState("test.item"));
    }
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        assertEquals(FeatureState.ENABLED, featureService.getFeatureState("test.item"));
    }
   
    @Test
    public void testHieraclicalFeaturesChildAndParentHaveDifferentStatuses() {
        FeatureDescriptor item = mock(FeatureDescriptor.class);
        when(item.process(any(ContextManager.class))).thenReturn(FeatureState.ENABLED);
        when(propertyReader.getFeatureDescriptor(eq("test.item"))).thenReturn(item);

        FeatureDescriptor parent = mock(FeatureDescriptor.class);
        when(parent.process(any(ContextManager.class))).thenReturn(FeatureState.DISABLED);
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(parent);
       
        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test.item"));
    }
View Full Code Here

Examples of com.tacitknowledge.flip.model.FeatureDescriptor

        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test.item"));
    }
   
    @Test
    public void testHieraclicalFeaturesChildAndParentHaveDifferentStatuses2() {
        FeatureDescriptor item = mock(FeatureDescriptor.class);
        when(item.process(any(ContextManager.class))).thenReturn(FeatureState.DISABLED);
        when(propertyReader.getFeatureDescriptor(eq("test.item"))).thenReturn(item);

        FeatureDescriptor parent = mock(FeatureDescriptor.class);
        when(parent.process(any(ContextManager.class))).thenReturn(FeatureState.ENABLED);
        when(propertyReader.getFeatureDescriptor(eq("test"))).thenReturn(parent);
       
        assertEquals(FeatureState.DISABLED, featureService.getFeatureState("test.item"));
    }
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.