JUnit - Ignore

In my JUnit tests I have a series of public static methods embedded. When I run my tests, I receive:
java.lang.Exception: No runnable methodsInstead of requesting that the classes be ignored in the filter set for the batch run, is there any way to specify to ignore that "no runnable methods" error?
When I run this in my IDE it works fine, but running it via an Ant task it just doesn't work. Here is my Ant task setup:
<junit printsummary="${unittest.printsummary}" showoutput="${unittest.showoutput}"
           haltonfailure="${unittest.haltonfailure}"
           dir="${output.test.results.dir}"
           maxmemory="${unittest.maxmem}">
      <classpath>
        <fileset file="${java.home}/../lib/tools.jar"/>
        <fileset dir="${output.test.lib.dir}" includes="**/*" />
        <fileset dir="${output.test.coverage.dir}/classes" includes="**/*" />
        <fileset dir="${thirdparty.dir}" includes="**/*.jar" />
      </classpath>
      <sysproperty key="net.sourceforge.cobertura.datafile" file="${instrument.datafile}" />
      <formatter type="xml" />
      <batchtest fork="true" todir="${output.test.results.dir}">
        <fileset dir="${output.test.bin.dir}" excludes="**/ui/**" />
      </batchtest>
    </junit>

I think I'll look there.
I will post the answer here if something comes about.

