static org.ovirt.engine.core.common.businessentities.network.VnicProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.network.VnicProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getNetworkId()).thenReturn(GUIDS[index]); return entity; } }
static org.ovirt.engine.core.common.businessentities.network.VnicProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.network.VnicProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getNetworkId()).thenReturn(GUIDS[index]); return entity; } }
static org.ovirt.engine.core.common.businessentities.network.VnicProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.network.VnicProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getNetworkId()).thenReturn(GUIDS[index]); return entity; } }
private void performProfilesActions(Guid networkGuid) { List<VnicProfileModel> profileModels = (List<VnicProfileModel>) getProfiles().getItems(); if (profileModels.isEmpty() || !getProfiles().getIsAvailable()) { return; } networkGuid = networkGuid == null ? getNetwork().getId() : networkGuid; ArrayList<ActionParametersBase> paramlist = new ArrayList<>(); for (VnicProfileModel profileModel : profileModels) { if (!StringHelper.isNullOrEmpty(profileModel.getProfile().getName())) { VnicProfile vnicProfile = profileModel.getProfile(); vnicProfile.setNetworkId(networkGuid); AddVnicProfileParameters parameters = new AddVnicProfileParameters(vnicProfile, !getNetwork().isExternal()); parameters.setPublicUse(profileModel.getPublicUse().getEntity()); paramlist.add(parameters); } } Frontend.getInstance().runMultipleActions(ActionType.AddVnicProfile, paramlist, (IFrontendActionAsyncCallback) null); // cast is required to avoid overload ambiguity }
@Test public void testGetEntityNameByIdAndTypeForVNICProfile() { VnicProfile vnicProfile = vnicProfileDao.get(FixturesTool.VM_NETWORK_INTERFACE_PROFILE); assertNotNull(vnicProfile); String name = vnicProfile.getName(); assertEquals(name, dao.getEntityNameByIdAndType(FixturesTool.VM_NETWORK_INTERFACE_PROFILE, VdcObjectType.VnicProfile)); }
@Override protected MapSqlParameterSource createFullParametersMapper(VnicProfile profile) { return createIdParameterMapper(profile.getId()) .addValue("name", profile.getName()) .addValue("network_id", profile.getNetworkId()) .addValue("network_qos_id", profile.getNetworkQosId()) .addValue("port_mirroring", profile.isPortMirroring()) .addValue("passthrough", profile.isPassthrough()) .addValue("migratable", profile.isMigratable()) .addValue("description", profile.getDescription()) .addValue("custom_properties", SerializationFactory.getSerializer().serialize(profile.getCustomProperties())) .addValue("network_filter_id", profile.getNetworkFilterId()); }
public EditVnicProfileModel(SearchableListModel<?, ?> sourceModel, VnicProfile profile, Guid dcId, boolean customPropertiesVisible) { super(sourceModel, customPropertiesVisible, dcId, profile.getNetworkQosId()); setTitle(constants.vnicProfileTitle()); setHelpTag(HelpTag.edit_vnic_profile); setHashName("edit_vnic_profile"); //$NON-NLS-1$ setProfile(profile); getName().setEntity(profile.getName()); getDescription().setEntity(profile.getDescription()); getPassthrough().setEntity(getProfile().isPassthrough()); getMigratable().setEntity(!getProfile().isPassthrough() || getProfile().isMigratable()); getPortMirroring().setEntity(getProfile().isPortMirroring()); getPublicUse().setIsAvailable(false); updateChangabilityIfVmsUsingTheProfile(); }