Example usage for junit.framework Assert assertEquals

List of usage examples for junit.framework Assert assertEquals

Introduction

In this page you can find the example usage for junit.framework Assert assertEquals.

Prototype

static public void assertEquals(int expected, int actual) 

Source Link

Document

Asserts that two ints are equal.

Usage

From source file:org.codehaus.grepo.query.jpa.repository.JpaRepositoryStatisticsTest.java

/** Test with named query. */
@Test/*from  ww  w  .  j ava2s .c  o  m*/
public void testStatisticsWithNamedQuery() {
    Assert.assertNotNull(repo.getByUsername("username"));
    Assert.assertEquals(1, collection.size());
    repo.find(-1L);
    Assert.assertEquals(2, collection.size());
}

From source file:com.manning.androidhacks.hack022.login.LoginTest.java

@Test
public void LoginShouldReturnTrueWhenCredentialsAreOk() {
    Login login = new Login();
    Assert.assertEquals(true, login.login("admin", "admin"));
}

From source file:net.dontdrinkandroot.utils.lang.StringUtilsTest.java

@Test
public void testArrayJoin() {

    String[] parts = new String[3];
    parts[0] = "a";
    parts[1] = "bee";
    parts[2] = "cee";

    Transformer<String, String> transformer = NOPTransformer.getInstance();
    CharSequence result = StringUtils.join(parts, ",", transformer);

    Assert.assertEquals("a,bee,cee", result.toString());
}

From source file:org.codehaus.grepo.query.hibernate.repository.HibernateRepositoryStatisticsTest.java

@Test
public void testStatisticsWithNamedQuery() {
    Assert.assertNotNull(repo.getByUsername("username"));
    Assert.assertEquals(1, collection.size());
    repo.get(-1L);//ww  w.  j a  va  2s  .co  m
    Assert.assertEquals(2, collection.size());
}

From source file:com.collective.celos.OozieExternalServiceTest.java

@Test
public void runPropertiesAreCorrectlySetup() {
    ScheduledTime t = new ScheduledTime("2013-11-26T17:23Z");
    SlotID id = new SlotID(new WorkflowID("test"), t);
    ObjectNode defaults = Util.newObjectNode();
    defaults.put("foo", "bar");
    defaults.put("uses-variables", "${year}-${month}-${day}-${hour}-${year}");
    defaults.put("another-one", "${year}-${month}-${day}T${hour}:${minute}:${second}.${millisecond}Z");
    Properties runProperties = makeOozieExternalService().setupRunProperties(defaults, id);
    Assert.assertEquals("bar", runProperties.getProperty("foo"));
    Assert.assertEquals("2013-11-26-17-2013", runProperties.getProperty("uses-variables"));
    Assert.assertEquals("2013-11-26T17:23:00.000Z", runProperties.getProperty("another-one"));
    Assert.assertEquals("2013", runProperties.getProperty(OozieExternalService.YEAR_PROP));
    Assert.assertEquals("11", runProperties.getProperty(OozieExternalService.MONTH_PROP));
    Assert.assertEquals("26", runProperties.getProperty(OozieExternalService.DAY_PROP));
    Assert.assertEquals("17", runProperties.getProperty(OozieExternalService.HOUR_PROP));
    Assert.assertEquals("23", runProperties.getProperty(OozieExternalService.MINUTE_PROP));
    Assert.assertEquals("00", runProperties.getProperty(OozieExternalService.SECOND_PROP));
    Assert.assertEquals("test@2013-11-26T17:23Z",
            runProperties.getProperty(OozieExternalService.WORKFLOW_NAME_PROP));
}

From source file:de.hybris.platform.importcockpit.services.login.impl.LoginServiceImplTest.java

@Test
public void testGetDefaultUsername() {
    final Configuration mockedConfiguration = Mockito.mock(Configuration.class);
    given(configurationService.getConfiguration()).willReturn(mockedConfiguration);
    given(mockedConfiguration.getString("importcockpit.default.login")).willReturn(DEFAULT_USER_NAME);
    Assert.assertEquals(DEFAULT_USER_NAME, loginServiceImpl.getDefaultUsername());
}

From source file:com.pamarin.income.repo.IncomeItemRepoT.java

@Test
public void findByOwner() {
    User owner = new User();
    owner.setId(1);//from  w  ww  .j  a  v a2 s .  com
    List<IncomeItem> items = repo.findByOwner(owner);
    Assert.assertEquals(5, items.size());
    Assert.assertEquals("", items.get(0).getIncomeName());
    Assert.assertEquals("www", items.get(4).getIncomeName());
}

From source file:com.verigreen.rest.TestSubmitBranchRequest.java

@Test
public void testCreateSubmitBranchRequest() {

    BranchDescriptor branchData = new BranchDescriptor();
    branchData.setCommitter("test@email.com");
    branchData.setProtectedBranch("protected-branch");
    branchData.setNewBranch("test-branch");
    CreateBranchRequest submitBranchRequest = GitHookApi.getCreateBranchRequest(branchData);
    Assert.assertNotNull(submitBranchRequest);
    Assert.assertEquals(submitBranchRequest.getEntity(), branchData);
    Assert.assertEquals(submitBranchRequest.getUri(), CollectorApi.getCollectorAddress() + "/branches");
}

From source file:de.r2soft.empires.framework.test.ObjectTreeTest.java

@Test
public void testInsertAndSearch() {
    Object obj = new Object();
    tree.insert(new Vector2D(10, 10), obj);
    Object objT = tree.search(new Vector2D(10, 10));
    Assert.assertEquals(obj, objT);
}

From source file:com.couchbase.capi.TestCAPI.java

public void testDatabaseHead() throws Exception {
    HttpClient client = getClient();/*w w  w . j  av  a 2 s. c  o  m*/

    HttpUriRequest request = new HttpHead(String.format("http://localhost:%d/default", port));
    HttpResponse response = client.execute(request);

    Assert.assertEquals(200, response.getStatusLine().getStatusCode());

}