本文整理匯總了Java中nl.jqno.equalsverifier.Warning類的典型用法代碼示例。如果您正苦於以下問題:Java Warning類的具體用法?Java Warning怎麽用?Java Warning使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Warning類屬於nl.jqno.equalsverifier包,在下文中一共展示了Warning類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: equalsContract
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
private static ArchCondition<JavaClass> equalsContract() {
return new ArchCondition<JavaClass>("implement equals and hashCode methods") {
@Override
public void check(JavaClass item, ConditionEvents events) {
String msg = "class " + item.getName();
try {
EqualsVerifier
.forClass(item.reflect())
.suppress(Warning.STRICT_INHERITANCE)
.verify();
events.add(SimpleConditionEvent.satisfied(item, msg + " match satisfy contract"));
} catch (AssertionError e) {
events.add(SimpleConditionEvent.violated(item, msg + " fail equals contract: " + e.getMessage()));
}
}
};
}
示例2: testEquals
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEquals() {
Node parent = new Node(TemplateId.CLINICAL_DOCUMENT);
Node child1 = new Node(TemplateId.IA_SECTION);
child1.setParent(parent);
Node child2 = new Node(TemplateId.ACI_SECTION);
child2.setParent(parent);
parent.setChildNodes(child1, child2);
EqualsVerifier.forClass(Node.class)
.withPrefabValues(List.class, Lists.newArrayList(new Node()), Lists.newArrayList(new Node(TemplateId.CLINICAL_DOCUMENT), new Node(TemplateId.ACI_NUMERATOR)))
.withPrefabValues(Node.class, new Node(TemplateId.ACI_DENOMINATOR), parent)
.withIgnoredFields("parent")
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例3: Configuration
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
private Configuration(Class<T> type, PrefabValues prefabValues, List<T> equalExamples, List<T> unequalExamples, Set<String> actualFields,
Set<String> excludedFields, Set<String> includedFields, Set<String> nonnullFields, Set<String> ignoredAnnotations,
CachedHashCodeInitializer<T> cachedHashCodeInitializer, boolean hasRedefinedSuperclass,
Class<? extends T> redefinedSubclass, boolean usingGetClass, EnumSet<Warning> warningsToSuppress) {
this.type = type;
this.typeTag = new TypeTag(type);
this.prefabValues = prefabValues;
this.equalExamples = equalExamples;
this.unequalExamples = unequalExamples;
this.actualFields = actualFields;
this.excludedFields = excludedFields;
this.includedFields = includedFields;
this.nonnullFields = nonnullFields;
this.ignoredAnnotations = ignoredAnnotations;
this.cachedHashCodeInitializer = cachedHashCodeInitializer;
this.hasRedefinedSuperclass = hasRedefinedSuperclass;
this.redefinedSubclass = redefinedSubclass;
this.usingGetClass = usingGetClass;
this.warningsToSuppress = warningsToSuppress;
}
示例4: testEquals
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEquals() {
EqualsVerifier.forClass(Link.class)
.withRedefinedSuperclass()
.withPrefabValues(Node.class,
new DummyNode(mock(Node.class), mock(Node.class)),
new DummyNode(mock(Node.class), mock(Node.class)))
.suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
.verify();
}
示例5: testEquals
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEquals() {
EqualsVerifier.forClass(DummyEdge.class)
.withRedefinedSuperclass()
.withPrefabValues(Node.class,
new DummyNode(mock(Node.class), mock(Node.class)),
new DummyNode(mock(Node.class), mock(Node.class)))
.suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
.verify();
}
示例6: testEquals
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEquals() {
EqualsVerifier.forClass(DummyNode.class)
.withRedefinedSuperclass()
.withPrefabValues(Node.class,
new DummyNode(mock(Node.class), mock(Node.class)),
new DummyNode(mock(Node.class), mock(Node.class)))
.suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
.verify();
}
示例7: testEquals
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEquals() {
EqualsVerifier.forClass(Segment.class)
.withRedefinedSuperclass()
.withPrefabValues(Node.class,
new Segment(59, 56, 15),
new Segment(21, 48, 88))
.suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
.verify();
}
示例8: equalsContract
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void equalsContract() {
EqualsVerifier.forClass(SubPopulation.class)
.usingGetClass()
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例9: equalsContract
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void equalsContract() {
EqualsVerifier.forClass(Metadata.class)
.usingGetClass()
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例10: testEqualsContract
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEqualsContract() {
EqualsVerifier.forClass(HealthCheck.class)
.usingGetClass()
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例11: verifyHashcodeEquals
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void verifyHashcodeEquals() {
// @formatter:off
EqualsVerifier.forClass(Node.class)
.usingGetClass()
.withIgnoredFields("x", "y", "size")
.suppress(Warning.STRICT_INHERITANCE)
.verify();
// @formatter:on
}
示例12: testEqualsWithJqnoEqualsVerifier
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void testEqualsWithJqnoEqualsVerifier() {
EqualsVerifier.forClass(Customer.class)
.suppress(Warning.STRICT_INHERITANCE)
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例13: testEqualsWithJqnoEqualsVerifier
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void testEqualsWithJqnoEqualsVerifier() {
EqualsVerifier.forClass(Address.class)
.withRedefinedSubclass(ExtendedAddress.class)
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例14: testEqualsWithJqnoEqualsVerifier
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void testEqualsWithJqnoEqualsVerifier() {
EqualsVerifier.forClass(ExtendedAddress.class)
.withRedefinedSuperclass()
.suppress(Warning.STRICT_INHERITANCE)
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
示例15: testEqualsWithJqnoEqualsVerifier
import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void testEqualsWithJqnoEqualsVerifier() {
EqualsVerifier.forClass(Address.class)
.usingGetClass()
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}