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:ar.com.zauber.commons.date.SignificantDateProviderTest.java

/** hora del dia */
@Test//  w w w  . j a  v a 2 s. co m
public final void testHour() {
    final DateProvider provider = new SignificantDateProvider(target, Calendar.HOUR_OF_DAY);
    Assert.assertEquals(DateUtils.truncate(new Date(1269028059L * 1000), Calendar.HOUR_OF_DAY),
            provider.getDate());
}

From source file:com.swcguild.contactlistmvc.dao.ContactListDaoTest.java

@Test
public void addGetDeleteContact() {
    Contact nc = new Contact();
    nc.setFirstName("John");
    nc.setLastName("Doe");
    nc.setCompany("Oracle");
    nc.setEmail("john@doe.com");
    nc.setPhone("1234445678");

    dao.addContact(nc);//from w  w w .  j  ava 2  s  .c  o  m

    Contact fromDb = dao.getContactById(nc.getContactId());

    Assert.assertEquals(fromDb, nc);

    dao.removeContact(nc.getContactId());

    Assert.assertNull(dao.getContactById(nc.getContactId()));

}

From source file:aop.DeclareMixinAspectJAdvisorFactoryTest.java

@Test
public void testDeclareMixin() {
    NotTargetAware notTargetAware = new NotTargetAware();
    DeclareMixinAspectJAdvisorFactory factory = new DeclareMixinAspectJAdvisorFactory();

    TargetAware targetAware = (TargetAware) createProxy(notTargetAware, factory.getAdvisors(
            new SingletonMetadataAwareAspectInstanceFactory(new DeclareMixinMakeTargetAware(), "someBean")),
            NotTargetAware.class);

    Assert.assertEquals(targetAware, targetAware.getTarget());
}

From source file:com.inferiorhumanorgans.WayToGo.Agency.BART.BaseXMLTask.java

@Override
protected Void doInBackground(final BARTAgency... someAgencies) {
    Assert.assertEquals(1, someAgencies.length);
    theAgency = someAgencies[0];/*from  w  w w.j  a  va  2 s. co  m*/

    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
    HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);
    HttpProtocolParams.setUseExpectContinue(params, true);
    /*HttpConnectionParams.setConnectionTimeout(params, 1000);
    HttpConnectionParams.setSoTimeout(params, 1000);
    ConnManagerParams.setTimeout(params, 1000);*/

    registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
    registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));

    return null;
}

From source file:org.atemsource.atem.impl.pojo.ListAssociationAttributeTest.java

@Test
public void testMoveAssociatedEntityAndGetIndex() {
    ListAssociationAttribute attribute = (ListAssociationAttribute) getCollectionAssociationAttribute();

    EntityA a = new EntityA();
    a.setList(new ArrayList<EntityB>());
    attribute.addElement(a, new EntityB());
    final EntityB b = new EntityB();
    attribute.addElement(a, b);/*from  w w  w . j  a v a  2 s. c om*/
    Assert.assertEquals(1, attribute.getIndex(a, b));
    attribute.moveElement(a, 1, 0);
    Assert.assertEquals(0, attribute.getIndex(a, b));
}

From source file:com.github.capone.protocol.crypto.VerifyKeyTest.java

@Test
public void keyFromBytesSucceeds() throws VerifyKey.InvalidKeyException {
    VerifyKey otherKey = VerifyKey.fromBytes(key.toBytes());
    Assert.assertEquals(key.toBytes(), otherKey.toBytes());
}

From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportGeoDefinitionTest.java

@Override
protected void testFirstEntry(ReportGeo first) {
    Assert.assertEquals(6039084783L, first.getAdGroupId().longValue());
    Assert.assertEquals("General", first.getAdGroupName());
    Assert.assertEquals("enabled", first.getAdGroupStatus());
    Assert.assertEquals("Unspecified", first.getCityCriteriaId());
    Assert.assertEquals("United States", first.getCountryTerritory());
    Assert.assertEquals("true", first.getIsTargetable());
    Assert.assertEquals("", first.getMetroArea());
    Assert.assertEquals("United States", first.getMostSpecificLocation());
    Assert.assertEquals("Froody Rudy", first.getAccountDescriptiveName());
    Assert.assertEquals("2014-03-01", first.getMonth());
    Assert.assertEquals(0d, first.getCost().doubleValue());
    Assert.assertEquals(0, first.getClicks().longValue());
    Assert.assertEquals(2, first.getImpressions().longValue());
    Assert.assertEquals("0.00", first.getCtr());
    Assert.assertEquals(0d, first.getAvgCpm().doubleValue());
    Assert.assertEquals(0d, first.getAvgCpc().doubleValue());
    Assert.assertEquals("1.00", first.getAvgPosition());
    Assert.assertEquals("0.00", first.getConversionRateManyPerClick());
    Assert.assertEquals("0.00", first.getConversionRate());
    Assert.assertEquals(6671111111L, first.getAccountId().longValue());
}

From source file:org.apereo.lap.controllers.HomeControllerTest.java

@Test
public void testController() {
    assertNotNull(config);//from   ww w  . j  a  v  a  2  s  .  c  om
    assertNotNull(pms);
    HomeController controller = new HomeController();
    controller.configuration = config;
    controller.processingManagerService = pms;
    Model model = new ExtendedModelMap();
    Assert.assertEquals("home", controller.home(model));

    Object dev = model.asMap().get("dev");
    Assert.assertEquals("AZ", dev);
}

From source file:com.netflix.simianarmy.conformity.TestCrossZoneLoadBalancing.java

@Test
public void testDisabledCrossZoneLoadBalancing() {
    Cluster cluster = new Cluster("cluster1", "us-east-1", new AutoScalingGroup("asg1"));
    Conformity result = check(cluster);/* w  w  w  . jav  a  2 s .  co  m*/
    Assert.assertEquals(result.getRuleId(), getName());
    Assert.assertEquals(result.getFailedComponents().size(), 1);
    Assert.assertEquals(result.getFailedComponents().iterator().next(), "elb2");
}

From source file:fragment.web.StaticPagesControllerTest.java

@Test
public void testLandingRouting() throws Exception {
    logger.debug("Testing routing....");
    DispatcherTestServlet servlet = this.getServletInstance();
    Method expected = locateMethod(controller.getClass(), "handle", new Class[] { HttpServletRequest.class });

    String[] valid = new String[] { "/errors/notfound", "/errors/error", "/errors/something" };
    for (String uri : valid) {
        Method handler = servlet.recognize(getRequestTemplate(HttpMethod.GET, uri));
        Assert.assertEquals(expected, handler);
    }/*from w ww.  j a  v a 2  s .  c o m*/
}