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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:27:33+00:00 2026-06-18T19:27:33+00:00

Here is my code import org.junit.Test; import static org.junit.Assert.assertThat; import static sun.nio.cs.Surrogate.is; public class

  • 0

Here is my code

import org.junit.Test;

import static org.junit.Assert.assertThat;
import static sun.nio.cs.Surrogate.is;

public class PlayerTest {
  public void should_return_3_when_status_is_3(){
        Player player = new Player();
        assertThat(player.getStatus(),is(3));
    }
}

And here is the trace

Can't find symbol
符号: method assertThat(int,boolean)
位置: class PlayerTest

my iml file is

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="module-library" scope="TEST">
      <library>
        <CLASSES>
          <root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.10.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
  </component>
</module>

I think I used it before,but it not works now.
Have no clue about what to do.However assertTrue is working.
Ubuntu 11.04 is being used.

  • 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-18T19:27:35+00:00Added an answer on June 18, 2026 at 7:27 pm

    The mistake is in

    import static sun.nio.cs.Surrogate.is;
    

    is() should return a matcher, but whatever this is, it returns boolean. Try org.hamcrest.Matchers.is or org.hamcrest.CoreMatchers.is instead.

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

Sidebar

Related Questions

This is my Java 1.5 code (complete example): import org.junit.Test; import static org.junit.Assert.*; import
Here is my code: import javax.swing.*; import java.awt.*; public class PanelModel { public static
Here is my code - import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.core.classloader.annotations.*; import
I am having issues with the following code in Scala import org.junit.Test import org.junit.Assert._
Here is the code: import javax.swing.*; import java.awt.event.*; import java.awt.*; public class TestGrid {
Here I found this code: import java.awt.*; import javax.swing.*; public class FunWithPanels extends JFrame
Here is a simple piece of code: import java.io.*; public class Read { public
I'm running the following code: import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; public class WorkspaceTest { public
Following is the test code: package a.b.c.concurrent.locks; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyLong; import
Here is my code import org.ksoap2.*; import org.ksoap2.serialization.*; import org.ksoap2.transport.*; import android.app.Activity; import android.os.Bundle;

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.