Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 240731 Details for
Bug 429959
[tests] create unit tests for "Developer Statistics"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
New Version of Test
DateFormatterTest.java (text/plain), 1.85 KB, created by
Akif Etkue
on 2014-03-10 18:45:38 EDT
(
hide
)
Description:
New Version of Test
Filename:
MIME Type:
Creator:
Akif Etkue
Created:
2014-03-10 18:45:38 EDT
Size:
1.85 KB
patch
obsolete
>/** > * Copyright (c) 2013 Timur Achmetow. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > */ >package org.eclipse.recommenders.stats.rcp; > >import static org.junit.Assert.*; > >import java.util.Date; > >import org.eclipse.recommenders.stats.rcp.ui.util.DateFormatter; >import org.junit.Test; > >public class DateFormatterTest { > > @Test > public final void nullCheck() { > assertNull(new DateFormatter().formatUnit(null, null)); > assertNull(new DateFormatter().formatUnit(null, new Date())); > assertNull(new DateFormatter().formatUnit(new Date(), null)); > } > > @Test > public final void formatMinutes() { > String minuteConverter = new DateFormatter().formatUnit(new Date(0), > new Date(120000)); > assertEquals("2 minutes ago", minuteConverter); > } > > @Test > public final void formatOneMinute() { > String minuteConverter = new DateFormatter().formatUnit(new Date(0), > new Date(60000)); > assertEquals("1 minute ago", minuteConverter); > } > > @Test > public final void formatOneHours() { > String minuteConverter = new DateFormatter().formatUnit(new Date(0), > new Date(3600000)); > assertEquals("1 hour ago", minuteConverter); > } > > @Test > public final void formatHours() { > String minuteConverter = new DateFormatter().formatUnit(new Date(0), > new Date(7200000)); > assertEquals("2 hours ago", minuteConverter); > } > > @Test > public final void formatOneDays() { > String minuteConverter = new DateFormatter().formatUnit(new Date(0), > new Date(86400000)); > assertEquals("1 day ago", minuteConverter); > } > > @Test > public final void formatDays() { > String minuteConverter = new DateFormatter().formatUnit(new Date(0), > new Date(172800000)); > assertEquals("2 days ago", minuteConverter); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 429959
:
240697
| 240731 |
240732