Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4541192
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:11:44+00:00 2026-05-21T15:11:44+00:00

I’m not quite sure if I’m missing something really obvious here but my searches

  • 0

I’m not quite sure if I’m missing something really obvious here but my searches on this topic aren’t returning results of use to me. I have recently gotten more into unit testing and using mock objects. This is all well and good for testing objects in isolation but, in a complex Spring MVC application that is interacting through AJAX with a lot of Javascript code I sometimes run into issues such as a value being passed in that is not what it needs to be and causes something to break. Of course it still fulfills the type, such as being a String, but it may be null, which would cause something to break down the line.

I figured if I could do something like below within an actual class of my application (not in an isolated unit test) then it could be useful. Sort of like a debug mode but instead its running the app as a unit test I would run it regularly and be able to interact with it (manual testing) and, if a bug occurs that violates one of the tests I placed in there it would tell me. I realize I can do this with System.out.println but I tend to use this too much, maybe sometimes, so it can be hard to sift through all the outputs to pick out things like this, so would be better, I think, if it had the regular Junit GUI dialog brought up when something occurred.

String somestring
if (somestring != null) {
boolean checkSomestring = true;
}
else {
boolean checkSomestring = false
}
assertEquals(checkSomestring, true);

I may have rambled a bit, I’m guessing there is a way to do this but it is eluding me at the moment, would appreciate any advice. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:11:45+00:00Added an answer on May 21, 2026 at 3:11 pm

    We’ve just got a little ASSERT(bool shouldBeTrue, string failureMessage) function in our javascript. When it fails it sends a logger request… just a GET request with url-encoded arguments: dateTime, machineName, currentCocument, and the failureMessage. The web-server just writes it to a log-file. Then a “tailing job” (a korn-shell script based on “tail -f”) periodically (every minute, from memory) picks-up the message-lines and emails them to the developers-email-group for the system. The same kit is used on several systems.

    Don’t ask me about the details; I’m “the unix guru”… and a self-confessed bunny when it comes to javascript. The guy who wrote it is still around though; so I could (next week) ask him if he minds it being published on the net.

    I think the whole setup is pretty neat. Most of the time we just ignore the assert-mails (I have an outlook rule which sends them all straight to the deleted bucket); except when we’re testing something… This way we get to use each others unit testing of the GUI to detect “breakages” in stuff we wrote. I also keep an eye on them for a couple days after each release.

    BTW: Once upon a time we tried automated web-app testing. We spent a small fortune on it, until we figured out that were using our good software to test our crappy test-scripts… and we basically gave-up in disgust. But that was years ago, and I believe that things have improved dramatically in this area, so it might be worth having another look; atleast for the “critical” functionality of the system.

    Cheers. Keith.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.