How to check whether or not a user session is null

Hello

I use Jdeveloper 11.1.2.2

I have a some Junit test case execution use case, that's the problem I have:

There's Junit tests that are written for some VO while tests of insert and update operation to Junit it is two General required columns Created by and updated by to engage in the database.
These values are taken from the UserName of the current UserSession.

So to get these values for each user, I thought to display a JPanel before the test is run, where the user enters the user name and password which is validated and the user is verified.

First of all, I need to check if there is a session presents or not. To check this, I wrote a createUserSession() and liked on the inside:
if(fixture.getApplicationModule().getSession().getUserData().isEmpty())
Would that be to show the Jpanel and the details of the user and verify the user.

But when executing the test itself, I found that the session is already present, now I just at the entry values based on who is the user.

But Junit run the tests in the order in which the tests are written. I therefore call this in all the test cases.

The Question is:
How can I check if the session is already present or not, so that I don't have to ask the user every time of each test runs to enter the user name and password?

Thank you
Nigel.

Edited by: Nigel Thomas July 30, 2012 10:26

Hello

ask yourself why you create test users and then automatically connect them as Jan Vervecken made in the net, I told him you. This way your test cases run without user intervention. To test if a session exists for a user, I would put a custom property in the user data. If this property exists, the user session is an existing one. However, make sure that the information you save user data survives passivation, because otherwise the information you get out of it is not accurate. See: http://tompeez.wordpress.com/2011/07/08/jdev-always-test-your-app-with-applicationmodule-pooling-turned-off/

Frank

Tags: Java

