Search in sources :

Example 1 with VMTemplateStorageResourceAssoc

use of com.cloud.legacymodel.storage.VMTemplateStorageResourceAssoc in project cosmic by MissionCriticalCloud.

the class NotAValidCommand method testDestroyCommand.

@Test
public void testDestroyCommand() {
    final VMTemplateStorageResourceAssoc templateStorage = Mockito.mock(VMTemplateStorageResourceAssoc.class);
    final StoragePoolVO poolVO = Mockito.mock(StoragePoolVO.class);
    final DestroyCommand destroyCommand = new DestroyCommand(poolVO, templateStorage);
    final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(destroyCommand, this.citrixResourceBase);
    verify(this.citrixResourceBase, times(1)).getConnection();
    assertFalse(answer.getResult());
}
Also used : RebootAnswer(com.cloud.legacymodel.communication.answer.RebootAnswer) Answer(com.cloud.legacymodel.communication.answer.Answer) CreateAnswer(com.cloud.legacymodel.communication.answer.CreateAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) DestroyCommand(com.cloud.legacymodel.communication.command.DestroyCommand) StoragePoolVO(com.cloud.storage.datastore.db.StoragePoolVO) VMTemplateStorageResourceAssoc(com.cloud.legacymodel.storage.VMTemplateStorageResourceAssoc) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

Answer (com.cloud.legacymodel.communication.answer.Answer)1 AttachAnswer (com.cloud.legacymodel.communication.answer.AttachAnswer)1 CreateAnswer (com.cloud.legacymodel.communication.answer.CreateAnswer)1 RebootAnswer (com.cloud.legacymodel.communication.answer.RebootAnswer)1 DestroyCommand (com.cloud.legacymodel.communication.command.DestroyCommand)1 VMTemplateStorageResourceAssoc (com.cloud.legacymodel.storage.VMTemplateStorageResourceAssoc)1 StoragePoolVO (com.cloud.storage.datastore.db.StoragePoolVO)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1