Unit Test Repository Problems

Ciao,
This is related to SQL Developer 3.0 Unit Test feature. Is it possible to have many shared repository in a single DB instance? How to prevent the users to delete the testcases written by another user in a shared repository?
Regards,
Bala

Hi, it is possible:
create the two roles
UT_REPO_USER
UT_REPO_ADMINISTRATOR
Extract the file dbtools\unit_test\repository\create10.sql from the jar oracle.sqldeveloper.unit_test.jar
Run the create10.sql script
HTH
Oliver

Similar Messages

  • Problem creating unit testing repository (and workaround)

    I tried to create the unit testing repository with a user that had all the required system privileges granted through a different role other than RESOURCE and CONNECT roles, and who wasn't explicitely granted CREATE VIEW, but inherited it through the custom role. However the check in SQL Developer is explicitely for the RESOURCE and CONNECT roles (regardless of what privileges they have granted to them in whichever database version past, present or future) and for CREATE VIEW privilege granted direct to the user:
    SELECT DECODE (roles.required_role_count + privs.required_priv_count,
                   3, 1,
                   0)
              AS basic_privs_granted
      FROM (SELECT COUNT (*) AS required_role_count
              FROM user_role_privs
             WHERE granted_role IN ('CONNECT', 'RESOURCE')) roles,
           (SELECT COUNT (*) AS required_priv_count
              FROM USER_SYS_PRIVS
             WHERE privilege IN ('CREATE VIEW')) privsI found this SQL contained within the sqldeveloper/extensions/oracle.sqldeveloper.unit_test.jar in an XML file: oracle/dbtools/unit_test/manage_user/UserSql.xml and replaced the SQL with one that actually checks for the specific system privileges:
    SELECT DECODE (required_sys_priv_count,
                   10, 1,
                   0)
              AS basic_privs_granted
      FROM
           (SELECT COUNT(*) AS required_sys_priv_count FROM
             (SELECT privilege
                FROM role_sys_privs
               WHERE privilege IN ('CREATE CLUSTER','CREATE INDEXTYPE','CREATE OPERATOR','CREATE PROCEDURE','CREATE SEQUENCE','CREATE SESSION','CREATE TABLE','CREATE TRIGGER','CREATE TYPE','CREATE VIEW')
              UNION
              SELECT privilege
                FROM user_sys_privs
               WHERE privilege IN ('CREATE CLUSTER','CREATE INDEXTYPE','CREATE OPERATOR','CREATE PROCEDURE','CREATE SEQUENCE','CREATE SESSION','CREATE TABLE','CREATE TRIGGER','CREATE TYPE','CREATE VIEW')))This enabled me to bypass that check when creating the respository. I don't know if all these privileges are actually required by the unit testing repository or not, so maybe the above list can be reduced...
    Edited by: RDB on Mar 1, 2013 2:24 PM

    Hi Sai Vineeth,
    First of all, I appreciate your elaborate way of framing the question. That itself helps others to comment.
    On the first two questions, I am sure you'll be able to follow the answers provided and take care of your concerns.
    On your question 3), an additional piece of information that should bring smile to you
    Whether the Test is to happen in DEV or QAS or whatever 'System Role' is dependent on the Test Plan.
    So, if you have two distinct Test Plans, one for Unit Tests and the other for Integration Tests, which should be the case, as usual, you can certainly point the System Role to DEV or QAS as required.
    Feel free to pose any other query as well.
    Best regards,
    Srini

  • Unit test code problem

    I'm doing my first proper unit test and I get an error, think min_size> is the problem
    Element type "application" must be followed by either attribute specifications, ">" or "/>".
    this generated code
    <?xml version="1.0" encoding="utf-8"?>
    <!-- This file is automatically generated by Flash Builder to compile FlexUnit classes and is not intended for modification.
    Please click on the "Refresh" icon in "FlexUnit Results" view to regenerate this file. -->
    <application xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx"min_size>
        <fx:Script>
            <![CDATA[
                import flexUnitTests.serviceTestSuit;
                private var flexUnitTests_serviceTestSuit_obj:flexUnitTests.serviceTestSuit;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    </application>

    Hi Nikos,
    Which Flash Builder build are you using?
    FlexUnitApplication.mxml is generated from MXML Application/MXML Windowed Application(Flex/AIR project respectively) file templates configured in Window->Preference->File templates.
    Can you take a look at the template if you see any 'min_size' available as part of the template?
    However, we are unable to reproduce the issue in the latest builds.
    Thanks,
    Balaji
    http://balajisridhar.wordpress.com

  • SQL Developer 2.1: Problem exporting and importing unit tests

    Hi,
    I have created several unit tests on functions that are within packages. I wanted to export these from one unit test repository into another repository on a different database. The export and import work fine, but when running the tests on the imported version, there are lots of ORA-06550 errors. When debugging this, the function name is missing in the call, i.e. it is attempting <SCHEMA>.<PACKAGE> (parameters) instead of <SCHEMA>.<PACKAGE>.<FUNCTION> (parameters).
    Looking in the unit test repository itself, it appears that the OBJECT_CALL column in the UT_TEST table is null - if I populate this with the name of the function, then everything works fine. Therefore, this seems to be a bug with export and import, and it is not including this in the XML. The same problem happens whether I export a single unit test or a suite of tests. Can you please confirm whether this is a bug or whether I am doing something wrong?
    Thanks,
    Pierre.

    Hi Pierre,
    Thanks for pointing this out. Unfortunately, it is a bug on our side and you have found the (ugly) "work-around".
    Bug 9236694 - 2.1: OTN: UT_TEST.OBJECT_CALL COLUMN NOT EXPORTED/IMPORTED
    Brian Jeffries
    SQL Developer Team

  • Unit Test Module cannot create repository

    DBA has created user with listed permissions in the documentation and Unit test repository creation is still stating basic permissions need to be met. In addition, I now need to upgrade my (nonexistant) repository and the basic permissions are still not met. What exactly does the repository admin require in oder to create a repository?
    Additional problems:
    When the dba types in the correct sys user password for that user to create the correct permissions through SQL developer, it states they are wrong. How does the sys user login as sysdba through that? That is our best guess as to why it won't recognize the password. This is also why I am asking what our DBA needs to simply get the admin user running.
    Also, after the repository is created, what permissions can be removed from that user? With our DBAs, less is more :)
    I appreciate any help; I realize this is a duplicate, but following other threads has not yielded results either.
    10gr2 DB, 3.0 now 3.1 Sql Developer
    Edited by: sinistral on Feb 14, 2012 11:15 AM
    Edited by: sinistral on Feb 14, 2012 11:15 AM

    Hi sinistral -
    Instructions for setting up a unit test repository in a (dba friendly ;) ) locked down environment are in {message:id=3985967}
    +That link points directly to the message for minimum permissions set up. Alternatively, A few messages back is one with info on how a dba can set up the roles/permissions as SQL Developer would so you don't get asked for sysdba info and can use the shared repository feature. {message:id=3985438}+
    Brian Jeffries
    SQL Developer Team
    Edited by: bjeffrie on Feb 15, 2012 11:58 AM to include reference to 'full permissions' info.
    Edited by: bjeffrie on Feb 15, 2012 12:45 PM to fix links

  • Unit Tester: Bug in Export/Import of Suites

    I was moving my Unit Test repository from one schema to another, so I first exported all of my suites and then imported them into a new repository.
    But, when I imported them into their new repository, all of the tests forgot what specific function/procedure name within a package they were actually calling. For example, the test that used to be for "pccdb.rotat_maintenance.parseRotatKey", now says it's going to call "pccdb.rotat" (i.e. the specific function name it's supposed to be calling within that package disappeared).
    I went looking and found that in the UT_TEST table, the "object_call" column was null for all of my tests, but because all of my tests call methods within packages, I'm thinking that column shouldn't be NULL. So, I filled in the appropriate function name for one of them, and the test started working....
    So, something in the import or export of unit suites (or their tests) isn't working quite right in populating the ut_tests.object_call column, I'm guessing - please take a look at it.

    This was originally reported in SQL Developer 2.1: Problem exporting and importing unit tests thread. It was logged as
    Bug 9236694 - 2.1: OTN: UT_TEST.OBJECT_CALL COLUMN NOT EXPORTED/IMPORTED
    It has been fixed and will be available in the next patch release.
    Brian Jeffries
    SQL Developer Team

  • Unit Test repos - Upgrade to SqlDev 3.0.04 from SqlDev 2.1.1.64

    Hi all,
    I just installed the new SQL Developer 3.0 (3.0.04).
    I have a Unit Test Repository that I created under SQL Developer 2.1.1.64 and when I get the new version 3 SQL Developer to connect to it I get a error stating that "No Repository was found on the selected connection. Would you like to create one now?"
    There is certainly a repos there so I say no.
    I tried the Tools|Unit Test|Create\Update repository menu option assuming it does an upgrade and I get prompted for sys credentials.
    I do not want to loose my existing tests and they still work fine from SQL Deveoper 2.1 so my repos is not corrupted.
    I have looked all over the doco for SQL Dev 3 but I am unable to find any detail about how to deal with upgrading the repos. Infact I cannot find any info about installing the repos from scratch??
    Hope someone can help.
    Cheers
    Chris .....

    Hi Chris,
    I spent many hours with UT in SQL Developer and I think, that I know, where is your problem.
    UT repository is only a group of tables, views, user rights and so on. When you go to c:\Program Files\sqldeveloper-3.0\sqldeveloper\extensions\, you can find file oracle.sqldeveloper.unit_test.jar.
    Rename this file to zip and unpack.
    Then go to oracle.sqldeveloper.unit_test.zip\oracle\dbtools\unit_test\repository\20\ and here you have some useful scripts.
    If you want update your repository, just run update20.sql.
    Then you must grant rights:
    create role UT_REPO_ADMINISTRATOR;
    create role UT_REPO_USER;
    grant create public synonym,drop public synonym to UT_REPO_ADMINISTRATOR;
    grant select on dba_role_privs to UT_REPO_USER;
    grant select on dba_role_privs to UT_REPO_ADMINISTRATOR;
    grant select on dba_roles to UT_REPO_ADMINISTRATOR;
    grant select on dba_roles to UT_REPO_USER;
    grant ut_repo_user to UT_REPO_ADMINISTRATOR with admin option;
    grant UT_REPO_ADMINISTRATOR to "YOUR_UT_ADMIN_USER" with admin option;
    Thats all, hope this helps...

  • Run unit test in comand line

    Hello everybody,
    I try to run existing unit test in comand line:
    ututil -run -test -name ROW_COUNT -repo unit_test_repos -db finch
    where
    ROW_COUNT - simple unit test
    unit_test_repos - unit test repository, which i create using tutorial (http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev/r30/sqldev_unit_test/sqldev_unit_test_otn.htm)
    finch - owner of procedure, which i try to test
    after execution this command i receive this message:
    C:\sqldeveloper\sqldeveloper\bin>ututil -run -test -name ROW_COUNT -repo unit_test_repos -db finch
    SEVERE Error: No Repository was found on the selected connection, you need to create a repository. - oracle.dbtools.unit_test.UtRepositoryManager.openConnectionWithChecks(UtRepositoryManager.java:214)
    Unable to open repositoryafter that i try to execute command with another parametres (instead of finch i use sys-user), but receive equal result.
    what`s wrong?
    in Help document i find next:
    The following example runs a unit test named AWARD_BONUS in a Windows environment where SQL Developer is installed under Program Files. (Note that test and suite names are case sensitive for the command-line interface.) This example uses the repository connection for user unit_test_repos and runs the test as user fred.
    cd c:\Program Files\sqldeveloper\sqldeveloper\bin
    ututil -run -test -name AWARD_BONUS -repo unit_test_repos -db fred"
    fred is connection which exist in oracle sql developer interface? what kind of privilegies should fred has?
    In oracle sql deevloper exist several connection to another servers. i`t can be reason of error?
    I trying in oracle sql developer interface select finch as manager of unit tests (tools - unit_test - manage_users to the next i select in dropdown list "finch" and granted needed privilegies for him) , but result was`t changed.
    thanks.

    It looks like you need to spark up SQL Developer, create a repository connection and assign that in the Unit Test Menu. It will walk you through creating the repository and then you can refer to that from the command line.

  • SQL Developer 3.0 Unit Test

    Hi all,
    I'm hoping that one of you very knowledgeable individuals may be able to assist me!
    I'm an APEX developer, and I'm trying to make use of Hudson (www.hudson-ci.org) to automate my build process. I can successfully check files out of a source control repository and run them on my database, but I'm falling down when I try to use SQL Developer 3.0 from the command line to execute some unit tests.
    My test environment is a Windows XP SP3 machine running an 11g DB, APEX 4.1 and SQL Developer 3.0. In SQL Developer, I've set up a connection called APPHOME and currently, my unit test repository is on the same connection. If I open a command prompt and execute:
    C:\sqldeveloper\bin>ututil -run -suite -name TEST_PROCEDURE_SUITE -repo APPHOME -db APPHOME -log 1
    It works fine. The suite of tests execute OK, I get UT_SUCCESS back and when I look in SQL Developer, the result is there.
    However, if in a Hudson project I include an instruction that tries to fire exactly the same command, I get a response of: "Connection not found: APPHOME".
    Do I need to do anything special to ensure that ututil will be able to see the connection? The only thing that I can think of is that when I execute ututil from the command line, it does so as the logged in user (me, and I'm the one who has created the connections in SQL Developer) whereas when its fired by Hudson, it is executing as some other user that doesn't have my connections?
    Does anybody have any thoughts about this?
    Thanks in advance!
    Nick

    Hi Nick,
    I think your diagnosis is correct i.e. the connections are specific to your user. To resolve, you can try logging onto the Hudson server as the user that will run ututil, run up sqldeveloper client and import the connections into that user.
    I hope this helps.
    Philip Richens
    SQLDEV Development Team

  • How  to genearte Unit Test reports  through  ANT/Command  line ?

    Hi,
    I am using sql developer unit test feature to test my database code. I am planning to execute and generate reports by running ant script.
    Is it possible to get the unit test results in any format (text,XML,HTML) after running the tests.
    How to integrate report generation tasks as part of Automated builds?
    Is there any command line utility do through can invoke through ant task?
    Thanks,
    Fernando

    Fernando,
    I, too, am looking to run our PL/SQL unit test suites through our automated ant build scripts. Currently, I've only been able to determine that there is a "UtUtil.bat" and "UtUtil.sh" command line utility for win and linux in /sqldeveloper/sqldeveloper/bin. However, it only take three switches:
    UtUtil -run ?
    UtUtil -imp ?
    and
    UtUtil -exp ?
    While this does provide some limited value to us through automating the importing of our exported test suites and then running them as part of our builds, it doesn't help in running reports on the test runs and exporting the reports to something our build processes can consume (i.e. xml).
    Also, we want to be able to run our full db build on (almost) any of our development machines and we don't want to have to have a unit test repository already preconfigured on each development db. I haven't found a utility to automate the creation of the unit test repository user and the repository, and then whena all the test suite runs have finished and the reports run, delete the repository and repository user.
    We have used Quest's Code Tester product in the past and it had all of these great features that I am really hoping Oracle can either implement or expose to us.
    Regards and best of luck,
    Mike Sanchez

  • Unit Tester: Manually Deleting Old Unit Test Results

    Oracle, as you know, there isn't currently a way to delete the results of previous unit test runs.
    Well, those previous test runs are giving us a very annoying slow response times in the Unit Tester GUI with some of our tests, because of the amount of time the interface is taking to load the results of previous tests.
    For example, one of our unit tests in particular took the interface 1 minute, 12 seconds to simply "bring up", even though we weren't on the Results tab. As time goes on (as a unit test has been run more and more), the interface goes slower and slower with that unit, because of the increasing number of unit test results.
    I know you're working on a long-term solution, but to assist us with working with these kind of tests now, can Oracle please provide us with the SQL statements necessary to delete all of a given unit test's test results from the unit tester repository, please? It would make my programmers so much less annoyed with working with these particular unit tests and the Unit Tester, in general.
    I'm guessing that if I go spelunking through the Unit Tester's repository tables, I could probably figure it out, but I'm looking for the "Oracle-sanctioned" way, I guess.
    Thanks.

    Hi,
    here are the necessary commands to delete your tables:
    Make a backup of your tables(!)
    create table t_ut_test_impl_results as select * from ut_test_impl_results ;
    create table t_ut_test_impl_val_results as select * from ut_test_impl_val_results ;
    create table t_ut_test_results as select * from ut_test_results ;
    create table t_ut_suite_results as select * from ut_suite_results ;
    create table t_ut_suite_test_results as select * from ut_suite_test_results ;
    -- delete data from tests
    delete from ut_test_impl_val_results ;
    delete from ut_test_impl_results ;
    delete from ut_test_results ;
    -- delete suite results
    delete from ut_suite_test_results ;
    delete from ut_suite_results ;
    This scripts are not Oracle sanctioned.
    Use them on your on risk
    HTH
    Oliver

  • Unit Test - Select current repository disabled in SQL Developer 4.0

    Hi,
    I am now using Oracle SQL Developer 4.0 and I want to use Unit Testing. However, when I go to Tools-> Unit Testing -> Select Current Repository, the option is disabled. However, it is working and active when using SQL Developer 3.0
    Anyone faced the same problem??

    I could finally solve it.
    Go to the View -> Test Units
    Then the Test Units box will open in the left side of the SQL Developer and you will be able to access the Tools-> Unit Testing -> Select Current Repository
    I hope this help everybody here

  • Problems with non-ASCII characters on Linux Unit Test Import

    I found a problem with non-ASCII characters in the Unit Test Import for Linux.  This problem does not appear in the Unit Test Import for Windows.
    I have attached a Unit Test export called PROC1.XML  It tests a procedure that is included in another attachment called PROC1.txt. The unit test includes 2 implementations.  Both implementations pass non-ASCII characters to the procedure and return them unchanged.
    In Linux, the unit test import will change the non-ASCII characters in the XML file to xFFFD. If I copy/paste the the non-ASCII characters into the Unit Test after the import, they will be stored and executed correctly.
    Amazon Ubuntu 3.13.0-45-generic / lubuntu-core
    Oracle 11g Express Edition - AL32UTF8
    SQL*Developer 4.0.3.16 Build MAIN-16.84
    Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
    In Windows, the unit test will import the non-ASCII characters unchanged from the XML file.
    Windows 7 Home Premium, Service Pack 1
    Oracle 11g Express Edition - AL32UTF8
    SQL*Developer 4.0.3.16 Build MAIN-16.84
    Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
    If SQL*Developer is coded the same between Windows and Linux, The JVM must be causing the problem.

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

  • [svn:osmf:] 14971: Fix a problem discovered by the unit test.

    Revision: 14971
    Revision: 14971
    Author:   [email protected]
    Date:     2010-03-23 16:34:10 -0700 (Tue, 23 Mar 2010)
    Log Message:
    Fix a problem discovered by the unit test.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/net/httpstreaming/f4f/BoxParser.as

    (Removed)

  • Unit testing - problems using £ sign

    Sorry if this has come up before...
    We're using the SQL Developer unit testing functionality in what we thought was a fairly straightforward manner.
    We use a startup to set up some data, run a procedure with specific values for the inputs, compare the outputs with expected values, and then use a teardown to remove the data.
    All works well except for one output field. For reasons I won't bother to go into, it's a varchar2 field that returns an amount, in the format £9.99 - i.e. with a UK pound (£) sign at the start of the string.
    Whenever I try and input an expected value including the pound sign, the whole value gets converted to null - so, £9.50 gets saved as an expected value of null, which then, of course, causes the test to fail (unless we set it to ignore the value which somewhat defeats the point of testing !)
    Playing around a little, it seems that characters such as $ and # are ok, but any string that uses £ anywhere within it (e.g. 876f£ffe) gets saved as null.
    Has anyone else encountered this or have a workaround/fix ?
    (SQL Developer version 3.2.20.09, running on Windows XP 32-bit)

    Have you tried opening a new browser window as the new user? That is:
    1. Hold Shift and right click IE shortcut
    2. Select Run as different user
    3. Enter the new user's credentials
    4. Browse to the SharePoint site
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

Maybe you are looking for

  • SOAP Receiver Adapter using SSL - PI 7.0

    Hi all, i am currently faced with a .net WCF webservice integration using https via SOAP Receiver Adapter in PI 7.0. Can anybody tell me into which Visual Administrator view i have to import my certificate in order to get https working ? Thanks in ad

  • Vendor balance transfors

    HI friend i have doubht ,in vendor balances updations, while tranforing vendor balances from 2009 to 2010, through f.07. some vendors are already showing some opening balance, how that vendor swill be transfor, weather we will transfor vendor balance

  • Still having trouble with NeoSpeech

    I have re-installed NeoSpeech and I am still having problems.  I read the comments about this but I have not seen anything that fixes the problems I am having. When I select the Kate voice it works, but if I select the Paul voice you don't see that s

  • Screen painter groups

    I have made with screen painter a program that has 2 screens . I want now to be able to have the screen No 1 to be only for viewing and not for editing . I suppose that i can do it with the attributes of the screen (Screen group ) . Can someone pleas

  • Closing the window - web dynpro Java

    Hi all, Do you know how to close the window when the user clicks on a button in web dynpro java? Thanks for your answers. Karim