package reuse.pipe.thread;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import reuse.pipe.Target;
import reuse.pipe.decorator.AsyncDecorator;
import reuse.util.Pair;

public class MergePointTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testMerge() throws Exception {
		@SuppressWarnings("unchecked")
		Target<Pair<Integer, String>> target = mock(Target.class);
		
		final MergePoint<Integer, String> mp = new MergePoint<Integer, String>(target);
		
		new AsyncDecorator<Integer>(mp.left).send(1);
		mp.right.send("hi");
		
		Pair<Integer, String> p = new Pair<Integer, String>(1,"hi");
		verify(target).send(p);
		
//		fail("Not yet implemented");
	}

//	@Test
//	public void testFeed() {
//		fail("Not yet implemented");
//	}

}

@@ -58,16 +58,18 @@
 ert.*;%0D%0A
+//
 import s
@@ -478,16 +478,18 @@
 tion %7B%0D%0A
+//
 %09%09@Suppr
@@ -514,16 +514,18 @@
 cked%22)%0D%0A
+//
 %09%09Target
@@ -578,20 +578,24 @@
 lass);%0D%0A
+//
 %09%09%0D%0A
+//
 %09%09final 
@@ -669,20 +669,24 @@
 rget);%0D%0A
+//
 %09%09%0D%0A
+//
 %09%09new As
@@ -726,16 +726,18 @@
 nd(1);%0D%0A
+//
 %09%09mp.rig
@@ -752,20 +752,24 @@
 %22hi%22);%0D%0A
+//
 %09%09%0D%0A
+//
 %09%09Pair%3CI
@@ -824,16 +824,18 @@
 %22hi%22);%0D%0A
+//
 %09%09verify

remove mockito dependency