### Question:
JcrEngine extends ModeShapeEngine implements Repositories { @Override public void start() { super.start(); final JcrEngine engine = this; Runnable cleanUpTask = new Runnable() { public void run() { engine.cleanUpLocks(); } }; try { scheduler.scheduleAtFixedRate(cleanUpTask, LOCK_SWEEP_INTERVAL_IN_MILLIS, LOCK_SWEEP_INTERVAL_IN_MILLIS, TimeUnit.MILLISECONDS); checkProblemsOnStartup(); } catch (RuntimeException e) { try { super.shutdown(); } catch (Throwable t) { } throw e; } } JcrEngine( ExecutionContext context,
               ModeShapeConfiguration.ConfigurationDefinition configuration ); @Override boolean awaitTermination( long timeout,
                                     TimeUnit unit ); @Override void start(); String getEngineVersion(); final JcrRepository getRepository( String repositoryName ); Set<String> getRepositoryNames(); Map<String, Object> initDescriptors(); void shutdownAndAwaitTermination( long timeout,
                                             TimeUnit unit );  }### Answer:
@Test( expected = JcrConfigurationException.class ) public void shouldFailToStartIfAnyRepositorySourceDoesNotDefineClass() throws Exception { configuration = new JcrConfiguration(); configuration.repositorySource("car-source") .setDescription("The automobile content"); configuration.repository("cars") .setSource("car-source-non-existant") .registerNamespace("car", "http: .addNodeTypes(resourceUrl("cars.cnd")) .setOption(Option.ANONYMOUS_USER_ROLES, ModeShapeRoles.ADMIN); engine = configuration.build(); engine.start(); }
@Test( expected = JcrConfigurationException.class ) public void shouldFailToStartIfAnyRepositoryReferencesNonExistantSource() throws Exception { configuration = new JcrConfiguration(); configuration.repositorySource("car-source") .usingClass(InMemoryRepositorySource.class) .setDescription("The automobile content"); configuration.repository("cars") .setSource("car-source-non-existant") .registerNamespace("car", "http: .addNodeTypes(resourceUrl("cars.cnd")) .setOption(Option.ANONYMOUS_USER_ROLES, ModeShapeRoles.ADMIN); engine = configuration.build(); engine.start(); }