gpt4 book ai didi

org.opendaylight.controller.cluster.schema.provider.impl.YangTextSchemaSourceSerializationProxy.getRepresentation()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 21:56:31 25 4
gpt4 key购买 nike

本文整理了Java中org.opendaylight.controller.cluster.schema.provider.impl.YangTextSchemaSourceSerializationProxy.getRepresentation()方法的一些代码示例,展示了YangTextSchemaSourceSerializationProxy.getRepresentation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangTextSchemaSourceSerializationProxy.getRepresentation()方法的具体详情如下:
包路径:org.opendaylight.controller.cluster.schema.provider.impl.YangTextSchemaSourceSerializationProxy
类名称:YangTextSchemaSourceSerializationProxy
方法名:getRepresentation

YangTextSchemaSourceSerializationProxy.getRepresentation介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.controller/sal-clustering-commons

@Override
public void onComplete(Throwable throwable, YangTextSchemaSourceSerializationProxy yangTextSchemaSourceSerializationProxy) {
  if(yangTextSchemaSourceSerializationProxy != null) {
    res.set(yangTextSchemaSourceSerializationProxy.getRepresentation());
  }
  if(throwable != null) {
    res.setException(throwable);
  }
}

代码示例来源:origin: opendaylight/controller

@Override
public void onComplete(Throwable throwable,
    YangTextSchemaSourceSerializationProxy yangTextSchemaSourceSerializationProxy) {
  if (yangTextSchemaSourceSerializationProxy != null) {
    res.set(yangTextSchemaSourceSerializationProxy.getRepresentation());
  }
  if (throwable != null) {
    res.setException(throwable);
  }
}

代码示例来源:origin: opendaylight/controller

@Test
public void serializeAndDesrializeProxy() throws ClassNotFoundException, IOException {
  YangTextSchemaSourceSerializationProxy proxy = new YangTextSchemaSourceSerializationProxy(schemaSource);
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  ObjectOutputStream oos = new ObjectOutputStream(bos);
  oos.writeObject(proxy);
  ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));
  YangTextSchemaSourceSerializationProxy deserializedProxy =
      (YangTextSchemaSourceSerializationProxy) ois.readObject();
  assertEquals(deserializedProxy.getRepresentation().getIdentifier(), proxy.getRepresentation().getIdentifier());
  assertArrayEquals(deserializedProxy.getRepresentation().read(), proxy.getRepresentation().read());
}

代码示例来源:origin: opendaylight/controller

@Test
  public void testProxyEqualsBackingYangTextSource() throws IOException {
    YangTextSchemaSourceSerializationProxy serializationProxy =
        new YangTextSchemaSourceSerializationProxy(schemaSource);

    assertEquals(serializationProxy.getRepresentation().getIdentifier(), schemaSource.getIdentifier());
    assertArrayEquals(serializationProxy.getRepresentation().read(), schemaSource.read());
  }
}

代码示例来源:origin: opendaylight/controller

@Test
public void testGetExistingYangTextSchemaSource() throws Exception {
  String source = "Test source.";
  YangTextSchemaSource schemaSource = YangTextSchemaSource.delegateForByteSource(
      ID, ByteSource.wrap(source.getBytes()));
  Mockito.when(mockedLocalRepository.getSchemaSource(ID, YangTextSchemaSource.class)).thenReturn(
      Futures.immediateCheckedFuture(schemaSource));
  Future<YangTextSchemaSourceSerializationProxy> retrievedSourceFuture =
      remoteRepository.getYangTextSchemaSource(ID);
  assertTrue(retrievedSourceFuture.isCompleted());
  YangTextSchemaSource resultSchemaSource = Await.result(retrievedSourceFuture,
      FiniteDuration.Zero()).getRepresentation();
  assertEquals(resultSchemaSource.getIdentifier(), schemaSource.getIdentifier());
  assertArrayEquals(resultSchemaSource.read(), schemaSource.read());
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com