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



Home Answers Viewqa JUNIT optional parameter of Test annotattion

Have Programming Question? Ask it here!
 
 
 


neelam
optional parameter of Test annotattion
1 Answer(s)      3 years and 9 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
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
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
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
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
CODING TEST
/class structure ΓΆβ?¬ΒΆ Choice of data structures ΓΆβ?¬ΒΆ Unit Test cases ΓΆβ?¬Β
CODING TEST
/class structure ΓΆβ?¬ΒΆ Choice of data structures ΓΆβ?¬ΒΆ Unit Test cases ΓΆβ?¬Β
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 Parameter - JSP-Servlet
, there's var answer. I need to pass this parameter back into the jsp part, how should i do
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
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
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
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
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
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
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
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
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
EclipsePro Test
EclipsePro Test       EclipsePro Test contains the powerful JUnit test generation... Eclipse development environment. JUnit Test Generation & Editing
Junit Test Suite
Junit Test Suite  Hi Sir I am a beginner to JUnit. I have created these three test classes - CounterTest,MyClassTest & PetTest. I want to run these all with a Test Suite. Please mention code with your answer. Best regards
JSP Session Parameter rewrite
JSP Session Parameter rewrite       In the section you will study about the session parameter... Parameter Rewrite</title> </head> <body> Last visit
pass parameter - file - Java Beginners
pass parameter - file  Hi, I want to pass paramter file to method. how it is possible. please send me example programs.   Hi Friend... immediately. file.jsp ========== File Parameter Use
Set Parameter - JSP-Interview Questions
Set Parameter  Hi, could someone please explain the process of setting parameter in the session from JSP with the help of code? Thanks!  Hi,In your JSP page use the Set Tag, and set the scope attribute
test cases problem
test cases problem  what to write in the testing phase of my project. My project is a JSP project that generate graphs from the student marks... 6.7.1..please help me with the test cases that could be made out
TEST JAMES MAIL SERVER
TEST JAMES MAIL SERVER  How to test Apache James Mail Server for stress? Which Load Generator should we use to create requests in the form of mail at a controlled rate for SMTP and POP3? Actually I needed to test JVM of the mail
Online Test System Project
Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database as mysql. my email address is help me. send a full project on online test system
online test system
online test system  Hi, 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
Online Test System Project
Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database as mysql.   Please visit the following links: http
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
online test application in java
Online Test Application Table Of Contents Introduction To Application Database Design Creating Data Access Object (DAO) Design Pattern Creating Views Writing Actions Mapping Application Admin Module User Module Download
JSP get Parameter
JSP get Parameter          JSP get Parameter is used to return the value of a request parameter passed as query string and posted data which is encoded
java test - Java Beginners
java test   Trace through the following program segment and state clearly the output that will be generated: public static void main(String [] args){ int no1; int no2; for (no1 = -2; no1 <= 1; no1++){ for (no2
Developing a program to test
Developing a program to test       Developing a program to test Given below program is to test the script : Qunit.html <
Test Actions
Test Actions An example of Testing a struts Action is given below using the junit. In this example the execute method is being test. HelloAction.java... method stub result = helloAction.execute(); super.setUp(); } @Test
Advertisements
 

 

 

DMCA.com