org.ldp4j.commons.testing.Utils.defaultToString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(77)

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

Utils.defaultToString介绍

[英]Returns the default string representation of an object as implemented in the Object class.
[中]返回对象类中实现的对象的默认字符串表示形式。

代码示例

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testDefaultToString$regularImplementation() {
  Object obj=new Object();
  assertThat(Utils.defaultToString(obj),equalTo(obj.toString()));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testDefaultToString$customObjectOverridingHashButNotEquals() {
  Object obj=new CustomHashObject(1234);
  assertThat(Utils.defaultToString(obj),equalTo(obj.toString()));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testToString() throws Exception {
  assertThat(
    this.sut.toString(),
    not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testDefaultToString$customObjectNotOverridingHashNorEquals() {
  Object obj=new CustomObject();
  assertThat(Utils.defaultToString(obj),equalTo(obj.toString()));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testToString() throws Exception {
  assertThat(
    this.sut.toString(),
    not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testToString$nonEmpty() throws Exception {
  assertThat(this.sut.toString(),not(equalTo(Utils.defaultToString(this.sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void hasCustomToString() throws Exception {
  assertThat(sut.toString(),not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testHasCustomStringRepresentation() {
  ImmutableElementParameter sut = createParameter("header", "value");
  assertThat(sut.toString(),not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testHasCustomStringRepresentation() {
  ImmutableElement sut = createElement("header");
  assertThat(sut.toString(),not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testHasCustomStringRepresentation() {
  ImmutableHeader sut = createHeader("header", "value");
  assertThat(sut.toString(),not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testToString() throws Exception {
  ApplicationContext sut = createContext();
  assertThat(
    sut.toString(),
    not(equalTo(Utils.defaultToString(sut))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testToString$empty() throws Exception {
  final ImmutableNamespaces ns = new ImmutableNamespaces();
  assertThat(ns.toString(),not(equalTo(Utils.defaultToString(ns))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testHasCustomStringRepresentation() {
  assertThat(singleValuedParameter().toString(),not(equalTo(Utils.defaultToString(singleValuedParameter()))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void hasCustomStringRepresentation() {
  final Weighted<String> original=Weighted.newInstance().withWeight(0.123D).withEntity("text/turtle");
  assertThat(original.toString(),not(equalTo(Utils.defaultToString(original))));
}

代码示例来源:origin: ldp4j/ldp4j

@Test
public void testHasCustomStringRepresentation() {
  assertThat(queryWithParameters().toString(),not(equalTo(Utils.defaultToString(queryWithParameters()))));
}

相关文章