use of com.vmware.vim25.DuplicateNameFaultMsg in project photon-model by vmware.
the class VimUtilsTest method convertToFault.
@Test
public void convertToFault() {
DuplicateName fault = new DuplicateName();
String msg = "msg";
Exception e = new DuplicateNameFaultMsg(msg, fault);
LocalizedMethodFault lmf = VimUtils.convertExceptionToFault(e);
assertSame(fault, lmf.getFault());
assertSame(msg, lmf.getLocalizedMessage());
}
use of com.vmware.vim25.DuplicateNameFaultMsg in project photon-model by vmware.
the class VimUtilsTest method retrhowKnownException.
@Test
public void retrhowKnownException() {
DuplicateName dn = new DuplicateName();
LocalizedMethodFault lmf = new LocalizedMethodFault();
lmf.setLocalizedMessage("msg");
lmf.setFault(dn);
try {
VimUtils.rethrow(lmf);
fail();
} catch (DuplicateNameFaultMsg msg) {
assertSame(dn, msg.getFaultInfo());
assertSame(lmf.getLocalizedMessage(), msg.getMessage());
} catch (Exception e) {
fail();
}
}
Aggregations