Ejemplo n.º 1
0
 @Test
 public void testPersistModule() {
   PersistProviderModule persistModule = SystemProvider.getProviderModule(adObject);
   try {
     persistModule.runWithoutPersisting();
   } catch (PersistException ex) {
     log.error("Got error while running persist test", ex);
     Assert.fail();
   }
 }
Ejemplo n.º 2
0
 @Test
 public void testPersistModuleOnClosingAd() {
   PersistProviderModule persistModule = SystemProvider.getProviderModule(adObject);
   try {
     // not we are not persisting the adobject to the database, because we don't have zett
     // database.
     AdObject inputAdObject = persistModule.getInputAdObject();
     Assert.assertNotNull(inputAdObject);
     persistModule.setAdToClosed();
     Assert.assertEquals(ObjectStatus.DELETED, inputAdObject.getStatus());
   } catch (PersistException ex) {
     log.error("Got error while running persistModuleOnClosing Ad");
   }
 }
Ejemplo n.º 3
0
  private static Map<String, SystemProvider> getSystemProviderMap()
      throws ServiceConfigurationError {
    if (systemProviderMap.isEmpty()) {
      @SuppressWarnings("unchecked")
      Iterator<SystemProvider> displayProviders = Service.providers(SystemProvider.class);
      while (displayProviders.hasNext()) {
        SystemProvider provider = (SystemProvider) displayProviders.next();
        systemProviderMap.put(provider.getProviderIdentifier(), provider);
      }

      // if the provider map is still empty (no providers found),
      if (systemProviderMap.isEmpty()) {
        // insert the default
        SystemProvider sp = new LWJGLSystemProvider();
        systemProviderMap.put(sp.getProviderIdentifier(), sp);
        sp = new JOGLSystemProvider();
        systemProviderMap.put(sp.getProviderIdentifier(), sp);
        sp = new DummySystemProvider();
        systemProviderMap.put(sp.getProviderIdentifier(), sp);
      }
    }

    return systemProviderMap;
  }
Ejemplo n.º 4
0
 public static synchronized void resetSystemProvider() {
   if (system != null) {
     system.disposeDisplaySystem();
     system = null;
   }
 }