My Articles:
The ability to group the related tests is one of the most important features of TestNG. Users can group multiple tests into a named group. The user can execute a particular set of tests belonging to a group or multiple groups. The test grouping feature allows the tests to be …
Learn to use the TestNG @DataProvider annotation that helps us to write data-driven parameter-based tests to run tests with different inputs.
TestNG parameterization feature allows user to pass parameters to tests as arguments. This is supported by using the testng @Parameters annotation.
Learn to configure TestNG tests to timeout after some pre-configured duration. Learn to configure timeout for test method, class and suite.
When executing TestNG tests, there may be some scenarios where you may have to disable a particular test or a test suite from getting executed. For example, consider a scenario where a serious bug exists in a feature due to certain tests belonging to certain scenarios that cannot be executed. …
Learn to write TestNG exception-based tests using the expectedExceptions attribute and assert messages with expectedExceptionsMessageRegExp.
TestNG before and after annotations. @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeGroups, @AfterGroups, @BeforeClass, @AfterClass, @BeforeMethod and @AfterMethod.
TestNG uses annotations to help developers to write the tests. Let us learn a few important testng annotations and their lifecycle.
Learn about TestNG features, installing the TestNG plugin into Eclipse and writing and executing TestNG tests through Eclipse IDE.
In this java regular expression tutorial, we will learn to use regex to validate credit card numbers. We will learn about number format and validations of credit card numbers from multiple providers such as VISA, Mastercard, Amex and Diners etc. 1. Valid Credit Card Numbers Formats On an actual credit …
Learn to use regular expressions for UK postcode validation in Java. You can modify the regex to suit it for any other format such as US postal codes.
Learn to use regular expressions for Canada postal code validation. Also learn the rules which must be applied to a valid canadian postal zip code.
Learn to use regular expressions for US zip code validation in Java. Also learn the regex rules to check a valid USA postal code.
Learn to use regular expressions to test whether a user has entered a valid International Standard Book Number (ISBN).
In this Java regex tutorial, we will learn to use regular expressions to test whether a user has entered a valid Social Security number in your application or website form. 1. Valid SSN Pattern United States Social Security numbers are nine-digit numbers in the format AAA-GG-SSSS with the following rules. …
In this Java regex tutorial, we will learn to test whether several lines in input text are between some minimum and maximum limit, without regard for how many total characters appear in the string. The regex for matching the number of lines will depend on the exact characters or character …
In this Java regex tutorial, we will learn to test whether the number of words in input text is within a certain minimum and maximum limit.
In this java regex tutorial, we will learn to test whether the length of input text is between some minimum and maximum limit.
To create a regular expression that allows only alphanumeric characters, we can use the regex pattern ^[a-zA-Z0-9]+$. This pattern ensures that the string consists solely of uppercase alphabets, lowercase alphabets, and digits. Alphanumeric characters are all alphabets and numbers i.e. letters A–Z, a–z, and digits 0–9. 1. Alphanumeric Regex Pattern …
You will get this exception message when you are trying to use named groups in java regex validation or matching. Root Cause of No match found Error in Regex Named Group Matching Error log will show the message like below: Solution You are probably not using “matcher.matches()” before fetching the …
In this Java date validation using regex, we will learn to validate simple date formats such as mm/dd/yy, mm/dd/yyyy, dd/mm/yy and dd/mm/yyyy. Here we want to use a regex that simply checks whether the input is a valid date without trying to eliminate things such as February 31st. We might …
In this regex tutorial, we will learn to validate international phone numbers based on industry-standard notation specified by ITU-T E.123. The rules and conventions used to print international phone numbers vary significantly around the world, so it’s hard to provide meaningful validation for an international phone number unless you adopt …
In this regex tutorial, we will learn to validate user-entered phone numbers for a specific format (in this example phone numbers are formatted in North American format) and if the numbers are correct then reformat them to a standard format for display. I have tested formats including 1234567890, 123-456-7890, 123.456.7890, …
Simple Java email validation example. Learn to validate email in Java using regular expressions. Five different regex patterns for email validation.
In this Java regular expression tutorial, we will learn to match any character which is part of “Greek Extended” unicode block or Greek script.
In this Java regex tutorial, learn to match all available currency symbols, e.g. $ Dollar, € Euro, ¥ Yen, in a String in Java.
In this Java regex example, we will learn to match trademark symbol ™ in a string using the regular expression.
Java regex word boundary example to match specific word or check if string contain word using Java regular expressions. java regex contain word example. java regex match specific word example.
Java regex word boundary example. Use regular expression word boundaries to find matching lines which start with or end with a certain words.
Java example of matching all common misspellings of any word in text content.
Learn how to delete a temporary file in Java. We will see examples to use File.deleteOnExit() and File.delete() methods.
Learn to create a temp file and directory in Java using the legacy and NIO classes. Also, learn to delete temp files or temp directories on JVM shutdown.
Learn to create a temporary file and write to it in Java. We will use the code sample used for creating a temporary file example.
Learn to check if a file exists or a directory exists in given path in Java. Also check is file is readable, writable or executable.
Java example to convert String to InputStream using ByteArrayInputStream and IOUtils classes. Writing String to InputSteam is a frequent job .
Learn reading data from files into a byte array in Java using NIO Files, FileInputStream, Commons IO FileUtils, and Guava ByteStreams classes.
Learn reading and writing UTF-8 content into a file using BufferedReader and BufferedWriter in Java.
Learn about hibernate Criteria query interface, its basics, syntax, fetching data with multiple conditions including pagination and sorting.
Learn what is hibernate query language, HQL syntaxes, named and native SQL queries, associations and aggregations with examples.
Learn to use the Hibernate @Immutable annotation to create immutable entities, similar to immutable classes in Java, a rather well-known concept.
Learn the basics and usage of JPA hibernate annotations used for creating entities, associations and named queries.
Learn the drawbacks and benefits of using the annotations configuration over XML files to better know when to apply which format.
Hibernate fetches data from the database either in eager or lazy mode. Lazy loading refers to a strategy when data is loaded on demand.
Learn JPA Cascade Types and how they are related to Hibernate Cascade Types. Learn how to control the orphan removal with an example.
Hibernate merge() does exactly the opposite of what refresh() does i.e. causing the updates to database with values from the detached entity.
Learn the different methods for persisting and updating the entity states in the database using Hibernate Session APIs to use save(), update() and saveOrUpdate() methods under different usecases. Starting Hibernate 6.0, all save(), update() and saveOrUpdate() methods have been marked deprecated in favor of Jakarta persistence API provided persist() and …
Learn the difference between get() vs load() methods that are used to fetch entity by id from the database using Hibernate.
Learn why it is important to implement hashCode() and equals() methods in hibernate entity classes. How does it affect different Sessions.
When we annotate the Java POJOs with JPA annotations and make them persistent entities, we can face situations where two entities can be related, and we must reference these entities from each other. This reference between the entities can be either uni-direction or in bi-direction. Creating these references is called …
A hibernate entity, in context to persistence context or Session, can have 4 lifecycle states: transient, persistent, detached and removed.