Similar Messages

  • JUnit Ignoring Exceptions

    Hi all,
    I'm writing a small api that at the moment I don't want to fully implement. For the methods that I haven't implemented I'm simply throwing a java.lang.UnsupportedOperationException (don't know if there's a better one I could use instead? I looked but couldn't find a CantBeBotheredToImplementRightNowException)
    In my test suite, though, I'm still writing the tests to test the code. When I run my tests, JUnit correctly reports the UnsupportedOperationExceptions.
    The thing is, I'm not really interested in these Exceptions at the moment, I just want to test the rest of my code. Is there a way to set JUnit to not report specific Exceptions?
    Thanks for any help

    This seems to work...
    Say I have a sample class:
    public class MyClass
         public int getTwo()
              return 2;
         public int getThree()
              throw new UnsupportedOperationException("three not yet implemented");
    }...and I have my TestCase
    public class MyClassTest extends TestCaseX
         MyClass mc;
         @Override
         protected void setUp() throws Exception
              super.setUp();
              mc = new MyClass();
         public void testGetTwo()
              assertEquals(2, mc.getTwo());
         public void testGetThree()
              assertEquals(3, mc.getThree());
    }...you'll notice this test case extends TestCaseX instead of TestCase. TestCaseX looks like:
    public class TestCaseX extends TestCase
         @Override
         public void runBare() throws Throwable
              try
                   super.runBare();
              catch (UnsupportedOperationException uoe)
                   System.out.println("Unsupported Operation from: " + getName() + ": " + uoe.getMessage());
    }Now when I run my tests I get all errors except for UnsupportedOperationException, and when I later want to see them, I simply remove the try/catch statement from this one class, and I don't have to hunt around for @ignore or SKIP***.
    I think I should have also overridden the other run() methods in TestCase, but this works in Eclipse so I'm happy.

  • Need help with build.xml / junit - pls ignore my previous posting

    i'm trying to add unit tests for another class file in a larger package. the package is built with ant. relevant lines of the build.xml that pertain to unit tests are
            </target>
            <target name="test" depends="dist, build-tests">
                    <!-- the grouper project doesn't use the junit ant task that's fine with me -->
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="organization.organizationSuite"/>
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>
            </target>
            <target name="test-individual" depends="dist, build-tests">
                    <!-- the grouper project doesn't use the junit ant task that's fine with me -->
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="organization.testFoo"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="organization.oldTest"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>i'm trying to add
      <arg value="organization.anotherTest"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>right now i can
    right now i can
    java junit.textui.TestRunner organization.testSuite
    or to run a specific test
    java junit.textui.TestRunner organization.oldTest
    i added the above lines to my build.xml, added the .java file for the anotherTest class to the ${testdir} where oldTest and testSuite and other junit related classes live within the package directory structure, then ran 'ant' to make a new .jar file.
    now when i switch in the new .jar file, i get errors whenever i try to
    java junit.textui.TestRunner organization.oldTest
    i get 'no class oldTest' found
    can anyone point me in the right direction?

    My Ant build.xml doesn't look like yours. I usually do it like this, and it works fine:
        <target name="test" depends="compile" description="run all unit tests">
            <junit>
                <jvmarg value="-Xms32m" />
                <jvmarg value="-Xmx64m" />
                <classpath>
                    <path refid="project.class.path" />
                </classpath>
                <formatter type="xml" />
                <batchtest fork="yes" todir="${reports}">
                    <fileset dir="${output.classes}">
                        <include name="**/*TestCase.class" />
                    </fileset>
                    <fileset dir="${output.classes}">
                        <include name="**/*TestSuite.class" />
                    </fileset>
                </batchtest>
            </junit>
        </target>
        <target name="report" depends="test" description="create HTML report for JUnit test results">
            <junitreport todir="${reports}">
                <fileset dir="${reports}">
                    <include name="TEST-*.xml"/>
                </fileset>
                <report format="frames" todir="${reports}"/>
            </junitreport>
        </target>I don't understand why you're running individual tests like that. why not run them all?
    %

  • Imac June 2010 Edition Ignores Ethernet Cable Entirely

    Hi,i have experienced this issue before and have dealt with it by just connecting wirelessy for months now,but i thought today i would bring it to the community's attention,first and foremost i have fixed this problem before but only for a few startups afterwerds it would no longer connect (by wire)
    Here's My Checklist
    -"Ethernet"is set to active in System Preferences
    -The cord has been tested with other internet based products,and works perfectly,it is also snugly connected to the back on the computer and the router
    -there is no problem with the router,modem,and ISP this problem lies with the computer's software/hardware.
    -There is a "Red Light" next to "Ethernet" in SP even when the cord is plugged in.
    Thank you for your help,and suggestions.

    Resetting the SMC doesn't really fix the problem. I've been seeing the same thing on one just bought a few months ago. It only seems to happen after the computer is shut down over the weekend. Resetting the SMC is only a temporary fix at best. I'd suggest trying to get Apple involved.

  • Yet Another Expressing anger and dissatisfaction over the Cyan situation. How can you ignore so many and not answer a single question about this?

    When I bought my Icon it was advertised as being "8.1 ready." Soon, I was led to believe, I would have Cortana. I was told that there were improvements to the camera that were in the Cyan firmware. As this phone had high spec hardware and was being called the Windows "flagship phone" on Verizon, I had no reason to doubt the update would arrive.
    Not only did it not, as we are all aware, but as months went by and people took to this forum, other Windows forums and Twitter to complain and question, Verizon has never put out a simple clear statement to their customers about what their intentions are and when they might take action. I feel deceived and ignored.
    To not address this in any way when so many are so vocally asking is rude. Quite simply rude.
    Even today the Icon is available online at the Microsoft store and the copy there says that this phone is "Windows Phone 8.1 ready" with an asterisk that leads to the disclaimer that "update availability and timing varies by carrier." It has been four months since this update began rolling out.
    What has led me to post this and lend my voice to the chorus is the articles published in the last day or two saying that Verizon has now changed the status of the update to "under development." Once again, without a single word of explanation or apology. Without a single message to all of their customers who have been asking for information for months. Again, just rude.
    These articles suggest the reason for the delay is Verizon's dissatisfaction with how their apps are working with 8.1. Of course there is no way for me to know if this is true since Verizon will not say anything at all about it. So I might as well believe what the reports say I guess. This of course makes the whole thing so much worse.
    Verizon, are you seriously holding up this thing that all of your customers want so as to make sure the horrible bloatware that no one wants will "work"?! You can't put out the update and then fix your terrible apps yourself like every other app maker? Only so that we can then uninstall them anyway? This is ridiculous and insulting.
    Verizon is always trying to disable phone features to customer's detriment and their profit. I don't doubt that is what this delay is about. Now it is difficult to tether my phone without paying an extra fee even though the feature is built into Windows Phone. Just a way to keep me from using the data that I payed for and that is allotted to me. In the old days you couldn't move pictures off of your phone through the usb cable you had. You had to send them over the network and use data.
    Why not try providing services instead of taking them away and delaying them? Why not treat customers well instead of ignoring their questions? Why not do what is right and allow Microsoft to update their hardware, hardware that we bought after being told that it was 8.1 ready?

    Hi Danny-CoolKID,
    AIM for Mac is not at version 5.9
    It is here http://www.aim.com/getaim/mac/latestmacosx.adp?aolp=0
    It is still at version 4.7 and the pages style has not been changed along with the other AIM pages.
    It does NOT do Audio or Video Chats.
    If you are looking at text only then also consider
    1) Proteus (Site being revamped at present)
    2) AdiumX
    Both these are third party software that can connect to multiple services.
    As iVmichael says there are other crossplatform solutions as well.
    YakforFree
    Paltalk
    9:22 PM Tuesday; June 13, 2006

  • Extended warranty T60p Broken for over a year, support now ignoring emails. Please help!

    Hi, it has been over a year since I first contacted lenovo support about a screen issue and I still can't use the machine, support have been ignoring my emails for the past 3 weeks.
    In June 2009 I upgraded the warranty of my T60p to 5 years. This time last year a problem developed with the screen where it would simply turn off every few seconds or minutes and I would have to open and close the screen several times to try and get it to turn back on, it was completely unusable.
    When I called Lenovo however, they insisted that my T60p was no longer in warranty and the online warranty lookup showed the same thing. After dozens of emails, phone calls and several months later they finally accepted that it was still in warranty and agreed to repair the machine.
    I sent the laptop in to be serviced and collected it a week or two later and when I tried to power it on when I got home  the situation was completely unchanged, the screen was turning off just as much if not more than before.
    I immediately called/emailed Lenovo to complain and to arrange a repair and  once again sent it in.
    When I collected it this time I turned it on to find that the new screen had some pretty serious water damage or something, along both sides of the display were a series of dark splotches.
    Once again I contacted Lenovo to complain about the  way I had been treated and the terrible level of service I had received.
    At this stage, I didn't trust that if it was sent away again I would ever receive a working laptop and since it cost  me about €50 (in postage and fuel) or so each time there was no way I was going to do that.
    I'm also convinced that Lenovo have run out of new LCD panels for my model and were now using old broken ones since I had the screen replaced before any of this started and this new screen then developed the problem with turning off, so the screen had been replaced three times and all the replacements were faulty.
    So in total I had already spent several hundred Euro upgrading the warranty  and then trying to get the machine repaired and had already wasted my time for over a year. I was offered an onsite repair which I still don't believe is good enough, though I did accept.
    Support have now been ignoring my emails for over 3 weeks.
    Either send an engineer to repair the laptop once and for all (if you are able to source an LCD panel of quality) or provide a replacement machine altogether.
    Also, please extend my warranty to reflect the fact that I was refused service for over 9 months and have been left with a broken laptop for over a year.

    Hi SimonHayden,
    lead_org has informed Serge1410 to look into that again. Sorry for inconvenience caused.
    Cleo
    WW Social Media
    T61, T410, x240, Z500, Flex 14
    Important Note: If you need help, post your question in the forum, and include your system type, model number and OS. Do not post your serial number.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    Follow @LenovoForums on Twitter!
    How to send a private message? --> Check out this article.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • After update June 28 of security and Java on 17in mac bk pro laptop cannot startup

    After June 28 security and Java updates my 17 in mac book pro will not start up properly..I get a screen with text on the side and a window telling me to press the sart button to shut down and then press again to start up...( a gray panel comes down over the page before the window appears)...I have tried the install disc and done the disc and permissions repair...permissions repair could not repair "System/Library/Core Services/Remote Management ARDAgent/Contents/Mac OS/ARDAgent" a SUID file. What can I do?

    Follow these documents.
    http://support.apple.com/kb/TS2570
    http://support.apple.com/kb/TS1440
    http://support.apple.com/kb/HT1455
    http://support.apple.com/kb/ht3964
    This one about permissions you can ignore
    http://support.apple.com/kb/TS1448
    Try to get into your machine and if you do, the first thing you do is backup your files to a external drive. (not TimeMachine) via regular drag and drop methods.
    Disconnect this drive. and all others.
    You can then c boot off the installer disk for your OS version and under the Utilities menu is Disk Utility > Repair Disk
    Also you can totally reinstall OS X, shouldn't effect your programs or files (but backup all files just in case)
    If that don't work, c boot off the installer disk again, this time use Disk Utility to Erase >format HFS+ Journaled with Security option > Zero All Data (will take some time) This will totally wipe the drive of everything and is a last ditch effort.
    When it's done quit, and reinstlal OS X.
    You'll have to go through the setup and reinstall your programs and files from backup. Secret is use the same user name and drive name as the previous time so your iTunes folder will work without a hitch.
    If you restore from TimeMachine, it's possible whatever problem you had can return, but you can try and if it doesn't work, just repeat above without TimeMachine.
    Later look at free Carbon Copy Clone your boot drive to a external HFS+ Journaled formatted drive and keep in a safe place, it hold option bootable, great if your hard drive bites it, or TimeMachine gets hosed. TM isn't bootable.

  • Launchctl ignores parameters in given launchd.plist, doesn't pass argument

    *Here's my plist:*
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Debug</key>
    <true/>
    <key>ExitTimeOut</key>
    <integer>0</integer>
    <key>GroupName</key>
    <string>wheel</string>
    <key>KeepAlive</key>
    <false/>
    <key>Label</key>
    <string>org.earlywine.backup.toDMG</string>
    <key>LowPriorityIO</key>
    <false/>
    <key>Program</key>
    <string>/usr/share/org.earlywine.backup/toDMG/Backup.bash</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Volumes/Home</string>
    <string>/Volums/Backup/Backups</string>
    </array>
    <key>RunAtLoad</key>
    <false/>
    <key>StandardErrorPath</key>
    <string>/Library/Logs/org.earlywine.backup.toDMG/stderr.txt</string>
    <key>StandardOutPath</key>
    <string>/Library/Logs/org.earlywine.backup.toDMG/stdout.txt</string>
    <key>TimeOut</key>
    <integer>0</integer>
    <key>UserName</key>
    <string>root</string>
    <key>WorkingDirectory</key>
    <string>/usr/share/org.earlywine.backup/toDMG</string>
    </dict>
    </plist>
    *Launchctl fails to honor parameters given to it in the plist.* Specifically, as an administrator, when running sudo launchctl, then giving it the load command and following it up with a list for the job label, here's what I'm shown:
    launchd% list org.earlywine.backup.toDMG
    "Label" = "org.earlywine.backup.toDMG";
    "LimitLoadToSessionType" = "System";
    "OnDemand" = true;
    "LastExitStatus" = 0;
    "TimeOut" = 0;
    "Program" = "/usr/share/org.earlywine.backup/toDMG/Backup.bash";
    "StandardOutPath" = "/Library/Logs/org.earlywine.backup.toDMG/stdout.txt";
    "StandardErrorPath" = "/Library/Logs/org.earlywine.backup.toDMG/stderr.txt";
    "ProgramArguments" = (
    "/Volumes/Home";
    "/Volums/Backup/Backups";
    *It's not clear at all based upon the man pages why the following arguments in the plist are not shown*: Debug, GroupName, UserName, ExitTimeOut, LowPriorityIO, and WorkingDirectory.
    I can confirm, that as a regular user, after loading and starting the jog, Console logs that the GroupName and UserName properties are ignored (documented in the man page). This is expected, and results in errors when the stdout and stderr files are attempted to be opened.
    *When started from any user's launchctl session, the script exits as though it wasn't given arguments.* This is evidenced by the usage() I have it print to stderr. The script checks to see if it was given 2 or more parameters, and if not, prints the usage and exits.
    I'm sure the script works properly - I've given myself sudoers rights to the Bash script, and can run it by hand without issue, as in:
    % sudo /usr/share/org.earlywine.backup/toDMG/Backup.bash /Volumes/Home /Volumes/Backup/Backups
    The plist is symlinked at /Library/LaunchDaemons/org.earlywine.backup.toDMG.plist and is in the launchctl list when an administrator sudo's into a launchctl session.
    *Behavior via the rc.shutdown.local script doesn't even equal that of a sudo'd launchctl session.*
    Here's my rc.shutdown.local script:
    #!/bin/bash
    launchctl start org.earlywine.backup.toDMG
    Console logs the following as a result of the shutdown:
    Nov 17 21:06:19 Tiznit com.apple.SystemStarter39: org.earlywine.backup.toDMG: Invalid argument
    Nov 17 21:06:19 Tiznit com.apple.SystemStarter39: launchctl start error: No such process
    Nov 17 21:06:19 Tiznit SystemStarter39: /bin/sh exit status: 1
    Based upon that message, I'd say that launchctl doesn't have the job loaded start. Despite that hunch, inserting into the shutdown script "launchctl load ..." in the line above the start makes no difference.
    The manual pages for SystemStarter and launchd do not discuss the operating environment of SystemStarter and the resulting bash script that it runs.
    It would be great if I could get some assistance with this, even though I'm running Leopard on an "unsupported" Mac.

    etresoft wrote:
    The manual pages for SystemStarter and launchd do not discuss the operating environment of SystemStarter and the resulting bash script that it runs.
    What do you mean "bash script?" Are you talking about your own bash script? It would run with the user's environment. You usually don't want to rely on environment settings in system scripts like this. If you need something, you specify it on the command line. If you run another program, you provide the full path to it.
    By "the resulting bash script that it runs", I mean the fact that SystemStarter looks for the file /etc/rc.shutdown.local and executes it during shutdown (see SystemStarter's Plist and this source lines 166-170).
    The rc.shutdown.local file, as I created it, is a bash script.
    A regular user can't make launchd run as root. If you want to run as root, remove the GroupName and UserName and run launchd as root.
    My initial reason for having UserName and GroupName in the plist was so that I could ensure the job ran as root. I know now that in order to do this the job must be started by a root-owned launchd.
    My own user is not an administrator, and the script needs root privileges in order to do its job properly. I may be able to start the job as such from my own launchd via launchctl if I prefixed the script name with "sudo" in the plist.
    I now know the UserName and GroupName plist options are not necessary to run the job as root during shutdown.
    I'm sure the script works properly - I've given myself sudoers rights to the Bash script, and can run it by hand without issue, as in:
    What does that mean? When you run a program with sudo, it just runs the program as root. There are lots more way to configure sudo in sudo's config file, but I don't think you are talking about that.
    I mean that the Bash script runs properly if run it by hand in the terminal, feeding it the arguments in bash. I was trying to imply that if it's given the arguments it will do its job.
    I was also trying to point out that the plist I gave launchctl didn't effect the same as running the script via Terminal. This even when running "sudo launchctl" and loading and starting the job, which would've been done as root.
    Given Jun T.'s response to ProgramArguments (thanks), the script will probably run on shutdown if I remove Program from the plist and move it to ProgramArguments as the first entry in the String array.

  • Alarm date is ignored - 6280 (v3.81)

    Hi, I got my 6280 yesterday and have noticed a bug in the calendar. When I enter a birthday and set an alarm for it with an earlier date, eg. 7 days before the birthday, and save, when I go back and look at the entry I notice that the alarm date has been ignored and it reverts back to the actual date of the birthday. eg. birthday is 10th June, set alarm date to 3rd June, and save. Go back into calendar entry and the alarm date is saved as 10th June. This is not how it worked on my previous Nokia model. Anyone else have this problem and know of a way to get the bug fixed? Thanks in advance, Rich (and why won't this site recognise carriage returns!)

    Hi,
    Just tried that on my 6280, v3.81 and it also does it. So does look like it's a bug... Have to wait for new firmware I suppose. Not that that is guaranteed to fix it, and you won't know until you get it, as they won't say what's fixed in each firmware.

  • Order by in subquery ignores where clause

    Following the suggestion to simulate "select first," I did the following:
    select e.*,
    (select * from (select dname from scott.dept d where d.deptno = e.deptno order by dname) t where rownum = 1) dname
    from scott.EMP e;
    The "order by dname" however, cause the subquery to ignore the where clause.
    I know in this case, I can use a first_value() or min(), and it'll always return 1 row b/c of the PK. Still, any idea why it would ignore the where clause in the presence of an order by?
    Thanks

    My output:
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 31 13:50:54 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select (select dname from (select dname from scott.dept d where d.deptno = e.deptno order by dname) t where rownum = 1) dname, e.* from scott.EMP e;
    DNAME EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    ACCOUNTING 7369 SMITH CLERK 7902 17-DEC-80 800 20
    ACCOUNTING 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    ACCOUNTING 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    ACCOUNTING 7566 JONES MANAGER 7839 02-APR-81 2975 20
    ACCOUNTING 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    ACCOUNTING 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    ACCOUNTING 7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    ACCOUNTING 7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    ACCOUNTING 7839 KING PRESIDENT 17-NOV-81 5000 10
    ACCOUNTING 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    ACCOUNTING 7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    ACCOUNTING 7900 JAMES CLERK 7698 03-DEC-81 950 30
    ACCOUNTING 7902 FORD ANALYST 7566 03-DEC-81 3000 20
    ACCOUNTING 7934 MILLER CLERK 7782 23-JAN-82 1300 10
    14 rows selected.
    SQL> select (select dname from (select dname from scott.dept d where d.deptno = e.deptno) t where rownum = 1) dname, e.* from scott.EMP e;
    DNAME EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    RESEARCH 7369 SMITH CLERK 7902 17-DEC-80 800 20
    SALES 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    SALES 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    RESEARCH 7566 JONES MANAGER 7839 02-APR-81 2975 20
    SALES 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    SALES 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    ACCOUNTING 7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    RESEARCH 7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    ACCOUNTING 7839 KING PRESIDENT 17-NOV-81 5000 10
    SALES 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    RESEARCH 7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    SALES 7900 JAMES CLERK 7698 03-DEC-81 950 30
    RESEARCH 7902 FORD ANALYST 7566 03-DEC-81 3000 20
    ACCOUNTING 7934 MILLER CLERK 7782 23-JAN-82 1300 10
    14 rows selected.
    SQL>

  • "Tab" KeyEvent ignored

    Hi!
    I have a simple scene with a BorderPane and an attached onKeyPressed-Action called "actionXYZ".
    <BorderPane onKeyPressed="#actionXYZ" xmlns:fx="http://javafx.com/fxml">
    </BorderPane> The method "actionXYZ" should do something, whenever I press the TAB-Key (KeyCode.TAB).
    public static void actionXYZ(KeyEvent event) {
       if (event.getCode() == KeyCode.TAB) {
              // done something
    } Problem now is, that the TAB-Key event is either not recognized or simply ignored. At least, nothing happens... But if i use another key Alt (KeyCode.TAB), everything works.
    Does the TAB-Key needs to be handled differently from other KeyEvents?
    Thanks,
    J. Ishikawa
    Edited by: J. Ishikawa on Jun 7, 2013 6:55 PM

    Usually the tab key is used to move the focus to the next tab stop. So add borderPane.requestFocus() statement to the handleAction method
    if you want to get the tab event code when the BorderPane layout container is focused.
    import java.net.URL;
    import java.util.ResourceBundle;
    import javafx.event.ActionEvent;
    import javafx.fxml.FXML;
    import javafx.fxml.Initializable;
    import javafx.scene.control.Label;
    import javafx.scene.input.KeyEvent;
    import javafx.scene.layout.BorderPane;
    public class SampleController implements Initializable {
        @FXML
        BorderPane borderPane;
        @FXML
        private void handleAction(KeyEvent event) {
            borderPane.requestFocus();             
            System.out.println("You pressed me! " + event.getCode());
        @Override
        public void initialize(URL url, ResourceBundle rb) {
    }

  • OpenMQ embedded broker in Maven JUnit

    I have standalone application wich interacts with OpenMQ through JMS. Maven build tool is used. I want to write JUnit tests checking application interaction with OpenMQ. For this purpose I want to use OpenMQ embedded broker. I found https://mq.dev.java.net/4.4-content/embedded-example.html guide. With minor changes I implemented embedded broker. But it's not work as described in guide.
    At first it appear to me that it cann't create necessary directories and I've added
    new File("target/openmq/var/instances/imqbroker").mkdirs();
    but later I understood that for some reason it's not creating directories and files which should create itself.
    I browsed the sources code and found, that Broker.start() method return value ignored during embedded broker creation. It seems to be a bug.
    I receive broker event 'READY : Broker has been started' but actually it don't starts and jms port 7676 close.
    Please, look at my code and tell me what's wrong with it?
    Application can be downloaded from this thread: http://forums.java.net/jive/thread.jspa?messageID=482904&#482904 .
    Direct link: http://forums.java.net/jive/servlet/JiveServlet/download/56-153207-482904-13987/openmqtest.zip
    To start build process put libraries defined in lib/dir.txt from OpenMQ distribution to project lib directory. Then use
    mvn clean package
    Here is the output:
    Running bulatnig.openmqtest.EmbeddedBrokerTest
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] WARNING [B2001]: Unable to load default property file /home/bulat/IdeaProjects/glassjmstest/openmqtest/target/openmq/lib/props/broker/default.properties:
    java.io.FileNotFoundException: /home/bulat/IdeaProjects/glassjmstest/openmqtest/target/openmq/lib/props/broker/default.properties (No such file or directory)
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] ERROR [B3001]: Defaulting to use the fallback properties. The Broker will only run in a minimal configuration using these settings. Fallback properties are being used because the defaults.property files could not be loaded. Please check the value of IMQ_HOME
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD]
    ================================================================================
    Open Message Queue 4.5
    Oracle
    Version: 4.5 (Build 10-f)
    Compile: Wed Jun 16 23:23:56 PDT 2010
    Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved. Use is
    subject to license terms.
    ================================================================================
    Java Runtime: 1.6.0_20 Sun Microsystems Inc. /usr/lib/jvm/java-6-sun-1.6.0.20/jre
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] IMQ_HOME=/home/bulat/IdeaProjects/glassjmstest/openmqtest/target/openmq
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] IMQ_VARHOME=/home/bulat/IdeaProjects/glassjmstest/openmqtest/target/openmq/var
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] Linux 2.6.32-24-generic amd64 nigmatullin (2 cpu) bulat
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] Java Heap Size: max=449664k, current=30336k
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] Arguments: -imqhome target/openmq
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] Embedded Broker
    [16/&#1089;&#1077;&#1085;/2010:09:04:03 MSD] ERROR [B3086]: The broker got an exception when trying to acquire the lock file:
    null/instances/imqbroker/lock
    java.io.IOException: No such file or directory
    The lock file may be corrupted, or there may be a permission problem
    with the lock file or the directory that contains the lock file.
    If you are certain no other copy of the broker is running with the
    instance name "imqbroker" then you may remove the lock file and
    try starting the broker again.:
    java.io.IOException: No such file or directory
         at java.io.UnixFileSystem.createFileExclusively(Native Method)
         at java.io.File.createNewFile(File.java:883)
         at com.sun.messaging.jmq.jmsserver.util.LockFile.getLock(LockFile.java:113)
         at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:798)
         at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:412)
         at com.sun.messaging.jmq.jmsserver.BrokerProcess.start(BrokerProcess.java:219)
         at com.sun.messaging.jmq.jmsserver.DirectBrokerProcess.start(DirectBrokerProcess.java:87)
         at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:144)
         at bulatnig.openmqtest.EmbeddedBrokerTest.startServer(EmbeddedBrokerTest.java:50)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
    Received broker event:READY : Broker has been started
    Edited by: bulatka on Sep 15, 2010 10:37 PM

    I changed arguments to:
    -imqhome target/openmq -libhome /home/bulat/desktop/MessageQueue4_4/mq/lib
    Build Failed:
    <testcase time="0" classname="bulatnig.openmqtest.EmbeddedBrokerTest" name="bulatnig.openmqtest.EmbeddedBrokerTest">
    <error message="com/sun/messaging/jms/management/server/ClusterNotification" type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError: com/sun/messaging/jms/management/server/ClusterNotification
    at com.sun.messaging.jmq.jmsserver.management.agent.Agent.loadAllMBeans(Agent.java:671)
    at com.sun.messaging.jmq.jmsserver.management.agent.Agent.loadMBeans(Agent.java:628)
    at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:1385)
    at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:412)
    at com.sun.messaging.jmq.jmsserver.BrokerProcess.start(BrokerProcess.java:219)
    at com.sun.messaging.jmq.jmsserver.DirectBrokerProcess.start(DirectBrokerProcess.java:87)
    at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:144)
    at bulatnig.openmqtest.EmbeddedBrokerTest.startServer(EmbeddedBrokerTest.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
    Caused by: java.lang.ClassNotFoundException: com.sun.messaging.jms.management.server.ClusterNotification
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 28 more
    </error>
    </testcase>
    I added imqjmx to project dependencies: project builds without errors.
    The next question: is it possible start embedded broker without OpenMQ locally installed? Which libraries should I put in dependencies to run embedded broker in JUnit tests?

  • Jdeveloper 11g using Junit38ClassRunner from junit-4.5.jar

    For some reason Jdeveloper is using the Junit38ClassRunner when I run Junit tests - so annotations like @Ignore and @Test are being ignored. Does anyone have any idea on how to change it to use the Junit4ClassRunner (which you'd kind of expect to be the default)?
    Any assistance much appreciated.

    The version of Jdeveloper is: J2EE Edition Version 11.1.2.0.0.
    Yeah - I've checked which jar the class runner is being loaded from - it's from junit-4.5.jar. If I ctrl- for the class name then when it displays the Junit38ClassRunner class, Jdeveloper displays where it's getting the source from and it's from junit-4.5-src.jar. I've also searched for the class in all the jars available to Jdeveloper and this jar is the only one in which it occurs. Same jar has Junit4ClassRunner which is obviously the one it should be using. I can't find any obvious (or less than obvious) way to configure how the junit classrunner is invoked.

  • Running JUnit code for EJB

    Hi,
    I have written following JUnit code for testing EJB whose jndi name is SBuySharesHome
    public class CTestCase_Default extends TestCase
         public CTestCase_Default ( String arg )
              super ( arg );
         protected updateBuyShares.SBuyShares remote_SBuyShares;
         protected void setUp () throws Exception
              * Getting InitialContext object
              Properties prop = new Properties ();
              prop.put ( Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory" );
              prop.put ( Context.PROVIDER_URL, "iiop://localhost" );
              InitialContext context = new InitialContext ( prop );
              * Creating remote interface object for Session EJB SBuyShares
              Object obj_SBuyShares = context.lookup("SBuySharesHome");
              updateBuyShares.SBuySharesHome home_SBuyShares = ( updateBuyShares.SBuySharesHome ) PortableRemoteObject.narrow ( obj_SBuyShares, updateBuyShares.SBuySharesHome.class );
              remote_SBuyShares = home_SBuyShares.create();
         * buyShares : invalidBuy
         publi void test_Default_0 () throws Throwable
              /** Scenario Element : method buyShares */
              int year = 2004;
              int customerId = 1001;
              int companyId = 1001;
              int noOfShares = 100;
              boolean ret_buyShares = remote_SBuyShares.buyShares(year, customerId, companyId, noOfShares);
    This code worked fine with WSAD 5.0 and WAS 5.0
    But above code is not running in the WSAD 5.1.2 with WAS 5.1
    It is giving following exception
    javax.naming.NamingException: The JNDI operation "lookup"on the context
    "localhost/nodes/localhost/servers/server1" with the name "null" failed.
    Please get the root cause Throwable contained in this NamingException for more information.
    Root exception is java.lang.NoClassDefFoundError: com/ibm/ejs/jts/jts/CurrentFactory
         at com.ibm.ws.naming.jndicos.CNContextImpl.suspendTransaction(CNContextImpl.java:4064)
         at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3521)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1565)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
         at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
         at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
         at javax.naming.InitialContext.lookup(InitialContext.java:359)
         at SearchDAOTest.CTestCase_INOUTDTO.setUp(CTestCase_INOUTDTO.java:38)
         at junit.framework.TestCase.runBare(TestCase.java:125)
         at junit.framework.TestResult$1.protect(TestResult.java:111)
         at junit.framework.TestResult.runProtected(TestResult.java:129)
         at junit.framework.TestResult.run(TestResult.java:114)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:212)
         at junit.framework.TestSuite.run(TestSuite.java:207)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
    I could not find this required com.ibm.ejs.jts.jts.CurrentFactory.class anywhere in the installation jar.
    Can anybody suggest some solution for this?

    Let me correct the stack trace in my previous posting, Please ignore the stack trace shown in the last posting. This is the correct stack trace
    javax.naming.NamingException: The JNDI operation "lookup"on the context
    "localhost/nodes/localhost/servers/server1" with the name "SBuySharesHome" failed.
    Please get the root cause Throwable contained in this NamingException for more information.
    Root exception is java.lang.NoClassDefFoundError: com/ibm/ejs/jts/jts/CurrentFactory
         at com.ibm.ws.naming.jndicos.CNContextImpl.suspendTransaction(CNContextImpl.java:4064)
         at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3521)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1565)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
         at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
         at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
         at javax.naming.InitialContext.lookup(InitialContext.java:359)
         at SearchDAOTest.CTestCase_INOUTDTO.setUp(CTestCase_INOUTDTO.java:38)
         at junit.framework.TestCase.runBare(TestCase.java:125)
         at junit.framework.TestResult$1.protect(TestResult.java:111)
         at junit.framework.TestResult.runProtected(TestResult.java:129)
         at junit.framework.TestResult.run(TestResult.java:114)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:212)
         at junit.framework.TestSuite.run(TestSuite.java:207)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)

  • JUNIT

    I need to build an application using ant however, the application uses JUNIT. I'm running ANT (asant.bat) from my windows XP console and I have added the path to Junit into my CLASSPATH variable, yet each time I compile I get the error: "package junit.framework does not exist"
    Here is my %CLASSPATH% variable ".;.;.;C:\junit\junit.jar"
    What else do I have to do to get this to work?

    For whoever has the same problem: the lib folder on Windows is found in "C:\Sun\AppServer\lib\ant\lib". Put the junit.jar (may be junit-4.4.jar or whatever) file there. Problem solved.No.
    That specific solution only works if
    1. You are using the Sun AppServer
    2. You want to completely ignore setting it up correctly via tha ant source script.

