@Test public void testGetURLConnectionProvider() throws Exception { InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0); ViewEntity viewDefinition = ViewEntityTest.getViewEntity(); ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig); ViewRegistry viewRegistry = createNiceMock(ViewRegistry.class); ViewURLStreamProvider urlStreamProvider = createNiceMock(ViewURLStreamProvider.class); ResourceProvider provider = createNiceMock(ResourceProvider.class); Resource.Type type = new Resource.Type("MY_VIEW/myType"); viewInstanceDefinition.addResourceProvider(type, provider); ViewContext viewContext = new ViewContextImpl(viewInstanceDefinition, viewRegistry); expect(viewRegistry.createURLStreamProvider(viewContext)).andReturn(urlStreamProvider); replay(viewRegistry); Assert.assertEquals(urlStreamProvider, viewContext.getURLConnectionProvider()); verify(viewRegistry); }
@Override public URLConnectionProvider getURLConnectionProvider() { return viewRegistry.createURLStreamProvider(this); }
ViewContextImpl implements ViewContext, ViewController { @Override public URLConnectionProvider getURLConnectionProvider() { return viewRegistry.createURLStreamProvider(this); } }
ViewContextImpl implements ViewContext, ViewController { @Override public URLConnectionProvider getURLConnectionProvider() { return viewRegistry.createURLStreamProvider(this); } ViewContextImpl(ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry);  ViewContextImpl(ViewEntity viewEntity, ViewRegistry viewRegistry); private  ViewContextImpl(ViewEntity viewEntity, ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry); }
ViewContextImpl implements ViewContext, ViewController { @Override public URLConnectionProvider getURLConnectionProvider() { return viewRegistry.createURLStreamProvider(this); } ViewContextImpl(ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry);  ViewContextImpl(ViewEntity viewEntity, ViewRegistry viewRegistry); private  ViewContextImpl(ViewEntity viewEntity, ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry); @Override String getViewName(); @Override ViewDefinition getViewDefinition(); @Override String getInstanceName(); @Override ViewInstanceDefinition getViewInstanceDefinition(); @Override Map<String, String> getProperties(); @Transactional @Override void putInstanceData(String key, String value); @Override String getInstanceData(String key); @Override Map<String, String> getInstanceData(); @Override void removeInstanceData(String key); @Override String getAmbariProperty(String key); @Override ResourceProvider<?> getResourceProvider(String type); @Override String getUsername(); @Override String getLoggedinUser(); @Override void hasPermission(String userName, String permissionName); @Override org.apache.ambari.view.URLStreamProvider getURLStreamProvider(); @Override URLConnectionProvider getURLConnectionProvider(); @Override synchronized AmbariStreamProvider getAmbariStreamProvider(); @Override AmbariStreamProvider getAmbariClusterStreamProvider(); @Override synchronized DataStore getDataStore(); @Override Collection<ViewDefinition> getViewDefinitions(); @Override Collection<ViewInstanceDefinition> getViewInstanceDefinitions(); @Override ViewController getController(); @Override HttpImpersonatorImpl getHttpImpersonator(); @Override ImpersonatorSetting getImpersonatorSetting(); @Override Cluster getCluster(); @Override void fireEvent(String eventId, Map<String, String> eventProperties); @Override void registerListener(Listener listener, String viewName); @Override void registerListener(Listener listener, String viewName, String viewVersion); @Override void unregisterListener(Listener listener, String viewName); @Override void unregisterListener(Listener listener, String viewName, String viewVersion); }
ViewContextImpl implements ViewContext, ViewController { @Override public URLConnectionProvider getURLConnectionProvider() { return viewRegistry.createURLStreamProvider(this); } ViewContextImpl(ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry);  ViewContextImpl(ViewEntity viewEntity, ViewRegistry viewRegistry); private  ViewContextImpl(ViewEntity viewEntity, ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry); @Override String getViewName(); @Override ViewDefinition getViewDefinition(); @Override String getInstanceName(); @Override ViewInstanceDefinition getViewInstanceDefinition(); @Override Map<String, String> getProperties(); @Transactional @Override void putInstanceData(String key, String value); @Override String getInstanceData(String key); @Override Map<String, String> getInstanceData(); @Override void removeInstanceData(String key); @Override String getAmbariProperty(String key); @Override ResourceProvider<?> getResourceProvider(String type); @Override String getUsername(); @Override String getLoggedinUser(); @Override void hasPermission(String userName, String permissionName); @Override org.apache.ambari.view.URLStreamProvider getURLStreamProvider(); @Override URLConnectionProvider getURLConnectionProvider(); @Override synchronized AmbariStreamProvider getAmbariStreamProvider(); @Override AmbariStreamProvider getAmbariClusterStreamProvider(); @Override synchronized DataStore getDataStore(); @Override Collection<ViewDefinition> getViewDefinitions(); @Override Collection<ViewInstanceDefinition> getViewInstanceDefinitions(); @Override ViewController getController(); @Override HttpImpersonatorImpl getHttpImpersonator(); @Override ImpersonatorSetting getImpersonatorSetting(); @Override Cluster getCluster(); @Override void fireEvent(String eventId, Map<String, String> eventProperties); @Override void registerListener(Listener listener, String viewName); @Override void registerListener(Listener listener, String viewName, String viewVersion); @Override void unregisterListener(Listener listener, String viewName); @Override void unregisterListener(Listener listener, String viewName, String viewVersion); static final String HADOOP_SECURITY_AUTH_TO_LOCAL; static final String CORE_SITE; static final String HDFS_AUTH_TO_LOCAL; }