Professional Documents
Culture Documents
Hosts typically do not include intermediary network devices like switches and
routers, which are instead often categorized as nodes. A node is also a
broader term that includes anything connected to a network, while a host
requires an IP address. In other words, all hosts are nodes, but network
nodes are not hosts unless they require an IP address to function.
On a TCP/IP network, each host has a host number that, together with a
network identity, forms its own unique IP address. In the Open Systems
Interconnection (OSI) model, protocols in the transport layer, also known as
Layer 4, are responsible for communication between hosts. Hosts use various
protocols to communicate, including transmission control protocol (TCP) and
User Datagram Protocol (UDP).
DOM parser is a tree-based API. A tree-based API is centered around a tree structure and therefore
provides interfaces on components of a tree (which is a DOM document) such as Document
interface,Node interface, NodeList interface, Element interface, Attr interface and so on.
A DOM parser creates a tree structure in memory from the input document and then waits for requests
from client. A DOM parser always serves the client application with the entire document no matter
how much is actually needed by the client. With DOM parser, method calls in client application have
to be explicit and forms a kind of chained method calls.
SAX parser is a event-based API. Usually an event-based API provides interfaces on handlers. There
are four handler interfaces, ContentHandlerinterface, DTDHandler interface, EntityResolver interface
and ErrorHandler interface.
SAX parser does not create any internal structure. Instead, it takes the occurrences of components of a
input document as events, and tells the client what it reads as it reads through the input document.
SAX parser serves the client application always only with pieces of the document at any given time.
With SAX parser, some custom methods are called [ “callback” methods ] when some certain events
occur during parsing on xml document. These methods do not have to be called explicitly by the
client, though we could call them explicitly.
SAX
verify that an exception is being thrown by the program during execution. TestNG provides a feature
to test such scenarios by allowing the user to specify the type of exceptions that are expected to be
thrown by a test method during execution. It supports multiple values being provided for verification.
If the exception thrown by the test is not part of the user entered list, the test method will be marked
as failed.
@Test(timeOut = 300)
We can specify a timeout for our TestNG tests. This can be done in the test class by setting
timeOutproperty of @Test annotation.
dependsOnMethods to tell TestNG which methods this test is dependent on, so those methods
should be executed before this method.
DependsOnGroup test depends on any other groups. This is helpful when we have multiple methods
and they are grouped together. So we can simply specify the group this test depends on, rather than
specifying the huge list of all the methods.
@Before Methods annotated with the annotation are executed before each test. This is useful when
we want to execute some common code before running a test.
@BeforeSuite @BeforeSuite
3 @BeforeClass
is invoked.
4 @AfterClass
have run.
5 @BeforeTest
6 @AfterTest
invoked.
8 @AfterGroups
invoked.
9 @BeforeMethod
test method.
10 @AfterMethod
test method.
11 @DataProvider
annotation.
12 @Factory
13 @Listeners
14 @Parameters
method.
15 @Test Marks a class or a method as a part of
the test