You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/08/02 19:34:13 UTC

git commit: Removed obsolete file SearchCriteria2Test.java which caused ant unittest to fail. cleanup.sql cleans up CLOUD and CLOUD_USAGE databases which are required by many unit-testcases. RB: https://reviews.apache.org/r/6283/diff/3/ Send-by: saksham.

Updated Branches:
  refs/heads/master 895b6a3e4 -> e116c2498


Removed obsolete file SearchCriteria2Test.java which caused ant unittest
to fail.
cleanup.sql cleans up CLOUD and CLOUD_USAGE databases which are required
by many unit-testcases.
RB: https://reviews.apache.org/r/6283/diff/3/
Send-by: saksham.srivastava@citrix.com


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e116c249
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e116c249
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e116c249

Branch: refs/heads/master
Commit: e116c24989a3dcc0a3f116c7ef90664e4fe14b71
Parents: 895b6a3
Author: Edison Su <su...@gmail.com>
Authored: Thu Aug 2 10:33:06 2012 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Thu Aug 2 10:33:06 2012 -0700

----------------------------------------------------------------------
 build/developer.xml                                |    2 +
 .../cloud/agent/manager/SearchCriteria2Test.java   |   99 ---------------
 2 files changed, 2 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e116c249/build/developer.xml
----------------------------------------------------------------------
diff --git a/build/developer.xml b/build/developer.xml
index bfe496d..2d5f2db 100755
--- a/build/developer.xml
+++ b/build/developer.xml
@@ -325,6 +325,7 @@
         </fileset>
         <fileset dir="${server.test.dir}">
           <include name="**/*Test.java"/>
+          <exclude name="**/upgrade/*.java"/>
         </fileset>
       </batchtest>
     </junit>
@@ -354,6 +355,7 @@
         </fileset>
         <fileset dir="${server.test.dir}">
           <include name="**/${test}.java"/>
+          <exclude name="**/upgrade/*.java"/>
         </fileset>
       </batchtest>
     </junit>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e116c249/server/test/com/cloud/agent/manager/SearchCriteria2Test.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/agent/manager/SearchCriteria2Test.java b/server/test/com/cloud/agent/manager/SearchCriteria2Test.java
deleted file mode 100755
index 763c548..0000000
--- a/server/test/com/cloud/agent/manager/SearchCriteria2Test.java
+++ /dev/null
@@ -1,99 +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
-// 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.
-package com.cloud.agent.manager;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-
-import com.cloud.host.Host;
-import com.cloud.host.HostVO;
-import com.cloud.host.Status;
-import com.cloud.host.dao.HostDao;
-import com.cloud.host.dao.HostDaoImpl;
-import com.cloud.utils.component.ComponentLocator;
-import com.cloud.utils.component.MockComponentLocator;
-import com.cloud.utils.db.DbTestUtils;
-import com.cloud.utils.db.SearchCriteria2;
-import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.utils.db.SearchCriteriaService;
-import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.dao.VMInstanceDao;
-import com.cloud.vm.dao.VMInstanceDaoImpl;
-
-import junit.framework.TestCase;
-
-public class SearchCriteria2Test extends TestCase {
-    private static final Logger s_logger = Logger.getLogger(SearchCriteria2Test.class);
-    
-    @Override
-    @Before
-    public void setUp() throws Exception {
-        DbTestUtils.executeScript("cleanup.sql", false, true);
-        MockComponentLocator locator = new MockComponentLocator("management-server");
-        locator.addDao("HostDao", HostDaoImpl.class);
-        locator.addDao("VmInstance", VMInstanceDaoImpl.class);
-        s_logger.debug("Finding sample data from 2.1.12");
-        DbTestUtils.executeScript("fake", false, true);
-    }
-    
-    public void testSearch() {
-    	ComponentLocator locator = ComponentLocator.getCurrentLocator();
-    	
-    	HostDao _hostDao = locator.inject(HostDaoImpl.class);
-    	VMInstanceDao _vmDao = locator.inject(VMInstanceDaoImpl.class);
-    	
-    	
-    	s_logger.debug("Test seraching host:");
-    	SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
-    	sc.addAnd(sc.getEntity().getStatus(), Op.EQ, Status.Disconnected);
-    	List<HostVO> ups = sc.list();
-    	for (HostVO vo : ups) {
-    		s_logger.info("Host id: " + vo.getId() + " is Disconnected");
-    	}
-    	
-    	SearchCriteriaService<VMInstanceVO, VMInstanceVO> sc1 = SearchCriteria2.create(VMInstanceVO.class);
-    	sc1.addAnd(sc1.getEntity().getState(), Op.EQ, VirtualMachine.State.Running);
-    	List<VMInstanceVO> vms = sc1.list();
-    	for (VMInstanceVO vm : vms) {
-    		s_logger.info("Vm name:" + vm.getInstanceName());
-    	}
-    	
-    	sc1 = SearchCriteria2.create(VMInstanceVO.class);
-    	sc1.addAnd(sc1.getEntity().getInstanceName(), Op.EQ, "s-1-TEST");
-    	VMInstanceVO vo = sc1.find();
-    	s_logger.info("SSVM name is " + vo.getInstanceName());
-    	
-    	SearchCriteriaService<HostVO, Long> sc3 = SearchCriteria2.create(HostVO.class, Long.class);
-    	sc3.selectField(sc3.getEntity().getId());
-    	sc3.addAnd(sc3.getEntity().getStatus(), Op.EQ, Status.Disconnected);
-    	sc3.addAnd(sc3.getEntity().getType(), Op.EQ, Host.Type.Routing);
-    	List<Long> hostIds = sc3.list();
-    	for (Long id : hostIds) {
-    		s_logger.info("Host Id is " + id);
-    	}
-    }
-    
-    @Override
-    @After
-    public void tearDown() throws Exception {
-    }
-    
-}