com.google.common.truth.Subject.isNotInstanceOf()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(104)

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

Subject.isNotInstanceOf介绍

[英]Fails if the subject is an instance of the given class.
[中]如果主题是给定类的实例,则失败。

代码示例

代码示例来源:origin: google/guava

public void testCreate() {
 Subscriber s1 = Subscriber.create(bus, this, getTestSubscriberMethod("recordingMethod"));
 assertThat(s1).isInstanceOf(Subscriber.SynchronizedSubscriber.class);
 // a thread-safe method should not create a synchronized subscriber
 Subscriber s2 = Subscriber.create(bus, this, getTestSubscriberMethod("threadSafeMethod"));
 assertThat(s2).isNotInstanceOf(Subscriber.SynchronizedSubscriber.class);
}

代码示例来源:origin: uber/AutoDispose

@Test public void lifecycleShouldNotExposeUnderlyingDelegate() {
  assertThat(testLifecycleScopeProvider.lifecycle()).isNotInstanceOf(Subject.class);
 }
}

代码示例来源:origin: google/guava

@Test
public void immutableGraph() {
 MutableGraph<String> mutableGraph = GraphBuilder.directed().build();
 mutableGraph.addNode("A");
 ImmutableGraph<String> immutableGraph = ImmutableGraph.copyOf(mutableGraph);
 assertThat(immutableGraph).isNotInstanceOf(MutableValueGraph.class);
 assertThat(immutableGraph).isEqualTo(mutableGraph);
 mutableGraph.addNode("B");
 assertThat(immutableGraph).isNotEqualTo(mutableGraph);
}

代码示例来源:origin: google/guava

@Test
public void immutableValueGraph() {
 MutableValueGraph<String, Integer> mutableValueGraph = ValueGraphBuilder.directed().build();
 mutableValueGraph.addNode("A");
 ImmutableValueGraph<String, Integer> immutableValueGraph =
   ImmutableValueGraph.copyOf(mutableValueGraph);
 assertThat(immutableValueGraph.asGraph()).isInstanceOf(ImmutableGraph.class);
 assertThat(immutableValueGraph).isNotInstanceOf(MutableValueGraph.class);
 assertThat(immutableValueGraph).isEqualTo(mutableValueGraph);
 mutableValueGraph.addNode("B");
 assertThat(immutableValueGraph).isNotEqualTo(mutableValueGraph);
}

代码示例来源:origin: google/guava

@Test
public void immutableNetwork() {
 MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
 mutableNetwork.addNode("A");
 ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
 assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
 assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
 assertThat(immutableNetwork).isEqualTo(mutableNetwork);
 mutableNetwork.addNode("B");
 assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}

代码示例来源:origin: google/guava

assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
InetAddress mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("192.168.0.1"), mapped);
assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("192.168.0.1"), mapped);
assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("1.2.3.4"), mapped);
assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("1.2.3.4"), mapped);

代码示例来源:origin: pwittchen/ReactiveNetwork

assertThat(settings.httpResponse()).isEqualTo(httpResponse);
assertThat(settings.errorHandler()).isNotNull();
assertThat(settings.errorHandler()).isNotInstanceOf(DefaultErrorHandler.class);
assertThat(settings.strategy()).isInstanceOf(SocketInternetObservingStrategy.class);

代码示例来源:origin: org.apache.ws.commons.axiom/saaj-testsuite

@Override
  protected void runTest() throws Throwable {
    Document doc = newSOAPFactory().createElement(new QName("test")).getOwnerDocument();
    assertThat(doc).isNotInstanceOf(SOAPPart.class);
    assertThat(doc).isNotInstanceOf(javax.xml.soap.Node.class);
    assertThat(doc.createElementNS(null, "test")).isInstanceOf(SOAPElement.class);
  }
}

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

