incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [4/44] Revert "Merge remote-tracking branch 'origin/javelin' into javelin"
Date Tue, 15 Jan 2013 02:04:55 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java b/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
index a039499..519ae70 100644
--- a/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
@@ -18,6 +18,8 @@ package com.cloud.upgrade;
 
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -25,10 +27,12 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class AdvanceZone223To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(AdvanceZone223To224UpgradeTest.class);
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -43,8 +47,6 @@ public class AdvanceZone223To224UpgradeTest extends TestCase {
 
     public void test223to224Upgrade() throws SQLException {
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
 
         String version = dao.getCurrentVersion();
         assert version.equals("2.2.3") : "Version returned is not 2.2.3 but " + version;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java b/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
index 521e92a..8bd9f06 100644
--- a/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -29,12 +31,15 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class BasicZone218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(BasicZone218To224UpgradeTest.class);
+    
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -54,9 +59,6 @@ public class BasicZone218To224UpgradeTest extends TestCase {
         Connection conn = Transaction.getStandaloneConnection();
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/HostCapacity218to22Test.java b/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
index af6321a..76ad12e 100644
--- a/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
+++ b/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
@@ -18,6 +18,8 @@ package com.cloud.upgrade;
 
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -25,11 +27,14 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 
 public class HostCapacity218to22Test extends TestCase {
     private static final Logger s_logger = Logger.getLogger(HostCapacity218to22Test.class);
+
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 	
     @Override
     @Before
@@ -46,9 +51,6 @@ public class HostCapacity218to22Test extends TestCase {
         s_logger.debug("Finding sample data from 2.1.8");
         DbTestUtils.executeScript("fake.sql", false, true);
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java b/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
index 601b1e8..41f334d 100644
--- a/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
@@ -23,6 +23,8 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -30,13 +32,16 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class InstanceGroup218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(InstanceGroup218To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -55,9 +60,6 @@ public class InstanceGroup218To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java b/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
index a430584..a9cb51f 100644
--- a/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -29,12 +31,15 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class PortForwarding218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(PortForwarding218To224UpgradeTest.class);
+    
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -55,9 +60,6 @@ public class PortForwarding218To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
index ef47aad..d33192f 100644
--- a/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -28,13 +30,16 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class Sanity220To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity220To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +59,6 @@ public class Sanity220To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-
         String version = dao.getCurrentVersion();
 
         if (!version.equals("2.2.1")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
index aa30df2..108eca9 100644
--- a/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -28,13 +30,16 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class Sanity222To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity222To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,8 +59,6 @@ public class Sanity222To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
 
         String version = dao.getCurrentVersion();
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
index 3291027..fd0b219 100644
--- a/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -28,12 +30,15 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.Transaction;
 
 public class Sanity223To225UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity223To225UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -53,9 +58,6 @@ public class Sanity223To225UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-
         String version = dao.getCurrentVersion();
 
         if (!version.equals("2.2.3")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
index a7b6ba1..775a62e 100644
--- a/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -28,13 +30,16 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class Sanity224To225UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity224To225UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +59,6 @@ public class Sanity224To225UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-
         String version = dao.getCurrentVersion();
 
         if (!version.equals("2.2.4")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java b/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
index e7a01e3..06835b5 100644
--- a/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
@@ -23,13 +23,15 @@ import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
 import org.junit.After;
 import org.junit.Before;
 
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -37,6 +39,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
 public class Template2214To30UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger
             .getLogger(Template2214To30UpgradeTest.class);
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -56,8 +59,6 @@ public class Template2214To30UpgradeTest extends TestCase {
                 "fake.sql", false,
                 true);
 
-        DatabaseUpgradeChecker checker = ComponentLocator
-                .inject(DatabaseUpgradeChecker.class);
 
         checker.upgrade("2.2.14", "3.0.0");
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java b/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
index 5f05ac3..ff44803 100644
--- a/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
+++ b/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
@@ -23,21 +23,26 @@ import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
 import org.junit.After;
 import org.junit.Before;
 
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 
+
 public class Test2214To30DBUpgrade extends TestCase {
     private static final Logger s_logger = Logger
             .getLogger(Test2214To30DBUpgrade.class);
 
+    @Inject DatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -56,9 +61,6 @@ public class Test2214To30DBUpgrade extends TestCase {
                 "fake.sql", false,
                 true);
 
-        DatabaseUpgradeChecker checker = ComponentLocator
-                .inject(DatabaseUpgradeChecker.class);
-
         checker.upgrade("2.2.14", "3.0.0");
 
         Connection conn = Transaction.getStandaloneConnection();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java b/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
index d349247..741af5a 100644
--- a/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -29,13 +31,16 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class Usage217To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Usage217To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject PremiumDatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -56,8 +61,6 @@ public class Usage217To224UpgradeTest extends TestCase {
         Connection conn;
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        PremiumDatabaseUpgradeChecker checker = ComponentLocator.inject(PremiumDatabaseUpgradeChecker.class);
         
         String version = dao.getCurrentVersion();
         assert version.equals("2.1.7") : "Version returned is not 2.1.7 but " + version;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java b/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
index 7319afa..cde114b 100644
--- a/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -29,13 +31,16 @@ import org.junit.After;
 import org.junit.Before;
 
 import com.cloud.upgrade.dao.VersionDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 
 public class UsageEvents218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(UsageEvents218To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +59,6 @@ public class UsageEvents218To224UpgradeTest extends TestCase {
         Connection conn;
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         assert version.equals("2.1.8") : "Version returned is not 2.1.8 but " + version;
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/user/MockAccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/user/MockAccountManagerImpl.java b/server/test/com/cloud/user/MockAccountManagerImpl.java
index ae5d0e5..550304a 100644
--- a/server/test/com/cloud/user/MockAccountManagerImpl.java
+++ b/server/test/com/cloud/user/MockAccountManagerImpl.java
@@ -23,6 +23,7 @@ import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import com.cloud.api.query.vo.ControlledViewEntity;
 
@@ -344,4 +345,9 @@ public class MockAccountManagerImpl implements Manager, AccountManager, AccountS
         return null;
     }
 
+    @Override
+    public RoleType getRoleType(Account account) {
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/user/MockDomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/user/MockDomainManagerImpl.java b/server/test/com/cloud/user/MockDomainManagerImpl.java
index 6dc4d07..9f49535 100644
--- a/server/test/com/cloud/user/MockDomainManagerImpl.java
+++ b/server/test/com/cloud/user/MockDomainManagerImpl.java
@@ -47,6 +47,12 @@ public class MockDomainManagerImpl implements  Manager, DomainManager {
     }
 
     @Override
+    public Domain getDomain(String uuid) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
     public boolean isChildDomain(Long parentId, Long childId) {
         // TODO Auto-generated method stub
         return false;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java b/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
index f07abca..1a5a900 100644
--- a/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
+++ b/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
@@ -16,17 +16,20 @@
 // under the License.
 package com.cloud.vm.dao;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VirtualMachine;
 
 
 public class UserVmDaoImplTest extends TestCase {
-    public void testPersist() {
-        UserVmDao dao = ComponentLocator.inject(UserVmDaoImpl.class);
+    @Inject UserVmDao dao;
+     
+	public void testPersist() {
         
         dao.expunge(1000l);
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index 4403d75..b29af9e 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -66,7 +66,6 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.Adapters;
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.*;
 import com.cloud.vpc.dao.MockVpcVirtualRouterElement;
@@ -157,6 +156,12 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager{
         return null;
     }
 
+    @Override
+    public Network getNetwork(String networkUuid) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getIp(long)
      */

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/vpc/MockVpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockVpcManagerImpl.java b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
index 25799d1..e7d888e 100644
--- a/server/test/com/cloud/vpc/MockVpcManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
@@ -21,6 +21,7 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.ejb.Local;
+import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
@@ -50,14 +51,14 @@ import com.cloud.offering.NetworkOffering;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.DomainRouterVO;
 import com.cloud.vpc.dao.MockVpcDaoImpl;
 
 @Local(value = { VpcManager.class, VpcService.class })
 public class MockVpcManagerImpl implements VpcManager, Manager{
-    MockVpcDaoImpl _vpcDao = ComponentLocator.inject(MockVpcDaoImpl.class);
+    @Inject MockVpcDaoImpl _vpcDao;
 
     /* (non-Javadoc)
      * @see com.cloud.network.vpc.VpcService#getVpcOffering(long)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/server/test/com/cloud/vpc/VpcApiUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/VpcApiUnitTest.java b/server/test/com/cloud/vpc/VpcApiUnitTest.java
index 5cc325f..9693f44 100644
--- a/server/test/com/cloud/vpc/VpcApiUnitTest.java
+++ b/server/test/com/cloud/vpc/VpcApiUnitTest.java
@@ -19,6 +19,8 @@ package com.cloud.vpc;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -45,8 +47,7 @@ import com.cloud.tags.dao.ResourceTagsDaoImpl;
 import com.cloud.user.AccountVO;
 import com.cloud.user.MockAccountManagerImpl;
 import com.cloud.user.dao.AccountDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
-import com.cloud.utils.component.MockComponentLocator;
+
 import com.cloud.vm.dao.DomainRouterDaoImpl;
 import com.cloud.vpc.dao.MockNetworkDaoImpl;
 import com.cloud.vpc.dao.MockNetworkOfferingDaoImpl;
@@ -58,45 +59,11 @@ import com.cloud.vpc.dao.MockVpcOfferingServiceMapDaoImpl;
 
 public class VpcApiUnitTest extends TestCase{
     private static final Logger s_logger = Logger.getLogger(VpcApiUnitTest.class);
-    MockComponentLocator _locator;
-    VpcManager _vpcService;
+    @Inject VpcManager _vpcService;
 
     @Override
     @Before
     public void setUp() throws Exception {
-        _locator = new MockComponentLocator(ManagementService.Name);
-        _locator.addDao("VpcDao", MockVpcDaoImpl.class);
-        _locator.addDao("VpcOfferingDao", VpcOfferingDaoImpl.class);
-        _locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
-        _locator.addDao("NetworkDao", MockNetworkDaoImpl.class);
-        _locator.addDao("IPAddressDao", IPAddressDaoImpl.class);
-        _locator.addDao("DomainRouterDao", DomainRouterDaoImpl.class);
-        _locator.addDao("VpcGatewayDao", VpcGatewayDaoImpl.class);
-        _locator.addDao("PrivateIpDao", PrivateIpDaoImpl.class);
-        _locator.addDao("StaticRouteDao", StaticRouteDaoImpl.class);
-        _locator.addDao("NetworkOfferingServiceMapDao", MockNetworkOfferingServiceMapDaoImpl.class);
-        _locator.addDao("VpcOfferingServiceMapDao", MockVpcOfferingServiceMapDaoImpl.class);
-        _locator.addDao("PhysicalNetworkDao", PhysicalNetworkDaoImpl.class);
-        _locator.addDao("ResourceTagDao", ResourceTagsDaoImpl.class);
-        _locator.addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
-        _locator.addDao("VlanDao", VlanDaoImpl.class);
-        _locator.addDao("AccountDao", AccountDaoImpl.class);
-        _locator.addDao("ResourceCountDao", ResourceCountDaoImpl.class);
-        _locator.addDao("NetworkOfferingDao", MockNetworkOfferingDaoImpl.class);
-        _locator.addDao("NetworkServiceMapDao", MockNetworkServiceMapDaoImpl.class);
-        _locator.addDao("VpcOfferingDao", MockVpcOfferingDaoImpl.class);
-        _locator.addDao("Site2SiteVpnDao", Site2SiteVpnGatewayDaoImpl.class);
-        
-        _locator.addManager("ConfigService", MockConfigurationManagerImpl.class);
-        _locator.addManager("vpc manager", VpcManagerImpl.class);
-        _locator.addManager("account manager", MockAccountManagerImpl.class);
-        _locator.addManager("network manager", MockNetworkManagerImpl.class);
-        _locator.addManager("Site2SiteVpnManager", MockSite2SiteVpnManagerImpl.class);
-        _locator.addManager("ResourceLimitService", MockResourceLimitManagerImpl.class);
-        
-        _locator.makeActive(null);
-        
-        _vpcService = ComponentLocator.inject(VpcManagerImpl.class);
     }
     
     public void test() {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index 990e7d8..864fe52 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -157,6 +157,43 @@ DROP TABLE IF EXISTS `cloud`.`autoscale_policies`;
 DROP TABLE IF EXISTS `cloud`.`counter`;
 DROP TABLE IF EXISTS `cloud`.`conditions`;
 DROP TABLE IF EXISTS `cloud`.`inline_load_balancer_nic_map`;
+DROP TABLE IF EXISTS `cloud`.`cmd_exec_log`;
+DROP TABLE IF EXISTS `cloud`.`keystore`;
+DROP TABLE IF EXISTS `cloud`.`swift`;
+DROP TABLE IF EXISTS `cloud`.`project_account`;
+DROP TABLE IF EXISTS `cloud`.`project_invitations`;
+DROP TABLE IF EXISTS `cloud`.`elastic_lb_vm_map`;
+DROP TABLE IF EXISTS `cloud`.`ntwk_offering_service_map`;
+DROP TABLE IF EXISTS `cloud`.`ntwk_service_map`;
+DROP TABLE IF EXISTS `cloud`.`external_load_balancer_devices`;
+DROP TABLE IF EXISTS `cloud`.`external_firewall_devices`;
+DROP TABLE IF EXISTS `cloud`.`network_external_lb_device_map`;
+DROP TABLE IF EXISTS `cloud`.`network_external_firewall_device_map`;
+DROP TABLE IF EXISTS `cloud`.`virtual_router_providers`;
+DROP TABLE IF EXISTS `cloud`.`op_user_stats_log`;
+DROP TABLE IF EXISTS `cloud`.`netscaler_pod_ref`;
+DROP TABLE IF EXISTS `cloud`.`mshost_peer`;
+DROP TABLE IF EXISTS `cloud`.`vm_template_details`;
+DROP TABLE IF EXISTS `cloud`.`hypervisor_capabilities`;
+DROP TABLE IF EXISTS `cloud`.`template_swift_ref`;
+DROP TABLE IF EXISTS `cloud`.`account_details`;
+DROP TABLE IF EXISTS `cloud`.`vpc`;
+DROP TABLE IF EXISTS `cloud`.`vpc_offerings`;
+DROP TABLE IF EXISTS `cloud`.`vpc_offering_service_map`;
+DROP TABLE IF EXISTS `cloud`.`vpc_gateways`;
+DROP TABLE IF EXISTS `cloud`.`router_network_ref`;
+DROP TABLE IF EXISTS `cloud`.`private_ip_address`;
+DROP TABLE IF EXISTS `cloud`.`static_routes`;
+DROP TABLE IF EXISTS `cloud`.`resource_tags`;
+DROP TABLE IF EXISTS `cloud`.`primary_data_store_provider`;
+DROP TABLE IF EXISTS `cloud`.`image_data_store_provider`;
+DROP TABLE IF EXISTS `cloud`.`image_data_store`;
+DROP TABLE IF EXISTS `cloud`.`vm_compute_tags`;
+DROP TABLE IF EXISTS `cloud`.`vm_root_disk_tags`;
+DROP TABLE IF EXISTS `cloud`.`vm_network_map`;
+DROP TABLE IF EXISTS `cloud`.`netapp_volume`;
+DROP TABLE IF EXISTS `cloud`.`netapp_pool`;
+DROP TABLE IF EXISTS `cloud`.`netapp_lun`;
 
 CREATE TABLE `cloud`.`version` (
   `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/test/integration/smoke/test_iso.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py
index 22d424f..8228a27 100644
--- a/test/integration/smoke/test_iso.py
+++ b/test/integration/smoke/test_iso.py
@@ -219,14 +219,14 @@ class TestISO(cloudstackTestCase):
         # Finding the OsTypeId from Ostype
         ostypes = list_os_types(
                     cls.api_client,
-                    description=self.services["ostype"]
+                    description=cls.services["ostype"]
                     )
         if not isinstance(ostypes, list):
             raise unittest.SkipTest("OSTypeId for given description not found")
 
-        self.services["iso_1"]["ostypeid"] = ostypes[0].id
-        self.services["iso_2"]["ostypeid"] = ostypes[0].id
-        self.services["ostypeid"] = ostypes[0].id
+        cls.services["iso_1"]["ostypeid"] = ostypes[0].id
+        cls.services["iso_2"]["ostypeid"] = ostypes[0].id
+        cls.services["ostypeid"] = ostypes[0].id
 
         cls.iso_1 = Iso.create(
                                cls.api_client, 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/tools/apidoc/gen_toc.py
----------------------------------------------------------------------
diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py
index 7739aea..0b281a2 100644
--- a/tools/apidoc/gen_toc.py
+++ b/tools/apidoc/gen_toc.py
@@ -129,7 +129,6 @@ known_categories = {
     'AutoScale': 'AutoScale',
     'Counter': 'AutoScale',
     'Condition': 'AutoScale',
-    'Api': 'API Discovery',
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/tools/apidoc/pom.xml
----------------------------------------------------------------------
diff --git a/tools/apidoc/pom.xml b/tools/apidoc/pom.xml
index e0b02bc..bc7411f 100644
--- a/tools/apidoc/pom.xml
+++ b/tools/apidoc/pom.xml
@@ -57,7 +57,7 @@
                                 <argument>${client.config.jars}</argument>
                                 <argument>./target</argument>
                                 <argument>-f</argument>
-                                <argument>${client.config.conf}/commands.properties,${client.config.conf}/commands-ext.properties,${client.config.conf}/virtualrouter_commands.properties,${client.config.conf}/nicira-nvp_commands.properties,${client.config.conf}/api-discovery_commands.properties </argument>
+                                <argument>${client.config.conf}/commands.properties,${client.config.conf}/commands-ext.properties,${client.config.conf}/virtualrouter_commands.properties,${client.config.conf}/nicira-nvp_commands.properties</argument>
                             </arguments>
                         </configuration>
                     </execution>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/tools/devcloud-kvm/README.md
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/README.md b/tools/devcloud-kvm/README.md
new file mode 100644
index 0000000..3261fbe
--- /dev/null
+++ b/tools/devcloud-kvm/README.md
@@ -0,0 +1,21 @@
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+===========================================================
+
+This directory hosts configs for setting up the devcloud-kvm
+environment.

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/tools/devcloud-kvm/devcloud-kvm.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/devcloud-kvm.cfg b/tools/devcloud-kvm/devcloud-kvm.cfg
new file mode 100644
index 0000000..47a128f
--- /dev/null
+++ b/tools/devcloud-kvm/devcloud-kvm.cfg
@@ -0,0 +1,97 @@
+{
+    "zones": [
+        {
+            "name": "DevCloudKVM0", 
+            "physical_networks": [
+                {
+                    "broadcastdomainrange": "Zone", 
+                    "name": "test-network", 
+                    "traffictypes": [
+                        {
+                            "typ": "Guest"
+                        }, 
+                        {
+                            "typ": "Management"
+                        } 
+                    ], 
+                    "providers": [
+                        {
+                            "broadcastdomainrange": "ZONE", 
+                            "name": "VirtualRouter"
+                        },
+                        {
+                            "broadcastdomainrange": "Pod",
+                            "name": "SecurityGroupProvider"
+                        }
+                    ]
+                }
+            ],
+            "dns2": "4.4.4.4", 
+            "dns1": "8.8.8.8",
+            "securitygroupenabled": "true", 
+            "localstorageenabled": "true",
+            "networktype": "Basic", 
+            "pods": [
+                {
+                    "endip": "192.168.100.250", 
+                    "name": "test00", 
+                    "startip": "192.168.100.200", 
+                    "guestIpRanges": [
+                        {
+                            "startip": "192.168.100.100", 
+                            "endip": "192.168.100.199", 
+                            "netmask": "255.255.255.0", 
+                            "gateway": "192.168.100.1"
+                        }
+                    ], 
+                    "netmask": "255.255.255.0", 
+                    "clusters": [
+                        {
+                            "clustername": "test000", 
+                            "hypervisor": "KVM", 
+                            "hosts": [
+                                {
+                                    "username": "root", 
+                                    "url": "http://192.168.100.10/", 
+                                    "password": "password"
+                                }
+                            ], 
+                            "clustertype": "CloudManaged"
+                        }
+                    ], 
+                    "gateway": "192.168.100.1"
+                }
+            ], 
+            "internaldns1": "192.168.100.10", 
+            "secondaryStorages": [
+                {
+                    "url": "nfs://192.168.100.10:/nfs/secondary"
+                }
+            ]
+        }
+    ], 
+    "logger": [
+        {
+            "name": "TestClient", 
+            "file": "/tmp/testclient.log"
+        }, 
+        {
+            "name": "TestCase", 
+            "file": "/tmp/testcase.log"
+        }
+    ], 
+    "mgtSvr": [
+        {
+            "mgtSvrIp": "127.0.0.1", 
+            "port": 8096
+        }
+    ],
+    "dbSvr": 
+        {
+	    "dbSvr": "127.0.0.1",
+	    "port": 3306,
+	    "user": "cloud",
+	    "passwd": "cloud",
+	    "db": "cloud"
+        }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/tools/devcloud-kvm/devcloud-kvm.sql
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/devcloud-kvm.sql b/tools/devcloud-kvm/devcloud-kvm.sql
new file mode 100644
index 0000000..9747883
--- /dev/null
+++ b/tools/devcloud-kvm/devcloud-kvm.sql
@@ -0,0 +1,40 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+-- 
+--   http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+
+INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, use_local_storage, type, disk_size) VALUES (17, 'tinyOffering', UUID(), 'tinyOffering', NOW(), 1, 'Service', 0);
+INSERT INTO `cloud`.`service_offering` (id, cpu, speed, ram_size) VALUES (17, 1, 100, 100);
+INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, type, disk_size) VALUES (18, 'tinyDiskOffering', UUID(), 'tinyDiskOffering', NOW(), 'Disk', 1073741824);
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','router.ram.size', '100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','router.cpu.mhz','100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','console.ram.size','100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','console.cpu.mhz', '100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','ssvm.ram.size','100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','ssvm.cpu.mhz','100');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'system.vm.use.local.storage', 'true');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.workers', '3');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.delay', '60');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.interval', '60');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'enable.ec2.api', 'true');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'enable.s3.api', 'true');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'host', '192.168.100.10');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'management.network.cidr', '192.168.100.0/24');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'secstorage.allowed.internal.sites', '192.168.0.0/8');
+UPDATE `cloud`.`configuration` SET value='10' where name = 'storage.overprovisioning.factor';
+UPDATE `cloud`.`configuration` SET value='10' where name = 'cpu.overprovisioning.factor';
+UPDATE `cloud`.`configuration` SET value='10' where name = 'mem.overprovisioning.factor';
+UPDATE `cloud`.`vm_template` SET unique_name="tiny Linux",name="tiny Linux",url="http://marcus.mlsorensen.com/cloudstack-extras/ttylinux_pv.qcow2",checksum="81dcf4b4ca05a3b637a040e851568f29",display_text="tiny Linux",format='QCOW2',hypervisor_type='KVM' where id=5;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/tools/devcloud-kvm/pom.xml
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/pom.xml b/tools/devcloud-kvm/pom.xml
new file mode 100644
index 0000000..c9af192
--- /dev/null
+++ b/tools/devcloud-kvm/pom.xml
@@ -0,0 +1,138 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+  license agreements. See the NOTICE file distributed with this work for additional 
+  information regarding copyright ownership. The ASF licenses this file to 
+  you under the Apache License, Version 2.0 (the "License"); you may not use 
+  this file except in compliance with the License. You may obtain a copy of 
+  the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+  by applicable law or agreed to in writing, software distributed under the 
+  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+  OF ANY KIND, either express or implied. See the License for the specific 
+  language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-devcloud-kvm</artifactId>
+  <name>Apache CloudStack Developer Tools</name>
+  <packaging>pom</packaging>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloudstack</artifactId>
+    <version>4.1.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.1.21</version>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+  </build>
+  <profiles>
+    <profile>
+      <id>deploydb</id>
+      <activation>
+        <property>
+          <name>deploydb</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>properties-maven-plugin</artifactId>
+            <version>1.0-alpha-2</version>
+            <executions>
+              <execution>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>read-project-properties</goal>
+                </goals>
+                <configuration>
+                  <files>
+                    <file>${project.parent.basedir}/utils/conf/db.properties</file>
+                    <file>${project.parent.basedir}/utils/conf/db.properties.override</file>
+                  </files>
+                  <quiet>true</quiet>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>sql-maven-plugin</artifactId>
+            <version>1.5</version>
+            <dependencies>
+              <!-- specify the dependent jdbc driver here -->
+              <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${cs.mysql.version}</version>
+              </dependency>
+            </dependencies>
+            <configuration>
+              <driver>org.gjt.mm.mysql.Driver</driver>
+              <url>jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud</url>
+              <username>${db.cloud.username}</username>
+              <password>${db.cloud.password}</password>
+              <!--all executions are ignored if -Dmaven.test.skip=true -->
+              <skip>${maven.test.skip}</skip>
+              <forceMojoExecution>true</forceMojoExecution>
+            </configuration>
+            <executions>
+              <execution>
+                <id>create-schema</id>
+                <phase>process-test-resources</phase>
+                <goals>
+                  <goal>execute</goal>
+                </goals>
+                <configuration>
+                  <srcFiles>
+                    <srcFile>${basedir}/devcloud-kvm.sql</srcFile>
+                  </srcFiles>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>deploysvr</id>
+      <activation>
+        <property>
+          <name>deploysvr</name>
+        </property>
+      </activation>
+      <build> 
+        <plugins>
+          <plugin>
+         <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <executable>python</executable>
+          <arguments>
+            <argument>../marvin/marvin/deployDataCenter.py</argument>
+            <argument>-i</argument>
+            <argument>devcloud-kvm.cfg</argument>
+          </arguments>
+        </configuration>
+          </plugin>
+        </plugins>
+      </build> 
+    </profile>
+  </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/UsageAlertManagerImpl.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageAlertManagerImpl.java b/usage/src/com/cloud/usage/UsageAlertManagerImpl.java
index 2b698c8..f6e0374 100644
--- a/usage/src/com/cloud/usage/UsageAlertManagerImpl.java
+++ b/usage/src/com/cloud/usage/UsageAlertManagerImpl.java
@@ -40,7 +40,7 @@ import com.cloud.alert.AlertVO;
 import com.cloud.alert.dao.AlertDao;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.sun.mail.smtp.SMTPMessage;
 import com.sun.mail.smtp.SMTPSSLTransport;
 import com.sun.mail.smtp.SMTPTransport;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/UsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageManagerImpl.java b/usage/src/com/cloud/usage/UsageManagerImpl.java
index bbf2cd6..4944a14 100644
--- a/usage/src/com/cloud/usage/UsageManagerImpl.java
+++ b/usage/src/com/cloud/usage/UsageManagerImpl.java
@@ -30,6 +30,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import javax.ejb.Local;
+import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
@@ -66,8 +67,8 @@ import com.cloud.user.AccountVO;
 import com.cloud.user.UserStatisticsVO;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.UserStatisticsDao;
-import com.cloud.utils.component.ComponentLocator;
-import com.cloud.utils.component.Inject;
+
+
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Filter;
@@ -89,23 +90,23 @@ public class UsageManagerImpl implements UsageManager, Runnable {
     private static final int THREE_DAYS_IN_MINUTES = 60 * 24 * 3;
     private static final int USAGE_AGGREGATION_RANGE_MIN = 10;
 
-    private final ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private final AccountDao m_accountDao = _locator.getDao(AccountDao.class);
-    private final UserStatisticsDao m_userStatsDao = _locator.getDao(UserStatisticsDao.class);
-    private final UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private final UsageVMInstanceDao m_usageInstanceDao = _locator.getDao(UsageVMInstanceDao.class);
-    private final UsageIPAddressDao m_usageIPAddressDao = _locator.getDao(UsageIPAddressDao.class);
-    private final UsageNetworkDao m_usageNetworkDao = _locator.getDao(UsageNetworkDao.class);
-    private final UsageVolumeDao m_usageVolumeDao = _locator.getDao(UsageVolumeDao.class);
-    private final UsageStorageDao m_usageStorageDao = _locator.getDao(UsageStorageDao.class);
-    private final UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao = _locator.getDao(UsageLoadBalancerPolicyDao.class);
-    private final UsagePortForwardingRuleDao m_usagePortForwardingRuleDao = _locator.getDao(UsagePortForwardingRuleDao.class);
-    private final UsageNetworkOfferingDao m_usageNetworkOfferingDao = _locator.getDao(UsageNetworkOfferingDao.class);
-    private final UsageVPNUserDao m_usageVPNUserDao = _locator.getDao(UsageVPNUserDao.class);
-    private final UsageSecurityGroupDao m_usageSecurityGroupDao = _locator.getDao(UsageSecurityGroupDao.class);
-    private final UsageJobDao m_usageJobDao = _locator.getDao(UsageJobDao.class);
+    @Inject private AccountDao m_accountDao;
+    @Inject private UserStatisticsDao m_userStatsDao;
+    @Inject private UsageDao m_usageDao;
+    @Inject private UsageVMInstanceDao m_usageInstanceDao;
+    @Inject private UsageIPAddressDao m_usageIPAddressDao;
+    @Inject private UsageNetworkDao m_usageNetworkDao;
+    @Inject private UsageVolumeDao m_usageVolumeDao;
+    @Inject private UsageStorageDao m_usageStorageDao;
+    @Inject private UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao;
+    @Inject private UsagePortForwardingRuleDao m_usagePortForwardingRuleDao;
+    @Inject private UsageNetworkOfferingDao m_usageNetworkOfferingDao;
+    @Inject private UsageVPNUserDao m_usageVPNUserDao;
+    @Inject private UsageSecurityGroupDao m_usageSecurityGroupDao;
+    @Inject private UsageJobDao m_usageJobDao;
     @Inject protected AlertManager _alertMgr;
     @Inject protected UsageEventDao _usageEventDao;
+    @Inject ConfigurationDao _configDao;
 
     private String m_version = null;
     private String m_name = null;
@@ -152,14 +153,7 @@ public class UsageManagerImpl implements UsageManager, Runnable {
 
         m_name = name;
 
-        ComponentLocator locator = ComponentLocator.getCurrentLocator();
-        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
-        if (configDao == null) {
-            s_logger.error("Unable to get the configuration dao.");
-            return false;
-        }
-
-        Map<String, String> configs = configDao.getConfiguration(params);
+        Map<String, String> configs = _configDao.getConfiguration(params);
 
         if (params != null) {
             mergeConfigs(configs, params);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/UsageServer.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageServer.java b/usage/src/com/cloud/usage/UsageServer.java
index 4cdca79..eaf9132 100644
--- a/usage/src/com/cloud/usage/UsageServer.java
+++ b/usage/src/com/cloud/usage/UsageServer.java
@@ -16,14 +16,17 @@
 // under the License.
 package com.cloud.usage;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class UsageServer {
     private static final Logger s_logger = Logger.getLogger(UsageServer.class.getName());
     public static final String Name = "usage-server";
 
+    @Inject UsageManager mgr; 
     /**
      * @param args
      */
@@ -38,8 +41,6 @@ public class UsageServer {
     }
 
     public void start() {
-        final ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-        UsageManager mgr = _locator.getManager(UsageManager.class);
         if (mgr != null) {
             if (s_logger.isInfoEnabled()) {
                 s_logger.info("UsageServer ready...");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java b/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
index 08cb021..a5a40c0 100644
--- a/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
@@ -22,7 +22,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageIPAddressVO;
 import com.cloud.usage.UsageServer;
@@ -32,16 +36,24 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageIPAddressDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
 
+@Component
 public class IPAddressUsageParser {
     public static final Logger s_logger = Logger.getLogger(IPAddressUsageParser.class.getName());
 
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageIPAddressDao m_usageIPAddressDao = _locator.getDao(UsageIPAddressDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageIPAddressDao m_usageIPAddressDao;
 
+    
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageIPAddressDao _usageIPAddressDao;
 
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageIPAddressDao = _usageIPAddressDao;
+    }
+    
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Parsing IP Address usage for account: " + account.getId());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java b/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
index c1423c6..edea320 100644
--- a/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
@@ -22,7 +22,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageLoadBalancerPolicyVO;
 import com.cloud.usage.UsageServer;
@@ -32,14 +36,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageLoadBalancerPolicyDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
 
+@Component
 public class LoadBalancerUsageParser {
     public static final Logger s_logger = Logger.getLogger(LoadBalancerUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao = _locator.getDao(UsageLoadBalancerPolicyDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao;
+    
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageLoadBalancerPolicyDao _usageLoadBalancerPolicyDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageLoadBalancerPolicyDao = _usageLoadBalancerPolicyDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/NetworkOfferingUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/NetworkOfferingUsageParser.java b/usage/src/com/cloud/usage/parser/NetworkOfferingUsageParser.java
index fc7fc2a..f6ddf9f 100644
--- a/usage/src/com/cloud/usage/parser/NetworkOfferingUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/NetworkOfferingUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsageNetworkOfferingVO;
@@ -32,14 +35,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageNetworkOfferingDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class NetworkOfferingUsageParser {
     public static final Logger s_logger = Logger.getLogger(NetworkOfferingUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageNetworkOfferingDao m_usageNetworkOfferingDao = _locator.getDao(UsageNetworkOfferingDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageNetworkOfferingDao m_usageNetworkOfferingDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageNetworkOfferingDao _usageNetworkOfferingDao;
+
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageNetworkOfferingDao = _usageNetworkOfferingDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/NetworkUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/NetworkUsageParser.java b/usage/src/com/cloud/usage/parser/NetworkUsageParser.java
index acdbc48..fb673d7 100644
--- a/usage/src/com/cloud/usage/parser/NetworkUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/NetworkUsageParser.java
@@ -21,26 +21,35 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsageNetworkVO;
-import com.cloud.usage.UsageServer;
 import com.cloud.usage.UsageTypes;
 import com.cloud.usage.UsageVO;
 import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageNetworkDao;
 import com.cloud.user.AccountVO;
-import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 import com.cloud.utils.db.SearchCriteria;
 
 public class NetworkUsageParser {
 public static final Logger s_logger = Logger.getLogger(NetworkUsageParser.class.getName());
 
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageNetworkDao m_usageNetworkDao = _locator.getDao(UsageNetworkDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageNetworkDao m_usageNetworkDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageNetworkDao _usageNetworkDao;
 
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageNetworkDao = _usageNetworkDao;
+    }
+    
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Parsing all Network usage events for account: " + account.getId());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/PortForwardingUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/PortForwardingUsageParser.java b/usage/src/com/cloud/usage/parser/PortForwardingUsageParser.java
index 469fb65..1692180 100644
--- a/usage/src/com/cloud/usage/parser/PortForwardingUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/PortForwardingUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsagePortForwardingRuleVO;
@@ -32,14 +35,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsagePortForwardingRuleDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class PortForwardingUsageParser {
     public static final Logger s_logger = Logger.getLogger(PortForwardingUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsagePortForwardingRuleDao m_usagePFRuleDao = _locator.getDao(UsagePortForwardingRuleDao.class);
+    private static UsageDao m_usageDao;
+    private static UsagePortForwardingRuleDao m_usagePFRuleDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsagePortForwardingRuleDao _usagePFRuleDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	_usagePFRuleDao = _usagePFRuleDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/SecurityGroupUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/SecurityGroupUsageParser.java b/usage/src/com/cloud/usage/parser/SecurityGroupUsageParser.java
index 2832385..ed7acf3 100644
--- a/usage/src/com/cloud/usage/parser/SecurityGroupUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/SecurityGroupUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsageSecurityGroupVO;
@@ -32,14 +35,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageSecurityGroupDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class SecurityGroupUsageParser {
     public static final Logger s_logger = Logger.getLogger(SecurityGroupUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageSecurityGroupDao m_usageSecurityGroupDao = _locator.getDao(UsageSecurityGroupDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageSecurityGroupDao m_usageSecurityGroupDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageSecurityGroupDao _usageSecurityGroupDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageSecurityGroupDao = _usageSecurityGroupDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/StorageUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/StorageUsageParser.java b/usage/src/com/cloud/usage/parser/StorageUsageParser.java
index 4d48e39..7542063 100644
--- a/usage/src/com/cloud/usage/parser/StorageUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/StorageUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.StorageTypes;
@@ -33,14 +36,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageStorageDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class StorageUsageParser {
     public static final Logger s_logger = Logger.getLogger(StorageUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageStorageDao m_usageStorageDao = _locator.getDao(UsageStorageDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageStorageDao m_usageStorageDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageStorageDao _usageStorageDao;
+ 
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageStorageDao = _usageStorageDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java b/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java
index 681e8ec..8d2e465 100644
--- a/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsageServer;
@@ -32,14 +35,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageVMInstanceDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class VMInstanceUsageParser {
     public static final Logger s_logger = Logger.getLogger(VMInstanceUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageVMInstanceDao m_usageInstanceDao = _locator.getDao(UsageVMInstanceDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageVMInstanceDao m_usageInstanceDao;
+
+    @Inject private static UsageDao _usageDao;;
+    @Inject private static UsageVMInstanceDao _usageInstanceDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageInstanceDao = _usageInstanceDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/VPNUserUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/VPNUserUsageParser.java b/usage/src/com/cloud/usage/parser/VPNUserUsageParser.java
index 089bf90..c9a863b 100644
--- a/usage/src/com/cloud/usage/parser/VPNUserUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/VPNUserUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsageVPNUserVO;
@@ -32,14 +35,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageVPNUserDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class VPNUserUsageParser {
     public static final Logger s_logger = Logger.getLogger(VPNUserUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageVPNUserDao m_usageVPNUserDao = _locator.getDao(UsageVPNUserDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageVPNUserDao m_usageVPNUserDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageVPNUserDao _usageVPNUserDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageVPNUserDao = _usageVPNUserDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/usage/src/com/cloud/usage/parser/VolumeUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/VolumeUsageParser.java b/usage/src/com/cloud/usage/parser/VolumeUsageParser.java
index db58f41..e797f1c 100644
--- a/usage/src/com/cloud/usage/parser/VolumeUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/VolumeUsageParser.java
@@ -22,6 +22,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.usage.UsageServer;
@@ -32,14 +35,22 @@ import com.cloud.usage.dao.UsageDao;
 import com.cloud.usage.dao.UsageVolumeDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentLocator;
+
 
 public class VolumeUsageParser {
     public static final Logger s_logger = Logger.getLogger(VolumeUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageVolumeDao m_usageVolumeDao = _locator.getDao(UsageVolumeDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageVolumeDao m_usageVolumeDao;
+
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageVolumeDao _usageVolumeDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageVolumeDao = _usageVolumeDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/utils/src/com/cloud/utils/IdentityProxy.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/IdentityProxy.java b/utils/src/com/cloud/utils/IdentityProxy.java
deleted file mode 100644
index 7e385fb..0000000
--- a/utils/src/com/cloud/utils/IdentityProxy.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// the License.  You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.utils;
-
-public class IdentityProxy {
-    private String _tableName;
-    private Long _value;
-    private String _idFieldName;
-
-    public IdentityProxy() {
-    }
-
-    public IdentityProxy(String tableName) {
-        _tableName = tableName;
-    }
-
-    public IdentityProxy(String tableName, Long id, String fieldName) {
-    	_tableName = tableName;
-    	_value = id;
-    	_idFieldName = fieldName;
-    }
-    
-    public String getTableName() {
-        return _tableName;
-    }
-
-    public void setTableName(String tableName) {
-        _tableName = tableName;
-    }
-
-    public Long getValue() {
-        return _value;
-    }
-
-    public void setValue(Long value) {
-        _value = value;
-    }
-    
-    public void setidFieldName(String value) {
-    	_idFieldName = value;
-    }
-    
-    public String getidFieldName() {
-    	return _idFieldName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/utils/src/com/cloud/utils/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/PropertiesUtil.java b/utils/src/com/cloud/utils/PropertiesUtil.java
index 3909ca8..90f8af8 100755
--- a/utils/src/com/cloud/utils/PropertiesUtil.java
+++ b/utils/src/com/cloud/utils/PropertiesUtil.java
@@ -17,6 +17,8 @@
 package com.cloud.utils;
 
 import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -28,6 +30,7 @@ import java.util.Set;
 import org.apache.log4j.Logger;
 
 public class PropertiesUtil {
+    private static final Logger s_logger = Logger.getLogger(PropertiesUtil.class);
     /**
      * Searches the class path and local paths to find the config file.
      * @param path path to find.  if it starts with / then it's absolute path.
@@ -116,4 +119,41 @@ public class PropertiesUtil {
         }
         return null;
     }
+
+    // Returns key=value pairs by parsing a commands.properties/config file
+    // with syntax; key=cmd;value (with this syntax cmd is stripped) and key=value
+    public static Map<String, String> processConfigFile(String[] configFiles) {
+        Map<String, String> configMap = new HashMap<String, String>();
+        Properties preProcessedCommands = new Properties();
+        for (String configFile : configFiles) {
+            File commandsFile = findConfigFile(configFile);
+            if (commandsFile != null) {
+                try {
+                    preProcessedCommands.load(new FileInputStream(commandsFile));
+                } catch (FileNotFoundException fnfex) {
+                    // in case of a file within a jar in classpath, try to open stream using url
+                    InputStream stream = PropertiesUtil.openStreamFromURL(configFile);
+                    if (stream != null) {
+                        try {
+                            preProcessedCommands.load(stream);
+                        } catch (IOException e) {
+                            s_logger.error("IO Exception, unable to find properties file:", fnfex);
+                        }
+                    } else {
+                        s_logger.error("Unable to find properites file", fnfex);
+                    }
+                } catch (IOException ioe) {
+                    s_logger.error("IO Exception loading properties file", ioe);
+                }
+            }
+        }
+
+        for (Object key : preProcessedCommands.keySet()) {
+            String preProcessedCommand = preProcessedCommands.getProperty((String) key);
+            int splitIndex = preProcessedCommand.lastIndexOf(";");
+            String value = preProcessedCommand.substring(splitIndex+1);
+            configMap.put((String)key, value);
+        }
+        return configMap;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/utils/src/com/cloud/utils/UriUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/UriUtils.java b/utils/src/com/cloud/utils/UriUtils.java
index 4a56988..a8b5ccb 100644
--- a/utils/src/com/cloud/utils/UriUtils.java
+++ b/utils/src/com/cloud/utils/UriUtils.java
@@ -32,7 +32,7 @@ public class UriUtils {
             throw new CloudRuntimeException("Unable to form nfs URI: " + host + " - " + path);
         }
     }
-    
+
     public static String formIscsiUri(String host, String iqn, Integer lun) {
         try {
             String path = iqn;
@@ -48,34 +48,34 @@ public class UriUtils {
 
     public static String formFileUri(String path) {
         File file = new File(path);
-        
+
         return file.toURI().toString();
     }
-    
+
     // a simple URI component helper (Note: it does not deal with URI paramemeter area)
     public static String encodeURIComponent(String url) {
-    	int schemeTail = url.indexOf("://");
-   	
-    	int pathStart = 0;
-    	if(schemeTail > 0)
-    		pathStart = url.indexOf('/', schemeTail + 3);
-    	else
-    		pathStart = url.indexOf('/');
-    	
-    	if(pathStart > 0) {
-    		String[] tokens = url.substring(pathStart + 1).split("/");
-    		if(tokens != null) {
-    			StringBuffer sb = new StringBuffer();
-    			sb.append(url.substring(0, pathStart));
-    			for(String token : tokens) {
-    				sb.append("/").append(URLEncoder.encode(token));
-    			}
-    			
-    			return sb.toString();
-    		}
-    	}
-    	
-		// no need to do URL component encoding
-		return url;
+        int schemeTail = url.indexOf("://");
+
+        int pathStart = 0;
+        if(schemeTail > 0)
+            pathStart = url.indexOf('/', schemeTail + 3);
+        else
+            pathStart = url.indexOf('/');
+
+        if(pathStart > 0) {
+            String[] tokens = url.substring(pathStart + 1).split("/");
+            if(tokens != null) {
+                StringBuffer sb = new StringBuffer();
+                sb.append(url.substring(0, pathStart));
+                for(String token : tokens) {
+                    sb.append("/").append(URLEncoder.encode(token));
+                }
+
+                return sb.toString();
+            }
+        }
+
+        // no need to do URL component encoding
+        return url;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/utils/src/com/cloud/utils/component/AdapterBase.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/AdapterBase.java b/utils/src/com/cloud/utils/component/AdapterBase.java
index e7be829..8fd374a 100644
--- a/utils/src/com/cloud/utils/component/AdapterBase.java
+++ b/utils/src/com/cloud/utils/component/AdapterBase.java
@@ -16,6 +16,7 @@
 // under the License.
 package com.cloud.utils.component;
 
+import java.util.List;
 import java.util.Map;
 
 import javax.naming.ConfigurationException;
@@ -34,6 +35,10 @@ public class AdapterBase implements Adapter {
     public String getName() {
         return _name;
     }
+    
+    public void setName(String name) {
+    	_name = name;
+    }
 
     @Override
     public boolean start() {
@@ -45,4 +50,12 @@ public class AdapterBase implements Adapter {
         return true;
     }
 
+    public static <T extends Adapter> T getAdapterByName(List<T> adapters, String name) {
+    	for(T adapter : adapters) {
+    		if(adapter.getName().equals(name))
+    			return adapter;
+    	}
+    	return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/utils/src/com/cloud/utils/component/Adapters.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/Adapters.java b/utils/src/com/cloud/utils/component/Adapters.java
deleted file mode 100755
index 2a2203f..0000000
--- a/utils/src/com/cloud/utils/component/Adapters.java
+++ /dev/null
@@ -1,93 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// the License.  You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.utils.component;
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.utils.EnumerationImpl;
-import com.cloud.utils.component.LegacyComponentLocator.ComponentInfo;
-
-/**
- * the iterator even during dynamic reloading.
- * 
- **/
-public class Adapters<T> implements Iterable<T> {
-    protected Map<String, T> _map; 
-    protected List<ComponentInfo<Adapter>> _infos;
-    
-    protected String      _name;
-
-    public Adapters(String name, List<ComponentInfo<Adapter>> adapters) {
-        _name = name;
-        set(adapters);
-    }
-
-    /**
-     * Get the adapter list name.
-     * 
-     * @return the name of the list of adapters.
-     */
-    public String getName() {
-        return _name;
-    }
-
-    public Enumeration<T> enumeration() {
-        return new EnumerationImpl<T>(_map.values().iterator());
-    }
-    
-    @Override
-    public Iterator<T> iterator() {
-        return new EnumerationImpl<T>(_map.values().iterator());
-    }
-
-    protected Collection<T> get() {
-        return _map.values();
-    }
-    
-    protected void set(List<ComponentInfo<Adapter>> adapters) {
-        HashMap<String, T> map = new LinkedHashMap<String, T>(adapters.size());
-        for (ComponentInfo<Adapter> adapter : adapters) {
-            @SuppressWarnings("unchecked")
-            T t = (T)adapter.instance;
-            map.put(adapter.getName(), t);
-        }
-        this._map = map;
-        this._infos = adapters;
-    }
-    
-    public T get(String name) {
-        return _map.get(name);
-    }
-
-    public boolean isSet() {
-        return _map.size() != 0;
-    }
-    
-    public static <T extends Adapter> T getAdapterByName(List<T> adapters, String name) {
-    	for(T adapter : adapters) {
-    		if(adapter.getName().equals(name))
-    			return adapter;
-    	}
-    	return null;
-    }
-}


Mime
View raw message