Junit explained in plain english please.

I been reading up on JUnit, and i still do not understand it.
What is the difference? Why not just make an application?
Please explain it as if you are explaining it to someone who is not very technical.
Thank you

What is the difference? Why not just make an application?You could. But it wouldn't be as nice.
If you have 100 tests, how are you going to organise them in your application? Will you write 100 different applications?
JUnit allows you to group tests nicely.
It allows you to share setup/teardown logic to prepare for running your tests.
It gives you a nice graphical display of how tests went if you're using an IDE (or the command line).
If you're using a tool like ant, it allows you to stop the script when you encounter a failed test. That's really useful if you're building something based on libraries - you don't want to build the rest of the webapp if one of the libraries it will be made from has a bug in it.
No, you don't have to use JUnit, but it's much easier to use JUnit than it is not to.
The simple example you asked for. Here's a real test case that I'm using to check to see if a component for breaking down web URIs is working correctly. Note how I use the nice simple "assertion" methods.
public class PathHolderTest extends TestCase {
   public void testRootPathAbsolute() {
      final PathHolder ph = new PathHolder("/");
      assertTrue(ph.isFolderPath());
      assertTrue(ph.isAbsolutePath());
      assertEquals(1,ph.getPathElements().length);
      assertEquals("/",ph.getPathElements()[0]);
   public void testSimplePathAbsolute() {
      final PathHolder ph = new PathHolder("/foo");
      assertFalse(ph.isFolderPath());
      assertTrue(ph.isAbsolutePath());
      assertEquals(2,ph.getPathElements().length);
      assertEquals("/",ph.getPathElements()[0]);
      assertEquals("foo",ph.getPathElements()[1]);
   public void testFolderPathAbsolute() {
      final PathHolder ph = new PathHolder("/foo/");
      assertTrue(ph.isFolderPath());
      assertTrue(ph.isAbsolutePath());
      assertEquals(2,ph.getPathElements().length);
      assertEquals("/",ph.getPathElements()[0]);
      assertEquals("foo",ph.getPathElements()[1]);
   public void testSubFilePathAbsolute() {
      final PathHolder ph = new PathHolder("/foo/bar");
      assertFalse(ph.isFolderPath());
      assertTrue(ph.isAbsolutePath());
      assertEquals(3,ph.getPathElements().length);
      assertEquals("/",ph.getPathElements()[0]);
      assertEquals("foo",ph.getPathElements()[1]);
      assertEquals("bar",ph.getPathElements()[2]);
   public void testSubFilePathWithExtensionAbsolute() {
      final PathHolder ph = new PathHolder("/foo/bar/index.html");
      assertFalse(ph.isFolderPath());
      assertTrue(ph.isAbsolutePath());
      assertEquals(4,ph.getPathElements().length);
      assertEquals("/",ph.getPathElements()[0]);
      assertEquals("foo",ph.getPathElements()[1]);
      assertEquals("bar",ph.getPathElements()[2]);
      assertEquals("index.html",ph.getPathElements()[3]);
}

Similar Messages

  • Newbie question: how do you reset the router; in plain English please

    I need some help in plain English please.  The router stopped working and maybe just needs a reset.  I tried reading http://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-123-mainline/46509-factory-default.html, but I don't understand the first thing.  It's a Linksys E2500.  Is this even the right forum?

    You are reading a Nexus IOS guide. Nexus is a carrier grade switch so don't mind that. Try this instead.
    http://kb.linksys.com/Linksys/ukp.aspx?vw=1&docid=eaa3127db5f4402584c959a7251e754c_4008.xml&pid=96&slnid=2

  • SE97 and table TCDCOUPLES in plain english please....

    Guys... can anybody please explain to me in plain english what SE97 and table TCDCOUPLES shows me! I read the "called transaction" thing, but can't comprehend the meaning. E.g. if I enter PFCG in SE97 there is a long list of funny transactions.
    Is this a log of transactions called once in PFCG? Or possible transactions called from buttons, ect. from in PFCG? Or is it all the transactions from where you can call PFCG?
    What do I need to do in connection with SU24 and creating roles?
    /vitofava

    Often transactions link to other transactions via drilldown, buttons, views etc.
    Where SAP uses CALL TRANSACTION for this link we can use SE97 to force a check on S_TCODE or to ignore the S_TCODE check.
    An example: MM50 allows the extension of a an material master for other org units.
    As standard MM50 calls MM01 for this and any users with MM50 also require MM01.  It is a common situation where MM50 is required  by users but MM01 is not suitable.  In this case you can use SE97 to set MM01 as "do not check". 
    Users can access MM01 functionality when called through MM50 but do not require MM01 in S_TCODE.  If they try to run MM01 they will get an authorisation as it is not access through/coupled with MM50.
    Like SU24, SE97 isn't completely accurate and a lot of it depends on use etc.  Recently I saw a scenario where particular (legitimate) use of MM02 required S_TCODE for SM30, which on this particular instance wasn't one of the default entries in SE97/TCDCOUPLES
    The parallel with SU24 is that you can switch off some checks on S_TCODE for linked transactions in the same way you can switch off some auth object checks for a transaction in SU24

  • What is Silverlight? In Plain English, Please.

    Referring to: http://go.microsoft.com/?linkid=7472851 
    Do you know what I wish?  I wish, just for once that a simple and concise description of what a product is and what it really can do could be posted right up front, on the landing page, or at most one link deep.  Not the marketing hype, not the techno-speak,
    not the jargon.  Just a plain simple description of what the thing does, what it is.  That would be really nice. Because, all I see on the pages I have visited from the link above is just that, techno-speak, jargon and hype.
    Look.  I get lots of e-mails, every day.  So, I get one from Microsoft indicating this new product, Silverlight, is available.  It sounds interesting, The graphics sure are nifty.  So, I click on the link to see if it is something I am interested in. 
    I mean, "Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications (RIAs) for the Web." is a nifty one-liner.  But, it really does not say much.  It means nothing to most
    people.  (Not everyone who receives MS e-mails is a top-level multi-certified techno-geek!)
    There ought to be a link titled something like "What is Silverlight."  This link would lead to plain-English description of the product.  Again, cut the techno-speak.  Provide a concise description of the product, what it can do, how it does it and stuff like
    that.  Let me decide if it really is as fantastic as the marketing department wants me to think it is.  Look, I'll give you 5 or maybe 10 minutes of my time to read through your descriptions, and then I will decide if it is so great that I want to invest considerable
    time and energy learning how to work it.  And, if there is a cost involved, whether it is something I want to shell out the going rate for.
    How about it?  Think about it.  Can someone have the balls to just cut the techno-speak, jargon and marketing hype and give it to us in plain English?  Please.

     Thanks for your response.  Okay, so it's a platform, not a "product."  Semantics.  Do you understand my point?  Too often it seems that product/platform descriptions are written with so much jargon and techno-speak that unless one is fluent in the jargon
    it is difficult if not impossible to quickly understand what a new product is.  (Product being a generic term here to point at the new thing.)  You see, in your reply you have begun to describe it in terms more easily understood.  That is precisely
    my point.  Too often when companies, MS and others, attempt to describe their products they use a barrage of jargon and techno-speak that makes if very difficult to understand in simple terms what the product actually does.  I know, everyone wants to keep
    up with the competition and impress with their command of fancy terms.  But, good effective communication is not about jargon.  It is about describing in clear terms so that people in a busy world full of time constraints and demands for our attention can
    gather information, distill it and make decisions as to what new products to understand, learn and implement.  That is my point.  My point is not a question.  My point is a heads-up to remind folks that it is important to communicate clearly and with precision. 
    Marketing is great, but useless if folks can't get the information they need to understand and make decisions.  We live in a world saturated with information.  Clouding information with jargon and techno-speak may appear impressive but it hinders the effective
    delivery of information.  Also, please don't assume I'm asking for "baby terms."  I'm not.  I can understand what something like Silverlight does.  But too much jargon gets confusing and results in my either spending extra time trying to understand the jargon
    or simply deciding it's not for me and moving on to something else.  Of course, all of us working in the various IT endeavors must use a certain amount of technical terms that are short and understood by those in our various industries.  (I'm no newbie, either. 
    I've been working with and understanding these silicon wonders since the early 1980s.  I also have two college degrees, one in computer science.  So, I'm no idiot.  I'm just not current on every single frigin' term that companies and techno-geeks come up with
    in the ever changing landscape of new terms, processes, products, platforms and other techno-stuff.)  But, even then, we need to be careful that we communicate clearly and effectively.  That is a skill, and art, that, like any skill, requires working at it,
    polishing the skill and efforting it.  So, there's a balance between using jargony terms and overkill.  The art is finding the balance.  Again, it's not a question as much as it is a point to be made.
    MHW22 

  • Iris Pro vs. GT 750M in the 21.5" iMac - in Plain English please

    Hey!
    I'm about to go Mac at the office.
    I was gearing up to make the purchase then I see there is yet another choice to make...
    Iris Pro vs. GT 750M
    I've read a bit on forums but it all seems way beyond my techie abilities.
    So in plain english will I notice a difference if I get the cheaper model?
    We mainly work with of Microsoft Office, internet apps and occasional Adobe stuff.
    I've found my Macbook Pro 2012 perfect fast for most of my tasks.
    Thanks!

    Iris pro is basic "good enough to get the job done" hardware to run the display. Its part of the CPU and does very poorly with 3D rendering.
    750M is an actual separate graphics processor with its own dedicated memory and the power to animate 3D graphics at full speed.
    If your Macbook Pro feels "fast enough" for you, the Iris will be "good enough" as well.

  • Could Someone Explain Interfaces in English Please?

    Hi Everyone-
    I'm new to Java. I've been reading "Learning Java" from O'Reilly. From what I understand, Interfaces are sort of a structural framework that lists certain methods. Any class that implements an interface must contain this "structure" and any objects intantiated using this class will be of the interface type? Is this correct? If not can someone explain interfaces in laymen's terms and the what is the usefulness of implementing Interfaces?
    Thanks.
    SA

    I'm new to Java. I've been reading "Learning Java"
    from O'Reilly. From what I understand, Interfaces are
    sort of a structural framework that lists certain
    methods. Any class that implements an interface must
    contain this "structure" ...OK so far...
    and any objects intantiated
    using this class will be of the interface type? Is
    this correct? It depends what you mean by "interface type". An interface can be said to define a type. So a class that implements that interface implements that type, and an object instantiated from that class is an instance of that type.
    If not can someone explain interfaces in
    laymen's terms and the what is the usefulness of
    implementing Interfaces?The utility of interfaces is that, without being tied down to particular implementations, allows types of objects to be defined.
    For example....is there a doctor in the house? Say:
    1) a Doctor is:
    - human
    - has gone to medical school
    - heals the sick
    2) a Norwegian is:
    - a person from Norway (assume we've defined "person" at this point)
    3) a Canadian is:
    - a person from Canada
    So:
    4) a Norwegian Doctor is a person from Norway who fulfills the qualifications to be a doctor
    5) a Canadian Doctor is a person from Canada who fulfills the qualifications to be a doctor
    6) a Canadian who is not a Canadian Doctor, is a person from Canada who does not fulfill the qualifications to be a doctor.
    If your appendix is about to burst, you need a doctor. You don't care if the doctor is Canadian or Norwegian (assume everybody including yourself speaks Esperonto so there aren't any language issues). You do care deeply if the person trying to remove your appendix is a Canadian but not a Canadian doctor.
    If you were establishing a hospital, you'd want doctors. If you were to write this in code, you'd have something like:
    Hospital.hireDoctor(Doctor doc);meaning, that method in the Hospital class will hire a doctor, which is the important part. So this would work:
    Doctor doc = NorwegianMedicalSchool.createDoctor();
    Doctor doc_eh = CanadianMedicalSchool.createDoctor();
    yourHospital.hireDoctor(doc);
    yourHospital.hireDoctor(doc_eh);The point is, you can write your Hospital code without knowing precisely how "Doctor" is implemented -- whether the doctors come from Canada or Norway. You just write it as appropriate given that you have a Doctor. And then when a Doctor is created by a Japanese medical school, it doesn't break your code. This is why interfaces are said to define "contracts" -- an interface defines what something is (i.e., what it does), and you can make your code insist on getting something that does that (fulfills the contract).
    Does this make any sense? Have I offended the Canadians? Probably.

  • In plain english please...

    Can anybody explain to me the logic behind this sort algorithm using a comparator?
    I don't understand the usage of "o1" and "o2", and I also don't understand why 1, -1, and 0 are returned and what is done with those values if they are returned.
    Thanks.
    java.util.Arrays.sort(names, new java.util.Comparator<String[]>() {
    public int compare(String[] o1, String[] o2) {
    if(Integer.parseInt(o1[1]) > Integer.parseInt(o2[1])) {
    return 1;
    } else if(Integer.parseInt(o1[1]) < Integer.parseInt(o2[1])) {
    return -1;
    } else {
    return 0;
    }

    One question though, if I wanted to compare and sort
    more than 2 items in a column in my 2d array, would I
    have to compare o0 to o1, o1 to o2, o2 to o3, and so
    on?If you're writing compare/compareTo, no. If you're writing sort method, yes.
    Your compareTo method (Comparable) or compare method (Comparator) is only responsible for comparing two things. The sort routine--Collections.sort or Arrays.sort--is responsible for ivoking your compare method on the various pairs of items in order to get the list or array sorted.
    The meat of the work of sorting is done by the sort method. It has the logic, "if A < B then swap A and B," etc. all you're doing in compare/compareTo is answering the sort method's question "Is A < B?"
    These may be the same online tutorials that you found cryptic, but look at these and see if they help.
    Making Java Objects Comparable
    http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html
    http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-sort.html

  • User Profile service in plain english

    Hello Experts,
    could any one please explain in plain English how does User profile services recognize users on SharePoint even if am not configuring the user profile sync service? I mean how SharePoint displaying user display name ? can I get the manager of a logged in
    user without using user profile sync service?
    please do not answer with link. just I need someone to explain it in his words in plain English
    Thanks

    When you log into SharePoint you give it a username and password, this might be automatic so you never notice it but it still happens in the background. The UPS then takes that username and creates a UPS entry for that account using information stored in
    Active Directory.
    If you're not familiar with AD it's normally a generally accessible 'phone book' like collection of user data like username, first name, surname, email address, manager, department and what security groups they belong to.
    If you configure the sync service this information is pulled through earlier in bulk rather than on-demand as users log in. You also get a lot more control over what data is used where and how.
    It's slightly different if you're using Forms Based Authentication but that's another story.

  • I would like to know how to extract my old contacts from the iTunes backup? Please explain in basic english i am a beginner

    I have had my old Iphone 5s replaced with a new one but I would like to know how to extract my old contacts from the iTunes backup? Please explain in basic english i am a beginner

    Hey,
    I think you will find that you have to have a debit/credit card stored on yur account regardless of whether your have iTunes Credit or want to purchase a free App. I don't know why, I assume its for ID verification or is part of the terms and conditions. I occasionally have to re-verify my credit card info even when just trying to run Update on one of my Apps or like I said downloading a free App.
    If you need further clarification all you can do is contact iTunes Support:
                   https://expresslane.apple.com/ServiceOptionAction.action
    Hope this helps. Andrew

  • Connector Specific Error. Can anyone PLEASE tell me in plain english not techi talk how to fix this error?

    Connector Specific Error.  
    Can anyone PLEASE tell me in plain english not techi talk how to fix this error?

    Hey royhanif,
    Welcome to the BlackBerry Support Community Forums.
    Thanks for the question.
    Follow the steps in this KB article to resolve the connector specific error: www.blackberry.com/btsc/KB15294
    Let me know if you have any more questions.
    Cheers.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • Share tab is greyed out when trying to export in FCPX - cannot export - I would like a real answer in plain english! Thank you!

    The share tab is greyed out when trying to export from Final Cut Pro X
    Please help with a REAL answer in plain English.
    Thank you!

    Thank you Tom!
    I checked every clip -
    Trashed preferences too.
    Finally, I took your advice and backed-up  my events and projects.
    Trashed Final Cut Pro X
    Downloaded a new copy from FCPX from the app store (from my previous purchases)
    Restarted FCPX
    Opened my event
    Moved to the timeline - and now!
    The SHARE tab works!
    Every aspect of FCPX is working faster as well.
    Go figure?
    Thanks again!
    Allan - olvblock

  • In plain English - How can I get music from one computer to another?

    Honestly guys, I havent a clue! I have purchased music from my work PC, but cant access it from my Home PC. I have read the manuals, but it dosent make sense to me! So, in ordinary, basic, plain English, how do I access it from home?!

    If you are using iTunes 7 I think this section from the Apple article is pretty straightforward.
    To transfer iTunes Store purchases using iPod:
    Connect your iPod to the computer on which you bought the items you want to transfer.
    Copy the iTunes Store purchases to your iPod.
    Disconnect your iPod (click the Eject button next to its icon) and then connect it to the computer you want to transfer the purchases to.
    Choose File > Transfer Purchases From iPod.
    You could also burn the song files to a data CD or DVD. Once you've burned the disc, take it to your other computer and import the songs into iTunes. Don't forget that regardless of which method you use, both computers have to be authorised to play the songs: About iTunes Music Store Authorisation and Deauthorisation

  • Sorry, Flagfox has encountered a problem. Please copy the report below and post it on our forums with a detailed explanation of what you were doing at the time so we can attempt to fix your issue. (English please) Flagfox version null (missing IPDB!)

    Sorry, Flagfox has encountered a problem. Please copy the report below and post it on our forums with a detailed explanation of what you were doing at the time so we can attempt to fix your issue. (English please)
    Flagfox version null (missing IPDB!)
    ERROR MESSAGE: Fatal Flagfox startup error!
    EXCEPTION THROWN: TypeError: ExtensionManager.getItemForID(id) is null
    STACK TRACE: startup()@file:///C:/Documents%20and%20Settings/Vanessa%20Ecret/Programdata/Mozilla/Firefox/Profiles/9eyewkfc.default/extensions/%7B1018e4d6-728f-4b20-ad56-37578a4de76b%7D/chrome/flagfox/modules/flagfox.jsm:40
    ([object ChromeWindow])@file:///C:/Documents%20and%20Settings/Vanessa%20Ecret/Programdata/Mozilla/Firefox/Profiles/9eyewkfc.default/extensions/%7B1018e4d6-728f-4b20-ad56-37578a4de76b%7D/chrome/flagfox/modules/flagfox.jsm:160
    Flagfox_loadForThisWindow([object Event])@chrome://flagfox/content/overlay.xul:16
    BROWSER: Mozilla Firefox 3.6.6/20100625231939 (Gecko 1.9.2.6/20100625231939) using locale en-US on WINNT x86-msvc
    This error and a Flagfox preferences dump has been sent to Tools -> Error Console. Please report this and any related errors so we can investigate your problem. Conversely, if you don't report this then it probably won't get fixed.
    == i was update

    Sorry, the Flagfox extension has encountered a problem. The following error output and a Flagfox preferences dump has been sent to Tools -> Error Console.
    FLAGFOX VERSION: 4.1.x (missing IPDB!)
    ERROR MESSAGE: Fatal Flagfox startup error!
    EXCEPTION THROWN: TypeError: addon is null
    STACK TRACE:
    (null)@resource://flagfox/flagfox.jsm:70
    safeCall((function (addon) {try {FlagfoxVersion = addon.version;var ip4db = addon.getResourceURI(IPv4DBfilename).QueryInterface(Components.interfaces.nsIFileURL).file;var ip6db = addon.getResourceURI(IPv6DBfilename).QueryInterface(Components.interfaces.nsIFileURL).file;ipdb.init(ip4db, ip6db);checkIPDBage();ready = true;} catch (e) {handleStartupError(e);}}),null)@resource://gre/modules/AddonManager.jsm:48
    ([object Object])@resource://gre/modules/AddonManager.jsm:897
    AOC_callNext()@resource://gre/modules/AddonManager.jsm:118
    (null)@resource://gre/modules/AddonManager.jsm:892
    PL_getAddon("{1018e4d6-728f-4b20-ad56-37578a4de76b}",(function (aAddon) {if (aAddon) {safeCall(aCallback, aAddon);} else {aCaller.callNext();}}))@resource:///modules/PluginProvider.jsm:79
    callProvider([object Object],"getAddonByID",null,"{1018e4d6-728f-4b20-ad56-37578a4de76b}",(function (aAddon) {if (aAddon) {safeCall(aCallback, aAddon);} else {aCaller.callNext();}}))@resource://gre/modules/AddonManager.jsm:76
    ([object Object],[object Object])@resource://gre/modules/AddonManager.jsm:888
    AOC_callNext()@resource://gre/modules/AddonManager.jsm:124
    (null)@resource://gre/modules/AddonManager.jsm:892
    (null)@resource:///modules/XPIProvider.jsm:3047
    ([object Array])@resource:///modules/XPIProvider.jsm:4864
    (0)@resource:///modules/XPIProvider.jsm:3867
    BROWSER: Mozilla Firefox 7.0.1 (Gecko 7.0.1 / 20110928134238)
    OS: Windows NT 6.1 (WINNT x86-msvc windows)
    LOCALE: en-us content / en-us UI / en-us OS
    Select and copy the error report above. In order to fix this problem for you and others, please read and follow the troubleshooting and bug reporting instructions on the Flagfox support forums. Please post an abundance of information with any error reports, namely what you were doing at the time that may have triggered this. (English please)

  • Can anyone explain this to me, please. It's a static section question.

    Can anyone explain this to me, please. It's a static section question.
    I came across the following style of programming recently and I would like to know what the Static section is actually doing in the class. Thx.
    Here is the code.
    public class ClassA {
         private static Hashtable ClassAList = new Hashtable();
         private ClassB cB;
         private Vector goodLink;
         private Hashtable classCList;
         static
              ClassA cA = new ClassA();
              ClassAList.put("whatever", cA);
         public static ClassA getClassA()
              return (ClassA) ClassAList.get("whatever");

    hi,
    The static section shall be loaded before it's constructor is called. (i.e at the time of loading the class). Therefore making it available for any other objects to call.
    hope this clarifies ur question
    prasanna

  • In plain English can someone tell me how to use the unsubscribe button or get it to show up in the "unsubscribe from mailing list" ad-on?

    There's nothing to detail it doesn't work.

    In plain English.
    If the unsubscribe header the add-on uses is present it shows up in the mail header along with the from Subject to etc. With or Without the add-on. So if there is no entry in the header, then the mail sender does not support that style of unsubscribing. In the United States unsubscribing from a mailing list is troublesome as legislators are either are unable or unwilling to understand the problem. Given the amounts of money involved I will go with the latter.
    Any difficulties you have with the actual add-on need to be dealt with by the add-on author The download page list a support link. https://addons.mozilla.org/en-US/thunderbird/addon/unsubscribe-from-mailing-list/?src=search

Maybe you are looking for

  • Find available space in buffer cache

    Hi. I want to find available space from buffer cache. First thought was to make it 8i-9i comp, by not using v$bh to calculate sum of memory and available space. I have the following pl/sql block to calculate the values: declare num_free_blck integer;

  • Re-install after system restore

    I had to do a system restore on my computer and now I can't access my Adobe apps nor can I re-install them. I can only updte which obviously always fails. What do I need to do to re-install my programs?

  • What is wrong with these apps?

    I have a 55" 2014 Bravia and since day one there were some apps on it that I hadn't tried. The other day I tried the Accuweather and NPR apps and NEITHER ONE WORKED!! I believe some of the others don't work either. I mostly use Netflix, Amazon so I h

  • HP 311 won't boot after ram upgrade

    I bought 2GB apacer RAM for my HP 311, but when I insert it and turn on computer, nothing happens. Only power, caps lock and network lights turn on, and hard drive light keeps blinking, but it doesn't look, that HDD is being read. When I take out RAM

  • Select list that is dependent on another select list with ajax

    I have a select list that contains it (ajax) onchange = "get_select_list_ajax (this, 'P2012_REQUERENTE', 'COMBO_REQUERENTE_ITEM', 'COMBO_REQUERENTE_AJAX');" class = "largura200" So I have a select list below, which is conditional, according to the va