Sponsored Content
Full Discussion: Test data creation
Top Forums Shell Programming and Scripting Test data creation Post 302474397 by pravin27 on Wednesday 24th of November 2010 07:27:31 AM
Old 11-24-2010
something like this,
Code:
sed -n $(( $RANDOM %`cat inputfile | wc -l` + 1))'p' inputfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Get data creation file

Hi, I've two machine A and B. On the machine B there's a script that get with an ftp command a file on the A machine. I want that creation data file on the machine B is the creation data file on the machine A. Example: File text.txt on machine A created on 01/01/2006 11:00. The script on the... (1 Reply)
Discussion started by: superfabius
1 Replies

2. UNIX for Dummies Questions & Answers

How to get a data creation file

Hi, I've two machine A and B. On the machine B there's a script that get with an ftp command a file on the A machine. I want that creation data file on the machine B is the creation data file on the machine A. Example: File text.txt on machine A created on 01/01/2006 11:00. The script on the... (2 Replies)
Discussion started by: superfabius
2 Replies

3. Shell Programming and Scripting

Creation of script,if the data file have more than one entry!!!

1.Daily there will be 14 files in the data directory 2.someday's the 14 files receive more than once r twice with different time stamps....we need to chk the count of the file and if the count of the file is two.we need to combine the both the files. 3. if any duplicate data is there just... (1 Reply)
Discussion started by: bobprabhu
1 Replies

4. Shell Programming and Scripting

Help with Creation of Script to Input Separators in Data

Hi all, I have one problem that is preparing datas so I can run a script to extrat informations for my statistic reports. I receive some datas, that are informations mixed and I need to separate them to analyse. This is an exemple of datas:... (8 Replies)
Discussion started by: Alexis Duarte
8 Replies

5. Shell Programming and Scripting

Extraction of data from multiple text files, and creation of a chart

Hello dear friends, My problem as explained below seems really basic. Fact is that I'm totally new to programming, and have only a week to produce a script ( CShell or Perl ? ) to perform this action. While searching on the forums, I found a command that could help me, but I don't know... (2 Replies)
Discussion started by: ackheron
2 Replies

6. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

7. Shell Programming and Scripting

data in file while creation

I want to add some starting information in a file while creation. like if I type vi test.sh then #!/bin/bash will be added automatically. Somebody suggest me how to do this ?? (1 Reply)
Discussion started by: lipun4u
1 Replies

8. Shell Programming and Scripting

"test*" file creation.

Hello All, I am not well-versed with Unix commands. While practicing I got following situation. My current working directory is empty and firstly, I created a file “test*” then I can see the file got created: > ls -ltr total 0 > > touch test* > > ls -ltr total 0 -rw-rw-rw- 1 kimxk ... (6 Replies)
Discussion started by: manishdivs
6 Replies

9. Shell Programming and Scripting

Capture the data in Linux .While doing load test.

Hi All, I am trying to capture the data in linux .While doing load test. is there's any sample script please help me. Linux test4 2.6.18-308.8.1.el5 #1 SMP Fri May 4 16:43:02 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux Thanks, (5 Replies)
Discussion started by: sam1226
5 Replies

10. Shell Programming and Scripting

Need help extracting data for report creation

Hi All, is there any way we can get the job names running with particular owner. Example: i want to get the job names running with owner as "autosys" (16 Replies)
Discussion started by: sdosanjh
16 Replies
Jifty::Test(3pm)					User Contributed Perl Documentation					  Jifty::Test(3pm)

