当前位置: 首页>>代码示例>>Java>>正文


Java DeviceProfile.addCommand方法代码示例

本文整理汇总了Java中org.edgexfoundry.domain.meta.DeviceProfile.addCommand方法的典型用法代码示例。如果您正苦于以下问题:Java DeviceProfile.addCommand方法的具体用法?Java DeviceProfile.addCommand怎么用?Java DeviceProfile.addCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.edgexfoundry.domain.meta.DeviceProfile的用法示例。


在下文中一共展示了DeviceProfile.addCommand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testValueDescriptorsForDeviceByName

import org.edgexfoundry.domain.meta.DeviceProfile; //导入方法依赖的package包/类
@Test
public void testValueDescriptorsForDeviceByName() {
  Device device = DeviceData.newTestInstance();
  DeviceProfile profile = ProfileData.newTestInstance();
  Command command = CommandData.newTestInstance();
  profile.addCommand(command);
  device.setProfile(profile);
  List<ValueDescriptor> valDes = new ArrayList<>();
  valDes.add(valueDescriptor);
  when(deviceClient.deviceForName(DeviceData.TEST_NAME)).thenReturn(device);
  when(valDescRepos.findByName(TEST_NAME)).thenReturn(valueDescriptor);
  List<ValueDescriptor> valueDescriptors =
      controller.valueDescriptorsForDeviceByName(DeviceData.TEST_NAME);
  checkTestData(valueDescriptors.get(0), TEST_ID);
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:16,代码来源:ValueDescriptorTest.java

示例2: testValueDescriptorsForDeviceById

import org.edgexfoundry.domain.meta.DeviceProfile; //导入方法依赖的package包/类
@Test
public void testValueDescriptorsForDeviceById() {
  Device device = DeviceData.newTestInstance();
  DeviceProfile profile = ProfileData.newTestInstance();
  Command command = CommandData.newTestInstance();
  profile.addCommand(command);
  device.setProfile(profile);
  List<ValueDescriptor> valDes = new ArrayList<>();
  valDes.add(valueDescriptor);
  when(deviceClient.device(TEST_ID)).thenReturn(device);
  when(valDescRepos.findByName(TEST_NAME)).thenReturn(valueDescriptor);
  List<ValueDescriptor> valueDescriptors = controller.valueDescriptorsForDeviceById(TEST_ID);
  checkTestData(valueDescriptors.get(0), TEST_ID);
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:15,代码来源:ValueDescriptorTest.java

示例3: update

import org.edgexfoundry.domain.meta.DeviceProfile; //导入方法依赖的package包/类
/**
 * update Command in DeviceProfile
 * 
 * @param name name which matched with Device and addressable
 * @param command updated Command
 * 
 * @return updated DeviceProfile
 */
public DeviceProfile update(String name, Command command) {
  if (deviceProfileClient == null || command == null) {
    return null;
  }

  DeviceProfile deviceProfile = deviceProfileClient.deviceProfileForName(name);
  deviceProfile.addCommand(command);
  return deviceProfile;
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:18,代码来源:DeviceProfileGenerator.java

示例4: setup

import org.edgexfoundry.domain.meta.DeviceProfile; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
  deviceClient = new DeviceClientImpl();
  srvClient = new DeviceServiceClientImpl();
  proClient = new DeviceProfileClientImpl();
  addrClient = new AddressableClientImpl();
  commandClient = new CommandClientImpl();
  client = new CmdClientImpl();
  setURL();
  Addressable addressable = AddressableData.newTestInstance();
  addrClient.add(addressable);
  DeviceService service = ServiceData.newTestInstance();
  service.setAddressable(addressable);
  srvClient.add(service);
  Command command = CommandData.newTestInstance();
  commandId = commandClient.add(command);
  DeviceProfile profile = ProfileData.newTestInstance();
  profile.addCommand(command);
  proClient.add(profile);
  Device device = DeviceData.newTestInstance();
  device.setAddressable(addressable);
  device.setProfile(profile);
  device.setService(service);
  id = deviceClient.add(device);
  assertNotNull("CommandDevice did not get created correctly", id);

}
 
开发者ID:edgexfoundry,项目名称:core-command-client,代码行数:28,代码来源:CmdClientTest.java


注:本文中的org.edgexfoundry.domain.meta.DeviceProfile.addCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。