Package org.mule.test.infrastructure.deployment

Examples of org.mule.test.infrastructure.deployment.FakeMuleServer


    public SystemProperty endpointScheme = new SystemProperty("scheme", "http");

    @Test
    public void verifyClassLoaderIsAppClassLoader() throws Exception
    {
        FakeMuleServer fakeMuleServer = new FakeMuleServer(temporaryFolder.getRoot().getAbsolutePath());
        fakeMuleServer.deployDomainFromClasspathFolder("domain/deployable-domains/http-connector-domain", "domain");
        fakeMuleServer.deployAppFromClasspathFolder("domain/deployable-apps/hello-world-app", HELLO_WORLD_APP);
        fakeMuleServer.deployAppFromClasspathFolder("domain/deployable-apps/hello-mule-app", HELLO_MULE_APP);
        fakeMuleServer.start();
        verifyAppProcessMessageWithAppClassLoader(fakeMuleServer, HELLO_MULE_APP, "http://localhost:%d/service/helloMule");
        verifyAppProcessMessageWithAppClassLoader(fakeMuleServer, HELLO_WORLD_APP, "http://localhost:%d/service/helloWorld");
    }
View Full Code Here


            replaceSystemOutputWithSocketOutput();
            System.out.println("MuleContextProcessApplication attached to log port");
            System.out.println("Creating fake mule server");
            String muleHomeSystemProperty = System.getProperty(MuleProperties.MULE_HOME_DIRECTORY_PROPERTY);
            System.out.println("Using mule home: " + muleHomeSystemProperty);
            FakeMuleServer fakeMuleServer = new FakeMuleServer(muleHomeSystemProperty, retrieveConfiguredCoreExtensions());
            File appsDirectory = fakeMuleServer.getAppsDir();
            System.out.println("Creating test app directory");
            File applicationDirectory = new File(appsDirectory, TEST_APPLICATION_NAME);
            if (!applicationDirectory.exists() && !applicationDirectory.mkdir())
            {
                throw new RuntimeException("Could not create test-app directory to create test application within fake mule serevr");
            }
            System.out.println("Test app directory created");
            System.out.println("Creating app config file");
            String applicationConfiguration = System.getProperty(MuleContextProcessBuilder.CONFIG_FILE_KEY);
            File applicationConfigurationFile = new File(MuleContextProcessApplication.class.getClassLoader().getResource(applicationConfiguration).getFile());
            if (!applicationConfigurationFile.exists())
            {
                throw new RuntimeException("Could not find file for application configuration " + applicationConfiguration);
            }
            FileUtils.copyFile(applicationConfigurationFile, new File(applicationDirectory, MuleServer.DEFAULT_CONFIGURATION));
            System.out.println("Test app config file created");

            ApplicationStartedDeploymentListener applicationStartedDeploymentListener = new ApplicationStartedDeploymentListener();
            fakeMuleServer.addDeploymentListener(applicationStartedDeploymentListener);
            System.out.println("Starting fake mule server");
            fakeMuleServer.start();

            System.out.println("Fake mule server started");
            applicationStartedDeploymentListener.waitUntilApplicationDeployed();
            notifyMuleContextStarted();
View Full Code Here

TOP

Related Classes of org.mule.test.infrastructure.deployment.FakeMuleServer

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.