Package org.apache.wink.common.internal.application

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


        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)) {
                    providersRegistry.addProvider(cls);
                }
View Full Code Here


        try {
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
   
                public Object run() throws FileNotFoundException{
                    final Set<Class<?>> classes =
                        new ApplicationFileLoader(loadWinkApplications).getClasses();
   
                    applications(new WinkApplication() {
                        @Override
                        public Set<Class<?>> getClasses() {
                            return classes;
View Full Code Here

public class HelloWorldTest extends MockServletInvocationTest {

    @Override
    protected Class<?>[] getClasses() {
        try {
            Set<Class<?>> classes = new ApplicationFileLoader("application").getClasses();
            Class<?>[] classesArray = new Class[classes.size()];
            return classes.toArray(classesArray);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

public abstract class QADefectsTest extends MockServletInvocationTest {

    @Override
    protected Class<?>[] getClasses() {
        try {
            Set<Class<?>> classes = new ApplicationFileLoader("application").getClasses();
            Class<?>[] classesArray = new Class[classes.size()];
            return classes.toArray(classesArray);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

        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)) {
                    providersRegistry.addProvider(cls);
                }
View Full Code Here

import junit.framework.TestCase;

public class ApplicationFileLoaderTest extends TestCase {

    public void testDefault() throws FileNotFoundException {
        ApplicationFileLoader applicationFileLoader = new ApplicationFileLoader();
        Set<Class<?>> classes = applicationFileLoader.getClasses();
        assertTrue(classes
            .contains(org.apache.wink.common.internal.providers.entity.FileProvider.class));
        assertTrue(classes
            .contains(org.apache.wink.common.internal.providers.entity.StringProvider.class));
        assertTrue(classes
View Full Code Here

            .contains(org.apache.wink.common.internal.providers.entity.ByteArrayProvider.class));
    }

    public void testFileNotFound() {
        try {
            new ApplicationFileLoader("noSuchFile");
        } catch (FileNotFoundException e) {
            return;
        }
        fail("Should be file not found exception!");
    }
View Full Code Here

        }
        fail("Should be file not found exception!");
    }

    public void testCustomFile() throws FileNotFoundException {
        ApplicationFileLoader applicationFileLoader =
            new ApplicationFileLoader(
                                      "org//apache//wink//common//internal//application//custom.app");

        Iterator<Class<?>> iterator = applicationFileLoader.getClasses().iterator();
        assertEquals(org.apache.wink.common.internal.providers.entity.FileProvider.class, iterator
            .next());
        assertEquals(org.apache.wink.common.internal.providers.entity.SourceProvider.DOMSourceProvider.class,
                     iterator.next());
        assertFalse(iterator.hasNext());
View Full Code Here

public class HelloWorldTest extends MockServletInvocationTest {

    @Override
    protected Class<?>[] getClasses() {
        try {
            Set<Class<?>> classes = new ApplicationFileLoader("application").getClasses();
            Class<?>[] classesArray = new Class[classes.size()];
            return classes.toArray(classesArray);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.application.ApplicationFileLoader

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.