Package com.tacitknowledge.flip.fixtures

Examples of com.tacitknowledge.flip.fixtures.TestContextProvider


    @Before
    public void setUp() {
        Environment environment = new Environment();
       
        propertyReader = mock(PropertyReader.class);
        contextProvider = new TestContextProvider();
        environment.setPropertyReaders(Collections.singletonList(propertyReader));
        environment.setContextProviders(Collections.singletonList(contextProvider));
       
        featureService = new FeatureServiceImpl(environment);
    }
View Full Code Here


    private Environment environment;
   
    @Before
    public void setUp() {
        environment = new Environment();
        environment.getContextProviders().add(new TestContextProvider());
        contextManager = new ContextManager(environment);
    }
View Full Code Here

        contextDescriptorFactory = new ContextDescriptorFactory();
    }
   
    @Test
    public void testGetDescriptorForAnnotatedClass() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertEquals("test", contextDescriptor.getName());
        assertEquals(contextProvider, contextDescriptor.getContext());
    }
View Full Code Here

        assertNull(contextDescriptorFactory.createContextDescriptor(new Integer("1")));
    }

    @Test
    public void testGetSimpleMethodAsProperty() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNotNull(contextDescriptor.getProperties().get("hello"));
        assertEquals("hello", contextDescriptor.getProperties().get("hello").getName());
    }
View Full Code Here

        assertEquals("hello", contextDescriptor.getProperties().get("hello").getName());
    }
   
    @Test
    public void testObtainNullForVoidMethod() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNull(contextDescriptor.getProperties().get("ignoreVoidMethod"));
    }
View Full Code Here

        assertNull(contextDescriptor.getProperties().get("ignoreVoidMethod"));
    }
   
    @Test
    public void testObtainNullForMethodWithParams() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNull(contextDescriptor.getProperties().get("methodWithParams"));
    }
View Full Code Here

        assertNull(contextDescriptor.getProperties().get("methodWithParams"));
    }
   
    @Test
    public void testGetMethodThatIsAnnotatedAsContextProperty() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNotNull(contextDescriptor.getProperties().get("intKey"));
        assertEquals("getIntegerValue", contextDescriptor.getProperties().get("intKey").getName());
    }
View Full Code Here

        assertEquals("getIntegerValue", contextDescriptor.getProperties().get("intKey").getName());
    }

    @Test
    public void testGetMethodThatIsGetter() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNotNull(contextDescriptor.getProperties().get("value"));
        assertEquals("getValue", contextDescriptor.getProperties().get("value").getName());
    }
View Full Code Here

        assertEquals("getValue", contextDescriptor.getProperties().get("value").getName());
    }
   
    @Test
    public void testGetMethodThatIsBooleanGetter() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNotNull(contextDescriptor.getProperties().get("booleanValue"));
        assertEquals("isBooleanValue", contextDescriptor.getProperties().get("booleanValue").getName());
        assertEquals(Boolean.TYPE, contextDescriptor.getProperties().get("booleanValue").getReturnType());
View Full Code Here

        assertEquals(Boolean.TYPE, contextDescriptor.getProperties().get("booleanValue").getReturnType());
    }
   
    @Test
    public void testGetMethodThatIsBooleanObjectGetter() {
        TestContextProvider contextProvider = new TestContextProvider();
        ContextDescriptor contextDescriptor = contextDescriptorFactory.createContextDescriptor(contextProvider);
       
        assertNotNull(contextDescriptor.getProperties().get("booleanObjectValue"));
        assertEquals("isBooleanObjectValue", contextDescriptor.getProperties().get("booleanObjectValue").getName());
        assertEquals(Boolean.class, contextDescriptor.getProperties().get("booleanObjectValue").getReturnType());
View Full Code Here

TOP

Related Classes of com.tacitknowledge.flip.fixtures.TestContextProvider

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.