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 9062429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:44:09+00:00 2026-06-16T15:44:09+00:00

Eclipse Juno Service Release 1 Example of a working Unit Test … InRangeTest =

  • 0

Eclipse Juno Service Release 1

Example of a working Unit Test …

InRangeTest = TestCase("InRangeTest");

InRangeTest.prototype.test01 = function()
{
    var ir = new InRange(0.0, "<", Number.MAX_VALUE, "≤");
    assertTrue(ir.isInRange(0.3));
};

But, to do more than one test I believe I should be using setUp. Unless I am mistaken, the advantage of setUp is that I would not have to instantiate var ir in every unit test. So, I tried the following …

InRangeTest = TestCase("InRangeTest");

InRangeTest.prototype.setUp = function()
{
    var ir = new InRange(0.0, "<", Number.MAX_VALUE, "≤");
};

InRangeTest.prototype.test01 = function()
{
    assertTrue(ir.isInRange(0.3));
};

Only, I get the error message

ReferenceError: ir is not defined

Replacing var ir with this.ir did not get it working.

What’s wrong?

Thanks for any help in advance.

  • 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-06-16T15:44:11+00:00Added an answer on June 16, 2026 at 3:44 pm

    If you use this.ir in both functions it should work:

    InRangeTest = TestCase("InRangeTest");
    
    InRangeTest.prototype.setUp = function()
    {
        this.ir = new InRange(0.0, "<", Number.MAX_VALUE, "≤");
    };
    
    InRangeTest.prototype.test01 = function()
    {
        assertTrue(this.ir.isInRange(0.3));
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Eclipse Juno Service Release 1, I created a Google App Engine project and
Environment Eclipse Juno Service Release 1 GWT 2.5 Google Chrome with the GWT developer
This is in relation to latest Juno or 4.2 release of Eclipse . I
I am using Eclipse Juno with Java 1.7 and i have created a test
I am trying to install Scala on Eclipse Juno Release 1, through Update Site
This is a bit weird. Using the newest Eclipse Juno release, I'm trying to
I am developing a simple test Bottom Up WebService using Eclipse Juno following Here
Using Eclipse (juno) and GAE plugin, I've compiled and ran the guestbook example (https://developers.google.com/appengine/docs/java/gettingstarted/creating)
I am using Eclipse Juno. I was working in Java perspective and suddenly I
I am using eclipse (Juno) to develop a web service for Tomcat 7 and

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.