Hi David,Thanks for this additional bit of data, and your analysis. It changed my understanding of how it works (surprise!)
Craig On Feb 11, 2008, at 10:33 AM, David Ezzio wrote:
Hi Craig,At r619280, TestJoin.java was in UNIX line endings with EOL style of "as-is". TestPersistence.java was in DOS line endings with EOL style of "as-is". On a DOS client, I changed the EOL-style to "native" for both files and committed at r619411. As you can see from the report below, TestJoin.java had only its props changed, while TestPersistence.java had both its props and contents changed.So the bottom line is, if I understand things correctly, we can change all "as-is" files with UNIX line endings to "native" without introducing a change in the contents, but it is not yet apparent how to do that for the "as-is" files with DOS line endings.Cheers, David Craig L Russell wrote:Hi David,A bit more detail, please. What client were you on? I assume DOS. Which file had CRLF? I assume TestJoin.java.Craig On Feb 7, 2008, at 5:47 AM, [EMAIL PROTECTED] wrote:Author: dezzio Date: Thu Feb 7 05:47:48 2008 New Revision: 619411 URL: http://svn.apache.org/viewvc?rev=619411&view=rev Log:Test conversion of svn:eol-style from as-is to native. One file in DOS line endings and one file in Unix line endings. Neither file changed on client, only their svn:eol-style property has been changed by this update.Modified:openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/ openjpa/persistence/simple/TestJoin.java (props changed) openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/ openjpa/persistence/simple/TestPersistence.java (contents, props changed)Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/ org/apache/openjpa/persistence/simple/TestJoin.java------------------------------------------------------------------------------ svn:eol-style = nativeModified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/ apache/openjpa/persistence/simple/TestPersistence.javaURL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java?rev=619411&r1=619410&r2=619411&view=diff= = = = = = = = = = ==================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/ apache/openjpa/persistence/simple/TestPersistence.java (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/ apache/openjpa/persistence/simple/TestPersistence.java Thu Feb 7 05:47:48 2008@@ -1,94 +1,94 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openjpa.persistence.simple; - -import javax.persistence.EntityManager; -import javax.persistence.EntityTransaction; - -import junit.textui.TestRunner; -import org.apache.openjpa.persistence.OpenJPAEntityManager; -import org.apache.openjpa.persistence.test.SingleEMFTestCase; - -/**- * Simple test case to get an EntityManager and perform some basic operations.- * - * @author Marc Prud'hommeaux - */ -public class TestPersistence - extends SingleEMFTestCase { - - public void setUp() { - setUp(AllFieldTypes.class); - } - - public void testCreateEntityManager() { - EntityManager em = emf.createEntityManager(); - - EntityTransaction t = em.getTransaction(); - assertNotNull(t); - t.begin(); - t.setRollbackOnly(); - t.rollback(); - - // openjpa-facade test - assertTrue(em instanceof OpenJPAEntityManager); - OpenJPAEntityManager ojem = (OpenJPAEntityManager) em; - ojem.getFetchPlan().setMaxFetchDepth(1); - assertEquals(1, ojem.getFetchPlan().getMaxFetchDepth()); - em.close(); - } - - public void testPersist() { - EntityManager em = emf.createEntityManager(); - em.getTransaction().begin(); - em.persist(new AllFieldTypes()); - em.getTransaction().commit(); - em.close(); - } - - public void testQuery() { - EntityManager em = emf.createEntityManager(); - em.getTransaction().begin(); - AllFieldTypes aft = new AllFieldTypes(); - aft.setStringField("foo"); - aft.setIntField(10); - em.persist(aft); - em.getTransaction().commit(); - em.close(); - - em = emf.createEntityManager(); - em.getTransaction().begin(); - assertEquals(1, em.createQuery- ("select x from AllFieldTypes x where x.stringField = 'foo'").- getResultList().size()); - assertEquals(0, em.createQuery- ("select x from AllFieldTypes x where x.stringField = 'bar'").- getResultList().size()); - assertEquals(1, em.createQuery- ("select x from AllFieldTypes x where x.intField >= 10").- getResultList().size()); - em.getTransaction().rollback(); - em.close(); - } - - public static void main(String[] args) { - TestRunner.run(TestPersistence.class); - } -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.simple; + +import javax.persistence.EntityManager; +import javax.persistence.EntityTransaction; + +import junit.textui.TestRunner; +import org.apache.openjpa.persistence.OpenJPAEntityManager; +import org.apache.openjpa.persistence.test.SingleEMFTestCase; + +/**+ * Simple test case to get an EntityManager and perform some basic operations.+ * + * @author Marc Prud'hommeaux + */ +public class TestPersistence + extends SingleEMFTestCase { + + public void setUp() { + setUp(AllFieldTypes.class); + } + + public void testCreateEntityManager() { + EntityManager em = emf.createEntityManager(); + + EntityTransaction t = em.getTransaction(); + assertNotNull(t); + t.begin(); + t.setRollbackOnly(); + t.rollback(); + + // openjpa-facade test + assertTrue(em instanceof OpenJPAEntityManager); + OpenJPAEntityManager ojem = (OpenJPAEntityManager) em; + ojem.getFetchPlan().setMaxFetchDepth(1); + assertEquals(1, ojem.getFetchPlan().getMaxFetchDepth()); + em.close(); + } + + public void testPersist() { + EntityManager em = emf.createEntityManager(); + em.getTransaction().begin(); + em.persist(new AllFieldTypes()); + em.getTransaction().commit(); + em.close(); + } + + public void testQuery() { + EntityManager em = emf.createEntityManager(); + em.getTransaction().begin(); + AllFieldTypes aft = new AllFieldTypes(); + aft.setStringField("foo"); + aft.setIntField(10); + em.persist(aft); + em.getTransaction().commit(); + em.close(); + + em = emf.createEntityManager(); + em.getTransaction().begin(); + assertEquals(1, em.createQuery+ ("select x from AllFieldTypes x where x.stringField = 'foo'").+ getResultList().size()); + assertEquals(0, em.createQuery+ ("select x from AllFieldTypes x where x.stringField = 'bar'").+ getResultList().size()); + assertEquals(1, em.createQuery+ ("select x from AllFieldTypes x where x.intField >= 10").+ getResultList().size()); + em.getTransaction().rollback(); + em.close(); + } + + public static void main(String[] args) { + TestRunner.run(TestPersistence.class); + } +} +Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/ org/apache/openjpa/persistence/simple/TestPersistence.java------------------------------------------------------------------------------ svn:eol-style = nativeCraig RussellArchitect, Sun Java Enterprise System http://java.sun.com/products/ jdo408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
