@Test public void testLonger() throws Exception { SourceService DRL = getSourceService(".drl"); SourceService modelDRL = getSourceService(".model.drl"); addToList(DRL, modelDRL); assertEquals(modelDRL, new SourceServicesImpl(instance).getServiceFor(makePath("myFile", ".model.drl"))); sourceServices.clear(); addToList(modelDRL, DRL); assertEquals(modelDRL, new SourceServicesImpl(instance).getServiceFor(makePath("myFile", ".model.drl"))); }
@Override public SourceService getServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); if ( sourceService == null ) { throw new IllegalArgumentException( "No SourceService found for '" + path + "'." ); } return sourceService; } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } }
SourceServicesImpl implements SourceServices { @Override public SourceService getServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); if ( sourceService == null ) { throw new IllegalArgumentException( "No SourceService found for '" + path + "'." ); } return sourceService; } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } } }
SourceServicesImpl implements SourceServices { @Override public SourceService getServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); if ( sourceService == null ) { throw new IllegalArgumentException( "No SourceService found for '" + path + "'." ); } return sourceService; } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } } SourceServicesImpl(); @Inject  SourceServicesImpl( @Any Instance<SourceService<?>> sourceServiceList ); }
SourceServicesImpl implements SourceServices { @Override public SourceService getServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); if ( sourceService == null ) { throw new IllegalArgumentException( "No SourceService found for '" + path + "'." ); } return sourceService; } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } } SourceServicesImpl(); @Inject  SourceServicesImpl( @Any Instance<SourceService<?>> sourceServiceList ); @Override boolean hasServiceFor( final Path path ); @Override SourceService getServiceFor( final Path path ); }
SourceServicesImpl implements SourceServices { @Override public SourceService getServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); if ( sourceService == null ) { throw new IllegalArgumentException( "No SourceService found for '" + path + "'." ); } return sourceService; } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } } SourceServicesImpl(); @Inject  SourceServicesImpl( @Any Instance<SourceService<?>> sourceServiceList ); @Override boolean hasServiceFor( final Path path ); @Override SourceService getServiceFor( final Path path );  }