473,326 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to write the harness test in Perl?

47
I have no idea what the harness test look like.. can anyone help me to write the test class.


if i have method like :
Expand|Select|Wrap|Line Numbers
  1. sub languages{
  2.     my $self = shift;
  3.     if (!$self->{LANGUAGE})
  4.     {
  5.         my @language = ();
  6.         my $statement = $db->prepare("select  languageId, languageName
  7.                                         from language");
  8.         $statement->execute();
  9.  
  10.         while(my @array = $statement->fetchrow_array()){
  11.             my ($id , $name) = @array;
  12.             my $object = Language->new();
  13.             $object->id($id);
  14.             $object->name($name);
  15.             push (@language, $object);    
  16.         }            
  17.  
  18.     }
  19.     return @language;
  20. }
  21. 1;
  22.  
  23.  
how can i write the test class dot t.

I am so confused about it. please help

thanks
Mar 4 '11 #1
2 1677
miller
1,089 Expert 1GB
To learn about writing test cases, just study the following cpan modules:

Then, after you're exposed to that, simply download and inspect any CPAN module and to learn from the example of their test cases.

- Miller
Mar 4 '11 #2
numberwhun
3,509 Expert Mod 2GB
You can also check out any of the plethora of tutorials that exist on the internet.

Regards,

Jeff
Mar 4 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question...
1
by: rk | last post by:
Hi, I'm trying to write a cgi/perl programs to post a report like the following format in which the the user has to feed the values(nos) in the boxes under % Done Qual Rel. Stab P1 p2 P3.......
1
by: von | last post by:
I am trying to write a single piece of data (that is generated from a Javascript) to a text file on my server via a Perl script. The Javascript is setup so that I can display the required data on...
6
by: atinti | last post by:
I'm tyring to write something that will send a simple email using Perl so far this is what I have #!/usr/bin/perl -w use strict; my $executable = "saplotus.exe'; my $server =...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
3
by: suresh Gautam | last post by:
I have MS-SQL procedure for reporting purpose. It accepts various parameters and gives the table variable after applying the different logic. Now, I need to write the test script to verify the...
3
by: rellaboyina | last post by:
Hi All, I want to test the Mason components and perl Modules using the modules available in Perl. I have already gone through the modules like Test::Harness, Test::Simple, Test::More,...
0
by: TheFunkyGibbon | last post by:
Hello, 1st post. Now the problem here is that I have never written a test script. I have an interview with ITV next thursday as a Test Analyst and I want to make a good impression. I know how to...
9
by: TeenaRoz | last post by:
HI, I am new to perl and I am trying to write a perl script which does the following: Can someone help me? Firstly, There are a set of files named yyy.properties present in many folders in...
3
by: pramod1984 | last post by:
#!/usr/bin/perl # PERL MODULES WE WILL BE USING use DBI; use DBD::mysql; use Asterisk::AGI; $AGI = new Asterisk::AGI; # HTTP HEADER
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.