mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
46 lines
1.4 KiB
Java
46 lines
1.4 KiB
Java
package com.cloud.network.dao;
|
|
|
|
import java.util.List;
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
import com.cloud.network.ElasticLbVmMapVO;
|
|
import com.cloud.network.LoadBalancerVO;
|
|
import com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl;
|
|
import com.cloud.utils.component.ComponentLocator;
|
|
import com.cloud.vm.DomainRouterVO;
|
|
|
|
public class ElbVmMapDaoTest extends TestCase {
|
|
public void testFindByIp() {
|
|
ElasticLbVmMapDaoImpl dao = ComponentLocator.inject(ElasticLbVmMapDaoImpl.class);
|
|
|
|
ElasticLbVmMapVO map = dao.findOneByIp(3);
|
|
if (map == null) {
|
|
System.out.println("Not Found");
|
|
} else {
|
|
System.out.println("Found");
|
|
}
|
|
}
|
|
public void testFindUnused() {
|
|
ElasticLbVmMapDaoImpl dao = ComponentLocator.inject(ElasticLbVmMapDaoImpl.class);
|
|
|
|
List<DomainRouterVO> map = dao.listUnusedElbVms();
|
|
if (map == null) {
|
|
System.out.println("Not Found");
|
|
} else {
|
|
System.out.println("Found");
|
|
}
|
|
}
|
|
|
|
public void testFindLB() {
|
|
ElasticLbVmMapDaoImpl dao = ComponentLocator.inject(ElasticLbVmMapDaoImpl.class);
|
|
|
|
List<LoadBalancerVO> lbs = dao.listLbsForElbVm(12);
|
|
if (lbs == null) {
|
|
System.out.println("Not Found");
|
|
} else {
|
|
System.out.println("Found " + lbs.size() + " lbs");
|
|
}
|
|
}
|
|
}
|