List of usage examples for junit.framework Assert assertNotNull
static public void assertNotNull(Object object)
From source file:com.taobao.ad.jpa.test.UUserTest.java
@Test public void testGetUUserById() { UUserDO uUser = userBO.getUUserById(1L); Assert.assertNotNull(uUser); Assert.assertEquals("1", uUser.getDescn()); Assert.assertEquals(1, uUser.getId().longValue()); Assert.assertEquals("baimei1@taobao.com", uUser.getEmail()); Assert.assertEquals("136666992031", uUser.getMobile()); Assert.assertEquals("eabd8ce9404507aa8c22714d3f5eada9", uUser.getPassword()); }
From source file:com.karriem.tp.tddassignment.TDDTestNGTest.java
@Test public void notNullValue() { Assert.assertNotNull(service.object()); }
From source file:org.cloudfoundry.maven.common.UiUtilsTest.java
@Test public void testRenderTextTable() { final List<String> services = new ArrayList<String>(); services.add("mysql"); services.add("MyMongoInstance"); final List<String> uris = new ArrayList<String>(); uris.add("cf-rocks.api.run.pivotal.io"); uris.add("spring-rocks.api.run.pivotal.io"); String expectedTableAsString = null; try {// www . j a v a 2s . c o m expectedTableAsString = FileCopyUtils.copyToString(new InputStreamReader( UiUtilsTest.class.getResourceAsStream("testRenderTextTable-expected-output.txt"))); } catch (IOException e) { e.printStackTrace(); Assert.fail(); } Assert.assertNotNull(expectedTableAsString); final CloudApplication app1 = new CloudApplication("first", "command", "buildpack", 512, 1, uris, services, AppState.STARTED); final CloudApplication app2 = new CloudApplication("second", "command", "buildpack", 1024, 2, uris, services, AppState.STOPPED); final List<CloudApplication> applications = Arrays.asList(app1, app2); final String renderedTableAsString = UiUtils.renderCloudApplicationsDataAsTable(applications); LOGGER.info("\n" + renderedTableAsString); Assert.assertEquals(expectedTableAsString, renderedTableAsString); }
From source file:org.jasig.ssp.util.importer.job.twodottwo.ReportAccuracyTest.java
@SuppressWarnings("unchecked") @Test// w w w.j a va 2 s . c o m public void testJob() throws Exception { JobExecution jobExecution = jobLauncherTestUtils.launchJob(); Map<String, ReportEntry> report = (Map<String, ReportEntry>) jobExecution.getExecutionContext() .get("report"); Assert.assertNotNull(report); Set<Entry<String, ReportEntry>> entrySet = report.entrySet(); Assert.assertEquals(3, entrySet.size()); for (Entry<String, ReportEntry> entry : entrySet) { Assert.assertEquals(new Integer(2), entry.getValue().getNumberInsertedUpdated()); } }
From source file:org.codehaus.grepo.query.hibernate.generator.GeneratorRepositoryTest.java
@Test public void testWithNatvieGeneratorUsingDynParams() { Assert.assertNotNull(repo.getWithNativeGeneratorUsingDynParams()); }
From source file:at.uni_salzburg.cs.ckgroup.cscpp.mapper.registry.RegistryPersistenceTestCase.java
@Test public void test() throws IOException, ParseException { URL storage = RegistryPersistenceTestCase.class.getResource("storage01.dat"); File storagePath = new File(storage.getPath()); Map<String, IRegistrationData> registrationData = new HashMap<String, IRegistrationData>(); RegistryPersistence.loadRegistry(storagePath, registrationData); IRegistrationData d1 = registrationData.get("http://localhost:8080/engine"); Assert.assertNotNull(d1); String engineUri = d1.getEngineUrl(); Assert.assertEquals("http://localhost:8080/engine", engineUri); String pilotUri = d1.getPilotUrl(); Assert.assertEquals("http://localhost:8080/pilot", pilotUri); Set<String> sensors = d1.getSensors(); Assert.assertEquals(7, sensors.size()); Assert.assertTrue(sensors.contains("sonar")); Assert.assertTrue(sensors.contains("position")); Assert.assertTrue(sensors.contains("random")); Assert.assertTrue(sensors.contains("photo")); Assert.assertTrue(sensors.contains("video")); Assert.assertTrue(sensors.contains("airPressure")); Assert.assertTrue(sensors.contains("temperature")); List<IWayPoint> wayPoints = d1.getWaypoints(); Assert.assertEquals(17, wayPoints.size()); Assert.assertTrue(wayPoints.get(0) instanceof WayPoint); WayPoint wayPoint = (WayPoint) wayPoints.get(0); System.out.println("test() " + wayPoint.toJSONString()); Assert.assertEquals(// ww w . ja v a2 s . c o m "{\"precision\":1.0,\"altitude\":1.0,\"velocity\":1.0,\"longitude\":13.04092571,\"latitude\":47.82204197}", wayPoint.toJSONString()); Assert.assertEquals("(47.82204197, 13.04092571, 1.000) precision 1 velocity 1.0", wayPoints.get(0).toString()); File tmpFile = File.createTempFile("mapper", ".dat"); RegistryPersistence.storeRegistry(tmpFile, registrationData); String expected = FileUtils.loadFileAsString(storagePath); Assert.assertEquals(1860, expected.length()); String actual = FileUtils.loadFileAsString(tmpFile); Assert.assertEquals(1860, actual.length()); Assert.assertEquals(expected, actual); tmpFile.delete(); }
From source file:org.jasig.ssp.util.importer.job.twodottwo.RawItemHeaderFailTest.java
@SuppressWarnings("unchecked") @Test//from w w w . j av a2s . com public void testJob() throws Exception { JobExecution jobExecution = jobLauncherTestUtils.launchJob(); Map<String, ReportEntry> report = (Map<String, ReportEntry>) jobExecution.getExecutionContext() .get("report"); Assert.assertNotNull(report); Set<Entry<String, ReportEntry>> entrySet = report.entrySet(); Assert.assertEquals(1, entrySet.size()); for (Entry<String, ReportEntry> entry : entrySet) { Assert.assertEquals(new Integer(0), entry.getValue().getNumberInsertedUpdated()); //TODO this should eventually be 1 see SSP-1919 Assert.assertEquals(new Integer(3), entry.getValue().getNumberParsed()); Assert.assertEquals(new Integer(3), entry.getValue().getNumberSkippedOnParse()); } List<ErrorEntry> errors = (List<ErrorEntry>) jobExecution.getExecutionContext().get("errors"); Assert.assertEquals(3, errors.size()); for (ErrorEntry error : errors) { Assert.assertEquals(new Integer(-1), new Integer(Integer.parseInt(error.getLineNumber()))); } }
From source file:org.openxdata.server.service.impl.SettingServiceTest.java
@Test public void getSetting_shouldNotReturnNullIfSettingFoundWithGivenName() throws Exception { Assert.assertNotNull(settingService.getSetting("epihandyser")); }
From source file:org.codehaus.grepo.query.hibernate.repository.HibernateRepositoryTest.java
@Test public void testWithSpecifiedQuery() { Assert.assertNotNull(repo.getByUsernameWithSpecifiedQuery("username")); }
From source file:org.jasig.ssp.util.importer.job.twodottwo.ErrorReportingTest.java
@SuppressWarnings("unchecked") @Test/*from ww w . j a v a2s . c o m*/ public void testJob() throws Exception { JobExecution jobExecution = jobLauncherTestUtils.launchJob(); Map<String, ReportEntry> report = (Map<String, ReportEntry>) jobExecution.getExecutionContext() .get("report"); Assert.assertNotNull(report); Set<Entry<String, ReportEntry>> entrySet = report.entrySet(); Assert.assertEquals(1, entrySet.size()); for (Entry<String, ReportEntry> entry : entrySet) { Assert.assertEquals(new Integer(0), entry.getValue().getNumberParsed()); Assert.assertEquals(new Integer(0), entry.getValue().getNumberSkippedOnParse()); Assert.assertEquals(new Integer(2), entry.getValue().getNumberSkippedOnDatabaseWrite()); Assert.assertEquals(new Integer(0), entry.getValue().getNumberInsertedUpdated()); } List<ErrorEntry> errors = (List<ErrorEntry>) jobExecution.getExecutionContext().get("errors"); Assert.assertEquals(2, errors.size()); }