ensure that graph attributes are not lost

- this entails making Module.isSealed==true if attributes are set
- also removed Module.nest(), which implied fixing replaceShape to form
  a CompositeModule where CopiedModule was used before (GraphModule and
  TlsModule)
This commit is contained in:
Roland Kuhn 2016-02-12 08:28:16 +01:00
parent 4e49d75ad8
commit 7b7647435b
18 changed files with 87 additions and 97 deletions

View file

@ -8,4 +8,5 @@ akka {
akka.actor.warn-about-java-serializer-usage = false
stream.materializer.debug.fuzzing-mode = on
stream.secret-test-fuzzing-warning-disable = 42
}

View file

@ -511,7 +511,9 @@ class InterpreterSpec extends AkkaSpec with GraphInterpreterSpecKit {
downstream.requestOne()
lastEvents() should be(Set(RequestOne))
upstream.onComplete()
EventFilter[IllegalArgumentException](pattern = ".*Cannot pull closed port.*", occurrences = 1).intercept {
upstream.onComplete()
}
val ev = lastEvents()
ev.nonEmpty should be(true)
ev.forall {

View file

@ -4,7 +4,6 @@
package akka.stream.scaladsl
import akka.NotUsed
import scala.collection.immutable
import scala.concurrent.duration._
import akka.stream.ActorMaterializer
@ -14,6 +13,7 @@ import akka.stream.testkit.Utils._
import org.reactivestreams.Subscription
import akka.testkit.TestProbe
import org.reactivestreams.Subscriber
import akka.testkit.EventFilter
class FlowIteratorSpec extends AbstractFlowIteratorSpec {
override def testName = "A Flow based on an iterator producing function"
@ -40,7 +40,9 @@ class FlowIterableSpec extends AbstractFlowIteratorSpec {
sub.request(1)
c.expectNext(1)
c.expectNoMsg(100.millis)
sub.request(2)
EventFilter[IllegalStateException](message = "not two", occurrences = 1).intercept {
sub.request(2)
}
c.expectError().getMessage should be("not two")
sub.request(2)
c.expectNoMsg(100.millis)

View file

@ -6,6 +6,7 @@ package akka.stream.scaladsl
import akka.stream.testkit.{ BaseTwoStreamsSetup, TestSubscriber }
import org.reactivestreams.Publisher
import scala.concurrent.duration._
import akka.testkit.EventFilter
class FlowZipWithSpec extends BaseTwoStreamsSetup {
@ -46,7 +47,9 @@ class FlowZipWithSpec extends BaseTwoStreamsSetup {
probe.expectNext(1 / -2)
probe.expectNext(2 / -1)
subscription.request(2)
EventFilter[ArithmeticException](occurrences = 1).intercept {
subscription.request(2)
}
probe.expectError() match {
case a: java.lang.ArithmeticException a.getMessage should be("/ by zero")
}

View file

@ -8,9 +8,9 @@ import akka.stream.testkit.TestSubscriber.Probe
import akka.stream.testkit.Utils._
import akka.stream.testkit._
import org.reactivestreams.Publisher
import scala.concurrent.duration._
import scala.util.control.NoStackTrace
import akka.testkit.EventFilter
class GraphUnzipWithSpec extends AkkaSpec {
@ -174,7 +174,9 @@ class GraphUnzipWithSpec extends AkkaSpec {
leftProbe.expectNext(1 / -1)
rightProbe.expectNext("1/-1")
requestFromBoth()
EventFilter[ArithmeticException](occurrences = 1).intercept {
requestFromBoth()
}
leftProbe.expectError() match {
case a: java.lang.ArithmeticException a.getMessage should be("/ by zero")

View file

@ -3,6 +3,7 @@ package akka.stream.scaladsl
import akka.stream.testkit._
import scala.concurrent.duration._
import akka.stream._
import akka.testkit.EventFilter
class GraphZipWithSpec extends TwoStreamsSetup {
import GraphDSL.Implicits._
@ -65,7 +66,9 @@ class GraphZipWithSpec extends TwoStreamsSetup {
probe.expectNext(1 / -2)
probe.expectNext(2 / -1)
subscription.request(2)
EventFilter[ArithmeticException](occurrences = 1).intercept {
subscription.request(2)
}
probe.expectError() match {
case a: java.lang.ArithmeticException a.getMessage should be("/ by zero")
}

View file

@ -13,6 +13,7 @@ import scala.util.control.NoStackTrace
import akka.stream._
import akka.stream.testkit._
import akka.NotUsed
import akka.testkit.EventFilter
class SourceSpec extends AkkaSpec with DefaultTimeout with ScalaFutures {
@ -235,13 +236,14 @@ class SourceSpec extends AkkaSpec with DefaultTimeout with ScalaFutures {
"terminate with a failure if there is an exception thrown" in {
val t = new RuntimeException("expected")
whenReady(
Source.unfold((0, 1)) {
case (a, _) if a > 10000000 throw t
case (a, b) Some((b, a + b) a)
}.runFold(List.empty[Int]) { case (xs, x) x :: xs }.failed) {
_ should be theSameInstanceAs (t)
}
EventFilter[RuntimeException](message = "expected", occurrences = 1) intercept
whenReady(
Source.unfold((0, 1)) {
case (a, _) if a > 10000000 throw t
case (a, b) Some((b, a + b) a)
}.runFold(List.empty[Int]) { case (xs, x) x :: xs }.failed) {
_ should be theSameInstanceAs (t)
}
}
"generate a finite fibonacci sequence asynchronously" in {