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

  • Home
  • SEARCH
  • 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 7826387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:23:26+00:00 2026-06-02T09:23:26+00:00

I start using Junit, and I have a very basic question. I want to

  • 0

I start using Junit, and I have a very basic question.

I want to check the method rateTrans. I don’t implement this yet, but I want to write the test before the implemention. I know which arguments this method would get.

So I wrote the next class:

import org.junit.Assert.*;
import junit.framework.*;

public class testing extends TestCase {

    public void testAdd(){
    assertTrue(rateTrans("1223",1,2,3,4,"blabla"));
    assertTrue(rateTrans("1223",1,2,3,4,"")) ;
    assertFalse(rateTrans("1223",7,2,3,4,"blabla"));
    }
}

It gives me the next problem: The method rateTrans(String, int, int, int, int, String) is undefined for the type testing.

What I do wrong?

  • 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-02T09:23:28+00:00Added an answer on June 2, 2026 at 9:23 am

    Just implement it with an empty body and/or null as return value (well, in this case false might be a good choice):

    protected boolean rateTrans(String, int, int, int, int, String) {
        // TODO: implement me!
        return false;
    }
    

    Congratulations, you’re doing TDD! Once you’ve implemented all the tests you may implement the method itself. Until then some tests might be green, due to the boolean return value, while others are red.

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

Sidebar

Related Questions

So I decided to start using prototype and here's my first question. I'm trying
I want to start using memcache with PHP (on Ubuntu 9.10). There are lots
I want to start using Bing for a project which will include working out
I'd like to start using HTML5's basic features, but at the same time, keep
I am using MiniDFSCluster to do junit tests. Now I just start and close
When using this approach below, by setting up the jUnit with Suites. We got
I have planed to start using a framework in php development. After going through
I'm using Spring junit runner, and its transaction capabilities to start and rollback transactions
I want to start using Python for small projects but the fact that a
I start using NaiveBayes/Simple classifier for classification (Weka), however I have some problems to

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.