Merge branch 'master' into 1852_billing_period_calc
authorChristos KK Loverdos <loverdos@gmail.com>
Tue, 31 Jan 2012 14:39:03 +0000 (16:39 +0200)
committerChristos KK Loverdos <loverdos@gmail.com>
Tue, 31 Jan 2012 14:39:03 +0000 (16:39 +0200)
Conflicts:
src/main/scala/gr/grnet/aquarium/user/UserDataSnapshot.scala
src/main/scala/gr/grnet/aquarium/user/UserStateComputations.scala
src/main/scala/gr/grnet/aquarium/user/actor/UserActor.scala

1  2 
src/main/scala/gr/grnet/aquarium/logic/accounting/Policy.scala
src/main/scala/gr/grnet/aquarium/user/UserDataSnapshot.scala
src/test/scala/gr/grnet/aquarium/user/UserActorTest.scala

@@@ -66,15 -77,25 +77,25 @@@ object Policy extends DSL with Loggabl
      }
    }
  
+   /**
+    * Get the policies that are valid between the specified time instances
+    */
    def policies(from: Date, to: Date): List[DSLPolicy] = {
-     policies.filter {
+     policies.get.filter {
        a => a._1.from.before(from) &&
             a._1.to.after(to)
 -    }.values.toList
 +    }.valuesIterator.toList
    }
-   
+   /**
+    * Get the policies that are valid throughout the specified
+    * [[gr.grnet.aquarium.logic.accounting.dsl.Timeslot]]
+    */
    def policies(t: Timeslot): List[DSLPolicy] = policies(t.from, t.to)
  
+   /**
+    * Load and parse a policy from file.
+    */
    def loadPolicyFromFile(pol: File): DSLPolicy = {
  
      val stream = pol.exists() match {
@@@ -21,7 -21,7 +21,7 @@@ class UserActorTest 
        0L,
        ActiveSuspendedSnapshot(true, now),
        CreditSnapshot(0, now),
--      AgreementSnapshot("default", now),
++      AgreementSnapshot(Agreement("default", now, now) :: Nil, now),
        RolesSnapshot(Nil, now),
        PaymentOrdersSnapshot(Nil, now),
        OwnedGroupsSnapshot(Nil, now),