Search in sources :

Example 1 with DataCollectionJobUtil

use of com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobUtil in project coprhd-controller by CoprHD.

the class SMICommunicationInterfaceTest method testXIVBlockPlugin.

// Need to start coordinator & DB service, before running this test
@Test
public void testXIVBlockPlugin() {
    StorageProvider provider = createXIVProvider();
    try {
        Map<String, Object> cache = new ConcurrentHashMap<String, Object>();
        Set<String> idset = new HashSet<String>();
        idset.add("SYMMETRIX+000194900404+VOLUME+00000");
        cache.put("000194900404-block-Volumes", idset);
        xiv.injectCache(cache);
        xiv.injectDBClient(_dbClient);
        xiv.injectCoordinatorClient(coordinator);
        // scanTest(_smiplugin);
        AccessProfile profile = populateSMISAccessProfile(provider);
        verifyDB(profile);
        Map<String, StorageSystemViewObject> storageSystemsCache = Collections.synchronizedMap(new HashMap<String, StorageSystemViewObject>());
        profile.setCache(storageSystemsCache);
        xiv.scan(profile);
        DataCollectionJobUtil util = new DataCollectionJobUtil();
        util.setDbClient(_dbClient);
        util.setConfigInfo(configinfo);
        List<URI> providerList = new ArrayList<URI>();
        providerList.add(provider.getId());
        util.performBookKeeping(storageSystemsCache, providerList);
        // provider.getStorageSystems();
        // profile.setSystemId(provider.getSystemId());
        profile.setserialID(profile.getserialID());
        xiv.discover(profile);
    } catch (Exception e) {
        _LOGGER.error(e.getMessage(), e);
    }
}
Also used : StorageSystemViewObject(com.emc.storageos.plugins.StorageSystemViewObject) ArrayList(java.util.ArrayList) AccessProfile(com.emc.storageos.plugins.AccessProfile) DataCollectionJobUtil(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobUtil) URI(java.net.URI) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) StorageSystemViewObject(com.emc.storageos.plugins.StorageSystemViewObject) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

AccessProfile (com.emc.storageos.plugins.AccessProfile)1 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)1 StorageSystemViewObject (com.emc.storageos.plugins.StorageSystemViewObject)1 DataCollectionJobUtil (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobUtil)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Test (org.junit.Test)1