How do I test a private function with FlexUnit4

Hi,
How do I (If it's possible) test a private function of a class i want to test.
I really don't want to change the function to public only for testing it.
Any suggestions

[2 cents better late than never?]
Instead of "private" to "protected", we tend to use "internal".  Since our tests live in a "test" directory (at sibling-level to "src") and package structure is replicated, tests can access "internal" resources (methods and members).
If one follows this pattern, it leads to 2 curious consequences:
one can spot definitely-untested methods by their "private"-ness =
good (well tested) code never uses "private" =
I tend to agree with the original author, (sorry mlabriola -- your work is awesome and I never thought I'd find myself disagreeing with you but...) one does need to test private resources.  Java allows one to work around the situation with the horrific kludge of using reflection to access private members.  Sadly / luckily I'm insufficiently au fait with Flex's version to coax something similar.
Sadly, I'm not sure what alternatives one could have: perhaps a flag that tells the compiler/runtime whether to enforce "private"-ness which one activates during test?
2c, R.

Similar Messages

  • How di I get mail to function with my msn email?

    do anyone know how I make my msn account function with mail ?
    Need help people !

    Welcome to the forums!
    To use Mail to access your msn mail account you need the http mail plug-in, which you can download here.
    [ Edited by Host, See Terms of Use, section 4.2.2 ]

  • Use private function with interface

    I'm working with ActionScript 2 and wanted to use an
    interface for one of my classes. However, the functions that it
    would define should be private in the classes that implement the
    interface. The problem is that I can't define private functions in
    the interface, and if I leave off any scope in the interface
    ("function findAndSetInformation():Void;") and make it private in
    the implementing class ("private function
    findAndSetInformation():Void {...") I get the error: "The
    implementation of the interface method doesn't match its
    definition.

    WHATS UP ?? WHERE IS TEH MODERATOR ?!!!!
    NO REPLY TELL NOW !!!!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Yh:
    hi,
    how can i used REPLACE function with LOB database item????!!!1<HR></BLOCKQUOTE>
    null

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • How well does a GPS camera function with Places in iPhoto?

    Hello,
    I am considering buying a GPS camera (Nikon Coolpix AW110 to be exact). Does anyone know how this functions with Places in iPhoto?
    Regards,
    Tom

    As long as the camera writes the data to the correct fields in the Metadata of the image, it will work. I would expect that the Nikon should do that.

  • How to set-up a private Email with icloud

    Hello,
    I have a couple of other E-Mail accounts that I would like to use as alias in addition to my principal account.
    Unfortunately I was not able to find a setting for doing this, while it is possible to do with both "GMAIL" and "OUTLOOK".
    Does anyone know, if this function really is not available in icloud or maybe I cannot find it?
    Thank you

    Hello notachav,
    From what I can gather, it sounds like you are trying to utilize iCloud Keychain on an iOS device. I have located an article that will walk you through a series of steps to ensure iCloud Keychain is activated:
    iPhone Tips
    http://support.apple.com/kb/TI241
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • How could I test Hierarchy Viewer Components with OATS?

    Hello,
    I need some help with OATS. I am new to the program and I am not sure is it possible to record actions on Hierarchy Viewer components.
    Any help will be appreciated.
    Thank you in advance.
    Edited by: 1008138 on 2013-5-27 2:36

    imjolly wrote:
    you can try downloading inssider3 (istumbler if MAC) and then run it. This will show the broadcasting networks round about you and their channels including your own and take out any guesswork. If you then enter your router and change your wireless channel to a free or less congested channel.
    inssider3.1.2.1
    Do you downlod on a WiFi run computer?
    I just downloaded on my Desktop attached to my router by ethernet and It did not recognise any WiFi network?

  • How do I test a Java card applet with different AIDs on the fly?

    ... Like sweeping cards from employees in a queue of people lining up in the morning?
    When I created my applet, the aid is a fixed value inside the class.
    Whenever I wanted to test it with another value, I changed that AID and rerun the applet.
    I find it very cumbersome that needs to be rerun and rerun, over and over again.
    How do I test the applet easily with any values of AIDs that I'd like to put in, on the fly.
    I know I can't simulate the sweeps of card in the applet because I can't have a main method with a signature
    of Strings[] args or String[] args. I can only have JUnit to help me out, but still java card doesn't allow either
    main(Strings[] args) or TestCase to inherit from.
    Thanks
    Jack

    your question is hard to understand but:
    an applet always has one definite AID and you cant change it after install as far as i know
    a) you want to test many cards with diffrent AIDs?
    ->send a list of select commands and check the return values
    b)you want one card with the same applet to be available for many AIDs?
    ->install many dummy applets forwarding the commands to one core applet
    c)i think i didnt get your point :/

  • How can I test that the ITS is setup right and working?.

    How can I test that the ITS is setup right and working?.
    At present when calling a CRM transaction (BOR object) via the Nav Bar of the Webclient IC I am getting a message box with the title of 'Message from Webpage' and the content saying 'Object expected'.
    I have re-checked the transaction launcher and navigation bar profile setting and these look okay, hence my question regarding the ITS and how we might test that its functional.
    Jason

    I assume that as I also have a call to a URL (website), which is working fine, then the ITS servicer is also working fine.
    That just leads me to know identify why my BOR object is not being called correctly.
    Within the Transaction launcher I have the following settings:
    Entries
    Launch Trans ID: ZZIC1_LT01
    Component set: ALL
    Technical details
    Description: xxxxx
    Class name: ZCL_ZZIC1_LT01
    Statefull: X
    Further Technical details
    Transaction type: BOR Transaction
    Logical system: CMDCLNT600
    BOR Object type: TSTC_UIF
    Method name: EXECUTE
    Transaction Parameters
    Parameter: Object_key
    Value: CRMD_BUS2000115
    Can anyone see any problems with these entries?.
    what's the best way to ensure that 'CRMD_BUS2000115' is a BOR object?. I can run it as a transaction.
    Jason

  • How can I test IRIG-B'a accuracy using Labview

    We have a GPS source as reference, how can we test second GPS clock with IRIG-B output ?  Can we by using Labview ?

    Most timecode generators work by taking an external input (GPS, IRIG, PPS, or any of a number of other timecodes such as MILA, NASA36, IRIG A, etc) and outputting an on-time signal.
    The most common systems now use a GPS receiver to steer an oscillator to some fixed frequency (10MHz is a favorite) and then use that steered oscillator to generate the outputs.  The one PPS from a GPS receiver is not very smooth and jumps around easily a few hundred nano-seconds every PPS (at least they used to).
    Time codes are usually done by generating an on-time digital signal in which the rising edge of the frame bits is co-incident with the PPS timing.  The digital signal is then sent through some analog magic (op amps and whatever) which delays the output on time.
    In digital signals, the rising edge is considered on time, in analog it is the zero-crossing.
    Good systems will calibrate out the analog delay in the factory by moving back the on-time timing that is fed to the analog so that all on-time marks are co-incident.

  • Best way to test the planning function in BI7.0

    Hi
    How can we test the planning function other than the wizard.Can it be tested by creating an input ready query on the aggregation level whcih is created on the top of multiprovider joining real time info cube and standard info cube.
    Kind Regards,
    Sarah

    Testing the planning function in planning modeler and planning wizard is the fastest and the best way to verify the planning function.
    In planning modeler, you have the option of executing the planning function in trace mode which helps you to track the changes before and after execution.
    Moreover, if you want to test the PF on the input ready query, you gotta wait until the query is successfully  created in BEx or WAD.

  • How do i test split by value functionality in mesage mapping with multiple

    how do i test split by value functionality in mesage mapping with multiple values ?
    regards,
    venkat

    repeat your source node. in mapping editor you can view queues by right clicking to mapped element.. selecting Display Queues option.. this will show u your values .
    You can also select this Display Queue option for splitByValue option
    for example
    source--->splitByValue>target
    Try viewing your queues to each this step... for splitByValue in display Queue you will see context inserted(grey colour) accodingly

  • How to test activity of function in SQLplus

    Hello,
    If function does correctly or wtong.
    Function will be transforming between kg and g (kilogram gram), km, m, s/m etc.
    1 kg = 1000 g
    My function have 3 input atributte.
    1 argument: source unit
    2 argument: target unit
    3 argument: source value
    I have table, which name is units_of_measures. This table contais data.
    My function:
    change_values(source_unit, target_unit, sorce_value);
    chanhe_values(kg, g, 1);
    This function return 1000, while 1 kg is 1000 g.
    How I would test function above my real data in sqlplus?
    How would I check, first transformation from kg into gram and
    gram into kg.
    And than It would write both results per standard output.
    Please asist.
    Thanks for help.
    Nice day.
    Alex

    Hello,
    Thankyou for answer.
    I have a new question. How would I test total table for different input attribute.
    Or, that I can see that transformation, that they are wrong.
    I have a table named, mark_of_measures.
    Table has 6 columns and she comntains data.
    1. column -> mark
    2. column -> name
    3. column -> amount
    4. column -> base
    5. column -> quotient
    6. column -> note
    Table contains 79 marks.
    It is slowly to test 79 marks with this: SELECT change_values(1,1000,1) from dual;
    How can I check, if transformatio is correctly for both (from kg into g and from g into kg)
    And from km into m and m into km. And cm into mm and mm into cm.
    If which don't understand, ask me please.
    My english is not perfectly.
    Plese give me answer.
    Thanks,
    Regards,
    Nice day.
    Alex

  • How to test procedures and functions of pl/sql

    I am working as a QA basically i got a new assignment of testing functions and procedures, and packeged bodies. Can any one help me in this matter.
    Please help me.
    Hi i am new to oracle I want to test procedures and functions,
    and packaged bodies of pl/sql.

    It depends on what you meant by "testing". I guess you need to check that routines (functions, procedures, packages etc) in valid state and execute without errors. The simpliest way is to get some development tool like TOAD (http://www.quest.com), Oracle Maestro (http://www.sqlmaestro.com) or PL/SQL Developer (http://www.allroundautomations.com). You can connect with them to database and look at the routine state VALID or INVALID. You can recompile them, run and even debug. I guess this should be enough.
    Alternatively you can do same thing from sqlplus. Of course with lesser comfort. You need to write certain SQL statements. For example i want to find invalid procedures:
    SQL> select OBJECT_NAME, OBJECT_TYPE from USER_OBJECTS where STATUS='INVALID';
    To check how procedures work you need to execute anonymous PL/SQL block like this:
    declare
         /* local variables declaration */
         NAME VARCHAR2(4000);
         PRESIDENT_ID NUMBER(38);
         ID NUMBER(38);
    begin
         /* setting up variables */
         NAME:='MICROSOFT';
         PRESIDENT_ID:='BILLY';
         ID:=NULL;
         /* calling routine */
         GEOMETRY.ADD_COMPANY(NAME,PRESIDENT_ID,ID);
    end;

  • I erroneously deleted some background icons, that now have left me with only thumbnail images, what appears when I want to enlarge is a grey circle containing a black exclamation symbol, how can I get back full function and undo my mistake

    I have erroneoulsy deleted icons repetious images from the computer which then affected my iphoto images, leaving me in some cases only with the thembnail image.   When I try to enlarge or perform any other function all that appears is a black field containing a grey circle with a black exclamation symbol( !)
    within it.  How to I get back full function of these affected images and undo my goof up.   I have tried restore, but my attempts have not proved successful. 
    Help !!!
    silvercoho

    What exactly did you do to delete these?
    How did you try to "restore" and what did you try to restore?
    Probably the only solution is to restore your backup of the iPhoto library  from before you did this
    LN

Maybe you are looking for

  • GRIR Account Clearing

    Dear All,              I had one invoice and multiple GRNs open in GRIR account. All the Documents were for the same Purchase Order Line Item no. But there was a difference of 0.07 paise. With the help of tolerance level, these documents were cleared

  • What wireless solutions does the video pod support?

    For a future webcast, I have a need to shoot a demonstration of chest x-ray equipment, suturing methods, and other "allied health" related procedures.  A simple webcam is not enough.  I have been looking at wireless camera technologies, and there are

  • Adobe 9 Stamdard

    Adobe 9 Stamdard won't recognize my printer.  Reloaded printer software, did a repair on Adobe, went through devices and checked for new drivers for my MFC-7360N, Brother.

  • Link box do not have url parameters button

    I start learn Dreamweaver with this lessons How to Build a Content Management System Using Dreamweaver - YouTube, but have a problem. I do not have in the link box the parameters button for URL. Is it some extension?

  • Re: Can I run JMF in linux without X

    I've just installed JMF for Linux last night. I have it working on a Win 98 system. I "think" X-Windows loads the display drivers ? Not sure though. I've an old ATI All-in-Wonder video capture card, and think I have to upgrade from X Windows 11 Relea