Package com.tacitknowledge.flip

Examples of com.tacitknowledge.flip.FeatureService


    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        FeatureServiceReflectionFactory factory = new FeatureServiceReflectionFactory();
        FeatureService featureService = factory.createFeatureService("com.tacitknowledge.flip");
        FlipContext.setFeatureService(featureService);
        Logger.getAnonymousLogger().warning("HHHHHHHHHHHHHEEEEEEEEEEEELLLLOOOOOOOOOOOO");
       
//        WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
//       
View Full Code Here


        assertNotNull(context.containsBeanDefinition("featureService"));
        BeanDefinition beanDefinition = context.getBeanDefinition("featureService");
        assertEquals("featureServiceFactory", beanDefinition.getFactoryBeanName());
        assertEquals("createFeatureService", beanDefinition.getFactoryMethodName());
       
        FeatureService featureService = context.getBean("featureService", FeatureService.class);
        assertNotNull(featureService);
    }
View Full Code Here

    public void init(ServletConfig config) throws ServletException
    {
        this.config = config;
        String packagePath = config.getInitParameter(PACKAGE_PATH);
        FeatureServiceReflectionFactory factory = new FeatureServiceReflectionFactory();
        FeatureService service = factory.createFeatureService(getPackagesToSearch(packagePath));
        FlipContext.setFeatureService(service);
    }
View Full Code Here

     * {@inheritDoc }
     */
    @Override
    public int doStartTag() throws JspException
    {
        FeatureService service = getFeatureService();
        if (service == null)
        {
            throw new FlipException("The FeatureService has not been instantiated.");
        }
        return service.getFeatureState(feature) == myState ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY;
    }
View Full Code Here

    @Test
    public void testGetFeatureServiceByPriorityBetweenAttributeAndRequestAttribute()
    {
        when(request.getAttribute(eq(JspFlipTag.FEATURE_SERVICE_ATTRIBUTE))).thenReturn(featureService);

        final FeatureService paramService = mock(FeatureService.class);
        tag.setService(paramService);

        assertEquals(paramService, tag.getFeatureService());
    }
View Full Code Here

    @Test
    public void testGetFeatureServiceByPriorityBetweenREquestAttributeAndWebContext()
    {
        when(request.getAttribute(eq(JspFlipTag.FEATURE_SERVICE_ATTRIBUTE))).thenReturn(featureService);

        final FeatureService paramService = mock(FeatureService.class);
        FlipContext.setFeatureService(paramService);

        assertEquals(featureService, tag.getFeatureService());
    }
View Full Code Here

TOP

Related Classes of com.tacitknowledge.flip.FeatureService

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.