incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <christophe.lomb...@gmail.com>
Subject Re: svn commit: r375574 - /incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
Date Tue, 07 Feb 2006 10:48:19 GMT
very good ! I'm starting the doc for the PersistenceManager setup and
I planned to make this kind of proposal - Thanks ! I have just to
write the doc :-)

On 2/7/06, apopescu@apache.org <apopescu@apache.org> wrote:
> Author: apopescu
> Date: Tue Feb  7 02:41:52 2006
> New Revision: 375574
>
> URL: http://svn.apache.org/viewcvs?rev=375574&view=rev
> Log:
> initialization of PersistenceManagerImpl changed
>
> Modified:
>     incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
>
> Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
> URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java?rev=375574&r1=375573&r2=375574&view=diff
> ==============================================================================
> --- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
(original)
> +++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
Tue Feb  7 02:41:52 2006
> @@ -27,6 +27,7 @@
>  import java.util.Date;
>  import java.util.GregorianCalendar;
>  import java.util.HashMap;
> +import java.util.Map;
>
>  import javax.jcr.ImportUUIDBehavior;
>  import javax.jcr.Repository;
> @@ -45,10 +46,12 @@
>  import org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader;
>  import org.apache.portals.graffito.jcr.mapper.impl.DigesterMapperImpl;
>  import org.apache.portals.graffito.jcr.persistence.PersistenceManager;
> +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverterProvider;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.BinaryTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.BooleanTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.ByteArrayTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.CalendarTypeConverterImpl;
> +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.DefaultAtomicTypeConverterProvider;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.DoubleTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.IntTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.LongTypeConverterImpl;
> @@ -56,6 +59,8 @@
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.TimestampTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.UtilDateTypeConverterImpl;
>  import org.apache.portals.graffito.jcr.persistence.impl.PersistenceManagerImpl;
> +import org.apache.portals.graffito.jcr.persistence.objectconverter.ObjectConverter;
> +import org.apache.portals.graffito.jcr.persistence.objectconverter.impl.ObjectConverterImpl;
>  import org.apache.portals.graffito.jcr.query.QueryManager;
>  import org.apache.portals.graffito.jcr.query.impl.QueryManagerImpl;
>  import org.apache.portals.graffito.jcr.repository.RepositoryUtil;
> @@ -173,27 +178,13 @@
>                 Repository repository = RepositoryUtil.getRepository("repositoryTest");
>                 String[] files = { "./src/test-config/jcrmapping.xml", "./src/test-config/jcrmapping-atomic.xml"
};
>                 session = RepositoryUtil.login(repository, "superuser", "superuser");
> -               HashMap atomicTypeConverters = new HashMap();
> -               atomicTypeConverters.put(String.class, new StringTypeConverterImpl());
> -               atomicTypeConverters.put(InputStream.class, new BinaryTypeConverterImpl());
> -               atomicTypeConverters.put(long.class, new LongTypeConverterImpl());
> -               atomicTypeConverters.put(Long.class, new LongTypeConverterImpl());
> -               atomicTypeConverters.put(int.class, new IntTypeConverterImpl());
> -               atomicTypeConverters.put(Integer.class, new IntTypeConverterImpl());
> -               atomicTypeConverters.put(double.class, new DoubleTypeConverterImpl());
> -               atomicTypeConverters.put(Double.class, new DoubleTypeConverterImpl());
> -               atomicTypeConverters.put(boolean.class, new BooleanTypeConverterImpl());
> -               atomicTypeConverters.put(Boolean.class, new BooleanTypeConverterImpl());
> -               atomicTypeConverters.put(Calendar.class, new CalendarTypeConverterImpl());
> -               atomicTypeConverters.put(GregorianCalendar.class, new CalendarTypeConverterImpl());
> -               atomicTypeConverters.put(Date.class, new UtilDateTypeConverterImpl());
> -               atomicTypeConverters.put(byte[].class, new ByteArrayTypeConverterImpl());
> -               atomicTypeConverters.put(Timestamp.class, new TimestampTypeConverterImpl());
>
> -               mapper = new DigesterMapperImpl(files);
> +               mapper = new DigesterMapperImpl(files);
> +        AtomicTypeConverterProvider converterProvider = new DefaultAtomicTypeConverterProvider();
> +        Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
>                 queryManager = new QueryManagerImpl(mapper, atomicTypeConverters);
> -               persistenceManager = new PersistenceManagerImpl(mapper, atomicTypeConverters,
queryManager, session);
> -
> +        ObjectConverter objectConverter = new ObjectConverterImpl(mapper, converterProvider);
> +               persistenceManager = new PersistenceManagerImpl(mapper, objectConverter,
queryManager, session);
>         }
>
>         /**
>
>
>


--
Best regards,

Christophe

Mime
View raw message