Package org.apache.aries.jpa.container.parsing.impl

Examples of org.apache.aries.jpa.container.parsing.impl.PersistenceDescriptorParserImpl$RememberingInputStream


      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);

      Bundle b = Skeleton.newMock(Bundle.class);
     
      Collection<ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);
      assertEquals("An incorrect number of persistence units has been returned.", 0, parsedUnits.size());
    } finally {
      if(is != null)
        is.close();
    }
View Full Code Here


      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
     
      Bundle b = Skeleton.newMock(Bundle.class);
     
      Collection<ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);

      fail("Parsing should not succeed");
    } finally {
      if(is != null)
        is.close();
View Full Code Here

      String location = "file22/META-INF/persistence.xml";
      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
     
      Bundle b = Skeleton.newMock(Bundle.class);
      List<ParsedPersistenceUnit> parsedUnits = getList(new PersistenceDescriptorParserImpl().parse(b, descriptor));
     
      assertEquals(2, parsedUnits.size());
     
      ParsedPersistenceUnit customUnit = parsedUnits.get(0);
      assertEquals("ENABLE_SELECTIVE", customUnit.getPersistenceXmlMetadata().get(ParsedPersistenceUnit.SHARED_CACHE_MODE));
View Full Code Here

      _logger.info(NLS.MESSAGES.getMessage("quiesce.manager.not.there"));
    }
  }

  private void initParser() {
    parser = new PersistenceDescriptorParserImpl();
    parserReg = ctx.registerService(PersistenceDescriptorParser.class.getName(), parser, null);
  }
View Full Code Here

      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
     
      Bundle b = Skeleton.newMock(Bundle.class);
     
      Collection<? extends ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);
      assertEquals("An incorrect number of persistence units has been returned.", 4, parsedUnits.size());
     
      List<ParsedPersistenceUnit> units = getList(parsedUnits);
     
      ParsedPersistenceUnit unit = units.get(0);
View Full Code Here

      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);

      Bundle b = Skeleton.newMock(Bundle.class);
     
      Collection<? extends ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);
      assertEquals("An incorrect number of persistence units has been returned.", 0, parsedUnits.size());
    } finally {
      if(is != null)
        is.close();
    }
View Full Code Here

      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
     
      Bundle b = Skeleton.newMock(Bundle.class);
     
      Collection<? extends ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);

      fail("Parsing should not succeed");
    } finally {
      if(is != null)
        is.close();
View Full Code Here

      String location = "file22/META-INF/persistence.xml";
      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
     
      Bundle b = Skeleton.newMock(Bundle.class);
      List<ParsedPersistenceUnit> parsedUnits = getList(new PersistenceDescriptorParserImpl().parse(b, descriptor));
     
      assertEquals(2, parsedUnits.size());
     
      ParsedPersistenceUnit customUnit = parsedUnits.get(0);
      assertEquals("ENABLE_SELECTIVE", customUnit.getPersistenceXmlMetadata().get(ParsedPersistenceUnit.SHARED_CACHE_MODE));
View Full Code Here

      is = getClass().getClassLoader().getResourceAsStream(location);
      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
     
      Bundle b = Skeleton.newMock(Bundle.class);
     
      Collection<? extends ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);
      assertEquals("An incorrect number of persistence units has been returned.", 33, parsedUnits.size());
     
      List<ParsedPersistenceUnit> units = getList(parsedUnits);
     
      Collections.sort(units, new Comparator<ParsedPersistenceUnit>() {
View Full Code Here

        is = getClass().getClassLoader().getResourceAsStream(location);
        PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
       
        Bundle b = Skeleton.newMock(Bundle.class);
       
        Collection<? extends ParsedPersistenceUnit> parsedUnits = new PersistenceDescriptorParserImpl().parse(b, descriptor);
        assertEquals("An incorrect number of persistence units has been returned.", 1, parsedUnits.size());
      
      } finally {
        if(is != null)
          is.close();
View Full Code Here

TOP

Related Classes of org.apache.aries.jpa.container.parsing.impl.PersistenceDescriptorParserImpl$RememberingInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.