Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JUNIT optional parameter of Test annotattion
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


neelam
optional parameter of Test annotattion
1 Answer(s)      3 years and 11 months ago
Posted in : JUNIT


What are two optional parameters of @Test annotation ?


Advertisement
View Answers

December 6, 2010 at 4:51 PM


The Test annotation supports two optional parameters. The first, expected, declares that a test method should throw an exception. If it doesn't throw an exception or if it throws a different exception than the one declared, the test fails. For example, the following test succeeds :

@Test(expected=IndexOutOfBoundsException.class) public void outOfBounds() {
       new ArrayList<Object>().get(1);
    }

The second optional parameter, timeout, causes a test to fail if it takes longer than a specified amount of clock time (measured in milliseconds). The following test fails :

@Test(timeout=100) public void infinity() {
       while(true);
    }


Related Tutorials/Questions & Answers:
optional parameter of Test annotattion
optional parameter of Test annotattion   What are two optional parameters of @Test annotation ?   The Test annotation supports two optional... parameter, timeout, causes a test to fail if it takes longer than a specified amount
optional parameter of Test annotattion
optional parameter of Test annotattion   The Test annotation supports two optional parameters. The first, expected, declares that a test method... a different exception than the one declared, the test fails. For example, the following
Advertisements
specified in the Optional Package
specified in the Optional Package  What types of DataSource objects are specified in the Optional Package
Init Parameter
Init Parameter  How set Init Parameter in servlet
test case
test case  Hi Can you explain me how to write test case in java. regards kennedy
WRITE AND TEST
WRITE AND TEST   WRITE AND TEST PROGRAM TO ACCEPT A STRING? 1).WHICH STARTS WITH 'S' OR 's' 2).ENDS WITH "nd" 3) THE LENGTH OF THE STRING SHOULD BE 10 OR LESS
Java parameter passing
Java parameter passing  What type of parameter passing does Java support
validate parameter before using it
validate parameter before using it   How to validate the parameter before using it in JSP
Online test
Online test   I am creating a project for online test system. There should be a timer,on pressing next button it will retrieve a next question and it will show on the same page,on completion of test it will show result
java test
into an xml file using java? (test_sample.csv(it should contain at least 39 lines)) i...:\\Documents and Settings/janardhany/Desktop/test_sample.txt... FileInputStream("C:\\Documents and Settings/janardhany/Desktop/test_sample.xls
CODING TEST
/class structure ΓΆβ?¬ΒΆ Choice of data structures ΓΆβ?¬ΒΆ Unit Test cases ΓΆβ?¬Β
CODING TEST
/class structure ΓΆβ?¬ΒΆ Choice of data structures ΓΆβ?¬ΒΆ Unit Test cases ΓΆβ?¬Β
pass parameter names and values
pass parameter names and values  What is the <jsp:param> standard action?   The <jsp:param> standard action is used with <jsp:include> or <jsp:forward> to pass parameter names and values
Passing Parameter - JSP-Servlet
Passing Parameter  I would like to ask how to pass a parameter from javascript section into the jsp section.It will be something like this: function change() { var answer = document.getElementById('selc').value
SQL Out Parameter
SQL Out Parameter       SQL Out Parameter allows the stored procedure to the pass data value ... from SQL Out Parameter .In this Example we create a procedure 'abc
parameter meta data - JDBC
parameter meta data   i wnts to know about the finition of parameter in jdbc as well as the diffrent methods used in parameter meta data  Hi friend, public interface ResultSetMetaData An object that can be used
Parameter Tag:
Parameter Tag:       bean:parameter...) of the specified request parameter. This tag retrieve the value of the specified request parameter and define the attribute of  type String or String[] in page scope
Passing a parameter using URL string
Passing a parameter using URL string  How to pass a parameter using the URL string in a JSF application
Passing Parameter - JSP-Servlet
, there's var answer. I need to pass this parameter back into the jsp part, how should i do
Test and debug enterprise components
. (Optional) If the parameter.... (Optional) If the parameter is a complex... Test and debug enterprise components
Query to Test MySQL Performance
Query to Test MySQL Performance  Query to Test MySQL Performance
how to conduct the test in java
how to conduct the test in java  how to conduct the test in java
PHP add parameter to url - PHP
PHP add parameter to url  need an example of parse_url in PHP. Thanks in advance
unit test in php - PHP
unit test in php  How can i run the unit test in PHP
Junit @Test annotation
Junit @Test annotation  What is the Application of @Test Annotation in JUnit ?   The Test annotation tells JUnit that the public void method to which it is attached can be run as a test case : public class Example
Static Parameter
Static Parameter       In this section, we will develop a simple application to access the static parameters. We will use a JavaBean to set and get the static parameters. Each static parameter has a value
test case - JUNIT
test case  Hi i am doing project on online reservation i want to know how to write the test case template for this online reservation
passing parameter from html to applet
passing parameter from html to applet  how to pass the following from HTML to applet in Java code - font size,font style,font size?give me suitable code
Applet - Passing Parameter in Java Applet
(Graphics g), we prints the parameter value to test the value passed from html... Applet - Passing Parameter in Java Applet   ... of retrieving the parameter values passed from the html page. So, you can pass
how to pass the parameter in callable statement
how to pass the parameter in callable statement  calstat=conn.prepareCall("{call studentrc(?,?,?,?,?)}"); // it show error parameter value is null...=smark1,mark2=smark2,total=stotal where Regno=Regno; end;// how can i pass the parameter
online test project
online test project  i need online test project in java using struts...kindly help..   Have a look at the following link: http://www.roseindia.net/struts/struts/struts2.2.1/onlinetestapp
Advertisements
 

 

 

DMCA.com