Skip to content

Instantly share code, notes, and snippets.

View ktoso's full-sized avatar
🗻
Life is Study!

Konrad `ktoso` Malawski ktoso

🗻
Life is Study!
View GitHub Profile
https://github.com/akka/akka/issues/16483
1 Manifest-Version: 1.0
2 Bundle-Description: Reactive Streams TCK
3 Bundle-SymbolicName: org.reactivestreams.reactive-streams-tck
4 Bundle-ManifestVersion: 2
5 Bnd-LastModified: 1416835217000
6 Bundle-Vendor: Reactive Streams SIG
7 Bundle-DocURL: http://reactive-streams.org
8 Import-Package: org.reactivestreams,org.testng;version="[5.14,6)",org.
9 testng.annotations;version="[5.14,6)"
10 Tool: Bnd-2.1.0.20130426-122213
1 Manifest-Version: 1.0
2 Export-Package: org.reactivestreams.tck;uses:="org.reactivestreams,org
3 .testng.annotations",org.reactivestreams
4 Bundle-SymbolicName: org.reactivestreams.reactive-streams-tck
5 Bundle-Version: 1.0.0.M1
6 Bundle-Name: reactive-streams
7 Bundle-ManifestVersion: 2
8 Bnd-LastModified: 1416835217000
9 Private-Package: org.reactivestreams.tck.support
10 Bundle-Vendor: Reactive Streams SIG
@ktoso
ktoso / java.java
Last active August 29, 2015 14:07
IntelliJ 14 EAP 139.1.20 has problems to understand a Scala generated static bridge method. While javac is perfectly happy with it
package com.example;
public class Problem {
{
Thing<String> x1 = ThingJava.make(); // expected, works
Thing<String> x2 = ThingScala.make(); // false red code, is also a static method, java's inference should work
// Javac is happy with this and compiles properly, yet idea panics with:
// Incompatible types:
// Found: Thing<Object>
final Flow<String, String> f1 = Flow.of(String.class).transform("f1", this.<String, String>op()); // javadsl
final Flow<String, String> f2 = Flow.of(String.class).transform("f2", this.<String, String>op()); // javadsl
final Flow<String, String> f3 = Flow.of(String.class).transform("f2", this.<String, String>op()); // javadsl
// TODO what do we want to do here, so scaladsl does not leak into javadls usage via using Taps?
final IterableTap<String> in1 = new IterableTap<String>(Util.immutableSeq(Arrays.asList("a", "b", "c"))); // scaladsl
final IterableTap<String> in2 = new IterableTap<String>(Util.immutableSeq(Arrays.asList("d", "e", "f"))); // scaladsl
final PublisherDrain<String> out1 = new PublisherDrain<String>();
final FutureDrain<String> out2 = new FutureDrain<String>();
akka-stream-tests-experimental > show libraryDependencies
[info] List(org.scala-lang:scala-library:2.10.4, org.scalatest:scalatest:2.1.3:test, org.scalacheck:scalacheck:1.11.3:test, junit:junit:4.11:test, com.novocode:junit-interface:0.11:test, commons-io:commons-io:2.4:test)
akka-stream-tests-experimental > show testOptions
[info] List(Argument(Some(TestFramework(WrappedArray(com.novocode.junit.JUnitFramework))),List(-v, -a, -u, /Users/ktoso/code/akka/akka-stream-tests/target/test-reports)), Argument(Some(TestFramework(WrappedArray(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework))),List(-u, /Users/ktoso/code/akka/akka-stream-tests/target/test-reports)))
[success] Total time: 0 s, completed 08-Oct-2014 15:02:49
akka-stream-tests-experimental > show test:testOptions
[info] List(Argument(Some(TestFramework(WrappedArray(com.novocode.junit.JUnitFramework))),List(-v, -a, -u, /Users/ktoso/code/akka/akka-stream-tests/target/test-reports)), Argument(Some(TestFramework(WrappedArray(org.scalatest.
@ktoso
ktoso / 0.10.NOT.txt
Created October 8, 2014 12:46
junit-interface not finding java junit tests
akka-stream-tests-experimental > show libraryDependencies
[info] List(org.scala-lang:scala-library:2.10.4, org.scalatest:scalatest:2.1.3:test, org.scalacheck:scalacheck:1.11.3:test, junit:junit:4.11:test, com.novocode:junit-interface:0.10:test, commons-io:commons-io:2.4:test)
akka-stream-tests-experimental > show test:definedTests
[info] Formatting 99 Scala sources {file:/Users/ktoso/code/akka/}akka-stream-tests-experimental(test) ...
[info] Updating {file:/Users/ktoso/code/akka/}akka-stream-experimental...
[info] Done updating.
final Subscriber<Integer> subscriber = UntypedActorSubscriber.create(ref);
final java.util.Iterator<Integer> input = Arrays.asList(1, 2, 3).iterator();
// wrong, because drain == scaladsl => extends scala.Drain, extends scala.Sink
Source.from(input).connect(new SubscriberDrain<Integer>(subscriber), materializer);
// wrong, because we only runWith DrainWithKey
// suggesting to allow runWith(SimpleDrain)?
Source.from(input).runWith(new SubscriberDrain<Integer>(subscriber), materializer);
FoldDrain<String, String> fold = new FoldDrain<String, String>();
Future<String> got = materialized.getDrainFor(fold);
}
}
class FoldDrain<In, Res> extends DrainWithTheKey<In, Future<Res>> { }
class DrainWithTheKey<In, Res> {
public Res something() { return null; }
}
trait DrainWithKey[-In, +MaterializedType] extends Drain[In, MaterializedType] {
// type MaterializedType
/**
* Attach this drain to the given [[org.reactivestreams.Publisher]]. Using the given
* [[FlowMaterializer]] is completely optional, especially if this drain belongs to
* a different Reactive Streams implementation. It is the responsibility of the
* caller to provide a suitable FlowMaterializer that can be used for running
* Flows if necessary.