Examples of ApplicationValidator


Examples of org.apache.wink.common.internal.application.ApplicationValidator

    private void initProvidersRegistry() {
        // setup OFFactoryRegistry to support default and scope
        LifecycleManagersRegistry ofFactoryRegistry = new LifecycleManagersRegistry();
        ofFactoryRegistry.addFactoryFactory(new ScopeLifecycleManager<Object>());
        providersRegistry = new ProvidersRegistry(ofFactoryRegistry, new ApplicationValidator());

        // process all applications
        for (Application app : config.getApplications()) {
            processApplication(app);
        }
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

        }
    }

    private ProvidersRegistry createProvidersRegistryImpl() {
        ProvidersRegistry providers =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        ;
        return providers;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

        }
    }

    private ProvidersRegistry createProvidersRegistryImpl() {
        ProvidersRegistry providers =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());

        return providers;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

        if (ofFactoryRegistry == null) {
            ofFactoryRegistry = new LifecycleManagersRegistry();
            ofFactoryRegistry.addFactoryFactory(new ScopeLifecycleManager<Object>());
            ofFactoryRegistry.addFactoryFactory(new JSR250LifecycleManager<Object>());
        }
        ApplicationValidator applicationValidator = new ApplicationValidator();
        providersRegistry = new ProvidersRegistry(ofFactoryRegistry, applicationValidator);
        resourceRegistry =
            new ResourceRegistry(ofFactoryRegistry, applicationValidator, properties);
    }
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

        super.setUp();

        LifecycleManagersRegistry ofFactoryRegistry = new LifecycleManagersRegistry();
        ofFactoryRegistry.addFactoryFactory(new ScopeLifecycleManager<Object>());
        ProvidersRegistry providersRegistry =
            new ProvidersRegistry(ofFactoryRegistry, new ApplicationValidator());

        Set<Class<?>> classes = new ApplicationFileLoader(true).getClasses();
        if (classes != null) {
            for (Class<?> cls : classes) {
                if (ProviderMetadataCollector.isProvider(cls)) {
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

    private static class String2Provider extends StringProvider {
    }

    private ProvidersRegistry createProvidersRegistryImpl() {
        ProvidersRegistry providers =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        return providers;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

     * @Consumes( { "abcd/efg, hijk/lmn", "opqr/stu" })
     * @throws Exception
     */
    public void testConsumesAnnotationParsing() throws Exception {
        ProvidersRegistry providersRegistry =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        providersRegistry.addProvider(MyProvider.class);
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyReaders");
        field.setAccessible(true);
        Object messageBodyReaders = field.get(providersRegistry);
        Field field2 = messageBodyReaders.getClass().getSuperclass().getDeclaredField("data");
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

     * @Produces( { "abcd/efg, hijk/lmn", "opqr/stu" })
     * @throws Exception
     */
    public void testProvidesAnnotationParsing() throws Exception {
        ProvidersRegistry providersRegistry =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        providersRegistry.addProvider(MyProvider.class);
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyWriters");
        field.setAccessible(true);
        Object messageBodyWriters = field.get(providersRegistry);
        Field field2 = messageBodyWriters.getClass().getSuperclass().getDeclaredField("data");
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

     *
     * @throws Exception
     */
    public void testGenericTypeInheritanceSorting() throws Exception {
        ProvidersRegistry providersRegistry =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        providersRegistry.addProvider(MyPrioritizedProvider.class);
        providersRegistry.addProvider(MySecondaryProvider.class);
       
        MessageBodyWriter writer = providersRegistry.getMessageBodyWriter(MyStringSub2.class, MyString.class, null, MediaType.WILDCARD_TYPE, null);
        // MyStringSub2 is closer to MyStringSub1, which is writeable by MySecondaryProvider, hence...
View Full Code Here

Examples of org.apache.wink.common.internal.application.ApplicationValidator

     * Thus, we need to ensure the providersCache continues to be instantiated with ConcurrentHashMap.
     */
    public void testProtectionModel() throws Exception {

        // I need the instantiated object providersCache in the abstract private nested class MediaTypeMap, so here we go!
        ProvidersRegistry providersRegistry = new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyReaders");
        field.setAccessible(true);
        Object messageBodyReaders = field.get(providersRegistry);
        Field field2 = messageBodyReaders.getClass().getSuperclass().getDeclaredField("providersCache");
        field2.setAccessible(true);
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.