cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [2/2] git commit: updated refs/heads/4.9-mvn-upgrade to 579d430
Date Tue, 02 Feb 2016 19:01:03 GMT
framework/quota: fix checkstyle issue

Fixes enum name to supress checkstyle failure due to the latest checkstyle
version

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/579d430a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/579d430a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/579d430a

Branch: refs/heads/4.9-mvn-upgrade
Commit: 579d430ac50f507fefa73bdb4d88c9f20bf7fdaf
Parents: dda426e
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Tue Feb 2 19:55:06 2016 +0100
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Feb 2 19:55:06 2016 +0100

----------------------------------------------------------------------
 .../cloudstack/quota/QuotaStatementImpl.java    |  8 +++----
 .../cloudstack/quota/QuotaStatementTest.java    | 22 ++++++++++----------
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/579d430a/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
----------------------------------------------------------------------
diff --git a/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java b/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
index 0f957be..c351b46 100644
--- a/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
+++ b/framework/quota/src/org/apache/cloudstack/quota/QuotaStatementImpl.java
@@ -59,11 +59,11 @@ public class QuotaStatementImpl extends ManagerBase implements QuotaStatement
{
 
     final public static int s_LAST_STATEMENT_SENT_DAYS = 6; //ideally should be less than
7 days
 
-    public enum STATEMENT_PERIODS {
+    public enum QuotaStatementPeriods {
         BIMONTHLY, MONTHLY, QUATERLY, HALFYEARLY, YEARLY
     };
 
-    private STATEMENT_PERIODS _period = STATEMENT_PERIODS.MONTHLY;
+    private QuotaStatementPeriods _period = QuotaStatementPeriods.MONTHLY;
 
     public QuotaStatementImpl() {
         super();
@@ -87,7 +87,7 @@ public class QuotaStatementImpl extends ManagerBase implements QuotaStatement
{
         String period_str = configs.get(QuotaConfig.QuotaStatementPeriod.key());
         int period = period_str == null ? 1 : Integer.parseInt(period_str);
 
-        STATEMENT_PERIODS _period = STATEMENT_PERIODS.values()[period];
+        QuotaStatementPeriods _period = QuotaStatementPeriods.values()[period];
         return true;
     }
 
@@ -263,7 +263,7 @@ public class QuotaStatementImpl extends ManagerBase implements QuotaStatement
{
         return null;
     }
 
-    public Calendar[] statementTime(final Calendar today, final STATEMENT_PERIODS period)
{
+    public Calendar[] statementTime(final Calendar today, final QuotaStatementPeriods period)
{
         //check if it is statement time
         int day_of_month = today.get(Calendar.DAY_OF_MONTH);
         int month_of_year = today.get(Calendar.MONTH);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/579d430a/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
----------------------------------------------------------------------
diff --git a/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java b/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
index d1cc7ac..e2b5a0a 100644
--- a/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
+++ b/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
@@ -21,7 +21,7 @@ import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.db.TransactionLegacy;
 import junit.framework.TestCase;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.cloudstack.quota.QuotaStatementImpl.STATEMENT_PERIODS;
+import org.apache.cloudstack.quota.QuotaStatementImpl.QuotaStatementPeriods;
 import org.apache.cloudstack.quota.dao.QuotaAccountDao;
 import org.apache.cloudstack.quota.dao.QuotaUsageDao;
 import org.apache.cloudstack.quota.vo.QuotaAccountVO;
@@ -85,12 +85,12 @@ public class QuotaStatementTest extends TestCase {
 
         //BIMONTHLY - first statement of month
         date.set(Calendar.DATE, QuotaStatementImpl.s_LAST_STATEMENT_SENT_DAYS + 1);
-        Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.BIMONTHLY);
+        Calendar period[] = quotaStatement.statementTime(date, QuotaStatementPeriods.BIMONTHLY);
         assertTrue(period == null);
 
         //1 of this month
         date.set(Calendar.DATE, 1);
-        period = quotaStatement.statementTime(date, STATEMENT_PERIODS.BIMONTHLY);
+        period = quotaStatement.statementTime(date, QuotaStatementPeriods.BIMONTHLY);
         assertTrue(period != null);
         assertTrue(period.length == 2);
         assertTrue(period[0].toString(), period[0].before(period[1]));
@@ -100,12 +100,12 @@ public class QuotaStatementTest extends TestCase {
         //BIMONTHLY - second statement of month
         date = Calendar.getInstance();
         date.set(Calendar.DATE, QuotaStatementImpl.s_LAST_STATEMENT_SENT_DAYS + 16);
-        period = quotaStatement.statementTime(date, STATEMENT_PERIODS.BIMONTHLY);
+        period = quotaStatement.statementTime(date, QuotaStatementPeriods.BIMONTHLY);
         assertTrue(period == null);
 
         //17 of this month
         date.set(Calendar.DATE, 17);
-        period = quotaStatement.statementTime(date, STATEMENT_PERIODS.BIMONTHLY);
+        period = quotaStatement.statementTime(date, QuotaStatementPeriods.BIMONTHLY);
         assertTrue(period != null);
         assertTrue(period.length == 2);
         assertTrue(period[0].toString(), period[0].before(period[1]));
@@ -128,12 +128,12 @@ public class QuotaStatementTest extends TestCase {
         //MONTHLY
         date = Calendar.getInstance();
         date.set(Calendar.DATE, QuotaStatementImpl.s_LAST_STATEMENT_SENT_DAYS + 1);
-        Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.MONTHLY);
+        Calendar period[] = quotaStatement.statementTime(date, QuotaStatementPeriods.MONTHLY);
         assertTrue(period == null);
 
         //1 of this month
         date.set(Calendar.DATE, QuotaStatementImpl.s_LAST_STATEMENT_SENT_DAYS - 1);
-        period = quotaStatement.statementTime(date, STATEMENT_PERIODS.MONTHLY);
+        period = quotaStatement.statementTime(date, QuotaStatementPeriods.MONTHLY);
         assertTrue(period != null);
         assertTrue(period.length == 2);
         assertTrue(period[0].toString(), period[0].before(period[1]));
@@ -157,7 +157,7 @@ public class QuotaStatementTest extends TestCase {
         date = Calendar.getInstance();
         date.set(Calendar.MONTH, Calendar.JANUARY); // 1 Jan
         date.set(Calendar.DATE, 1);
-        Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.QUATERLY);
+        Calendar period[] = quotaStatement.statementTime(date, QuotaStatementPeriods.QUATERLY);
         assertTrue(period != null);
         assertTrue(period.length == 2);
         assertTrue("period[0].before(period[1])" + period[0].toString(), period[0].before(period[1]));
@@ -182,7 +182,7 @@ public class QuotaStatementTest extends TestCase {
         date = Calendar.getInstance();
         date.set(Calendar.MONTH, Calendar.JANUARY); // 1 Jan
         date.set(Calendar.DATE, 1);
-        Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.HALFYEARLY);
+        Calendar period[] = quotaStatement.statementTime(date, QuotaStatementPeriods.HALFYEARLY);
         assertTrue(period != null);
         assertTrue(period.length == 2);
         assertTrue("period[0].before(period[1])" + period[0].toString(), period[0].before(period[1]));
@@ -207,7 +207,7 @@ public class QuotaStatementTest extends TestCase {
         date = Calendar.getInstance();
         date.set(Calendar.MONTH, Calendar.JANUARY); // 1 Jan
         date.set(Calendar.DATE, 1);
-        Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.YEARLY);
+        Calendar period[] = quotaStatement.statementTime(date, QuotaStatementPeriods.YEARLY);
         assertTrue("period != null", period != null);
         assertTrue(period.length == 2);
         assertTrue("period[0].before(period[1])" + period[0].toString(), period[0].before(period[1]));
@@ -244,7 +244,7 @@ public class QuotaStatementTest extends TestCase {
 
         // call real method on send monthly statement
         quotaStatement.sendStatement();
-        Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.MONTHLY);
+        Calendar period[] = quotaStatement.statementTime(date, QuotaStatementPeriods.MONTHLY);
         if (period != null){
             Mockito.verify(alertManager, Mockito.times(1)).sendQuotaAlert(Mockito.any(QuotaAlertManagerImpl.DeferredQuotaEmail.class));
         }


Mime
View raw message