Skip to content

Commit

Permalink
move Duration classes according to scala 2.10 nightly and remove cast…
Browse files Browse the repository at this point in the history
…s to FiniteDuration, see #2504
  • Loading branch information
rkuhn committed Oct 11, 2012
1 parent 6f70624 commit 0f04239
Show file tree
Hide file tree
Showing 227 changed files with 307 additions and 387 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import scala.concurrent.Await;
import scala.concurrent.Future;
import scala.concurrent.Promise;
import scala.concurrent.util.Duration;
import scala.concurrent.duration.Duration;
import akka.testkit.TestKitExtension;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand Down
4 changes: 2 additions & 2 deletions akka-actor-tests/src/test/java/akka/util/JavaDuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
package akka.util;

import org.junit.Test;
import scala.concurrent.util.Duration;
import scala.concurrent.duration.Duration;

public class JavaDuration {

@Test
public void testCreation() {
final Duration fivesec = Duration.create(5, "seconds");
final Duration threemillis = Duration.parse("3 millis");
final Duration threemillis = Duration.create("3 millis");
final Duration diff = fivesec.minus(threemillis);
assert diff.lt(fivesec);
assert Duration.Zero().lteq(Duration.Inf());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import language.postfixOps
import akka.testkit._
import akka.testkit.DefaultTimeout
import akka.testkit.TestEvent._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.routing._
import org.scalatest.BeforeAndAfterEach
import akka.ConfigurationException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import akka.actor.ActorDSL._
//#import
import akka.event.Logging.Warning
import scala.concurrent.{ Await, Future }
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.TimeoutException

class ActorDSLSpec extends AkkaSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package akka.actor

import akka.testkit._
import org.scalatest.BeforeAndAfterEach
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import scala.concurrent.Await
import akka.pattern.ask

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.scalatest.matchers.MustMatchers

import akka.actor.Actor._
import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.atomic._
import scala.concurrent.Await
import akka.pattern.ask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package akka.actor
import language.postfixOps

import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import scala.concurrent.Await
import akka.pattern.ask
import java.net.MalformedURLException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.scalatest.matchers.MustMatchers

import akka.testkit._
import akka.util.Timeout
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import scala.concurrent.Await
import java.lang.IllegalStateException
import scala.concurrent.Promise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import akka.testkit._
import org.scalatest.junit.JUnitSuite
import com.typesafe.config.ConfigFactory
import scala.concurrent.Await
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import scala.collection.JavaConverters
import java.util.concurrent.{ TimeUnit, RejectedExecutionException, CountDownLatch, ConcurrentLinkedQueue }
import akka.util.Timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
package akka.actor

import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.testkit._
import akka.testkit.TestEvent._
import scala.concurrent.Await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import akka.testkit.TestEvent._
import akka.dispatch.BoundedDequeBasedMailbox
import akka.pattern.ask
import scala.concurrent.Await
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.actor.ActorSystem.Settings
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.Assertions.intercept
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import akka.testkit.DefaultTimeout
import akka.testkit.TestEvent._
import scala.concurrent.Await
import akka.pattern.ask
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.BeforeAndAfterEach
import org.scalatest.junit.JUnitSuite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import language.postfixOps

import akka.testkit.AkkaSpec
import akka.dispatch.UnboundedMailbox
import scala.concurrent.util.duration._
import scala.concurrent.duration._

object ConsistencySpec {
val config = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package akka.actor

import language.postfixOps
import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.atomic._
import scala.concurrent.Await
import akka.pattern.ask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import akka.testkit.AkkaSpec
import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigParseOptions
import akka.routing._
import scala.concurrent.util.duration._
import scala.concurrent.duration._

object DeployerSpec {
val deployerConf = ConfigFactory.parseString("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import language.postfixOps
import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach }
import akka.testkit._
import TestEvent.Mute
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.event._
import com.typesafe.config.ConfigFactory
import scala.concurrent.Await
import akka.util.Timeout
import scala.concurrent.util.Duration
import scala.concurrent.util.FiniteDuration

object FSMActorSpec {
val timeout = Timeout(2 seconds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ package akka.actor
import language.postfixOps

import akka.testkit._
import scala.concurrent.util.Duration
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.event.Logging

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ package akka.actor
import language.postfixOps

import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.util.Duration
import scala.concurrent.duration._

object FSMTransitionSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ package akka.actor
import language.postfixOps

import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.actor.Actor._
import scala.concurrent.util.Duration
import scala.concurrent.Await
import akka.pattern.{ ask, pipe }

Expand Down
4 changes: 1 addition & 3 deletions akka-actor-tests/src/test/scala/akka/actor/IOActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ package akka.actor
import language.postfixOps
import akka.util.ByteString
import scala.concurrent.{ ExecutionContext, Await, Future, Promise }
import scala.concurrent.util.{ Duration, Deadline }
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import scala.util.continuations._
import akka.testkit._
import akka.dispatch.MessageDispatcher
import akka.pattern.ask
import java.net.{ Socket, InetSocketAddress, InetAddress, SocketAddress }
import scala.util.Failure
import annotation.tailrec
import scala.concurrent.util.FiniteDuration

object IOActorSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package akka.actor
import language.postfixOps
import akka.testkit._
import scala.concurrent.Await
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.util.Timeout
import scala.concurrent.Future
import scala.util.Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ package akka.actor

import language.postfixOps
import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.atomic.AtomicInteger
import scala.concurrent.Await
import java.util.concurrent.TimeoutException
import scala.concurrent.util.Duration

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class ReceiveTimeoutSpec extends AkkaSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import java.util.concurrent.{ TimeUnit, CountDownLatch }
import akka.testkit.AkkaSpec
import akka.testkit.DefaultTimeout
import akka.testkit.TestLatch
import scala.concurrent.util.duration._
import scala.concurrent.util.Duration
import scala.concurrent.duration._
import akka.pattern.ask

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package akka.actor
import language.postfixOps

import org.scalatest.BeforeAndAfterEach
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.{ CountDownLatch, ConcurrentLinkedQueue, TimeUnit }
import akka.testkit._
import scala.concurrent.Await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ package akka.actor
import language.postfixOps
import java.util.concurrent.{ TimeUnit, CountDownLatch }
import scala.concurrent.Await
import scala.concurrent.util.Duration
import scala.concurrent.util.duration.intToDurationInt
import scala.concurrent.duration._
import scala.math.BigInt.int2bigInt
import scala.util.Random
import scala.util.control.NoStackTrace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import java.util.concurrent.{ TimeUnit, CountDownLatch }
import akka.testkit.AkkaSpec
import akka.testkit.DefaultTimeout
import akka.pattern.ask
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import scala.util.control.NonFatal

object SupervisorMiscSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package akka.actor
import language.postfixOps

import org.scalatest.BeforeAndAfterEach
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.{ Die, Ping }
import akka.testkit.TestEvent._
import akka.testkit._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import language.postfixOps
import org.scalatest.WordSpec
import org.scalatest.matchers.MustMatchers
import scala.concurrent.Await
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.actor.Actor._
import akka.testkit.{ TestKit, EventFilter, filterEvents, filterException, AkkaSpec, ImplicitSender, DefaultTimeout }
import akka.dispatch.Dispatchers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import akka.testkit.ImplicitSender
import akka.testkit.DefaultTimeout
import scala.concurrent.Await
import akka.pattern.ask
import scala.concurrent.util.duration._
import scala.concurrent.duration._

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class Ticket669Spec extends AkkaSpec with BeforeAndAfterAll with ImplicitSender with DefaultTimeout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import language.postfixOps
import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach }
import akka.util.Timeout
import scala.concurrent.{ Await, Future, Promise }
import scala.concurrent.util.Duration
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.atomic.AtomicReference
import annotation.tailrec
import akka.testkit.{ EventFilter, filterEvents, AkkaSpec }
Expand All @@ -20,7 +19,6 @@ import akka.serialization.JavaSerializer
import akka.actor.TypedActor._
import java.lang.IllegalStateException
import java.util.concurrent.{ TimeoutException, TimeUnit, CountDownLatch }
import scala.concurrent.util.FiniteDuration

object TypedActorSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import akka.event.Logging.Error
import akka.pattern.ask
import akka.testkit._
import akka.util.Switch
import scala.concurrent.util.duration._
import scala.concurrent.util.Duration
import scala.concurrent.duration._
import scala.concurrent.{ Await, Future, Promise }
import scala.annotation.tailrec

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import java.util.concurrent.atomic.{ AtomicBoolean, AtomicInteger }
import akka.testkit.{ filterEvents, EventFilter, AkkaSpec }
import akka.actor.{ Props, Actor }
import scala.concurrent.Await
import scala.concurrent.util.Duration
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.testkit.DefaultTimeout
import akka.dispatch.{ PinnedDispatcher, Dispatchers, Dispatcher }
import akka.pattern.ask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import scala.collection.JavaConverters._
import com.typesafe.config.ConfigFactory
import akka.actor.Actor
import akka.actor.Props
import scala.concurrent.util.duration._
import scala.concurrent.duration._

object DispatchersSpec {
val config = """
Expand Down
3 changes: 1 addition & 2 deletions akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import language.postfixOps
import akka.testkit.AkkaSpec
import com.typesafe.config.ConfigFactory
import scala.collection.JavaConverters._
import scala.concurrent.util.duration._
import scala.concurrent.util.Duration
import scala.concurrent.duration._
import akka.actor.{ IOManager, ActorSystem }

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import language.postfixOps
import akka.actor.{ Actor, Props }
import scala.concurrent.Future
import scala.concurrent.Await
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import akka.testkit.{ AkkaSpec, DefaultTimeout }
import akka.pattern.{ ask, pipe }
import scala.concurrent.ExecutionException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import akka.actor._
import akka.testkit.{ EventFilter, filterEvents, filterException, AkkaSpec, DefaultTimeout, TestLatch }
import scala.concurrent.{ Await, Awaitable, Future, Promise, ExecutionContext }
import scala.util.control.NonFatal
import scala.concurrent.util.duration._
import scala.concurrent.util.Duration
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import org.scalatest.junit.JUnitSuite
import scala.runtime.NonLocalReturnControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.typesafe.config.Config
import akka.actor.{ RepointableRef, Props, DeadLetter, ActorSystem, ActorRefWithCell, ActorRef, ActorCell }
import akka.testkit.AkkaSpec
import scala.concurrent.{ Future, Promise, Await }
import scala.concurrent.util.duration.intToDurationInt
import scala.concurrent.duration._

@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAndAfterEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import akka.actor.{ Props, InternalActorRef, ActorSystem, Actor }
import akka.pattern.ask
import akka.testkit.{ DefaultTimeout, AkkaSpec }
import scala.concurrent.Await
import scala.concurrent.util.duration.intToDurationInt
import scala.concurrent.duration._

object PriorityDispatcherSpec {
val config = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import language.postfixOps

import org.scalatest.BeforeAndAfterEach
import akka.testkit._
import scala.concurrent.util.duration._
import scala.concurrent.duration._
import java.util.concurrent.atomic._
import akka.actor.{ Props, Actor, ActorRef, ActorSystem }
import java.util.Comparator
Expand Down
Loading

0 comments on commit 0f04239

Please sign in to comment.