Package org.airavata.appcatalog.cpi

Examples of org.airavata.appcatalog.cpi.ApplicationInterface


    }

    @Test
    public void testAppInterface(){
        try {
            ApplicationInterface appInterface = appcatalog.getApplicationInterface();
            ApplicationInterfaceDescription description = new ApplicationInterfaceDescription();
            String wrfModuleId = addAppModule("WRF");
            String amberModuleId = addAppModule("AMBER");
            List<String> modules = new ArrayList<String>();
            modules.add(wrfModuleId);
            modules.add(amberModuleId);
            InputDataObjectType appInput1 = createAppInput("input1", "input1", DataType.STRING);
            InputDataObjectType appInput2 = createAppInput("input2", "input2", DataType.INTEGER);
            List<InputDataObjectType> inputs = new ArrayList<InputDataObjectType>();
            inputs.add(appInput1);
            inputs.add(appInput2);
            OutputDataObjectType output1 = createAppOutput("output1", "", DataType.STRING);
            OutputDataObjectType output2 = createAppOutput("output2", "", DataType.STRING);
            List<OutputDataObjectType> outputs = new ArrayList<OutputDataObjectType>();
            outputs.add(output1);
            outputs.add(output2);
            description.setApplicationName("testApplication");
            description.setApplicationDesription("my testApplication");
            description.setApplicationModules(modules);
            description.setApplicationInputs(inputs);
            description.setApplicationOutputs(outputs);
            String appID = appInterface.addApplicationInterface(description);
            System.out.println("********** application id ************* : " + appID);
            ApplicationInterfaceDescription ainterface = null;
            if (appInterface.isApplicationInterfaceExists(appID)){
                ainterface = appInterface.getApplicationInterface(appID);
                System.out.println("********** application name ************* : " + ainterface.getApplicationName());
                System.out.println("********** application description ************* : " + ainterface.getApplicationDesription());
            }
            ApplicationModule wrfModule = appInterface.getApplicationModule(wrfModuleId);
            System.out.println("********** WRF module name ************* : " + wrfModule.getAppModuleName());
            ApplicationModule amberModule = appInterface.getApplicationModule(amberModuleId);
            System.out.println("********** Amber module name ************* : " + amberModule.getAppModuleName());

            List<InputDataObjectType> applicationInputs = appInterface.getApplicationInputs(appID);
            System.out.println("********** App Input size ************* : " + applicationInputs.size());

            List<OutputDataObjectType> applicationOutputs = appInterface.getApplicationOutputs(appID);
            System.out.println("********** App output size ************* : " + applicationOutputs.size());

            description.setApplicationName("testApplication2");
            appInterface.updateApplicationInterface(appID, description);
            if (appInterface.isApplicationInterfaceExists(appID)){
                ainterface = appInterface.getApplicationInterface(appID);
                System.out.println("********** updated application name ************* : " + ainterface.getApplicationName());
            }

            wrfModule.setAppModuleVersion("1.0.1");
            appInterface.updateApplicationModule(wrfModuleId, wrfModule);
            wrfModule = appInterface.getApplicationModule(wrfModuleId);
            System.out.println("********** Updated WRF module version ************* : " + wrfModule.getAppModuleVersion());

            Map<String, String> filters = new HashMap<String, String>();
            filters.put(AbstractResource.ApplicationInterfaceConstants.APPLICATION_NAME, "testApplication2");
            List<ApplicationInterfaceDescription> apps = appInterface.getApplicationInterfaces(filters);
            System.out.println("********** Size og app interfaces ************* : " + apps.size());

            List<ApplicationInterfaceDescription> appInts = appInterface.getAllApplicationInterfaces();
            System.out.println("********** Size of all app interfaces ************* : " + appInts.size());

            List<String> appIntIds = appInterface.getAllApplicationInterfaceIds();
            System.out.println("********** Size of all app interface ids ************* : " + appIntIds.size());

            assertTrue("App interface saved successfully", ainterface != null);
        }catch (AppCatalogException e) {
            e.printStackTrace();
View Full Code Here


    }

    @Test
    public void testAppDeployment () throws Exception {
        ApplicationDeployment appDep = appcatalog.getApplicationDeployment();
        ApplicationInterface appInt = appcatalog.getApplicationInterface();
        ComputeResource computeRs = appcatalog.getComputeResource();
        ComputeResourceDescription cm = new ComputeResourceDescription();
        cm.setHostName("localhost");
        cm.setResourceDescription("test compute host");
        String hostId = computeRs.addComputeResource(cm);

        ApplicationModule module = new ApplicationModule();
        module.setAppModuleName("WRF");
        module.setAppModuleVersion("1.0.0");
        String wrfModuleId = appInt.addApplicationModule(module);

        ApplicationDeploymentDescription description = new ApplicationDeploymentDescription();
        description.setAppModuleId(wrfModuleId);
        description.setComputeHostId(hostId);
        description.setExecutablePath("/home/a/b/c");
View Full Code Here

TOP

Related Classes of org.airavata.appcatalog.cpi.ApplicationInterface

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.