This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
package com.earth2me.essentials;
|
|
|
|
|
2013-06-08 21:31:19 +00:00
|
|
|
import com.earth2me.essentials.utils.DateUtil;
|
|
|
|
import com.earth2me.essentials.utils.LocationUtil;
|
2011-05-16 09:46:10 +00:00
|
|
|
import java.io.IOException;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.GregorianCalendar;
|
2012-08-08 11:13:39 +00:00
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
import junit.framework.TestCase;
|
2011-07-15 23:33:22 +00:00
|
|
|
import org.bukkit.World.Environment;
|
|
|
|
import org.bukkit.plugin.InvalidDescriptionException;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
public class UtilTest extends TestCase
|
|
|
|
{
|
2011-07-15 23:33:22 +00:00
|
|
|
private final Essentials ess;
|
|
|
|
private final FakeServer server;
|
|
|
|
|
|
|
|
public UtilTest()
|
|
|
|
{
|
|
|
|
server = new FakeServer();
|
|
|
|
server.createWorld("testWorld", Environment.NORMAL);
|
2014-01-20 10:20:13 +00:00
|
|
|
ess = new Essentials(server);
|
2011-05-16 09:46:10 +00:00
|
|
|
try
|
|
|
|
{
|
2011-07-15 23:33:22 +00:00
|
|
|
ess.setupForTesting(server);
|
|
|
|
}
|
|
|
|
catch (InvalidDescriptionException ex)
|
|
|
|
{
|
|
|
|
fail("InvalidDescriptionException");
|
2011-05-16 09:46:10 +00:00
|
|
|
}
|
|
|
|
catch (IOException ex)
|
|
|
|
{
|
2011-07-15 23:33:22 +00:00
|
|
|
fail("IOException");
|
2011-05-16 09:46:10 +00:00
|
|
|
}
|
2011-11-21 01:55:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-08 11:13:39 +00:00
|
|
|
public void testSafeLocation()
|
|
|
|
{
|
|
|
|
Set<String> testSet = new HashSet<String>();
|
|
|
|
int count = 0;
|
|
|
|
int x, y, z, origX, origY, origZ;
|
|
|
|
x = y = z = origX = origY = origZ = 0;
|
|
|
|
int i = 0;
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
testSet.add(x + ":" + y + ":" + z);
|
|
|
|
count++;
|
|
|
|
i++;
|
2013-06-08 21:31:19 +00:00
|
|
|
if (i >= LocationUtil.VOLUME.length)
|
2012-08-08 11:13:39 +00:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2013-06-08 21:31:19 +00:00
|
|
|
x = origX + LocationUtil.VOLUME[i].x;
|
|
|
|
y = origY + LocationUtil.VOLUME[i].y;
|
|
|
|
z = origZ + LocationUtil.VOLUME[i].z;
|
2012-08-08 11:13:39 +00:00
|
|
|
}
|
|
|
|
assertTrue(testSet.contains("0:0:0"));
|
|
|
|
assertTrue(testSet.contains("3:3:3"));
|
|
|
|
assertEquals(testSet.size(), count);
|
2013-06-08 21:31:19 +00:00
|
|
|
int diameter = LocationUtil.RADIUS * 2 + 1;
|
2012-08-08 11:13:39 +00:00
|
|
|
assertEquals(diameter * diameter * diameter, count);
|
|
|
|
}
|
|
|
|
|
2011-11-21 01:55:26 +00:00
|
|
|
public void testFDDnow()
|
|
|
|
{
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
Calendar c = new GregorianCalendar();
|
2013-06-08 21:31:19 +00:00
|
|
|
String resp = DateUtil.formatDateDiff(c, c);
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
assertEquals(resp, "now");
|
|
|
|
}
|
2011-11-21 01:55:26 +00:00
|
|
|
|
|
|
|
public void testFDDfuture()
|
|
|
|
{
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
Calendar a, b;
|
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 10, 0, 1);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 second", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 10, 0, 2);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 seconds", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 10, 0, 3);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 seconds", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 10, 1, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 minute", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 10, 2, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 minutes", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 10, 3, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 minutes", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 11, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 hour", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 12, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 hours", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 13, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 hours", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 2, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 day", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 3, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 days", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 4, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 days", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 2, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 month", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 3, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 months", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 4, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 months", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2011, 1, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 year", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2012, 1, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 years", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2013, 1, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 years", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2011, 4, 5, 23, 38, 12);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 year 3 months 4 days", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 9, 17, 23, 45, 45);
|
|
|
|
b = new GregorianCalendar(2015, 3, 7, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("4 years 5 months 20 days", DateUtil.formatDateDiff(a, b));
|
2011-05-31 20:36:43 +00:00
|
|
|
a = new GregorianCalendar(2011, 4, 31, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2011, 4, 31, 10, 5, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("5 minutes", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
2011-11-21 01:55:26 +00:00
|
|
|
|
|
|
|
public void testFDDpast()
|
|
|
|
{
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
Calendar a, b;
|
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 59, 59);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 second", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 59, 58);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 seconds", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 59, 57);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 seconds", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 59, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 minute", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 58, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 minutes", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 57, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 minutes", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 9, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 hour", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 8, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 hours", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 1, 7, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 hours", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 5, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 4, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 day", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 5, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 3, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 days", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 5, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 1, 2, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 days", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 5, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 4, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 month", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 5, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 3, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 months", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 5, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2010, 2, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 months", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2009, 1, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("1 year", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2008, 1, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("2 years", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2007, 1, 1, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("3 years", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
|
|
|
b = new GregorianCalendar(2009, 4, 5, 23, 38, 12);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("8 months 26 days 10 hours", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
a = new GregorianCalendar(2010, 9, 17, 23, 45, 45);
|
|
|
|
b = new GregorianCalendar(2000, 3, 7, 10, 0, 0);
|
2013-06-08 21:31:19 +00:00
|
|
|
assertEquals("10 years 6 months 10 days", DateUtil.formatDateDiff(a, b));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
|
|
|
}
|