Similar Questions

  • How to check whether or not the value is already in the collection

    Hello

    I'm in the analysis of a donkey of xml file assigning values to the collection.
    For each new record, that I am available for capture of xml, I need to check if this value already exists in the collection or not, and then only I must add this value to the collection.
    How we do that. I am not able to check whether or not it is already present in the collection. Help, please.

    Here is my code


    TYPE tab_A_type_rec IS RECORD)
    Name Varchar2 (50);
    );

    TYPE tab_A_type IS TABLE OF THE tab_A_type_rec;

    pkv_A_tab tab_A_type: = tab_A_type ();


    l_nl: = dbms_xslprocessor.selectnodes (dbms_xmldom.makeNode (l_doc), ' / / List "");
    for cur_rec in 0... dbms_xmldom.GetLength (l_nl)-1 LOOP
    l_n: = dbms_xmldom.item (l_nl, cur_rec);

    pkv_A_tab.extend; -----
    pkv_A_tab (pkv_A_tab. (Last). Name: = dbms_xslprocessor.valueOf (l_n,'Name / text () '); -I have to do these two steps only after checking whther that value is already present in the collection pkv_A_tab or not... What will be the stated case.

    end loop;


    Thank you
    Pramod

    Peter Gjelstrup wrote:

    Then in the final use TOGETHER to eliminate duplicates.

    The only problem - cannot use SET operator nested table records ;) or even on a table nested objects, unless the object type has map/delivery orders. Now if in real life, record type has only one attribute - NAME OP can just create type of TABLE OF VARCHAR2 (50). Then:

    SQL> declare
      2      type tab_A_type is table of varchar2(50);
      3      pkv_A_tab tab_A_type := tab_A_type('A','B','C','A','B','C','D');
      4  begin
      5  if 'B' member of pkv_A_tab
      6    then
      7      dbms_output.put_line('Found B.');
      8  end if;
      9  pkv_A_tab := set(pkv_A_tab);
     10  dbms_output.put_line('List of distinct elements:');
     11  for i in 1..pkv_A_tab.count loop
     12    dbms_output.put_line(pkv_A_tab(i));
     13  end loop;
     14  end;
     15  /
    Found B.
    List of distinct elements:
    A
    B
    C
    D
    
    PL/SQL procedure successfully completed.
    
    SQL>   
    

    SY.

  • How to check whether or not the arraycollection collection is initialized

    Hi all

    I am bit new to use the collection arraycollection in flex. I'm having this particular scenario, where I get Server data in a table. So I have to check if the arracollection I created is initialized or not. If it is not initialized I need to initialize it or other wise, just add collection from table to table. Here is the code snippet

    currentTrajectory = new collection ArrayCollection (event.result as Array);

    var _multiTrajectoryEvent:MultiTrajectoriesEvent;

    _multiTrajectoryEvent = new MultiTrajectoriesEvent (MultiTrajectoriesEvent.DRAW_AUTO_TRAJ);

    If (!) (_multiTrajectoryEvent.trajectories.source is nothing))

    {

    _multiTrajectoryEvent.trajectories.addItem (currentTrajectory);

    }

    else

    {

    _multiTrajectoryEvent.trajectories = new ArrayCollection ([currentTrajectory]);

    }

    But unfortunately the above code does not work for me, because the arraycollection collection is not initialized first, there is no way of checking me if it is initialized later or not as the compiler gives me the error checking to null...

    Can any Walter suggest how can I check if the table collection is initialized or not?

    I would appreciate any suggestions and thouhgts for the same

    Thank you

    Akshay

    Sorry to say, but it's not the right approach...

    I'm abt don't know what is exactly done so I'll give a generic example...

    I have an ArrayCollection collection...

    private var arrC:ArrayCollection;

    Maybe it's getting used internally in several places, so you be sure if she be initialized already or not. Then use a code something like that...

    If (arrC! = null & arrC.length > 0)

    {

    ...

    ...

    }

    If you are using

    If (arrC.Length > 0)

    {

    ...

    ...

    }

    and it is not initialised it will give exceptional at the time to compile...

    For a logic if(a && b) be true both a and b must be true, so if same first one (a) is false it will not evaluate the second logic (b).

    Thus, the previous logic works.

    concerning

    Nishant

  • I found an old vista home basic dvd with a key, how can check whether key works but not install it?

    I found an old vista home basic dvd with a key, how can check whether key works, but not install it? some dvd install can be live boot from themselves too [password required for a direct start?]?

    Hello

    You must install it to see if it is legal to do so.

    There is no public database of product keys.

    See you soon.

  • check whether or not a concurrent request is complete the backend

    Hi all
    I want to check whether or not the competing applications is complete the backend using the API. I discovered that FND_CONCURRENT.wait_for_request can be used, but inside this procedure they use dbms_lock.sleep command to delay treatment. I used the same dbms_lock.sleep in my code, but does not correct results.
    Please you siggest me on solutions workaround that needs to be done to get the exact time of the concurrent request will have to fill.


    Thank you and best regards,
    Mahesh

    Hello

    You can get the same information in table FND_CONCURRENT_REQUESTS (API of FND_CONCURRENT of the readings of the same table).

    If you want to continue to use an API, see if you can use FND_CONCURRENT. GET_REQUEST_STATUS (Please check if it is a public API).

    Kind regards
    Hussein

  • How to check generating a lot of archivelogs/session of the user?

    Hello

    On a 10g database, how can I get to the session/user who generates a lot of archivelogs?

    Thanks in advance,

    For the currently connected sessions, you can query V$ SESSTAT (join to V$ STATNAME). Therefore,.

    select s.sid, s.value
    from v$sesstat s, v$statname n
    where s.statistic#=n.statistic#
    and n.name = 'redo size'
    order by 2
    /
    

    However, there are few complications:
    1. persistent Sessions will appear with very high statistics, simply because they have not disconnected. Many applications maintain permanent Sessions for one of
    a. follow-up and ongoing execution user submitted or jobs at the request (for example, in Oracle e-Business Suite and Peoplesoft)
    b. connection pooling
    2. the Sessions that have already disconnected will not appear in your report.

    Therefore, you have to frequent meetings of "sample" and find that the differentials redo size. Then, another complication hits you:
    c. oracle reuses the Session ID. Once a session disconnects, another session of connection can get the same SID. He could get the same serial number immediately, so you might want to use a combination of SID + SERIAL # from V$ SESSION as your key (you will need to add V$ SESSION in your query of surveillance) even in this case, I would not ensure that the couple would not repeat after some time, especially with the restart of the instance.
    You would be better to use AUDSID from V$ SESSION, that this value is incremented (and not reused) auditing session.

  • I'm on disk check utility, how do I know when its done and how I know whether or not, I have a problem?

    I have Microsoft windows, I have a laptop, windows vista, I ran CCleaner, Speedy PC Pro, Uniblue registry Booster and security system from Microsoft that comes with this system. Now, whenever I run these or any program on my computer that has to do with safety or clean my computer or any fixing problem, I get a message that appears from the bar saying run disk utility to check off tasks? I know you probably want to know what the message says, but I can tell you that he keeps telling to run check disk utility.  the full message is "corrupt Registry Booster.exe file or directoryc:\program key is damaged and unreadable. Run the chkdsk utility.  What can I do to fix this?

    ... Initially re-read your error message.
    ...." Corrupt Registry Booster.exe file the file or the directoryc:\program

    data\microsoft\crypto\RSA\machine keys is damaged and unreadable.

    Your registry booster has damaged your system.

    Uninstall Speedy PC Pro and Uniblue Registry Booster. They is snake at best, disastrous at worst oil.

    As the CCleaner, it's ok as LONG as stay you away from registry option in the left column. Never use registry cleaner... period.
    Registry cleaner could be useful in the hands of accomplished computer experts.
    In the hands of regular users, it's a time bomb.

    You said... more security system from Microsoft that comes with this system.
    Only the security system that comes with the operating system is Windows Defender and Windows Firewall.
    This is not enough. Advise to install Microsoft Security Essentials...
    It's a free program and good enough for home use.
    A point to note: stop Windows Defender because he has his own Defender. 2 defenders running on the same computer will create conflicts. It's normal.

    How long disk check run...

    Depending on your system. More "junks" in the system, more time. In general, it takes some time. When it runs, don't interrupt, don't stop the computer.

    How do you know you have a problem or drive no check...

    The system will create a log of disk check. Here's how to access the Journal:

    Start > in the search box, type event viewer > Enter >
    the column on the left, click on the pointer before Windows logs
    Select (left-click) Applications, and then
    Click with the right button on Applications
    Select search
    in the 'search box', type chkdsk
    Click next
    leave the search window
    the middle column, you will see Wininit 1001, click
    right column, under the event 1001, Wininit, click Properties of the event
    A new window with the diskcheck newspaper.
    You can use the slider to display, or click the button copy and then paste it to the one that you want to use, such as Notepad or wordpad.

  • connect the DBA_USERS alll users using any method (or PLSQL cursor) and check whether or not users are connected

    Hello

    I have to connect to all users of the dictionary DBA_USERS and one by one, or in bulk.

    As we do to treat a data pointer.

    In oracle, we now CONN/CONNECT statement to connect users to oracle.

    I have doubt on can we write these CONN/CONNECT statement in any PL/SQL block or not.

    My problem here is also as if a user does not connect for any reason, then it must record in the log file.

    Please ask me if you need more information!

    My DB is-

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - production

    Hello

    I totally agree with comments of Steve.

    -Thank you

    Pavan Kumar N

  • When you install age of empires 3 it progresses quite far ahead, it reports an error and to check whether or not the sound.bar file on the disc (cd 2).

    I ask to check if the file sound.bar is on is the cd or not. I'm unable to explore the disc on my computer to determine if the file is there or not. Overall, the progress bar indicates that the installation was almost complete. There are some light scratches on the cd. All solutions? I'm unable to explore the disc on my computer to determine if the file is there or not. Overall, the progress bar indicates that installation was almost over before I got this error message. Is there any way to get this file, as I suspect the cd is damaged as it has a few light scratches on the cd. All solutions?

    Hello

    1. don't you try to install the game in the other computer with the same disc?

    If you are not able to install the same game on another computer it clearly seems to be a problem is with the CD, then I would you to see link and check if it helps.

    How to replace lost, broken, or lack of Microsoft software or hardware: http://support.microsoft.com/kb/326246/en-gb

    For your information:

    Error message when you install a program of mapping or game from Microsoft: http://support.microsoft.com/kb/258496

    Hope this information is useful.

  • Envy touch: how to determine whether or not Windows 10 is an upgrade on an HP laptop?

    I need help on how to determine if the 10 Windows on the laptop is an upgrade to say Windows 8 or is not an upgrade.

    I had some problems with the audio drivers on an upgrade at the beginning to 10 Windows on another laptop HP and I understand that this issue has been resolved with HP laptops with Windows 10 which are not upgraded.

    Thank you

    Hello

    Can't get HP Envy 17 - So13ca (oh) but HP Envy 17 - S013ca (zero). The following link shows its specifications:

    http://support.HP.com/in-en/document/c05187473

    She has 10 Home 64-bit Windows pre-installed.

    Kind regards.

  • Check whether or not the magsafe power adapter is authentic

    Hello! I bought some 60 W MagSafe 2 Power adapter MD565CH/A, 85 W MagSafe 2 Power adapter MD506CH/A & 45 W MagSafe 2 Power adapter MD592CH/A but the serial number in each category is same for example there are 10 units for 60 W & all have the same serial number. I have a doubt, be they authentic shape Apple or not. Kindly help.

    You will need to call Apple for confirmation.

  • How to restore the tabs, not the previous session, but a session before

    I have a number of open tabs for resources that I need for a project. I've not will work on this project every day so I always restore from a previous session. But if I have a session without these tabs then the current tabs will become the previous session. How to store the session I have to restore it not at the next session, but in a session that follows so the general question?

    Hi CatsUncleNedThomas, if you want personal advice on these issues, please start a new question. You can do this by using the following link:

    https://support.Mozilla.org/questions/new/desktop/fix-problems

    Scroll down beyond the solutions suggested to continue with the form (I think he has 3 different screens).

  • How canI force FF DO NOT reload old session after crash/reboot the PC?

    My PC has problems and crashes. This isn't a problem with FF BUT: cause me this problem in FF: after reboot, when I restart FF he tries to recharge old session, EVEN if my options are set to 'Show my home page' and NOT 'my windows/tabs from last time '. When he tries to restore the tabs, FF, it causes my PC to hang & crash AGAIN! How can I force FF again, as if I could close healthy? Maybe a way to launch FF in 'safe mode', sort of? Thank you! -Marvie

    The value of the integer pref browser.sessionstore.max_resumed_crashes to 0 on the subject: config page in order to get the about: sessionrestore page immediately with the first reboot after a failure has occurred or the Task Manager was used for the closing of Firefox.

    Which allows to deselect the tabs that you do not want to reopen, but will reopen the other tabs.

    See:

  • Check the permissions of a user session

    I have a problem with a supplier 3rd party application

    The application is very poor (this requires access s/n)

    I believe that the application performs the following operations when a user connects

    User1 create a session

    It's round fires a trigger or procedure (I can't see the code for as it is encrypted)

    The trigger allows User1 a tas bunch of roles, then runs the sql statement in the User1 and him revokes roles (even if the declaration of the User1 is still ongoing)

    Sometimes the the User1 sql statement can take a few hours to run

    During this time, it is possible to check what are the roles granted to the session of the User1?

    I think at one of the tables $ x will have the answer

    This is a Dev env and there is nothing in the dba_audit_trail

    G.

    The REDO logs will have all THE statements that have been executed.

  • How to check the slider back row contains data or not

    Hi all


    How to check whether or not the cursor returned row contains data in one of its field.


    Thank you and best regards,
    Prakash P

    Use ROWCOUNT %
    Use % NOTFOUND

    example of

    DECLARE
    
       id    number;
       desc varchar2(10);
       CURSOR cursor_one IS
          SELECT
              id, desc
          FROM
              table;
    BEGIN
       OPEN cursor_one;
       LOOP
          FETCH cursor_one INTO id, desc;
          EXIT WHEN cursor_one%ROWCOUNT > 20 OR cursor_one%NOTFOUND;
       ...
       END LOOP;
       CLOSE cursor_one;
    END;
    

Maybe you are looking for

  • Takes a lickin', keeps on tickin'.

    Maybe this is one for the record books, but seriously, I need comments on how to get the most "bang" for the buck in this situation.  My iMac 27 "new found himself on the wrong side of a landfill by negligence of 45.  No one was injured, but the iMac

  • Network says 'Search'... »

    I have an iPhone 5 s, update to the latest version 9. Any iOS. I never had this problem before, but I allowed my iPhone to die completely (nothing new) and when I put it on the charger to the phone turns on. * POOF *. NO network, "the search...". "I

  • Where to install XP, have the product key but no installation media

    I think I have a problem with my windows install but I have gone through all the patches on the site and can not solve the problem. Is it possible to download windows XP to the internet, as I have my product key, but not the original CD   * original

  • Questions: Buying a laptop in India and go to Canada Parmanently

    Hello It's salim of the India. I want to buy a Dell laptop within the next fortnight here in India and I have some doubts to erase everything first. Hope you can help me. I'll be moving to Canada permanently in July this year. So, first of all, I nee

  • the power of fire IPS rules

    Dear, Please find the attached screenshot for an example, there are many disabled bydefault rules how do I know that I need to enable to avoid any attack on the network. Thank you