16.1 Annotation
An annotation is a form of metadata that provides data about a program that is not part of the program itself. Annotations have no direct effect on the operation of the code which is annotated. The annotation has a number of uses and a few of them are as follows:
An important use of annotation in test automation is to define the test type (functional, regression) and test functional area (customer accounts, funds transfer, etc., for a banking application). Once this information is defined as an annotation in tests, the tool can be written to selectively execute a specific type of test. Also, the tool can provide info about the test coverage in each functional area.
16.1 | Built-in Annotations
Java provides some built-in annotations. A few of them are listed below:
- Annotation can be used by the compiler to detect errors or suppress warnings.
- Annotations can be examined at runtime.
- Software tools can be written that process annotation information to generate code, XML files, etc.
An important use of annotation in test automation is to define the test type (functional, regression) and test functional area (customer accounts, funds transfer, etc., for a banking application). Once this information is defined as an annotation in tests, the tool can be written to selectively execute a specific type of test. Also, the tool can provide info about the test coverage in each functional area.
16.1 | Built-in Annotations
Java provides some built-in annotations. A few of them are listed below:
- @Override: Verifies that the specific method is an override. It causes a compile error if the method is not found in one of the parent classes or implemented interfaces.
- @Deprecated: Marks the specific method as obsolete. It causes a compile-time error if the specific method is used.
- @SuppressWarnings: Instructs the compiler to suppress the compile-time warnings which match the annotation parameters.
Section ‘Interfaces‘ shows the use of @Override annotation.
Annotations can also be used to annotate annotations. Listed as follows are few annotations that define the behavior of an annotation:
Annotations can also be used to annotate annotations. Listed as follows are few annotations that define the behavior of an annotation:
- @Retention: Specifies how the annotation is stored- whether in code only or compiles into the class or available at runtime through reflection.
- @Documented: Marks another annotation for inclusion in the documentation.
- @Target: Marks another annotation to restrict the kind of Java elements the annotation may be applied to.
- @Inherited: Marks another annotation to be inherited to a subclass of annotated class.
15 thoughts on “16.1 Annotation”
Comments are closed.
thanks for sharing this information
aws training in bangalore
Amazon web services training in bangalore
best AWS Training institute in Bangalore
aws certification course in bangalore
devops training in bangalore
devops training institutes in bangalore
devops certification course in bangalore
data science training in bangalore
nice post
aws training center in chennai
aws training in chennai
aws training institute in chennai
best angularjs training in chennai
angular js training in sholinganallur
angularjs training in chennai
azure training in chennai
data Science training in chennai
I really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.
shuttering works
I really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.
best seo company in bangalore SSS digital Marketing
It was helpful indeed. Thanks a lot for the content and Keep maintaining a great job…!
Pega Training in Chennai
Pega Training Institutes in Chennai
Tableau Training in Chennai
Oracle Training in Chennai
Oracle DBA Training in Chennai
Job Openings in Chennai
Social Media Marketing Courses in Chennai
Primavera Training in Chennai
Advanced Excel Training in Chennai
Embedded System Course Chennai
Spark Training in Chennai
Great Post!!! Thanks for sharing your blog and waiting for your new updates.
DevOps certification in Chennai
DevOps Training in Chennai
devops training in bangalore
devops training in coimbatore
Devops Course in Coimbatore
Best devops training in Coimbatore
devops training institutes in Coimbatore
ielts coaching centre in coimbatore
Excellent post, it will be definitely helpful for many people. Keep posting more like this.
Ethical Hacking course in Chennai
Ethical Hacking Training Institute in Chennai
Hacking course in Chennai
ccna Training in Chennai
Salesforce course in Chennai
PHP Training in Chennai
Tally course in Chennai
Ethical Hacking course in OMR
Ethical Hacking course in Anna Nagar
Ethical Hacking course in Vadapalani
Delhi Agra Jaipur Tour by Bus
Delhi to Jaipur Same Day Tour
Delhi One Day Tour Package
Delhi Sightseeing One Day
Delhi Sightseeing Tour by Bus
Delhi Jaipur One Day Tour Package
Haridwar, Rishikesh Tours by Volvo
Thanks for posting this.I got lots of information from your blog.
Software Testing Training in Chennai
Software Testing Training in Bangalore
Software Testing Training in Coimbatore
Software Testing Training in Madurai
Software Testing Training Institute in Chennai
Software Testing Course in Chennai
Testing Course in Chennai
Software Testing Training Institute in Bangalore
Selenium Course in Bangalore
Innovative blog thanks for sharing this inforamation.
content writing course in chennai
German Classes in Chennai
IELTS Coaching in Chennai
Japanese Classes in Chennai
Spoken English Classes in Chennai
TOEFL Coaching in Chennai
German Classes in Anna Nagar
Spoken English Classes in Anna Nagar
content writing training in chennai
Thanks for sharing the valuable information. This blog contains various good concept and ideas.
DOT NET Training in Chennai
DOT NET Training in Bangalore
DOT NET Training Institutes in Bangalore
DOT NET Course in Bangalore
Best DOT NET Training Institutes in Bangalore
DOT NET Institute in Bangalore
Dot NET Training in Marathahalli
AWS Training in Bangalore
Data Science Courses in Bangalore
DevOps Training in Bangalore
Thanks for sharing the useful information
software testing training in chennai
Such a wonderful article and I feel that it is best to write more on this topic. Thank you so much because i learn a lot of ideas about it. Keep posting…
Digital Marketing Course In Kolkata
Great Post with valuable information. I am glad that I have visited this site. Share more updates.
Spoken English Classes in Chennai
Thank you for the auspicious writeup. It in fact was a
amusement account it. Look advanced to more added agreeable from you!
However, how could we communicate?