Maybe you are looking for

  • Saving a .pdf Created in Flare9 as Reader Extended PDF

    When I first installed Adobe Acrobat X Pro and built .pdfs from Flare, I was able to save the .pdf with the "Reader Extended PDF" function. Now, that capability is no longer available and in order to access this feature I must save the .pdf and open

  • Hp all in one c 5280 error scanning and copy black sheep result

    a year ago inpresora buy a C5280 all in one, but since two months ago, when I try toscan or copy pages out completely black. please help

  • Sync fails on a particular device everytime

    My encryption "hand-shake" is failing. Therefore this device cannot sync. 1305304056789 Engine.Forms WARN Error decrypting record: Record SHA256 HMAC mismatch: should be 2355efb62a694cf659669feae580a03685b5228871f9145b291032ee638b5b3c, is c84321e18cd

  • Error msg when running Forte the first time

    The first time I ran Forte after installing it, I got an error message. Does anyone know what this means? I got this message on Win 98 and 2000. Here is the error message: "Some of the set of previously installed modules did not satisfy their depende

  • Address Book Notes for New Contacts Appear Only In Edit Mode

    When I create a new contact in +Address Book+, exit Edit mode, and then add a Note to that new contact, the note is visible only when the contact is switched to Edit mode. This does not effect existing contacts. This problem first appeared yesterday.