Creating a Test Harness

Hi there ....
I have this problem, basically, my self and a few of my class mates have built this program as part of our module and we now need to have a Test Harness to run and log our Test Cases.
I have all the test cases arranged in .txt files and plan on using the 'Test Harness' to read test cases from these files, feed it to our program and then log the output from our programe (the methods) yet again on another .txt file. We have the feature for logging, in the formatted required.
However, non of us has built a test harness before and it looks like a complex procedure, the problem is we dont know how to approach it.
We can test methods that return a value but we dont know how to use the test harness to test void methods that pass data to components or call other methods.
I would appriciate any form of help.
Cheers

Hi yawmark,
I appologise for including a poor code example ealier on, i had to come up with something quick. I will however, visit the sugeted sites you mentioned, thank you.
I did however, create a simple class that compiles and can be used to set, return, reset and print a few details about a person. I hope that is of better use than my previous example. here it is:
public class SimplePerson {
    int age = 0;
    String firstName = "";
    String lastName = "";
    /** Creates a new instance of SimplePerson */
    public SimplePerson() {
    /** Sets the age of this person */
    private void setAge(int takeAge){
        age = takeAge;
    /** Returns the age of this person */
    private int getAge(){
        return age;
    /** Sets the First Name of this person */
    private void setFirstName(String takeName){
        firstName = takeName;
    /** Returns the First Name of this person */
    private String getFirstName(){
        return firstName;
    /** Sets the Last Name of this person */
    private void setLastName(String takeName){
        firstName = takeName;
    /** Returns the Last Name of this person */
    private String getLastName(){
        return firstName;
    /** Resets the details of this person back to back to
     *  the default form.
    private void resetAll(){
        age = 0;
        firstName = "";
        lastName = "";
    /** Prints all the details this person has */
    private void printAll(){
        System.out.println("Age: " +Integer.toString(age)
                + "\n First Name: " + firstName
                + "\n Last Name: " + lastName );
}Cheers mate

Similar Messages

  • Refcursor as an OUT variable and test harness is failing

    Folks,
    create or replace PROCEDURE GetA ( p_list IN OUT sys_refcursor )is
    lv_func_name function_static.fntn_name%type:='GetCountrylist';
    st varchar2(1000);
    begin
    st := 'begin :1:='||lv_func_name||'; end;' ;
    dbms_output.put_line(st);
    execute immediate st using out p_list;
    end GetA;
    create or replace function Getcountrylist return sys_refcursor is
    p_list sys_refcursor;
    begin
    open p_list for
    select ctry_code Code, ctry_name Description
    from country
    where active_flag = 1;
    return p_list;
    end GetCountrylist;
    the following test harness is giving me an invalid cursor.
    declare
    rc1 sys_refcursor;
    v_code varchar2(10);
    v_desc varchar2(10);
    begin
    GetA (rc1);
    loop
    fetch rc1 into v_code,v_desc;
    DBMS_OUTPUT.PUT_LINE(v_code || ' ** ' || v_desc);
    END LOOP;
    CLOSE rc1;
    end;
    But if I test it in sqlplus like this, it works fine.
    Var r refcursor
    Exec geta(:r)
    Print r
    Any help.
    Thanks
    Ram

    STEP - 2
    SQL>
    SQL>
    SQL> insert into country values('&ct_cd','&ct_nm',&flg);
    Enter value for ct_cd: 007
    Enter value for ct_nm: Russia
    Enter value for flg: 1
    old   1: insert into country values('&ct_cd','&ct_nm',&flg)
    new   1: insert into country values('007','Russia',1)
    1 row created.
    SQL> /
    Enter value for ct_cd: 001
    Enter value for ct_nm: USA
    Enter value for flg: 0
    old   1: insert into country values('&ct_cd','&ct_nm',&flg)
    new   1: insert into country values('001','USA',0)
    1 row created.
    SQL> /
    Enter value for ct_cd: 091
    Enter value for ct_nm: INDIA
    Enter value for flg: 1
    old   1: insert into country values('&ct_cd','&ct_nm',&flg)
    new   1: insert into country values('091','INDIA',1)
    1 row created.
    SQL> /
    Enter value for ct_cd: 056
    Enter value for ct_nm: UK
    Enter value for flg: 1
    old   1: insert into country values('&ct_cd','&ct_nm',&flg)
    new   1: insert into country values('056','UK',1)
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from country;
    CTRY_CODE  CTRY_NAME                      ACTIVE_FLAG
    007        Russia                                   1
    001        USA                                      0
    091        INDIA                                    1
    056        UK                                       1
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace PROCEDURE GetA ( p_list IN OUT sys_refcursor )
      2  is
      3    --  lv_func_name function_static.fntn_name%type:='GetCountrylist';
      4    lv_func_name varchar2(30):='GetCountrylist';
      5    st varchar2(1000);
      6  begin
      7   st := 'begin :1:='||lv_func_name||'; end;' ;
      8   dbms_output.put_line(st);
      9   execute immediate st using out p_list;
    10* end GetA;
    11  /
    Procedure created.
    SQL>
    SQL>
    SQL> create or replace function Getcountrylist
      2  return sys_refcursor
      3  is
      4    p_list sys_refcursor;
      5  begin
      6    open p_list for
      7    select ctry_code Code, ctry_name Description
      8    from country
      9    where active_flag = 1;
    10 
    11    return p_list;
    12 
    13  end GetCountrylist;
    14  /
    Function created.
    SQL>
    SQL> declare
      2   rc1 sys_refcursor;
      3 
      4   type a is record ( code varchar2(10), description varchar2(30) );
      5   b a;
      6  begin
      7   GetA(rc1);
      8   loop
      9    fetch rc1 into b;
    10    exit when rc1%notfound;
    11    DBMS_OUTPUT.PUT_LINE(b.code || ' ** ' || b.description);
    12   END LOOP;
    13   CLOSE rc1;
    14  end;
    15  /
    begin :1:=GetCountrylist; end;
    007 ** Russia
    091 ** INDIA
    056 ** UK
    PL/SQL procedure successfully completed.Regards.
    Satyaki De

  • Creating a test in PDF: Is it possible to create Right and Wrong answer fields in PDF?

    Very new to this.  I may be way off, but Im trying to create a test for some students to do in class.  Is it possible to create fields that turn green when right and red when wrong?  Also can you have a field that accumulates the right answers to give a score?

    Sure you can, with a bit of JavaScript. What sort of fields will you be using and what part of the field do you want to be green or red?

  • Creating a test database from backups of the production

    Hello Experts,
    I am a newbie with very much new in Oracle. I have been provided with the inc0 backup(which comprises even the controlfile backup) of the production database (PROD) taken through RMAN and asked to create a new test database (TEST) using the backup. Can anyone please provide me the steps on how to restore it and create the new database ?
    Database version 10.2.0.4
    I am aware of duplicate database concept using RMAN, but I have been asked to not to connect to the target (PROD) database while duplicating. So, I need to create the test database by using the backup of prod database without connecting to PROD database. Please guide me.

    Refer
    http://arjudba.blogspot.in/2008/05/restore-and-recover-database-to-new.html
    RMAN restore database from another backup of different database name
    When you are restoring using the backup of the production database, the db_name would be same on the auxiliary database. Once you restore and recover the database in your test server, you can change the db_name from prod to test by recreating the controlfile

  • How to Create and Test a Zone of Type F1-APP-URL

    Hi,
    I would like to how to create and test a Zone of Type F1-APP-URL?
    What all is required to setup an ADF application based URL in F1-APP-URL, what to configure and what are the basics or definite steps required to have a Zone of Type F1-APP-URL up and running in the application? Any Sample ADF components to be created?
    Please kindly let me know. Any test or dummy URL existing already which is based on ADF?

    Refer to Doc. Id 1515146.1 on the support site. Although for the moment it refers to a MWM example and may not be much of a help but it'd give a basic idea as to how it should be done.

  • Creating a test using the form wizard

    I need to create a multipart test that will be used for editors applying for jobs. Part of the test will be a multiple choice spelling test, with 20 questions. I created the file in Word and am trying to use the form wizard to create check box fields. It looks like this:
    1.
    initative
    intiative
    initiative
    enitiative
    I want the blanks to the left of each word to be a check box field or a radio button.
    When I created the pdf form and saved it, I found that when I checked any one of the boxes, all four check box fields were automatically filled in. I know I'm doing something wrong, but can't figure out what.
    Do these forms have to be created in one session? Or can I save the form, close it and then contune editing the form fields later?
    I am using Acrobat Pro 9.5
    Any advice anyone can provide would be appreciated.
    Thanks.
    dg

    I have gotten the hang of creating check boxes and radio buttons so that they behave the way I need them to behave. Thanks for the help on that.
    I create these tests 2X per year and each test is to be used at least 500 times.
    Here's my next apparent dilemma: I am creating this test in Acrobat Pro 9.5. The test takers are in three different cities in India. They use Reader X.
    When I "distributed" a test of the only section I have completed to myself I discovered all of the distribution mechanisms (saving to a network folder, distributing via email, etc.). All of these options are far too complicated for my users.
    Isn't there a way to create a form in Pro 9.5 that can just be saved with Reader X enabled so that anyone who opens the file in Reader X can just "save as" and have their filled-in data saved? I must emphasize that the saving process must be as simple as possible.
    I need to keep this as simple as possible because I distribute these tests once and they are used over and over and the completed tests are collected by HR people who are not tech savvy at all. They are emailed to me from the three diffferent locations.
    Previously I used Word but frankly there were two many ways people could cheat: That's why I want to switch to Acrobat forms. But this is looking like it's not going to work.
    Perhaps I am missing something?
    dg

  • How to create  a test plan with specific transactions (or program)

    Hello,
    I'm a new user in Sol Man !
    How to create  a test plan with specific transactions (or program).
    In my Business Blueprint (SOLAR01) I've created in 'transaction tab' the name of my specific transactions and linked it.
    In my test plan (STWB_2) those specific doesn't appear to be selected !
    Thanks in advance.
    Georges HUYNEN

    Hi 
    In solar01 you have defined but you have to assign the test case in solar02 for this test case in the test cases tab.
    When you do so expand the business sceanario node in test plan generation of STWB_2 transaction and now that will appear.
    Also visit my weblog
    /people/community.user/blog/2006/12/07/organize-and-perform-testing-using-solution-manager
    please reward points.

  • Unable to create the test suite file

    Hi,
    I imported a BPEL project to my JDeveloper ver 10.1.3.3.0. When I clicked on the <project name>.bpel, I got the
    "unable to create the test suite file" error and all the partnerlinks have a bang sign (!). None of the partner link works.
    Please help,
    Thanks,
    Amorsolo

    Probably you might want to post it in the BPEL forum.
    BPEL
    -Arun

  • Unable to create the test suits file!

    Dear Experts!
    Getting the "Unable to create the test suits file!" error while opening .bpel file in JDeveloper 10.1.3.5. Also, all the partner links showing warning symbol. When I click on them, getting the following error:
    ERROR:WSDLException: faultCode=INVALID_WSDL: Invalid XML in document at: Start of root element expected.
    Looks like partner links are not mapped correctly. Could you please throw some light, where I need to fix the issue.
    Appreciate your help.
    Thank you.

    I had similar issue sometimes back, error was because sample xml my test was using wasn't conforming to my code. In my case, I didn't write test suite so deployment was successful and was getting error while testing post deployment. In your case, test suite will execute.
    Try to follow your xslt mapping or any xpath statements within bpel flow, it must be having direct mapping of some element from source but your sample input xml might not be having that element and hence resulting in error. Try iterative debugging by adding more elements in input xml.
    Regards,
    Ankit

  • Creating junit test cases using the reflection API

    In order to use the reflection API to get information about a *.java file's class name and methods, I need to compile the *.java file first, and then get info through the *.class file. Am I right?
    Eclipse, the Java IDE, can create junit test cases for java files the user selects right after the *.java files have been created, and even before the *.java files have been compiled by the user. I guess Eclipse internally compiles the java files before creating JUnit test cases for them. Does anyone know about it? Thanks.

    Let me explain my problem in more details.
    Given any java source tree, my program is supposed to create junit test cases for each class using java reflection. My approach is to scan through the source tree to keep the list of classes available, then compile all the java files in the given source tree, then do Class.forName() to load them to get their methods... Obviously I don't know what classes I will have at compilation time. I create a temp_classes directory as the output directory for the given source tree java files, and I add temp_classes to my classpath when I strart up my own program. However, that won't work..
    D:\eclipse\workspace\cmpe271_hw4\classes>java -classpath ..\classes;..\temp_classes Test
    javac -classpath .\temp_classes; -d .\temp_classes @temp_classes\javalist.txt
    java.lang.ClassNotFoundException: Factory
    java.lang.ClassNotFoundException: InvalidDateFormatException
    java.lang.ClassNotFoundException: MyUtility
    java.lang.ClassNotFoundException: Storage

  • Guidence regarding creating  a test data and running any function module

    hi pals,
       can you plz tell me how to create a test data, commit and run any function module, in details(step wise) ??

    Hi yawmark,
    I appologise for including a poor code example ealier on, i had to come up with something quick. I will however, visit the sugeted sites you mentioned, thank you.
    I did however, create a simple class that compiles and can be used to set, return, reset and print a few details about a person. I hope that is of better use than my previous example. here it is:
    public class SimplePerson {
        int age = 0;
        String firstName = "";
        String lastName = "";
        /** Creates a new instance of SimplePerson */
        public SimplePerson() {
        /** Sets the age of this person */
        private void setAge(int takeAge){
            age = takeAge;
        /** Returns the age of this person */
        private int getAge(){
            return age;
        /** Sets the First Name of this person */
        private void setFirstName(String takeName){
            firstName = takeName;
        /** Returns the First Name of this person */
        private String getFirstName(){
            return firstName;
        /** Sets the Last Name of this person */
        private void setLastName(String takeName){
            firstName = takeName;
        /** Returns the Last Name of this person */
        private String getLastName(){
            return firstName;
        /** Resets the details of this person back to back to
         *  the default form.
        private void resetAll(){
            age = 0;
            firstName = "";
            lastName = "";
        /** Prints all the details this person has */
        private void printAll(){
            System.out.println("Age: " +Integer.toString(age)
                    + "\n First Name: " + firstName
                    + "\n Last Name: " + lastName );
    }Cheers mate

  • Create a test instance

    I installed the new oracle 10g home, before upgrade the main database from 9i to 10g, i want to create a testing instance just to test if i can start sqlplus from 10g home. What's the procedure to create such instance?
    Thanks!

    If you want to create a regular instance go ahead and run dbca or run your scripts.
    Regards

  • Create Unit Test Vectors From The Unit Test Configuration Window

    I have recently been using more test vectors in the unit test framework.
    The principle works well but if you are in a unit test and decide you need a test vector you must:
    Close the unit test configuration
    Create a test vector
    Set up your vector (entering values and data types, which is much easier if you could see the actual unit test case)
    Close the vector configuration window
    Open the unit test configuration
    Assign the new vector file to the unit test
    Now you can assign vectors to test inputs
    This seems convoluted and forces unnecessary context switchs.
    I propose that at a minimum, you should be able to create a new vector file and launch it's configuration without leaving the unit test configuration window. I suspect that the whole process could be streamlined even further though.
    James Mc
    ========
    CLA and cRIO Fanatic
    wiresmithtech.com/blog

    Oops supposed to be ideas exchange, sorry!
    James Mc
    ========
    CLA and cRIO Fanatic
    wiresmithtech.com/blog

  • Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic. can anyone tell me what is the best way to clone the environment, can I just tar the weblogic file syste

    Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic..
    Can anyone tell me what is the best way to cloning the application from different environment, the test and production are in different physical server.
    Can I just tar the weblogic file system and untar it to the new server and make the necessary changes?
    Can anyone share their experiences and how to with me?
    Thank in advance.
    Katherine

    Hi Katherine,
    yes and no . You need as well weblogic + soa files as the database schemas (soa_infra, mds...).
    Please refer to the AMIS Blog: https://technology.amis.nl/2011/08/11/clone-your-oracle-fmw-soa-suite-11g/
    HTH
    Borys

  • How to create a TEST form just like in workshop

    Hello
    I am using WL Workshop 7.0.2. and Java 1.4. Could anyone pls tell me how to create
    my own test form like in Workshop.
    Is it possible to have a HTML client without any java class or JSP in between
    the HTML form and the webservices(jws). In workshop I know that knexServlet is
    somehow resposible for creating the test form in work shop.
    Any example which has used webservices created by workshop and has a HTML form
    has a client.
    Any HELP will be greatly appreciated.
    Thanks
    madhu

    Thanks Anurag,
    Could you point me to some rich JSP client example, (not the HelloWorld or MazeDisplay).
    preferably which takes a XML as request.
    Thanks
    madhu
    "Anurag Pareek" <[email protected]> wrote:
    Madhu,
    To call a webservice, a client using HTTP should be able to send a SOAP
    request to the server hosting the webservice. Generally, it is complicated
    to code the SOAP request manually and hence clients use a proxy on their
    side to do the job for them. For a Java client, this job is taken care
    of by
    the client proxy JAR file which can either be downloaded from the Test
    View
    web page or generated using the <clientgen> ant task.
    Requests from the Test View page are given special treatment, and there
    is
    special functionality provided in the server to help in iterative
    development using the Test View.
    For any client other than the Test View such special wiring is not
    available. Hence you need to use a JSP or a Java class on the client
    side.
    Regards,
    Anurag
    "madhu" <[email protected]> wrote in message
    news:3ee8cca3$[email protected]..
    Hello
    I am using WL Workshop 7.0.2. and Java 1.4. Could anyone pls tell mehow
    to create
    my own test form like in Workshop.
    Is it possible to have a HTML client without any java class or JSPin
    between
    the HTML form and the webservices(jws). In workshop I know thatknexServlet is
    somehow resposible for creating the test form in work shop.
    Any example which has used webservices created by workshop and hasa HTML
    form
    has a client.
    Any HELP will be greatly appreciated.
    Thanks
    madhu

Maybe you are looking for

  • Problem in Releasing the Request

    Hello, I am trying to release the request which is targetting to one of the available system (say QAS) When clicking the release button, I am getting the error message as below : ========= Test call of transport control program (tp) ended with return

  • -How to use JDBC to connect the SQLServer and Oracle.

    Hi, I create a table in the WIP DB, I want to modify this table when use "PRE-START" activity in POD. SAPME version: 5.2.3.4     SDK:2.0    DB:SQL2005 and Oracle 10.2g SourceCode like below: public void execute(StartHookDTO dto) throws Exception {   

  • Sharing Programs between Powerbook & iMac G5

    Hi Lads, I buying iMac G5 still trying to decide on the 17' or 20' but thats another days work. Question i have is. I currently have Office Mac 04 on the PB. Will i be able to copy over the programs i purchased from the PB to the iMac. As well as Mac

  • How to achieve Quantity Control in purchasing?

    Hi all, My client company is controlling the purchasing  quantity of consumable goods manually. Now in the new SAP system they want to control from the system. The scenario is ,  let us say diesel, they will prepare yearly estimated quantity for plan

  • One-to-many relationship: problem with several tables on the one side...

    Hello I'm having problems developing a database for a content management system. Apart from details, I've got one main table, that holds the tree structure of the content ("resources") and several other tables that contain data of a particular dataty