當前位置: 首頁>>代碼示例>>Java>>正文


Java Warning類代碼示例

本文整理匯總了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()));
			}
		}
	};
}
 
開發者ID:valery1707,項目名稱:russian-requisites-validator,代碼行數:18,代碼來源:ArchitectureTest.java

示例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();
}
 
開發者ID:CMSgov,項目名稱:qpp-conversion-tool,代碼行數:17,代碼來源:NodeTest.java

示例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;
}
 
開發者ID:jqno,項目名稱:equalsverifier,代碼行數:22,代碼來源:Configuration.java

示例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();
}
 
開發者ID:ProgrammingLife2017,項目名稱:hygene,代碼行數:11,代碼來源:LinkTest.java

示例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();
}
 
開發者ID:ProgrammingLife2017,項目名稱:hygene,代碼行數:11,代碼來源:DummyEdgeTest.java

示例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();
}
 
開發者ID:ProgrammingLife2017,項目名稱:hygene,代碼行數:11,代碼來源:DummyNodeTest.java

示例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();
}
 
開發者ID:ProgrammingLife2017,項目名稱:hygene,代碼行數:11,代碼來源:SegmentTest.java

示例8: equalsContract

import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void equalsContract() {
	EqualsVerifier.forClass(SubPopulation.class)
			.usingGetClass()
			.suppress(Warning.NONFINAL_FIELDS)
			.verify();
}
 
開發者ID:CMSgov,項目名稱:qpp-conversion-tool,代碼行數:8,代碼來源:SubPopulationTest.java

示例9: equalsContract

import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void equalsContract() {
	EqualsVerifier.forClass(Metadata.class)
			.usingGetClass()
			.suppress(Warning.NONFINAL_FIELDS)
			.verify();
}
 
開發者ID:CMSgov,項目名稱:qpp-conversion-tool,代碼行數:8,代碼來源:MetadataTest.java

示例10: testEqualsContract

import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
void testEqualsContract() {
	EqualsVerifier.forClass(HealthCheck.class)
			.usingGetClass()
			.suppress(Warning.NONFINAL_FIELDS)
			.verify();
}
 
開發者ID:CMSgov,項目名稱:qpp-conversion-tool,代碼行數:8,代碼來源:HealthCheckTest.java

示例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
}
 
開發者ID:cereebro,項目名稱:cereebro,代碼行數:11,代碼來源:NodeTest.java

示例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();
}
 
開發者ID:fdlessard,項目名稱:EqualsProject,代碼行數:9,代碼來源:CustomerTest.java

示例13: testEqualsWithJqnoEqualsVerifier

import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void testEqualsWithJqnoEqualsVerifier() {
    EqualsVerifier.forClass(Address.class)
            .withRedefinedSubclass(ExtendedAddress.class)
            .suppress(Warning.NONFINAL_FIELDS)
            .verify();
}
 
開發者ID:fdlessard,項目名稱:EqualsProject,代碼行數:8,代碼來源:AddressTest.java

示例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();
}
 
開發者ID:fdlessard,項目名稱:EqualsProject,代碼行數:10,代碼來源:ExtendedAddressTest.java

示例15: testEqualsWithJqnoEqualsVerifier

import nl.jqno.equalsverifier.Warning; //導入依賴的package包/類
@Test
public void testEqualsWithJqnoEqualsVerifier() {

    EqualsVerifier.forClass(Address.class)
            .usingGetClass()
            .suppress(Warning.NONFINAL_FIELDS)
            .verify();
}
 
開發者ID:fdlessard,項目名稱:EqualsProject,代碼行數:9,代碼來源:AddressTest.java


注:本文中的nl.jqno.equalsverifier.Warning類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。