Search in sources :

Example 1 with DeleteProjectCmd

use of org.apache.cloudstack.api.command.user.project.DeleteProjectCmd in project cloudstack by apache.

the class NetworkProviderTest method deleteProject.

public void deleteProject(String name) {
    BaseCmd cmd = new DeleteProjectCmd();
    BaseCmd proxy = ComponentContext.inject(cmd);
    ProjectVO project = _projectDao.findByNameAndDomain(name, Domain.ROOT_DOMAIN);
    try {
        ManagementServerMock.setParameter(proxy, "id", BaseCmd.CommandType.LONG, project.getId());
        ((DeleteProjectCmd) proxy).execute();
        if (_api.findById(net.juniper.contrail.api.types.Project.class, project.getUuid()) != null) {
            fail("unable to delete project in vnc");
        }
    } catch (Exception e) {
        e.printStackTrace();
        fail("Exception while deleting project");
    }
}
Also used : Project(net.juniper.contrail.api.types.Project) BaseCmd(org.apache.cloudstack.api.BaseCmd) DeleteProjectCmd(org.apache.cloudstack.api.command.user.project.DeleteProjectCmd) ProjectVO(com.cloud.projects.ProjectVO) CloudException(com.cloud.exception.CloudException) IOException(java.io.IOException)

Aggregations

CloudException (com.cloud.exception.CloudException)1 ProjectVO (com.cloud.projects.ProjectVO)1 IOException (java.io.IOException)1 Project (net.juniper.contrail.api.types.Project)1 BaseCmd (org.apache.cloudstack.api.BaseCmd)1 DeleteProjectCmd (org.apache.cloudstack.api.command.user.project.DeleteProjectCmd)1