protected void runTest() throws Throwable {
    Document doc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(" <!-- --> <root/> ")));
    Node child = doc.getFirstChild();
    do {
      assertThat(child).isNotInstanceOf(Text.class);
      child = child.getNextSibling();
    } while (child != null);
    
    child = doc.getLastChild();
    do {
      assertThat(child).isNotInstanceOf(Text.class);
      child = child.getPreviousSibling();
    } while (child != null);
    
    NodeList children = doc.getChildNodes();
    assertThat(children.getLength()).isEqualTo(2);
    assertThat(children.item(1)).isSameAs(doc.getDocumentElement());
  }
}

代码示例来源:origin: com.google.guava/guava-tests

public void testCreate() {
 Subscriber s1 = Subscriber.create(bus, this, getTestSubscriberMethod("recordingMethod"));
 assertThat(s1).isInstanceOf(Subscriber.SynchronizedSubscriber.class);
 // a thread-safe method should not create a synchronized subscriber
 Subscriber s2 = Subscriber.create(bus, this, getTestSubscriberMethod("threadSafeMethod"));
 assertThat(s2).isNotInstanceOf(Subscriber.SynchronizedSubscriber.class);
}

代码示例来源:origin: com.google.guava/guava-tests

@Test
public void immutableGraph() {
 MutableGraph<String> mutableGraph = GraphBuilder.directed().build();
 mutableGraph.addNode("A");
 ImmutableGraph<String> immutableGraph = ImmutableGraph.copyOf(mutableGraph);
 assertThat(immutableGraph).isNotInstanceOf(MutableValueGraph.class);
 assertThat(immutableGraph).isEqualTo(mutableGraph);
 mutableGraph.addNode("B");
 assertThat(immutableGraph).isNotEqualTo(mutableGraph);
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void existingSignedInUser_signInScreen_notVisible() {
 prepareOneTestUserOneTestProjectDialog(testUiProject);
 cleanLoadUsersAndProjects();
 assertThat(projectSelectionDialog.getCenterPanelWrapper().getComponent(0))
   .isNotInstanceOf(ProjectSelectorSignInPanel.class);
}

代码示例来源:origin: com.google.guava/guava-tests

@Test
public void immutableValueGraph() {
 MutableValueGraph<String, Integer> mutableValueGraph = ValueGraphBuilder.directed().build();
 mutableValueGraph.addNode("A");
 ImmutableValueGraph<String, Integer> immutableValueGraph =
   ImmutableValueGraph.copyOf(mutableValueGraph);
 assertThat(immutableValueGraph.asGraph()).isInstanceOf(ImmutableGraph.class);
 assertThat(immutableValueGraph).isNotInstanceOf(MutableValueGraph.class);
 assertThat(immutableValueGraph).isEqualTo(mutableValueGraph);
 mutableValueGraph.addNode("B");
 assertThat(immutableValueGraph).isNotEqualTo(mutableValueGraph);
}

代码示例来源:origin: com.google.guava/guava-tests

@Test
public void immutableNetwork() {
 MutableNetwork<String, Integer> mutableNetwork = NetworkBuilder.directed().build();
 mutableNetwork.addNode("A");
 ImmutableNetwork<String, Integer> immutableNetwork = ImmutableNetwork.copyOf(mutableNetwork);
 assertThat(immutableNetwork.asGraph()).isInstanceOf(ImmutableGraph.class);
 assertThat(immutableNetwork).isNotInstanceOf(MutableNetwork.class);
 assertThat(immutableNetwork).isEqualTo(mutableNetwork);
 mutableNetwork.addNode("B");
 assertThat(immutableNetwork).isNotEqualTo(mutableNetwork);
}

代码示例来源:origin: com.google.guava/guava-tests

assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
InetAddress mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("192.168.0.1"), mapped);
assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("192.168.0.1"), mapped);
assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("1.2.3.4"), mapped);
assertTrue(InetAddresses.isMappedIPv4Address(mappedStr));
mapped = InetAddresses.forString(mappedStr);
assertThat(mapped).isNotInstanceOf(Inet6Address.class);
assertEquals(InetAddress.getByName("1.2.3.4"), mapped);

相关文章