NAME
Jifty::Test - Jifty's test module SYNOPSIS
use Jifty::Test tests => 5; # to load po for test: # use Jifty::Test tests => 5, l10n => 1; # ...all of Test::More's functionality... my $model = MyApp::Model::MyModel->new; $model->create(); ok($model->id, 'model works'); is($model->foo, 'some default', 'default works'); # Startup an external server (see Jifty::TestServer) my $server = Jifty::Test->make_server; my $server_url = $server->started_ok; # You're probably also interested in Jifty::Test::WWW::Mechanize DESCRIPTION
Jifty::Test is a superset of Test::More. It provides all of Test::More's functionality in addition to the class methods defined below. METHODS
is_passing my $is_passing = Jifty::Test->is_passing; Check if the test is currently in a passing state. o All tests run so far have passed o We have run at least one test o We have not run more than we planned (if we planned at all) is_done my $is_done = Jifty::Test->is_done; Check if we have run all the tests we've planned. If the plan is 'no_plan' then is_done() will return true if at least one test has run. setup ARGS This method is passed a single argument. This is a reference to the array of parameters passed in to the import statement. Merges the "test_config" into the default configuration, resets the database, and resets the fake "outgoing mail" folder. This is the method to override if you wish to do custom setup work, such as insert test data into your database. package MyApp::Test; use base qw/ Jifty::Test /; sub setup { my $self = shift; my $args = shift; # Make sure to call the super-class version $self->SUPER::setup($args); # Now that we have the database and such... my %test_args = @$args; if ($test_arg{something_special}) { # do something special... } } And later in your tests, you may do the following: use MyApp::Test tests => 14, something_special => 1; # 14 tests with some special setup... setup_test_database Create the test database. This can be overloaded if you do your databases in a different way. load_test_configs FILENAME This will load all the test config files that apply to FILENAME (default: $0, the current test script file). Say you are running the test script "/home/bob/MyApp/t/user/12-delete.t". The files that will be loaded are: "/home/bob/MyApp/t/user/12-delete.t-config.yml" "/home/bob/MyApp/t/user/test_config.yml" "/home/bob/MyApp/t/test_config.yml" ..followed by the usual Jifty configuration files (such as "MyApp/etc/config.yml" and "MyApp/etc/site_config.yml"). The options in a more specific test file override the options in a less specific test file. The options are returned in a single hashref. test_config Returns a hash which overrides parts of the application's configuration for testing. By default, this changes the database name by appending a 'test', as well as setting the port to a random port between 10000 and 15000. Individual test configurations may override these defaults (see "load_test_configs"). It is passed the current configuration before any test config is loaded. You can override this to provide application-specific test configuration, e.g: sub test_config { my $class = shift; my ($config) = @_; my $hash = $class->SUPER::test_config($config); $hash->{framework}{LogConfig} = "etc/log-test.conf" return $hash; } Note that this is deprecated in favor of having real config files in your test directory. make_server Creates a new Jifty::TestServer depending on the value of $ENV{JIFTY_TEST_SERVER}. If the environment variable is "Inline", we run tests using PSGI inline without spawning an actual server. Otherwise, we fork off a Plack::Server to run tests against. web Like calling "<Jifty-"web>>. "<Jifty::Test-"web>> does the necessary Jifty->web initialization for it to be usable in a test. mailbox A mailbox used for testing mail sending. setup_mailbox Clears the mailbox. teardown_mailbox Deletes the mailbox. is_available Informs Email::Send that Jifty::Test is always available as a mailer. send Should not be called manually, but is automatically called by Email::Send when using Jifty::Test as a mailer. (Note that it is a class method.) messages Returns the messages in the test mailbox, as a list of Email::Simple objects. You may have to use a module like Email::MIME to parse multi-part messages stored in the mailbox. test_file my $files = Jifty::Test->test_file($file); Register $file as having been created by the test. It will be cleaned up at the end of the test run if and only if the test passes. Otherwise it will be left alone. It returns $file so you can do this: my $file = Jifty::Test->test_file( Jifty::Util->absolute_path("t/foo") ); test_in_isolation my $return = Jifty::Test->test_in_isolation( sub { ...your testing code... }); For testing testing modules so you can run testing code (which perhaps fail) without effecting the outer test. Saves the state of Jifty::Test's Test::Builder object and redirects all output to dev null before running your testing code. It then restores the Test::Builder object back to its original state. # Test that fail() returns 0 ok !Jifty::Test->test_in_isolation sub { return fail; }; SEE ALSO
Jifty::Test::WWW::Mechanize, Jifty::TestServer perl v5.14.2 2010-12-08 Jifty::Test(3pm)
All times are GMT -4. The time now is 12:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy