fix build

This commit is contained in:
Edison Su 2012-12-13 15:17:23 -08:00
parent 75285f90ba
commit 510d3759a7
2 changed files with 10 additions and 6 deletions

View File

@ -231,13 +231,13 @@ public class volumeServiceTest {
try { try {
primaryDataStoreProviderMgr.configure("primary data store mgr", new HashMap<String, Object>()); primaryDataStoreProviderMgr.configure("primary data store mgr", new HashMap<String, Object>());
PrimaryDataStoreProvider provider = primaryDataStoreProviderMgr.getDataStoreProvider("default primary data store provider"); PrimaryDataStoreProvider provider = primaryDataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
PrimaryDataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
params.put("url", "nfs://test/test"); params.put("url", "nfs://test/test");
params.put("dcId", dcId.toString()); params.put("dcId", dcId.toString());
params.put("clusterId", clusterId.toString()); params.put("clusterId", clusterId.toString());
params.put("name", "my primary data store"); params.put("name", "my primary data store");
PrimaryDataStoreInfo primaryDataStoreInfo = lifeCycle.registerDataStore(params); PrimaryDataStoreInfo primaryDataStoreInfo = provider.registerDataStore(params);
return primaryDataStoreInfo; return primaryDataStoreInfo;
} catch (ConfigurationException e) { } catch (ConfigurationException e) {
return null; return null;
@ -293,7 +293,7 @@ public class volumeServiceTest {
DefaultPrimaryDatastoreProviderImpl provider = ComponentInject.inject(DefaultPrimaryDatastoreProviderImpl.class); DefaultPrimaryDatastoreProviderImpl provider = ComponentInject.inject(DefaultPrimaryDatastoreProviderImpl.class);
//assertNotNull(provider.dataStoreDao); //assertNotNull(provider.dataStoreDao);
DefaultPrimaryDataStore dpdsi = DefaultPrimaryDataStore.createDataStore(null, null, null); DefaultPrimaryDataStore dpdsi = DefaultPrimaryDataStore.createDataStore(null);
//assertNotNull(dpdsi.volumeDao); //assertNotNull(dpdsi.volumeDao);
} }

View File

@ -1,10 +1,14 @@
package org.apache.cloudstack.storage.datastore.provider; package org.apache.cloudstack.storage.datastore.provider;
import java.util.List;
import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStore; import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStore;
import org.apache.cloudstack.storage.datastore.PrimaryDataStore; import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
import org.apache.cloudstack.storage.datastore.driver.SolidfirePrimaryDataStoreDriver; import org.apache.cloudstack.storage.datastore.driver.SolidfirePrimaryDataStoreDriver;
import org.apache.cloudstack.storage.datastore.lifecycle.DefaultPrimaryDataStoreLifeCycleImpl; import org.apache.cloudstack.storage.datastore.lifecycle.DefaultPrimaryDataStoreLifeCycleImpl;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
@ -13,8 +17,8 @@ public class SolidfirePrimaryDataStoreProvider extends
private final String name = "Solidfre Primary Data Store Provider"; private final String name = "Solidfre Primary Data Store Provider";
public SolidfirePrimaryDataStoreProvider() { public SolidfirePrimaryDataStoreProvider(@Qualifier("solidfire") List<PrimaryDataStoreConfigurator> configurators) {
super(); super(configurators);
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@ -35,7 +39,7 @@ public class SolidfirePrimaryDataStoreProvider extends
SolidfirePrimaryDataStoreDriver driver = new SolidfirePrimaryDataStoreDriver(); SolidfirePrimaryDataStoreDriver driver = new SolidfirePrimaryDataStoreDriver();
pds.setDriver(driver); pds.setDriver(driver);
DefaultPrimaryDataStoreLifeCycleImpl lifeCycle = new DefaultPrimaryDataStoreLifeCycleImpl(super.dataStoreDao, pds); DefaultPrimaryDataStoreLifeCycleImpl lifeCycle = new DefaultPrimaryDataStoreLifeCycleImpl(dataStoreDao);
pds.setLifeCycle(lifeCycle); pds.setLifeCycle(lifeCycle);
return pds; return pds;
} }