| 
				
			 | 
			
			
				@@ -11,6 +11,8 @@ import com.reactnativenavigation.layout.bottomtabs.BottomTabsCreator; 
			 | 
		
	
		
			
			| 
				11
			 | 
			
				11
			 | 
			
			
				 import com.reactnativenavigation.layout.bottomtabs.BottomTabsLayout; 
			 | 
		
	
		
			
			| 
				12
			 | 
			
				12
			 | 
			
			
				 import com.reactnativenavigation.layout.parse.LayoutNode; 
			 | 
		
	
		
			
			| 
				13
			 | 
			
				13
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				14
			 | 
			
			
				+import org.json.JSONException; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				15
			 | 
			
			
				+import org.json.JSONObject; 
			 | 
		
	
		
			
			| 
				14
			 | 
			
				16
			 | 
			
			
				 import org.junit.Before; 
			 | 
		
	
		
			
			| 
				15
			 | 
			
				17
			 | 
			
			
				 import org.junit.Ignore; 
			 | 
		
	
		
			
			| 
				16
			 | 
			
				18
			 | 
			
			
				 import org.junit.Test; 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -18,7 +20,6 @@ import org.robolectric.Robolectric; 
			 | 
		
	
		
			
			| 
				18
			 | 
			
				20
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				19
			 | 
			
				21
			 | 
			
			
				 import java.util.Arrays; 
			 | 
		
	
		
			
			| 
				20
			 | 
			
				22
			 | 
			
			
				 import java.util.Collections; 
			 | 
		
	
		
			
			| 
				21
			 | 
			
				
			 | 
			
			
				-import java.util.HashMap; 
			 | 
		
	
		
			
			| 
				22
			 | 
			
				23
			 | 
			
			
				 import java.util.List; 
			 | 
		
	
		
			
			| 
				23
			 | 
			
				24
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				24
			 | 
			
				25
			 | 
			
			
				 import static org.assertj.core.api.Java6Assertions.assertThat; 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -170,7 +171,7 @@ public class LayoutFactoryTest extends BaseTest { 
			 | 
		
	
		
			
			| 
				170
			 | 
			
				171
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				171
			 | 
			
				172
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				172
			 | 
			
				173
			 | 
			
			
				 	@Test 
			 | 
		
	
		
			
			| 
				173
			 | 
			
				
			 | 
			
			
				-	public void pushScreenToFirstBottomTab() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				174
			 | 
			
			
				+	public void pushScreenToFirstBottomTab() throws Exception { 
			 | 
		
	
		
			
			| 
				174
			 | 
			
				175
			 | 
			
			
				 		BottomTabs bottomTabsMock = mock(BottomTabs.class); 
			 | 
		
	
		
			
			| 
				175
			 | 
			
				176
			 | 
			
			
				 		when(bottomTabsMock.size()).thenReturn(0, 1); 
			 | 
		
	
		
			
			| 
				176
			 | 
			
				177
			 | 
			
			
				  
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -193,7 +194,7 @@ public class LayoutFactoryTest extends BaseTest { 
			 | 
		
	
		
			
			| 
				193
			 | 
			
				194
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				194
			 | 
			
				195
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				195
			 | 
			
				196
			 | 
			
			
				 	@Test 
			 | 
		
	
		
			
			| 
				196
			 | 
			
				
			 | 
			
			
				-	public void popScreenFromFirstBottomTab() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				197
			 | 
			
			
				+	public void popScreenFromFirstBottomTab() throws Exception { 
			 | 
		
	
		
			
			| 
				197
			 | 
			
				198
			 | 
			
			
				 		BottomTabs bottomTabsMock = mock(BottomTabs.class); 
			 | 
		
	
		
			
			| 
				198
			 | 
			
				199
			 | 
			
			
				 		when(bottomTabsMock.size()).thenReturn(0, 1); 
			 | 
		
	
		
			
			| 
				199
			 | 
			
				200
			 | 
			
			
				  
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -263,20 +264,20 @@ public class LayoutFactoryTest extends BaseTest { 
			 | 
		
	
		
			
			| 
				263
			 | 
			
				264
			 | 
			
			
				 		assertThat(result.getChildAt(0)).isEqualTo(mockView); 
			 | 
		
	
		
			
			| 
				264
			 | 
			
				265
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				265
			 | 
			
				266
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				266
			 | 
			
				
			 | 
			
			
				-	private void pushContainer(ContainerStackLayout containerStackLayout, String screenId, String reactRootViewKey, View rootView) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				267
			 | 
			
			
				+	private void pushContainer(ContainerStackLayout containerStackLayout, String screenId, String reactRootViewKey, View rootView) throws Exception { 
			 | 
		
	
		
			
			| 
				267
			 | 
			
				268
			 | 
			
			
				 		when(reactRootViewCreator.create(eq(screenId), eq(reactRootViewKey))).thenReturn(rootView); 
			 | 
		
	
		
			
			| 
				268
			 | 
			
				269
			 | 
			
			
				 		View pushedContainer = createLayoutFactory().create(createContainerNode(screenId, reactRootViewKey)); 
			 | 
		
	
		
			
			| 
				269
			 | 
			
				270
			 | 
			
			
				 		containerStackLayout.push(pushedContainer); 
			 | 
		
	
		
			
			| 
				270
			 | 
			
				271
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				271
			 | 
			
				272
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				272
			 | 
			
				
			 | 
			
			
				-	private void pushContainer(BottomTabsLayout containerStackLayout, String screenId, String reactRootViewKey, View rootView) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				273
			 | 
			
			
				+	private void pushContainer(BottomTabsLayout containerStackLayout, String screenId, String reactRootViewKey, View rootView) throws Exception { 
			 | 
		
	
		
			
			| 
				273
			 | 
			
				274
			 | 
			
			
				 		when(reactRootViewCreator.create(eq(screenId), eq(reactRootViewKey))).thenReturn(rootView); 
			 | 
		
	
		
			
			| 
				274
			 | 
			
				275
			 | 
			
			
				 		View pushedContainer = createLayoutFactory().create(createContainerNode(screenId, reactRootViewKey)); 
			 | 
		
	
		
			
			| 
				275
			 | 
			
				276
			 | 
			
			
				 		containerStackLayout.push(pushedContainer); 
			 | 
		
	
		
			
			| 
				276
			 | 
			
				277
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				277
			 | 
			
				278
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				278
			 | 
			
				279
			 | 
			
			
				 	@Test 
			 | 
		
	
		
			
			| 
				279
			 | 
			
				
			 | 
			
			
				-	public void popScreenFromScreenStackLayout() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				280
			 | 
			
			
				+	public void popScreenFromScreenStackLayout() throws Exception { 
			 | 
		
	
		
			
			| 
				280
			 | 
			
				281
			 | 
			
			
				 		when(reactRootViewCreator.create(eq(NODE_ID), eq(REACT_ROOT_VIEW_KEY))).thenReturn(mockView); 
			 | 
		
	
		
			
			| 
				281
			 | 
			
				282
			 | 
			
			
				 		final LayoutNode container = createContainerNode(); 
			 | 
		
	
		
			
			| 
				282
			 | 
			
				283
			 | 
			
			
				 		final LayoutNode stackNode = createContainerStackNode(container); 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -295,7 +296,7 @@ public class LayoutFactoryTest extends BaseTest { 
			 | 
		
	
		
			
			| 
				295
			 | 
			
				296
			 | 
			
			
				 	@Ignore 
			 | 
		
	
		
			
			| 
				296
			 | 
			
				297
			 | 
			
			
				 	public void throwsExceptionForUnknownType() throws Exception { 
			 | 
		
	
		
			
			| 
				297
			 | 
			
				298
			 | 
			
			
				 		when(reactRootViewCreator.create(eq(NODE_ID), eq(REACT_ROOT_VIEW_KEY))).thenReturn(mockView); 
			 | 
		
	
		
			
			| 
				298
			 | 
			
				
			 | 
			
			
				-		final LayoutNode node = new LayoutNode(NODE_ID, null, Collections.<String, Object>emptyMap(), Collections.<LayoutNode>emptyList()); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				299
			 | 
			
			
				+		final LayoutNode node = new LayoutNode(NODE_ID, null, new JSONObject(), Collections.<LayoutNode>emptyList()); 
			 | 
		
	
		
			
			| 
				299
			 | 
			
				300
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				300
			 | 
			
				301
			 | 
			
			
				 		createLayoutFactory().create(node); 
			 | 
		
	
		
			
			| 
				301
			 | 
			
				302
			 | 
			
			
				 	} 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -314,24 +315,22 @@ public class LayoutFactoryTest extends BaseTest { 
			 | 
		
	
		
			
			| 
				314
			 | 
			
				315
			 | 
			
			
				 		return new LayoutFactory(activity, reactRootViewCreator, bottomTabsCreator); 
			 | 
		
	
		
			
			| 
				315
			 | 
			
				316
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				316
			 | 
			
				317
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				317
			 | 
			
				
			 | 
			
			
				-	private LayoutNode createContainerNode() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				318
			 | 
			
			
				+	private LayoutNode createContainerNode() throws Exception { 
			 | 
		
	
		
			
			| 
				318
			 | 
			
				319
			 | 
			
			
				 		return createContainerNode(NODE_ID, REACT_ROOT_VIEW_KEY); 
			 | 
		
	
		
			
			| 
				319
			 | 
			
				320
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				320
			 | 
			
				321
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				321
			 | 
			
				
			 | 
			
			
				-	private LayoutNode createSideMenuLeftNode() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				322
			 | 
			
			
				+	private LayoutNode createSideMenuLeftNode() throws Exception { 
			 | 
		
	
		
			
			| 
				322
			 | 
			
				323
			 | 
			
			
				 		List<LayoutNode> children = Arrays.asList(createContainerNode()); 
			 | 
		
	
		
			
			| 
				323
			 | 
			
				324
			 | 
			
			
				 		return new LayoutNode("SideMenuLeft", LayoutNode.Type.SideMenuLeft, null, children); 
			 | 
		
	
		
			
			| 
				324
			 | 
			
				325
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				325
			 | 
			
				326
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				326
			 | 
			
				
			 | 
			
			
				-	private LayoutNode createSideMenuRightNode() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				327
			 | 
			
			
				+	private LayoutNode createSideMenuRightNode() throws Exception { 
			 | 
		
	
		
			
			| 
				327
			 | 
			
				328
			 | 
			
			
				 		List<LayoutNode> children = Arrays.asList(createContainerNode()); 
			 | 
		
	
		
			
			| 
				328
			 | 
			
				329
			 | 
			
			
				 		return new LayoutNode("SideMenuRight", LayoutNode.Type.SideMenuRight, null, children); 
			 | 
		
	
		
			
			| 
				329
			 | 
			
				330
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				330
			 | 
			
				331
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				331
			 | 
			
				
			 | 
			
			
				-	private LayoutNode createContainerNode(final String id, final String name) { 
			 | 
		
	
		
			
			| 
				332
			 | 
			
				
			 | 
			
			
				-		return new LayoutNode(id, LayoutNode.Type.Container, new HashMap<String, Object>() {{ 
			 | 
		
	
		
			
			| 
				333
			 | 
			
				
			 | 
			
			
				-			put("name", name); 
			 | 
		
	
		
			
			| 
				334
			 | 
			
				
			 | 
			
			
				-		}}, null); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				332
			 | 
			
			
				+	private LayoutNode createContainerNode(final String id, final String name) throws JSONException { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				333
			 | 
			
			
				+		return new LayoutNode(id, LayoutNode.Type.Container, new JSONObject().put("name", name), null); 
			 | 
		
	
		
			
			| 
				335
			 | 
			
				334
			 | 
			
			
				 	} 
			 | 
		
	
		
			
			| 
				336
			 | 
			
				335
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				337
			 | 
			
				336
			 | 
			
			
				 	private LayoutNode createSideMenuContainerNode(List<LayoutNode> children) { 
			 |