Maven Flashcards

1
Q

XML

A

Extensible Markup Language) is a widely-used markup language for representing and exchanging structured data. It provides a way to describe data in a hierarchical format using tags similar to HTML. XML is often used to store and transport data between different systems in a platform-independent manner.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

XML Attributes:

A

provide additional information about the element and are defined within the opening tag of an element.

<book>
</book>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

XML Comments

A

<!-- This is a sample XML document -->

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

XML Declaration

A

specifies the version of XML being used and can include an encoding declaration for character encoding.

<?xml version=”1.0” encoding=”UTF-8”?>

<book>
<!-- ... -->
</book>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

assertThrows

A

In JUnit 5, the ____ method is used for asserting that a certain exception is thrown by a piece of code. It’s particularly useful for testing methods that are expected to throw exceptions under specific conditions.

Suppose you have a Calculator class with a method divide that throws an ArithmeticException when attempting to divide by zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

assertThrows - visual

A

@Test
void testDivideByZero() {
assertThrows(ArithmeticException.class, () -> {
Calculator.divide(10, 0);
});
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Assertions.fails()

A

The __ assertion fails a test throwing an AssertionFailedError. It can be used to verify that an actual exception is thrown, or when we want to make a test fail during its development.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Maven lifecycle

A
  1. clean: This phase is responsible for cleaning up the output generated from previous builds.

mvn clean

  1. validate: In this phase, Maven validates the project files, e.g., checking if all required information is available.
  2. compile: During this phase, Maven compiles the source code of the project.
  3. test: In the test phase, Maven runs unit tests for the project.
  4. package: In this phase, Maven packages the compiled code into a distributable format, such as JAR, WAR, or EAR.
  5. install: The install phase installs the package into the local Maven repository. This allows other projects on the same machine to depend on it.
  6. deploy: This phase deploys the final package to a remote repository, making it available to other developers or projects.
  7. verify: The verify phase runs any checks to verify the package is valid and meets quality criteria.
  8. site: During the site phase, Maven generates project documentation and reports.
  9. clean site: If you want to clean the previously generated site, you can use this phase.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Surefilre Plugin

A

used during the test phase of the build lifecycle to execute the unit tests of an application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Surefilre Plugin - reports formats

A
  • Plain text files (.txt)
  • XML files (.xml)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Surefilre Plugin - goal

A

This plugin has only one goal, test. This goal is bound to the test phase of the default build lifecycle,and the command mvn testwill execute it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Surefilre Plugin - configuration

A

__ can work with the test frameworks JUnit and TestNG. No matter which framework we use, the behavior of surefire is the same.

By default, surefireautomatically includes all test classes whose name starts with Test, or ends with Test, Tests or TestCase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Maven

A

Maven is a powerful project management tool by the Apache Group that is based on POM (project object model). The tool provides allows developers to build and document the lifecycle framework.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Build tools

A

tools or programs that help create an executable application from the source code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly