Test Description and Specification for ValidationEventCollector tests



public ValidationEventCollector()

Description

Domain testing of input and output conditions, and external pre-conditions for class ValidationEventCollector, constructor public ValidationEventCollector().

Assertion testing

Assertion Expected results Test Case ID
ValidationEventCollector(): no exceptions are thrown. no exceptions CtorHandle001

Test Descriptions


See:
Test descriptions for CtorHandleTests.java (CtorHandle001)


public ValidationEvent[] getEvents()

Description

Domain testing of input and output conditions, and external pre-conditions for class ValidationEventCollector, method public ValidationEvent[] getEvents().

Assertion testing

Assertion Expected results Test Case ID
handleEvent(ValidationEvent event), event severity is: WARNING, ERROR, FATAL_ERROR, totally 6 events, getEvents() returns a copy of all the collected errors and warnings. getEvents() returns array of length 6, returned events are copies of handled CtorHandle005
no events were handled, getEvents() returns an empty array if there weren't any. getEvents() returns array of length 0 CtorHandle006
collector was cleared by reset(), getEvents() returns an empty array if there are not events collected. getEvents() returns an empty array CtorHandle007

Test Descriptions


See:
Test descriptions for CtorHandleTests.java (CtorHandle005, CtorHandle006, CtorHandle007)


public boolean handleEvent(ValidationEvent event)

Description

Domain testing of input and output conditions, and external pre-conditions for class ValidationEventCollector, method public boolean handleEvent(ValidationEvent event).

Assertion testing

Assertion Expected results Test Case ID
handleEvent(ValidationEvent event): event severity is ERROR, handleEvent(event) is invoked to cover handling ERRORs. CtorHandle001
handleEvent(ValidationEvent event): event severity is FATAL_ERROR, handleEvent(event) returns false. handleEvent(event) returns false CtorHandle002
handleEvent(ValidationEvent event): event severity is WARNING, handleEvent(event) is invoked to cover handling WARNINGs. CtorHandle003
handleEvent(null) is invoked, subsequent handleEvent(event) with FATAL_ERROR returns false. handleEvent(null) does not affect subsequent hasEvents(), handleEvent(event), getEvents() CtorHandle004

Test Descriptions


See:
Test descriptions for CtorHandleTests.java (CtorHandle001, CtorHandle002, CtorHandle003, CtorHandle004)


public boolean hasEvents()

Description

Domain testing of input and output conditions, and external pre-conditions for class ValidationEventCollector, method public boolean hasEvents().

Assertion testing

Assertion Expected results Test Case ID
no events were handled, hasEvents() returns false if this event collector contains no events. hasEvents() returns false CtorHandle006
collector was cleared by reset(), hasEvents() returns false if this event collector contains no events, otherwise true. hasEvents() returns true if events were handled, false after the collector was reset CtorHandle007

Test Descriptions

Test cases included:
CtorHandle001, CtorHandle002, CtorHandle003, CtorHandle004, CtorHandle005, CtorHandle006, CtorHandle007.

ItemValue
title Constructor tests
source CtorHandleTests.java
executeClass javasoft.sqe.tests.api.jakarta.xml.bind.helpers.ValidationEventCollector.CtorHandleTests
keywords runtime positive
executeArgs -TestCaseID ALL


public void reset()

Description

Domain testing of input and output conditions, and external pre-conditions for class ValidationEventCollector, method public void reset().

Assertion testing

Assertion Expected results Test Case ID
no events were handled, reset() clears all collected errors and warnings. reset() throws no exceptions, does not affect the empty collector CtorHandle006
several events were handled, reset() clears all collected errors and warnings. reset() clears all collected errors and warnings CtorHandle007

Test Descriptions


See:
Test descriptions for CtorHandleTests.java (CtorHandle006, CtorHandle007)


Last updated: 02/12/17
Copyright © 2017, 2020 Oracle and/or its affiliates. All rights reserved.