Search in sources :

Example 1 with TestGroup

use of org.apache.asterix.testframework.xml.TestGroup in project asterixdb by apache.

the class ExecutionTestUtil method setUp.

public static List<ILibraryManager> setUp(boolean cleanup, String configFile, AsterixHyracksIntegrationUtil alternateIntegrationUtil, boolean startHdfs) throws Exception {
    System.out.println("Starting setup");
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("Starting setup");
    }
    System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, configFile);
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("initializing pseudo cluster");
    }
    integrationUtil = alternateIntegrationUtil;
    integrationUtil.init(cleanup);
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("initializing HDFS");
    }
    if (startHdfs) {
        HDFSCluster.getInstance().setup();
    }
    // Set the node resolver to be the identity resolver that expects node
    // names
    // to be node controller ids; a valid assumption in test environment.
    System.setProperty(ExternalDataConstants.NODE_RESOLVER_FACTORY_PROPERTY, IdentitiyResolverFactory.class.getName());
    FailedGroup = new TestGroup();
    FailedGroup.setName("failed");
    List<ILibraryManager> libraryManagers = new ArrayList<>();
    // Adds the library manager for CC.
    libraryManagers.add(((ICcApplicationContext) integrationUtil.cc.getApplicationContext()).getLibraryManager());
    // Adds library managers for NCs, one-per-NC.
    for (NodeControllerService nc : integrationUtil.ncs) {
        INcApplicationContext runtimeCtx = (INcApplicationContext) nc.getApplicationContext();
        libraryManagers.add(runtimeCtx.getLibraryManager());
    }
    return libraryManagers;
}
Also used : NodeControllerService(org.apache.hyracks.control.nc.NodeControllerService) INcApplicationContext(org.apache.asterix.common.api.INcApplicationContext) ILibraryManager(org.apache.asterix.common.library.ILibraryManager) ArrayList(java.util.ArrayList) TestGroup(org.apache.asterix.testframework.xml.TestGroup) IdentitiyResolverFactory(org.apache.asterix.external.util.IdentitiyResolverFactory)

Aggregations

ArrayList (java.util.ArrayList)1 INcApplicationContext (org.apache.asterix.common.api.INcApplicationContext)1 ILibraryManager (org.apache.asterix.common.library.ILibraryManager)1 IdentitiyResolverFactory (org.apache.asterix.external.util.IdentitiyResolverFactory)1 TestGroup (org.apache.asterix.testframework.xml.TestGroup)1 NodeControllerService (org.apache.hyracks.control.nc.NodeControllerService)1