@Test(expected = InformationNeedNotResolvableException.class) public void testResolveWithNullValue() throws InformationNeedNotResolvableException { InformationType expectedInformation = new InformationType(Element.class, "unsupported", ""); analyzer.resolve(expectedInformation, parameters); }
@Override public AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters) throws InformationNeedNotResolvableException { if (providers.stream().noneMatch((provider) -> provider.provides(expectedInformation, parameters.getTypes()))) { throw new InformationNeedNotResolvableException("No provider supports the information need."); } InformationProvider providerSupportingInformationNeed = providers.stream() .filter((provider) -> provider.provides(expectedInformation, parameters.getTypes())).findFirst().get(); AnalyzerResult analyzerResult = new SimpleAnalyzerResult(providerSupportingInformationNeed.resolve(expectedInformation, parameters)); return analyzerResult; }
SimpleAnalyzer implements Analyzer { @Override public AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters) throws InformationNeedNotResolvableException { if (providers.stream().noneMatch((provider) -> provider.provides(expectedInformation, parameters.getTypes()))) { throw new InformationNeedNotResolvableException("No provider supports the information need."); } InformationProvider providerSupportingInformationNeed = providers.stream() .filter((provider) -> provider.provides(expectedInformation, parameters.getTypes())).findFirst().get(); AnalyzerResult analyzerResult = new SimpleAnalyzerResult(providerSupportingInformationNeed.resolve(expectedInformation, parameters)); return analyzerResult; } }
SimpleAnalyzer implements Analyzer { @Override public AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters) throws InformationNeedNotResolvableException { if (providers.stream().noneMatch((provider) -> provider.provides(expectedInformation, parameters.getTypes()))) { throw new InformationNeedNotResolvableException("No provider supports the information need."); } InformationProvider providerSupportingInformationNeed = providers.stream() .filter((provider) -> provider.provides(expectedInformation, parameters.getTypes())).findFirst().get(); AnalyzerResult analyzerResult = new SimpleAnalyzerResult(providerSupportingInformationNeed.resolve(expectedInformation, parameters)); return analyzerResult; } SimpleAnalyzer(Project project); }
SimpleAnalyzer implements Analyzer { @Override public AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters) throws InformationNeedNotResolvableException { if (providers.stream().noneMatch((provider) -> provider.provides(expectedInformation, parameters.getTypes()))) { throw new InformationNeedNotResolvableException("No provider supports the information need."); } InformationProvider providerSupportingInformationNeed = providers.stream() .filter((provider) -> provider.provides(expectedInformation, parameters.getTypes())).findFirst().get(); AnalyzerResult analyzerResult = new SimpleAnalyzerResult(providerSupportingInformationNeed.resolve(expectedInformation, parameters)); return analyzerResult; } SimpleAnalyzer(Project project); @Override Project getProject(); @Override void setProject(Project project); @Override AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters); @Override void setProviders(Collection<InformationProvider> providers); @Override void addInformationProvider(InformationProvider informationProvider); @Override Set<InformationProvider> getInformationProviders(); }
SimpleAnalyzer implements Analyzer { @Override public AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters) throws InformationNeedNotResolvableException { if (providers.stream().noneMatch((provider) -> provider.provides(expectedInformation, parameters.getTypes()))) { throw new InformationNeedNotResolvableException("No provider supports the information need."); } InformationProvider providerSupportingInformationNeed = providers.stream() .filter((provider) -> provider.provides(expectedInformation, parameters.getTypes())).findFirst().get(); AnalyzerResult analyzerResult = new SimpleAnalyzerResult(providerSupportingInformationNeed.resolve(expectedInformation, parameters)); return analyzerResult; } SimpleAnalyzer(Project project); @Override Project getProject(); @Override void setProject(Project project); @Override AnalyzerResult resolve(InformationType expectedInformation, ParameterList parameters); @Override void setProviders(Collection<InformationProvider> providers); @Override void addInformationProvider(InformationProvider informationProvider); @Override Set<InformationProvider> getInformationProviders();  }