List of usage examples for java.lang Long Long
@Deprecated(since = "9") public Long(String s) throws NumberFormatException
From source file:com.redhat.rhn.taskomatic.task.test.ErrataQueueTest.java
public void testErrataQueue() throws Exception { ErrataQueue eq = new ErrataQueue(); String suffix = RandomStringUtils.randomAlphanumeric(5); TaskoBunch bunch = new TaskoBunch(); TaskoTemplate template = new TaskoTemplate(); TaskoTask task = new TaskoTask(); bunch.setName("testBunchName_" + suffix); task.setName("testTaskName_" + suffix); task.setTaskClass(ErrataQueue.class.toString()); template.setTask(task);/*from w w w. jav a 2 s . c om*/ template.setOrdering(0L); template.setBunch(bunch); TaskoFactory.save(template.getBunch()); TaskoFactory.save(template.getTask()); TaskoFactory.save(template); TaskoRun run = new TaskoRun(null, template, new Long(1)); eq.execute(null, run); // Just a simple test to make sure we get here without // exceptions. Better than nothin' assertTrue(true); TaskoFactory.delete(run); TaskoFactory.delete(template); TaskoFactory.delete(template.getBunch()); TaskoFactory.delete(template.getTask()); commitAndCloseSession(); commitHappened(); }
From source file:org.atemsource.atem.impl.common.attribute.PrimitiveAttributeTest.java
private EntityA createEntityA() { EntityA entity = new EntityA(); entity.setBooleanO(Boolean.TRUE); entity.setBooleanP(false);/* w w w .j ava 2s. c om*/ entity.setIntO(null); entity.setIntP(12); entity.setLongO(4L); entity.setNumber(new Long(10)); return entity; }
From source file:controllers.user.UserResumeApp.java
/** * Tab??//w w w . j a v a 2s . c om * * @return */ @Transactional(readOnly = true) public static Result workinfo() { DynamicForm requestData = Form.form().bindFromRequest(); String userId = requestData.get("userId"); ExpertDetailInfo expert = Expert.viewByUserId(new Long(userId)); List<JobExp> jobExpList = expert.getJobExp(); if (jobExpList != null && jobExpList.size() > 0) { sortJobExpList(jobExpList); } return ok(views.html.usercenter.detailUS.workinfo.render(expert)); }
From source file:com.healthcit.cacure.model.ModuleTest.java
@Test @DataSet// ww w . j a v a 2 s . c o m public void testRead() { Module module = em.find(Module.class, 1001L); assertNotNull(module); assertEquals("Questionnaire Module", module.getDescription()); assertEquals(date("2011-05-31 11:00:43.812"), module.getUpdateDate()); assertEquals(ModuleStatus.IN_PROGRESS, module.getStatus()); assertEquals("Questionnaire Module Comments", module.getComments()); assertEquals(new Long(1), module.getAuthor().getId()); assertNotNull(module.getForms()); assertEquals(2, module.getForms().size()); assertEquals(new Long(1070), module.getForms().get(0).getId()); assertEquals(new Long(1002), module.getForms().get(1).getId()); assertEquals("1/01/2020", module.getCompletionTime()); // Date data type assertEquals(date("2011-08-30 00:00:00.000"), module.getReleaseDate()); }
From source file:id.go.kemdikbud.tandajasa.dao.GolonganDaoTest.java
@Test public void testCariSemua() { Long jumlahRecord = 2L;//from w w w . j a v a 2s . c o m GolonganDao pd = (GolonganDao) ctx.getBean("golonganDao"); List<Golongan> hasil = pd.semuaGolongan(); Assert.assertEquals(new Long(jumlahRecord), new Long(hasil.size())); }
From source file:edu.umm.radonc.ca_dash.controllers.D3PieChartController.java
public D3PieChartController() { endDate = new Date(); GregorianCalendar gc = new GregorianCalendar(); gc.setTime(endDate);/*from w w w. j a v a2 s. c o m*/ gc.add(Calendar.MONTH, -1); startDate = gc.getTime(); interval = "1m"; this.df = new SimpleDateFormat("MM/dd/YYYY"); this.selectedFacility = new Long(-1); this.dstats = new SynchronizedDescriptiveStatistics(); this.interval = ""; selectedFilters = new ArrayList<>(); jsonData = new JSONArray(); }
From source file:fr.univrouen.poste.services.CommissionExcelParser.java
public void process(CommissionExcel commissionExcel) throws SQLException { List<List<String>> cells = excelParser .getCells(commissionExcel.getBigFile().getBinaryFile().getBinaryStream()); Map<String, Long> cellsPosition = new HashMap<String, Long>(); int p = 0;//from www . j ava 2s.co m List<String> cellsHead = cells.remove(0); for (String cellName : cellsHead) { cellsPosition.put(cellName, new Long(p++)); } Map<List<String>, CommissionEntry> dbcommissionEntries = new HashMap<List<String>, CommissionEntry>(); for (CommissionEntry commissionEntry : CommissionEntry.findAllCommissionEntrys()) { dbcommissionEntries.put(getList4Id(commissionEntry), commissionEntry); } for (List<String> row : cells) { // create a new commissionEntry CommissionEntry commissionEntry = new CommissionEntry(); for (String cellName : cellsPosition.keySet()) { int position = cellsPosition.get(cellName).intValue(); if (row.size() > position) { String cellValue = row.get(position); commissionMappingService.setAttrFromCell(commissionEntry, cellName, cellValue); } else { logger.debug("can't get " + cellName + " for this row in excel file ..."); } } if (commissionEntry.getNumPoste() != null && !commissionEntry.getNumPoste().isEmpty() && commissionEntry.getEmail() != null && !commissionEntry.getEmail().isEmpty()) { // Rcupration d'un CommissionEntry chaque fois trop gourmand, mme avec l'index ... //TypedQuery<CommissionEntry> query = CommissionEntry.findCommissionEntrysByNumPosteAndEmail(commissionEntry.getNumPoste(), commissionEntry.getEmail(), null, null); CommissionEntry dbCommissionEntry = dbcommissionEntries.get(getList4Id(commissionEntry)); if (dbCommissionEntry == null) { commissionEntry.persist(); } else { // This GalaxyEntry exists already, we merge it if needed if (!fieldsEquals(dbCommissionEntry, commissionEntry)) { dbCommissionEntry.setNom(commissionEntry.getNom()); dbCommissionEntry.setPrenom(commissionEntry.getPrenom()); dbCommissionEntry.setPresident(commissionEntry.getPresident()); dbCommissionEntry.merge(); } } } } }
From source file:org.terasoluna.gfw.functionaltest.domain.service.date.DateServiceImpl.java
@Override public void insertOperationDate(String id, String diffTime) { Map<String, Object> params = new HashMap<String, Object>(); params.put("diff", new Long(diffTime)); params.put("operation_date_id", new Integer(id)); jdbcTemplate.update(INSERT_OPERATION_DATE, params); }
From source file:com.redhat.rhn.frontend.taglibs.list.ListTagUtil.java
/** * Increments a "persistent" counter. These counters are used by column tags * to track and increment values across column render passes. * @param ctx active PageContext/* ww w.j a va 2 s . com*/ * @param name name of counter * @return next value */ public static Long incrementPersistentCounter(PageContext ctx, String name) { Long counter = (Long) ctx.getRequest().getAttribute(name); if (counter == null) { counter = new Long(1); } else { counter = new Long(counter.longValue() + 1); } ctx.getRequest().setAttribute(name, counter); return counter; }
From source file:org.drizzly.MySQLConnectionTest.java
@Test public void testGetAllEmployees() { ApplicationContext application = new AnnotationConfigApplicationContext(EmployeeManager.class); EmployeeManager emp = application.getBean(EmployeeManager.class); Long empId = new Long(1); EmployeeDAO dao = new EmployeeDAO(); Assert.notEmpty(dao.findAllEmployees()); }