How can I unit test my Swing application?

Hi All,
In my application I came across a situation where I have to automate the unit testing of my application.
Using my application user can able to draw polylines and rectangles on a BufferedImage added to a JFrame.
Can any one please help/suggest me, how to automate the drawing process (this process consists of drawing the polylines with mouse and few action/mouse events)?
your help will be highly helpful to me.
Satya

What exactly will that unit test prove? That you can mock the drawing of lines?
Unit test are supposed to test certain parts of your application code - I'd concentrate on unit tests that are actually useful and for example in the future can help to catch regressions.
If anywhere you can get help creating unit tests of this magnitude, I'd look in the unit testing support for Swing applications. Google for "java swing unit test" to see what you can come up with. Probably you'll need to create some plumbing yourself to make custom painting unit-testable; perhaps you could do something with painting to a BufferedImage in stead of to a Swing component for example.

Similar Messages

  • I am running out of memory on my hard drive and need to delete files. How can I see all the files/applications on my hard drive so I can see what is taking up a lot of room?

    I am running out of memory on my hard drive and need to delete files. How can I see all the files/applications on my hard drive so I can see what is taking up a lot of room?
    Thanks!
    David

    Either of these should help.
    http://grandperspectiv.sourceforge.net/
    http://www.whatsizemac.com/
    Or search 'disk size' in the App Store.
    Be carefull with what you delete & have a backup BEFORE you start, you may also want to reboot to try to free any memory that may have been written to disk.

  • How can I get back into my application aftermath invoking Start up page of index.htm ?

    Gorgeous Hello All,
    If anyone of you can please provide me a solution for the following, will help me in plentious and galore.
    Am using Adobe RoboHelp, Version 10 and IE version being 10.
    A hurdle :-
    I have a application which has been developed in ASP .NET, Version 4.0. Help link has been created in this application wherein here the Start up page of index.htm has been linked to be read from the RoboHelp local project folder\!SSL!\Multiscreen_HTML5\desktop. All are working absolutely fine except when
    I login into the above-said application -> click on the Help page -> the index.htm opens with Contents, Index, Glossary -> Am able to successfully perform any task by respective clickings
    -> But I am not able to get back into my application when I click on the IE provided Back button (Alt+Left) -> Any amount of invoking Back button makes the system getting looped into this Start up page of index.htm only -> When I Close Tab (Ctrl + W) or Close ( X ) -> The window session gets closed and I have to repeat all by relogin once again.
    How can I get back into my application aftermath invoking Start up page of index.htm ?
    (I can always get back into the application easily by erasing those parts in the url which refers to this RoboHelp linkages – but this certainly looks non-polished work)
    Help Please
    Cheese – Vipin Nambiar, Bangalore

    Hey Jeff, I used Internet Explorer 10.0.9200 and Google Chrome 26.0.1410. Alas - it is the same behavior.
    (But Jeff : When I used Microsoft HTML Help as primary layout to generate chm file , My Help when launched from my Application opened in a new browser window and when I closed this Help browser window did not close my application. Looks like need to write few liner code to get this issue settled )
    Thanks Indeed of lots for your concerns Jeff !!!

  • How can I set a third party application to access my organizations intranet through my organizations network

    how can I set a third party application to access my organizations intranet through my organizations network  . I am using blackberry bold 9700 OS 6

    Hi deepajithesh
    This feature is not available. Applications access the BlackBerry Network using the connection to BIS.
    Thanks
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • How can I copy test plan WITH ITS RESULTS (PASS/FAIL) to other project in MTM??

    How can I copy test plan WITH ITS RESULTS (PASS/FAIL) to other project in MTM??

    Hi odedn,
    Thank you for posting in MSDN forum.
    Based on your issue, you mean that you want to copy the test plan with test results from the current team project
    to other team project, am I right?
    If yes, as far as I know that when we copy test plan with test results to other team proejcts. It is default that
    there just will not copy the test plan with test results (pass/fail) to other team project in MTM.
    You can refer the following MSDN document’s
    what gets cloned, it explained that which objects are copied from the source test plan to the destination test plan.
    Reference:
    http://msdn.microsoft.com/en-us/library/hh543843.aspx
    If you still want to this feature, I suggest you can
    submit this feature request:
    http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there. You can send your idea there and people can vote. If
    you submit this suggestion, I hope you could post that link here, I will help you vote it.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I save test results to microsoft access database?

    How can I save test results to microsoft access database?

    Your best solution is to use the Database Connectivity Toolset. You can view the specifications and prices at the following web site:
    LabVIEW Database Connectivity Toolset
    http://sine.ni.com/apps/we/nioc.vp?cid=6429〈=US
    If you have additional questions about this toolset, you can email us at [email protected]
    Zvezdana S.
    National Instruments

  • How can i attach files in oracle applications

    Hi,
    How can i attach files in oracle applications ? Is there any thing like open dialogue box?
    krishna

    Hi Naveen,
    While I am searching for attaching files to oracle forms in forum, I found you. I have a question; probably you could help me out. I have a custom form which needs to have the facility to open the text files from C drive and load the data into Oracle tables.
    The custom form will be attached to Oracle apps responsibility... We are currently using forms6i.
    Could you help me out to open a dialog box which provides the users to open the text files from C drive when user clicks on a button
    I have attached d2kcomm and d2kwutil to the form. It complies at the form level
    but still it is not showing the dialog box.
    I would appreciate if you can help me in this regard.
    Thanks in Advance
    Ravi.
    Message was edited by:
    ravipampana

  • How can I get rid of some applications that I don't want anymore?

    How can I get rid of some applications which I don't want anymore?

    Hold the app icon until it wiggles then tap the "X"
    or
    Settings > General > Usage > select the app > Delete App
    iOS stock apps can not be removed.
    If you do not want them to show up on your devices anymore you can hide the:
    iTunes Store: Hiding and unhiding purchases

  • How can I know the version of Application Server Java Virtual Machine

    How can I know the version of Application Server Java Virtual Machine?
    Thanks a lot.

    Thats easy. Your jdk/jre are located in the App Server home directory. Just run the java command under the jdk directory with the "-version" switch and it will provide you with detailed information about your VM.
    For example if you're doing it at command prompt it will be something like
    java -versionI hope this will be useful to you.
    Regards,
    Wasif

  • Help:How can I run the J2EE Client Application? Thanks

    Help:How can I run the J2EE Client Application that will access the remote J2EE1.4 application server which runs on another host computer?
    I have developped a stateles senterprise java bean name converter and deloyed it in the j2ee1.4 application server on the host machine A. The converterbean provides the remote home interface and remote interface. At the same time I have developped the j2ee application client named convertappclient. When I access the conveter bean at host computer A through the script 'appclient.bat' as 'appclient -client convertappclient.jar', the client can access the bean sucessfully. Now I want to access the bean through the script 'appclient.bat' at host computer B,what files should I copy from host computer A to host computer B;and what the command line should be like? Thanks!
    The following are the code of the enterprise java bean and it's home interface .
    The client code is also provided.
    The enterprise java bean:
    package converter;
    import java.rmi.RemoteException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import java.math.*;
    public class ConverterBean implements SessionBean {
    BigDecimal yenRate = new BigDecimal("121.6000");
    BigDecimal euroRate = new BigDecimal("0.0077");
    public ConverterBean() {
    public BigDecimal dollarToYen(BigDecimal dollars) {
    BigDecimal result = dollars.multiply(yenRate);
    return result.setScale(2, BigDecimal.ROUND_UP);
    public BigDecimal yenToEuro(BigDecimal yen) {
    BigDecimal result = yen.multiply(euroRate);
    return result.setScale(2, BigDecimal.ROUND_UP);
    public void ejbCreate() {
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext sc) {
    The bean's remote home interface :
    package converter;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface ConverterHome extends EJBHome {
    Converter create() throws RemoteException, CreateException;
    The bean's remote interface:
    package converter;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    import java.math.*;
    public interface Converter extends EJBObject {
    public BigDecimal dollarToYen(BigDecimal dollars) throws RemoteException;
    public BigDecimal yenToEuro(BigDecimal yen) throws RemoteException;
    The j2ee application client:
    import converter.Converter;
    import converter.ConverterHome;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.math.BigDecimal;
    public class ConverterClient {
    public static void main(String[] args) {
    try {
    Context initial = new InitialContext();
    System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
                   System.setProperty("java.naming.provider.url","jnp://10.144.97.250:3700");
    Context myEnv = (Context) initial.lookup("java:comp/env");
    Object objref = myEnv.lookup("ejb/SimpleConverter");
    ConverterHome home =
    (ConverterHome) PortableRemoteObject.narrow(objref,
    ConverterHome.class);
    Converter currencyConverter = home.create();
    BigDecimal param = new BigDecimal("100.00");
    BigDecimal amount = currencyConverter.dollarToYen(param);
    System.out.println(amount);
    amount = currencyConverter.yenToEuro(param);
    System.out.println(amount);
    System.exit(0);
    } catch (Exception ex) {
    System.err.println("Caught an unexpected exception!");
    ex.printStackTrace();
    }

    Surprisingly I find an upsurge in the number of posts with this same problem. I recently found a post which gave a nice link for this. Follow the steps and it should help:
    http://docs.sun.com/source/819-0079/dgacc.html#wp1022105

  • How can I learn developing Mobile Andriod Applications in Dreamweaver CS6 ?

    How can I learn developing Mobile Andriod Applications in Dreamweaver CS6 ?

    Please don't duplicate posts.  One question on the same topic is all that's required.
    Create & package Mobile app with DW, jQuery Mobile & PhoneGap
    http://www.adobe.com/devnet/dreamweaver/articles/dw-phonegap-mobile-app.html
    Nancy O.

  • What is utp and who will do this ?how you do unit testing?

    Hi....
    he asked me like this
    1...what is utp and who will do this ?how you do unit testing?
    thanks and regards,
    k.swaminath reddy.

    Hi Swaminath,
    Adding to what Sandhya told..When the huge work is diveded by units, each unit is assigned to a Developer.After complition of the assigned work Developer has to do testing that object by seeing that Unit Plan or Creating Unit Plan.
    Regards,
    Ameer Baba.

  • How can I tell my computer what applications to open upon start up?

    How can I tell my computer what applications to open upon start up?

    If your Mac is running OS X 10.9 Mavericks.
    Choose Apple menu > System Preferences, then click Users & Groups.
    Select your user account, then click Login Items.
    Do one of the following:
    Click Add below the list on the right, select an app, document, folder, or disk, then click Add.If you don’t want an item’s windows to be visible after login, select Hide. (Hide does not apply to servers, which always appear in the Finder after login.)
    If you want to remove an automatic startup item,
    Select the name of the item you want to  from opening automatically, then click Delete below the list on the right.

  • How can i fix the Error "The application failed to initialize properly (0xc00001d)...."

    How can i fix the error "The application failed to initialize properly(0xc00001d). Click Ok to terminate the application"?
    I've tried to re-install twice the program and also restarted my PC several times and it still shows this error whenever i try to run it.

    Read the other threads on the same topic, or just install the 12.0.1 update.

  • How can run one JSF 1.1 application in Glassfish v2?

    Hello
    How can run one JSF 1.1 application in Glassfish v2?
    I need deploy one JSF 1.1 application in Glassfish v2. It's possible?
    Paulo

    in Glassfish v2 I have the messege error:
    java.lang.RuntimeException: WEB5002: Exception in handleBeforeEvent.
         at com.sun.web.server.J2EEInstanceListener.handleBeforeEvent(J2EEInstanceListener.java:250)
         at com.sun.web.server.J2EEInstanceListener.instanceEvent(J2EEInstanceListener.java:106)
    [#|2007-08-14T10:49:16.438-0300|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=416049de-0564-4eb6-8d07-ac8f65f5f7fa;|ApplicationDispatcher[/lilya2] PWC1225: Allocate exception for servlet FacesServlet
    java.lang.RuntimeException: WEB5003: Exception in handleAfterEvent.
         at com.sun.web.server.J2EEInstanceListener.handleAfterEvent(J2EEInstanceListener.java:320)
    but in Tomcat 5.5 it work without problems.

Maybe you are looking for

  • External Microphone headset use to work... but no longer works....

    When i got my MBP last year I was a heavy gamer and from November 2007 until I think like August 2008 give or take a few months I always used my headset and mic while playing online multiplayer games with no issue. Been a few months since I tried, bu

  • How to set two values equal from different recordset?

    I have created a posts recordset and a comments recordset the comments table has a post_id to link the comment to a specific post through setting it equal to the id field in the posts table so that whenever a post loads the comment whos post_id is eq

  • PeopleSoft EPM 8.9 Sample Content for XIr2

    <p>You can download the BusinessObjects 6.5 content from edelivery.oracle.com. </p><p> However, if you would like to use XI r2 with EPM8.9 we've taken the time to migrate this content to XIr2. Since XIr2 has an archive file technology, it is very eas

  • Forms runtime error

    I am getting below error in form 6 & 6i while runing, there are no issues in compiling, but after runing a form I am getting below error. Compiling procedure FETCH_DATA... Compilation error on procedure FETCH_DATA: PL/SQL ERROR 0 at line 0, column 0

  • Is it proper to use indexed views as the source of your cubes

    I understand that you're supposed to use views as the source of your SSAS cube because it provides a layer of abstraction and allows you to make schema changes without adversely effecting the cube. I also know that when you have users accessing the w