Example usage for junit.framework Assert assertNotNull

List of usage examples for junit.framework Assert assertNotNull

Introduction

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

Prototype

static public void assertNotNull(Object object) 

Source Link

Document

Asserts that an object isn't null.

Usage

From source file:net.awired.generic.jpa.impl.GenericDaoImplTest.java

@Test
public void should_add_entity() {
    EntityTest entity = new EntityTest();
    entity.setName("genre");
    EntityTest persisted = save(entity);
    Assert.assertEquals("genre", persisted.getName());
    Assert.assertNotNull(persisted.getId());
}

From source file:org.codehaus.grepo.query.hibernate.generator.GeneratorRepositoryTest.java

@Test
public void testWithHQLGenerator() {
    Assert.assertNotNull(repo.getWithHQLGenerator("username"));
}

From source file:com.liferay.mobile.push.DeviceRegistrationTest.java

@Test
public void registerWithRegistrationId() throws Exception {
    final String registrationId = "123";

    push.onSuccess(new Push.OnSuccess() {

        @Override//  w ww.ja v a 2 s  . c o  m
        public void onSuccess(JSONObject device) {
            try {
                Assert.assertNotNull(device);
                Assert.assertEquals(Push.ANDROID, device.getString("platform"));
                Assert.assertEquals(registrationId, device.getString("token"));
            } catch (JSONException je) {
                Assert.fail();
            }
        }

    }).onFailure(new Push.OnFailure() {

        @Override
        public void onFailure(Exception e) {
            Assert.fail(e.getMessage());
        }

    }).register(registrationId);

    Robolectric.runBackgroundTasks();
}

From source file:philaman.cput.cardealer.test.repository.OfferedServiceRepositoryTest.java

@Test
public void createOfferedService() {
    repo = ctx.getBean(OfferedServiceRepository.class);
    OfferedService offeredService = new OfferedService.Builder("Clutch Change").rate(230).durationhr("30 min")
            .build();/*w ww . jav  a2  s  .  co m*/
    repo.save(offeredService);
    id = offeredService.getId();
    Assert.assertNotNull(offeredService);
}

From source file:eagle.security.userprofile.model.UserProfileEigenModelerTest.java

@org.junit.Test
public void testBuild() throws Exception {

    UserProfileEigenModeler modeler = new UserProfileEigenModeler();
    String user = "user1";
    final RealMatrix mockMatrix = new Array2DRowRealMatrix(buildMockData());
    List<UserProfileEigenModel> model = modeler.build("default", user, mockMatrix);
    Assert.assertEquals(model.length(), 1);

    UserProfileEigenModel eigenModel = model.head();
    Assert.assertNotNull(eigenModel.statistics());
    Assert.assertNotNull(eigenModel.principalComponents());
    Assert.assertNotNull(eigenModel.maxVector());
    Assert.assertNotNull(eigenModel.minVector());
    Assert.assertEquals(eigenModel.statistics().length, mockMatrix.getColumnDimension());
    Assert.assertTrue(eigenModel.principalComponents().length <= mockMatrix.getColumnDimension());
    Assert.assertTrue(eigenModel.maxVector().getDimension() <= mockMatrix.getColumnDimension());
    Assert.assertTrue(eigenModel.minVector().getDimension() <= mockMatrix.getColumnDimension());
    Assert.assertEquals(true, eigenModel.statistics()[3].isLowVariant());
}

From source file:fulcrum.xml.ParserTest.java

@Test
public void testInitializeVFS() {
    LOGGER.info("Starting Loading");
    InputStream simple = getInputStream(SIMPLE);
    Assert.assertNotNull(simple);
    InputStream complex = getInputStream(COMPLEX);
    Assert.assertNotNull(complex);//w w w. j  a  va 2 s  .co  m
}

From source file:org.openxdata.server.service.impl.PermissionServiceTest.java

@Test
public void getPermissions_shouldReturnAllPermissions() throws Exception {

    List<Permission> permissions = permissionService.getPermissions();

    Assert.assertNotNull(permissions);
    Assert.assertEquals(75, permissions.size());
}

From source file:com.ace.erp.dao.PermissionMapperTest.java

@Test
public void getOnePTest() {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("roleId", 5);
    params.put("resourceId", 33);
    RoleResourcePermission roleResourcePermission = rrpMapper.getOne(params);
    System.out.println(roleResourcePermission.toString());
    Assert.assertNotNull(roleResourcePermission);
}

From source file:com.googlecode.t7mp.steps.CopySetenvScripStepTest.java

@Before
public void setUp() {
    catalinaBaseDir = Files.createTempDir();
    Assert.assertTrue(catalinaBaseDir.exists());
    Assert.assertNotNull(catalinaBaseDir);
    Assert.assertTrue(catalinaBaseDir.exists());

    Mockito.when(configuration.getCatalinaBase()).thenReturn(catalinaBaseDir);
    //        Mockito.when(mojo.getLog()).thenReturn(log);
}

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

/** Test with named query. */
@Test//from  w  w  w. j a  v  a2  s  .c om
public void testStatisticsWithNamedQuery() {
    Assert.assertNotNull(repo.getByUsername("username"));
    Assert.assertEquals(1, collection.size());
    repo.find(-1L);
    Assert.assertEquals(2, collection.size());
}