-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into wip-fix-multi-jvm-test-jboner
- Loading branch information
Showing
94 changed files
with
9,257 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
akka-actor-tests/src/test/scala/akka/util/NonFatalSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com> | ||
*/ | ||
package akka.util | ||
|
||
import org.scalatest.matchers.MustMatchers | ||
import akka.testkit.AkkaSpec | ||
|
||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) | ||
class NonFatalSpec extends AkkaSpec with MustMatchers { | ||
|
||
"A NonFatal extractor" must { | ||
|
||
"match ordinary RuntimeException" in { | ||
try { | ||
throw new RuntimeException("Boom") | ||
} catch { | ||
case NonFatal(e) ⇒ // as expected | ||
} | ||
} | ||
|
||
"not match StackOverflowError" in { | ||
//not @tailrec | ||
def blowUp(n: Long): Long = { | ||
blowUp(n + 1) + 1 | ||
} | ||
|
||
intercept[StackOverflowError] { | ||
try { | ||
blowUp(0) | ||
} catch { | ||
case NonFatal(e) ⇒ assert(false) | ||
} | ||
} | ||
} | ||
|
||
"not match InterruptedException" in { | ||
intercept[InterruptedException] { | ||
try { | ||
throw new InterruptedException("Simulated InterruptedException") | ||
} catch { | ||
case NonFatal(e) ⇒ assert(false) | ||
} | ||
} | ||
} | ||
|
||
"be used together with InterruptedException" in { | ||
try { | ||
throw new InterruptedException("Simulated InterruptedException") | ||
} catch { | ||
case _: InterruptedException ⇒ // as expected | ||
case NonFatal(e) ⇒ assert(false) | ||
} | ||
|
||
try { | ||
throw new RuntimeException("Simulated RuntimeException") | ||
} catch { | ||
case NonFatal(_) | _: InterruptedException ⇒ // as expected | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.