Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.324.317 Times

Test::Unit::TestCase 0.14

  Date Added: February 07, 2010  |  Visits: 1.077

Test::Unit::TestCase

Report Broken Link
Printer Friendly Version


Product Homepage
Download (94 downloads)



Test::Unit::TestCase is a unit testing framework base class. SYNOPSIS package FooBar; use base qw(Test::Unit::TestCase); sub new { my $self = shift()->SUPER::new(@_); # your state for fixture here return $self; } sub set_up { # provide fixture } sub tear_down { # clean up after test } sub test_foo { # test the foo feature } sub test_bar { # test the bar feature } (Taken from the JUnit TestCase class documentation) A test case defines the "fixture" (resources need for testing) to run multiple tests. To define a test case: implement a subclass of TestCase define instance variables that store the state of the fixture initialize the fixture state by overriding set_up() clean-up after a test by overriding tear_down(). Each test runs in its own fixture so there can be no side effects among test runs. Here is an example: package MathTest; use base qw(Test::Unit::TestCase); sub new { my $self = shift()->SUPER::new(@_); $self->{value_1} = 0; $self->{value_2} = 0; return $self; } sub set_up { my $self = shift; $self->{value_1} = 2; $self->{value_2} = 3; } For each test implement a method which interacts with the fixture. Verify the expected results with assertions specified by calling $self->assert() with a boolean value. sub test_add { my $self = shift; my $result = $self->{value_1} + $self->{value_2}; $self->assert($result == 5); } Once the methods are defined you can run them. The normal way to do this uses reflection to implement run_test. It dynamically finds and invokes a method. For this the name of the test case has to correspond to the test method to be run. The tests to be run can be collected into a TestSuite. The framework provides different test runners, which can run a test suite and collect the results. A test runner either expects a method suite() as the entry point to get a test to run or it will extract the suite automatically. If you do not like the rather verbose backtrace that appears when a test fails, you can use the quell_backtrace() method. You will get any message provided, but not the backtrace..

Requirements: No special requirements
Platforms: Linux
Keyword: Base Fixture Libraries Programming Sub Test Testcase Testing Testunittestcase Unit Testing Unit Testing Framework Value
Users rating: 0/10

License: Freeware Size: 45.06 KB
USER REVIEWS
More Reviews or Write Review


TEST::UNIT::TESTCASE RELATED
Dictionaries  -  js functional and unit testing framework 2.3.0
JsFUnit is a Functional and Unit Testing framework for client-side (in-browser) JavaScript. It be based on jsUnit
31.59 KB  
Programming  -  Unit Testing Framework - XSLT 0.0.8.alpha
Unit Testing Framework - XSLT (UTF-X) is a JUnit extension for testing XSLT stylesheets.
12.09 MB  
Libraries  -  Test::Unit::TestSuite 0.14
Test::Unit::TestSuite is a unit testing framework base class. SYNOPSIS use Test::Unit::TestSuite; # more code here ... sub suite { my $class = shift; # create an empty suite my $suite = Test::Unit::TestSuite->empty_new("A Test Suite");...
45.06 KB  
Libraries  -  Test::Chunks 0.39
Test::Chunks is a Data Driven Testing Framework. NOTE - This module has been deprecated and replaced by Test::Base. This is basically just a renaming of the module. Test::Chunks was not the best name for this module. Please discontinue using...
32.77 KB  
Libraries  -  Test::Unit::tests::AllTests 0.14
Test::Unit::tests::AllTests is a unit testing framework self tests. SYNOPSIS # command line style use perl TestRunner.pl Test::Unit::tests::AllTests # GUI style use perl TkTestRunner.pl Test::Unit::tests::AllTests This class is used by...
45.06 KB  
Libraries  -  Test::Unit::TestRunner 0.14
Test::Unit::TestRunner is a unit testing framework helper class. SYNOPSIS use Test::Unit::TestRunner; my $testrunner = Test::Unit::TestRunner->new(); $testrunner->start($my_testcase_class); This class is the test runner for the command...
45.06 KB  
Libraries  -  Test::Unit::Runner::Terminal 0.25
Test::Unit::Runner::Terminal is a unit testing framework helper class. SYNOPSIS use Test::Unit::Runner::Terminal; my $testrunner = Test::Unit::Runner::Terminal->new(); $testrunner->start($my_test_class); This class is a test runner for...
75.78 KB  
Libraries  -  Test::Unit::InnerClass 0.14
Test::Unit::InnerClass is a unit testing framework helper class. SYNOPSIS This class is not intended to be used directly This class is used by the framework to emulate the anonymous inner classes feature of Java. It is much easier to port...
45.06 KB  
Libraries  -  Test::Unit::GTestRunner 0.04
Test::Unit::GTestRunner is a Unit testing framework helper class SYNOPSIS use Test::Unit::GTestRunner; Test::Unit::GTestRunner->new->start ($my_testcase_class); Test::Unit::GTestRunner::main ($my_testcase_class); If you just want to run...
63.49 KB  
Libraries  -  SipUnit 0.0.6b
SipUnit provides a test environment geared toward unit testing SIP applications. SipUnit project extends the JUnit test framework to incorporate SIP-specific assertions, and it provides a high-level API for performing the SIP operations needed to...
5.6 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB