ApplicationMngrImpl implements IApplicationMngr { static void checkErrors( Collection<RoboconfError> errors, Logger logger ) throws InvalidApplicationException { if( RoboconfErrorHelpers.containsCriticalErrors( errors )) throw new InvalidApplicationException( errors ); Collection<RoboconfError> warnings = RoboconfErrorHelpers.findWarnings( errors ); for( String warningMsg : RoboconfErrorHelpers.formatErrors( warnings, null, true ).values()) logger.warning( warningMsg ); } ApplicationMngrImpl(
			INotificationMngr notificationMngr,
			IConfigurationMngr configurationMngr,
			ITargetsMngr targetsMngr,
			IMessagingMngr messagingMngr,
			IRandomMngr randomMngr,
			IAutonomicMngr autonomicMngr ); void setApplicationTemplateMngr( IApplicationTemplateMngr applicationTemplateMngr ); @Override Application findApplicationByName( String applicationName ); @Override ManagedApplication findManagedApplicationByName( String applicationName ); @Override Collection<ManagedApplication> getManagedApplications(); @Override ManagedApplication createApplication( String name, String description, String tplName, String tplQualifier ); @Override ManagedApplication createApplication( String name, String description, ApplicationTemplate tpl ); @Override void updateApplication( ManagedApplication ma, String newDesc ); @Override void deleteApplication( ManagedApplication ma ); @Override void restoreApplications(); @Override boolean isTemplateUsed( ApplicationTemplate tpl ); @Override void bindOrUnbindApplication( ManagedApplication ma, String externalExportPrefix, String applicationName, boolean bind ); @Override void replaceApplicationBindings( ManagedApplication ma, String externalExportPrefix, Set<String> applicationNames );  }
@Test public void testCheckErrors_noError() throws Exception { ApplicationMngrImpl.checkErrors( new ArrayList<RoboconfError>( 0 ), Logger.getLogger( getClass().getName())); }
@Test( expected = InvalidApplicationException.class ) public void testCheckErrors_withError() throws Exception { List<RoboconfError> errors = new ArrayList<> (); errors.add( new RoboconfError( ErrorCode.CO_CYCLE_IN_COMPONENTS_INHERITANCE )); ApplicationMngrImpl.checkErrors( errors, Logger.getLogger( getClass().getName())); }
@Test public void testCheckErrors_withWarning() throws Exception { List<RoboconfError> errors = new ArrayList<> (); errors.add( new RoboconfError( ErrorCode.RM_MISSING_APPLICATION_DSL_ID )); ApplicationMngrImpl.checkErrors( errors, Logger.getLogger( getClass().getName())); }