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:com.doculibre.constellio.utils.izpack.UsersXmlFileUtils.java

public static void main(String[] argv) {
    createEmptyUsersFile();//from ww w.  ja  va 2  s  .  c om

    ConstellioUser dataUser = new ConstellioUser("admin", "lol", ConstellioSpringUtils.getDefaultLocale());
    dataUser.setFirstName("System");
    dataUser.setLastName("Administrator");
    dataUser.getRoles().add(Roles.ADMIN);

    addUserTo(dataUser);

    List<ConstellioUser> users = readUsers();

    Assert.assertEquals(1, users.size());

    ConstellioUser user = users.get(0);

    Assert.assertTrue(user.checkPassword("lol"));

    //        Assert.assertEquals(1, user.getRoles());

    Assert.assertTrue(user.isAdmin());
    System.out.println("Succes!" + DEFAULT_USERS_FILE);

}

From source file:com.github.consiliens.harv.run.test.TestGson.java

public static void a(Header expected, Header actual) {
    Assert.assertEquals(expected.getName(), actual.getName());
    Assert.assertEquals(expected.getValue(), actual.getValue());
}

From source file:com.github.consiliens.harv.run.test.TestGson.java

public static void a(long expected, long actual) {
    Assert.assertEquals(expected, actual);
}

From source file:io.selendroid.server.internal.SelendroidAssert.java

public static void assertResponseStatusCode(HttpResponse response, int statusCode) {
    Assert.assertEquals(statusCode, response.getStatusLine().getStatusCode());
}

From source file:com.pamarin.income.util.RpadT.java

@Test
public void test() {
    Assert.assertEquals("00", StringUtils.rightPad("0", 2, "0"));
    Assert.assertEquals("000", StringUtils.rightPad("0", 3, "0"));
    Assert.assertEquals("00000", StringUtils.rightPad("0", 5, "0"));
    Assert.assertEquals("000000000", StringUtils.rightPad("0", 9, "0"));

    Assert.assertEquals("0000000", StringUtils.rightPad("", 7, "0"));
    Assert.assertEquals("", StringUtils.rightPad("", 0, "0"));
}

From source file:com.github.consiliens.harv.run.test.TestGson.java

public static void a(String expected, String actual) {
    Assert.assertEquals(expected, actual);
}

From source file:de.mayflower.filmmarket.domain.ShortFormIntegrationTest.java

@Test
public void testShortForm() {
    ShortForm shortForm = new ShortForm();
    shortForm.setLicensee("Lizenznehmer");
    shortForm.setLicensor("Lizenzgeber");
    shortForm.setLicensefee(50L);//w w w  .  j a va 2s  .c o  m
    shortForm.persist();
    shortForm.flush();
    shortForm.clear();

    Assert.assertNotNull(shortForm.getId());
    Assert.assertEquals("Lizenznehmer", shortForm.getLicensee());
    Assert.assertTrue(50L == shortForm.getLicensefee());
}

From source file:com.framework.infrastructure.utils.StringUtilsTest.java

@Test
public void utilsByApache() {
    //join//from   w  ww  .  j a  v a2  s .  c o  m
    List<String> inputList = Lists.newArrayList("a", "b", "c");
    String result = StringUtils.join(inputList, ",");
    Assert.assertEquals("a,b,c", result);

    Assert.assertEquals("001", StringUtils.leftPad("1", 3, "0"));
}

From source file:cn.javass.spring.chapter4.ResourcePatternTest.java

@Test
public void testClasspathPrefix() throws IOException {
    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();

    //???ResourceResourceLoader.getResource
    Resource[] resources = resolver.getResources("classpath:META-INF/INDEX.LIST");
    Assert.assertEquals(1, resources.length);

    //??ResourceResourceLoader.getResource
    resources = resolver.getResources("classpath:META-INF/*.LIST");
    Assert.assertTrue(resources.length == 1);

    //???ResourceResourceLoader.getResource
    resources = resolver.getResources("classpath:META-INF/MANIFEST.MF");
    Assert.assertEquals(1, resources.length);
}

From source file:com.taobao.ad.jpa.test.DataTrackingJobTest.java

@Test
public void testGetDataTrackingData() {
    Assert.assertEquals(1.0, dataTrackingJobBO.getDataTrackingData("select 1 from dual"));
}