Test application modules require authentication with JUnit

Hello
I just read John Stegemans great article on testing with jdeveloper 11g oracle business components:
[http://www.oracle.com/technology/pub/articles/adf-development-essentials/part5.html]
Thank you very much.

I tried to write a test unit using the [Oracle Fusion order demo Application | http://www.oracle.com/technology/products/jdev/samples/fod/index.html].

1 import the Fusion order Demo Application
2. new project created "StoreFrontSerciceTest."
3. Finally created a Testsuite in Componten new business using the wizard, as described by the blog.

When I run AllStoreServiceAMTest, all objects view and entity tests fails with 'error', because there is no security context:
oracle.adf.share.security.ADFSecurityAuthenticationException: JAAS-Anmeldefehler.    
Authentifizierung nicht erfolgreich.
     at oracle.adf.share.security.authentication.JAASAuthenticationService.doLogin(JAASAuthenticationService.java:122)
     at oracle.adf.share.security.authentication.JAASAuthenticationService.login(JAASAuthenticationService.java:91)
..
     at oracle.fodemo.storefront.adfextensions.FODApplicationModuleImpl.prepareSession(FODApplicationModuleImpl.java:23)
All Tips how I can write application security with extension modul tests?
In particular, in a real-life project, we'd like to test differnent behavior of the services (application modules) dependend on the role of authentication.

How to set security information when creating the application module in the device:
public class StoreServiceAMFixture {
    private static StoreServiceAMFixture fixture1 = new StoreServiceAMFixture();
    private ApplicationModule _am;

    private StoreServiceAMFixture() {
        _am = Configuration.createRootApplicationModule("oracle.fodemo.storefront.store.service.StoreServiceAM","StoreServiceAMLocal");
    }
..
}
See you soon
Stefan

Hello Stefan,

Even though it is a little old, take a look at section 24.8.5 [URL http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/web_testdebug008.htm] this

John

Tags: Java

Similar Questions

  • JUnit test of an ADF application when you have nested application modules

    Hello

    When you set up a device for JUnit test in the model of the ADF, and you have nested application modules, there are advised to have a class of the device for each module of the application, or create a luminaire of class for the root application module and access somehow nested those there for view objects you want to test JUnit , or have a luminaire of class and somehow reference the individual nested application of this class modules? Everything I've read about JUnit test of an ADF application only shows an application module in the template project.

    Thank you.

    I have used with success that one category of luminaire for my application module root, and then in my test case files I can reference the application embedded this suff module.

    Example:

    The TestAMFixture.java file is where you describe the application module you want to use. This file and others, is what is generated when you let JDeveloper create your Business Component Test Suite (chosen from the New Gallery):

    The constructor of this file is where the application module is defined:

    public TestAMFixture() {}

    _testAm = Configuration.createRootApplicationModule (amDef, Config);

    }

    In my test for the projectVO scenario file, I'm testing a required attribute in a display object, so I need to access the view object that is in a nested application module:

    ViewObject _projectVO = fixture1.getApplicationModule () .findViewObject ("ProjectAM1.ProjectVO1");

    fixture1 is a reference to the TestAMFixture class. getApplicationModule() is a method in this class that returns the application root module I set in the TestAMFixture constructor. ProjectAM1 is the nested application module and ProjectVO1 is the view object where the attribute is that I will test.

    For a better explanation, please see these references, I used.

    https://www.YouTube.com/watch?v=zgyyyHKT3i4

    Unit test your Application with JUnit

    Nested Application modules

  • Running Application Module tester with ADF security

    Hi, I use JDeveloper 11.1.1.6 and recently activated ADF security on my request. Now when I try to run the Application Module Tester by right click on the request form and say run I get the following error. I get the JAAS prompt to enter my credentials, but no matter what I put, I get the following.

    oracle.jbo.JboException: Houston-29000: Unexpected exception caught: oracle.adf.share.security.ADFSecurityAuthenticationException, msg = EXC_NO_AUTHENTICATION_SERVICE
    at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:599)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2473)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2347)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3246)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:572)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:505)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:500)
    at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:523)
    at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:869)
    at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:214)
    at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:906)
    at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:632)
    at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:597)
    at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:428)
    Caused by: oracle.adf.share.security.ADFSecurityAuthenticationException: EXC_NO_AUTHENTICATION_SERVICE
    at oracle.adf.share.security.authentication.AuthenticationServiceUtil.getAuthenticationService(AuthenticationServiceUtil.java:68)
    at oracle.jbo.common.UserAznUtil.authenticate(UserAznUtil.java:64)
    at oracle.jbo.common.UserAznUtil.authenticateUser(UserAznUtil.java:32)
    at oracle.jbo.jbotester.TesterEnvInfoProvider.getInfo(TesterEnvInfoProvider.java:344)
    at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:65)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2913)
    at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:580)
    ... 13 more
    # # 0 in detail
    oracle.adf.share.security.ADFSecurityAuthenticationException: EXC_NO_AUTHENTICATION_SERVICE
    at oracle.adf.share.security.authentication.AuthenticationServiceUtil.getAuthenticationService(AuthenticationServiceUtil.java:68)
    at oracle.jbo.common.UserAznUtil.authenticate(UserAznUtil.java:64)
    at oracle.jbo.common.UserAznUtil.authenticateUser(UserAznUtil.java:32)
    at oracle.jbo.jbotester.TesterEnvInfoProvider.getInfo(TesterEnvInfoProvider.java:344)
    at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:65)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2913)
    at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:580)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2473)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2347)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3246)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:572)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:505)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:500)
    at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:523)
    at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:869)
    at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:214)
    at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:906)
    at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:632)
    at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:597)
    at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:428)

    Also, I have tried to disable the security of the ADF and the request module Tester then works fine but I need to run it with security ADF is turned on. Someone knows how to fix this?

    Thank you.

    I understood the question. It seems that I had to remove the library "ADF generic Runtime ' libraries and Classpath of the project of my model parameters. Does anyone know why having this library referenced in your project settings would cause this issue? I also had to delete this reference from the library to a project to generate a web service proxy in the past, it seems to cause a few problems when they are associated with libraries and Classpath for a project or even associated with a library that depends on another library. Can anyone provide any indication regarding the library and why it causes so many problems? You can recreate this issue on demand by adding the library "ADF generic Runtime ' to your template with ADF security project and then activated by running the module of the application by clicking on it and say run.

  • Application Module test authentication fails

    Hi all

    I try to run the application module tester to test my ejb object using the menu run.

    But it shows the JAAS security dialog box and asks the principle and identification information.

    I try weblogic/weblogic1 and database user/pass but it shows failure of authentication.

    What name of user/pass should I fill out?


    Thank you

    Hello

    go to the Application > Secure > users and groups and create new users and roles

    Kind regards

    Branislav

  • Error "Required application module is not configured" showed in distributed environment of EMP

    Hi Experts,

    We are trying to install and configure EMP 11.2.2.2. on an environment distributed.

    We have 3 servers,

    On a server, we installed Foundation Services and R & A.

    On server B, we have installed EPMA, planning, Manager of Calc,

    On Server C, we have installed Essbase.

    (By the way, SQL Server is on a different server)

    First we have problem deployment on application server on server B, and then we installed and deployed web applications of all the products that we use on the server has.

    After doing this Manager planning and calc were deployed to the application server on server B with success.

    EPMA web tier and the data synchronization has failed somehow, but after we manually created the server EpmaWebReports1 & EPMADataSync1 on the weblogic administration console.

    EPMA has been deployed successfully. So, up to this point, all products have been deployed, and the services can be started.

    But when launch us the workspace on a server, and then access the module planning or epma (dimension library, the library of applications... etc), error has occurred.

    It bumps a message as "Necessary application module awb.appmanager is not configured." or "Required application module awb.dimeditor is not configured."

    For more information on server A we installed on the disk, I have, and on server B, we installed on the D drive.

    We do not know if it makes no effect, we watched Installation EMP system produced in an environment distributed and have seen this:

    In a distributed environment, Oracle EPM home must be the same on each machine. For example, if the path for Oracle EPM home is/Oracle/Middleware on the first machine that you configure, it must be/Oracle/Middleware on all machines in the deployment.

    It is delicate because the estimate does not include the disk information in oracle home.

    Does anyone have an opinion on the issues that we face? Thank you very much!

    Eric

    For machines that are hosting the web application, really, it must be the same way home of middleware.

    See you soon

    John

    http://John-Goodwin.blogspot.com/

  • ADF Code Corder 42: by using a < af:poll > with an Application Module

    Hi all

    With the help of JDev 11.1.2.3.0.

    I worked to solve this puzzle for a while.  I'm trying to implement a simplified version of the ADF Code corner #42 (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/42-progressbarcolor-169184.pdf)

    The thing is that my 'business ' service is running in my module of the application.  In short, I take 10,000 rows to view object and run through a few different algorithms.  It would be nice to give a report during this operation.  However, as soon as I start my method of request module, my component < af:poll > end, refusing to update the current page.

    I watched a lot of sites tutorials to try to solve this problem.  I try to stay within the limits of the ADF Essentials which means no ADVERTISING, only of the poll.  Here are some of the best references:

    GEBS | Oracle Fusion Middleware 11g ADF progress indicator

    Refresh the page periodically by using survey components |

    Their service 'business' in the managed bean and the other simply re - runs a page runs a view object.  I can't find a site that will their own business service and surveys it.  Here's what I have:

    Application module

        private long uploadStatus;
    
    
        public void doUpload() {
            long max = this.getMaximum();
            for(this.uploadStatus = 0; this.uploadStatus <= max ; this.uploadStatus += 500){
                System.out.println("@ " + this.uploadStatus);
                try {
                    TimeUnit.SECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("Upload Complete");
        }
    
        public long getStatus(){
            return this.uploadStatus;
        }
    
        public long getMaximum(){
            return 10000;
        }
    

    Backing Bean

    public class ProgressBarModel extends BoundedRangeModel {
    
        private long max;
        private long status;
    
        Thread newProgress = null;
    
        public ProgressBarModel() {
            this.getMaximum();
            this.getValue();
        }
    
        @Override
        public long getMaximum() {
            // Not best practice. Should get through page def method operation
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModule("AppModuleDataControl");
            this.max = am.getMaximum();
            return this.max;
        }
    
        @Override
        public long getValue() {
            System.out.println("polling ...");
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModule("AppModuleDataControl");
            this.status = am.getStatus();
            return this.status;
        }
    
        public void doUpload(ActionEvent actionEvent) {
            if (newProgress != null) {
                newProgress.interrupt();
            }
    
            ProgressUpdater progressSimulator = new ProgressUpdater();
            newProgress = new Thread(progressSimulator);
            newProgress.run();
    
        }
    
        public void stopUpload() {
            newProgress.interrupt();
            newProgress = null;
        }
    
        class ProgressUpdater implements Runnable {
            public void run() {
                AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModule("AppModuleDataControl");
                am.doUpload();
            }
        }
    
        public long getPercentageUploaded() {
            long state = this.status * 10 / 10000;
            if(state >= 100){
                this.stopUpload();
            }
            return this.status * 100 / 10000;
        }
    }
    

    JSPX

    <af:panelFormLayout id="pfl1">
                                    <af:poll id="pollid" interval="1000"/>
                                    <af:outputFormatted value="#{MyProgressRangeModel.percentageUploaded}% completed"
                                                        id="of1" partialTriggers="pollid"/>
                                    <af:commandToolbarButton actionListener="#{MyProgressRangeModel.doUpload}" text="Run"
                                                            id="ctb1"/>
    </af:panelFormLayout>
    

    Give me the result

    polling ...
    polling ...
    polling ...
    @ 0
    @ 500
    @ 1000
    @ 1500
    @ 2000
    @ 2500
    @ 3000
    .... // up to 10000
    Upload Complete
    polling ...
    polling ...
    

    How can I get the survey allows you to control when the method of the module of an application is running?  Use more than one module app, for inclusion in the database and the other for monitoring?

    Thank you

    Will be

    I went with that instead

    How I finally reached updates to asynchronous UI with WebSockets and JMS

  • Application loader stuck on "authentication with the iTunes store."

    I'm trying to submit my app via iTunes Connect. I was stuck on "authentication with the iTunes store" for more almost 20 min. Is this normal? Something wrong?

    Screen Shot 2014-09-10 at 9.09.24 PM.png

    I followed the Guide step by step Adobe publishing applications iPad and everything went smoothly thanks to the DPS App Builder. I was able to download both the app developer .ipa and distribution app .zip following the steps very well. But eventually, all measures are useless: interface of iTunes Connect has changed since the guide Adobe did, and now I'm completely lost.

    I downloaded the app Loader and try to submit this .zip app developer I have to iTunes Connect via the Application Loader. But in vain.

    Any help would be really appreciated. Thank you

    You can ignore this warning. You will, however, probably to encounter other errors. Please see http://status.adobedps.com/ for later.

    Neil

  • ViewObject/Application module with 2 different databases-* URGENT *.

    Hi all
    I need to get the data of two databases for reading different oracle single table in a jspx page.
    It is possible to obtain these data using a single VO and his application module.

    If this is not the case, what is the way to go about such a scenario. How can I say VO to get data of different databases.

    Both are oracle db, but on different machines, different credentials.


    Thank you very much
    Amit

    No, it is also not possible. However, you can have two modules different app pointing to different databases. EOs / your inside a an appmodule will only be the connection that a single database.

    Arun-

  • Main application of JAAS application module

    Hello

    I use Studio Edition Version 11.1.2.3.0.

    Since the activation of security in my ADF application, when I try to run or debug an Application Module I'm invited with a command of JAAS authentication prompt.

    I tried the OS identification information and qualifications of the DB without result. I'm always presented with the following error:

    (oracle.jbo.JboException) Houston-29000: Unexpected exception caught: oracle.adf.share.security.ADFSecurityAuthenticationException, msg = javax.security.auth.login.FailedLoginException: a user with the specified name does not exist.

    I tried to remove and reconfigure the ADF security, but the error persists. If I remove the ADF security I can run the AM again.

    Thank you very much.

    Hello

    To test the application module, you must set the users (and roles) in your jazn-"Data.xml".

    Arun-

  • How to simulate a DAQ hardware and use it to test applications without hardware?

                           How can I simulate a DAQ in MAX material and use it to test applications without hardware?

    If my application requires input from external hardware to do how can I simulate a DAQ hardware in LabVEIW?

    I need to simulate several digital inputs and outputs to test the software. currently I have not the material and material DAQ here.

    answer with your valuable suggestions.

    Thanks in advance

    RENN

    Hello

    There is no option to simulate the traditional device. You need hardware for it so I would say to simulate a PXI system that has a configuration similar to the PCI-6014 and make a small change to your request...

  • BlackBerry smartphone to test applications

    Hello

    The members of the forum can advise on how to test applications on real hardware. I just bought a 'sim free' Pearl 9105 from amazon. But I paid no attention... it's actually from a 3rd party vendor, and they sent a device unlocked with logo orange etc. He has problems with the WiFi, no app store App etc. I also had a wait upgraded to OS 6. It did not work on after spending much time after the methods advised, I gave up. As it is not provided, as announced, I return it. But only just read the return policy and it is not favorable. My mistake I might, if it was directly from Amazon, which would have been more just.

    Which leaves me a strange feeling. What are the developers officially supposed to do? Rather than being messed around, is there a standard way to get a feature of development that are available with the version of required operating system etc. ready to go. I hate wasting time with all this and would rather be sitting here software test and writing and above all contributing to the platform. In any case, perhaps with feedback from other developers it will all become clear.

    I actually look for os 6 upgrade would be a piece of cake and solve all these problems, but it now seems more that I joined the pirates rather than BONE fide developers, and this isn't what I want to do :-)

    Help, please

    Hi, I am also a new developer is just beginning to find some things again, but I can give some useful suggestions for you:

    First of all,

  • Restore does not work in a web service that is created from an application module method

    Hello world

    I use jdeveloper 11.1.1.7.0

    I have a pl/Sql function named "InsertTest" that makes a lot of calculation and the DML operations (for example, insert and update tables) effective on many tables, while there no COMMIT in a pl/sql function.

    In a class of application module, I created a function (callDBFunction()) that calls the pl/Sql function,

    and I want to only use the result of a pl/Sql function, and at the end I restore all changes that are created in the pl/Sql function (using this.getDBTransaction () .rollback ()).

    // in application module impl class
    public void callDBFunction() {
    
      CallableStatement plsqlBlock = null;
      String statement = "BEGIN :1 := InsertTest(); END;";
      try {
      plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);         
      plsqlBlock.registerOutParameter(1, OracleTypes.VARCHAR);
      plsqlBlock.executeUpdate();
      String rslt = plsqlBlock.getString(1);
    
      //..... use the result of plSql function
    
      this.getDBTransaction().rollback();  // rollback all changes
    
      } catch (SQLException e) {
      e.printStackTrace();          
      }
    }
    
    
    
    
    
    

    Then, via the tab of the Service Interface, I created a web service of the function above.

    When I test the web service and call the function, any changes made to the pl/Sql function is committed in the database.

    in fact it seems that the line "this.getDBTransaction () .rollback ()" in the code above was useless (doesn't work).

    How can I restore in this case?

    Habib

    Concerning

    If I call the function via the request module Tester, all changes rollback and it works as I hope.

    but in the case of service web when calling the function all changes are committed to database.

    This probably confirms my hypothesis that when you instantiate AM of ADFBC WS, connection has autocommit = true.

    You can try to change this with: plsqlBlock.getConnection () .setAutoCommit (false) before calling your plsql procedure.

    Dario

  • Deactivation of the consolidation Application Module?

    Hello

    I use jdev 11r1. I have two types of applications,

    1. one is full of EO based VO

    2. another is full of transient VO

    Disable the grouping of applications module only for the objective test to save the activation.

    Question: if I use off the module Application pooling,

    1. how much test engineer interact with applications of VO based EO.

    2. how much test engineer interact with their applications to complete transient VO.

    3 will be activation/passivation will work for application of VO based EO.

    4 activation/passivation will be transitional full application of the VO work.

    5. If I'm commit / rollback the transaction on EO based application of VO.

    6. If I'm commit / rollback the transaction on plenty of transitional application of the VO.

    Answer the question myself,

    for 1 & 2. based on connection pool settings. I hope, but I'm not sure.

    for 3 and 4. Activation/passivation will be works, I hope, but I don't know.

    for 5. Commit / rollback will be working as usual.

    for 6. cancellation will be working as usual. I don't know about the validation

    Please correct me if I'm wrong.

    Thank you.

    Connections settings would consider, however, as there isn't that one module application it will no connections for this add-on.

    Timo

  • How to save an application/module HCM custom in the merge request

    Hi all
    I'm working on a proposed merger of coexistence and one of the requirement we must create/save a custom application/module in Fusion Apps(Just like Creating Entry in FND_APPLICATION IN EBS).
    Once created, we want it to be a schema-related custom and Linus directory structure personalized as well.
    Any help would be much appreciated.
    Thank you
    Ankit

    Hello

    The steps are that you mentioned.
    Taken in charge have recently created Note 1543753.1 - how to create a custom in a custom Application Host job?
    You can keep an eye on it when it will be published and will provide you with the steps and screenshots how to do it.

    Kind regards
    Sebastian

  • Cannot run the application module in a project of (Model) generic in BPM application

    I use jDeveloper 11.1.1.6 and I want to add a generic or a model for a BPM application project, in order to develop the custom user interface.
    but when I created an application module with associated and then java class do a right click on it to run, I saw the following error message:

    (oracle.jbo.ConfigException) Houston-33001: tester.xcfg Configuration file is not found in the classpath.

    more when I use a merger Web application instead of BPM application, with the projects of model and view controller, there is no problem and I am able to run the module of the application.

    Thank you very much for your contribution.

    Comment the mds-config section in your adf - config.xml temporarily and try. It will work

Maybe you are looking for

  • A40 - 231 is unable to read DVD-R.

    Burned or blank DVD - R doesn't recognize my A40-231 waiting for a few minutes, the disc turns in the reader, from time to time, then stops. Factory pressed DVD are fine, CD - R is very good, only DVD-R can't be read... I tried several Verbatim and T

  • Is CompactRio best solution for me?

    I develop the couple-tour and need to control, hydraulic test machine in addition to saving the graphics of each couple. Control Panel will use the industrial Joystick (to control 5 proportional valves for directional hydraulic) and also requires the

  • Laptop with Vista does not start

    For the last 24 hours since I restarted my HP laptop, the screen showed "configuration updates, step 1 of 3, 0% complete, don't turn off your computer."

  • Deletion of drive to the VM makes disk space disappear

    I'm new to esxi, then I've probably missed something obivous. But I'm running a Server Windows 2012, and I wanted to add a new hard drive for storage.I added a new 2 TB HDD (virtual disk new created, used thick Prov. and scsci), but then (for other r

  • When open cc and click on download apps get error message

    When open cc and click on download apps get error message