Re: svn commit: r1762349 - in /ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity: DelegatorUnitTests.java util/EntitySaxReaderTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1762349 - in /ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity: DelegatorUnitTests.java util/EntitySaxReaderTests.java

Jacopo Cappellato-5
Taher,

thanks for your review and for improving the code in the tests I have
recently implemented!

Much appreciated,

Jacopo

On Mon, Sep 26, 2016 at 7:20 PM, <[hidden email]> wrote:

> Author: taher
> Date: Mon Sep 26 17:20:20 2016
> New Revision: 1762349
>
> URL: http://svn.apache.org/viewvc?rev=1762349&view=rev
> Log:
> Fixed: Adjusting access to static resources statically in entity unit tests
>
> Minor fix in the preparation of resources to be used in unit tests to be
> accessed statically instead of dynamically.
>
> Modified:
>     ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/
> DelegatorUnitTests.java
>     ofbiz/trunk/framework/entity/src/test/java/org/apache/
> ofbiz/entity/util/EntitySaxReaderTests.java
>
> Modified: ofbiz/trunk/framework/entity/src/test/java/org/apache/
> ofbiz/entity/DelegatorUnitTests.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/
> src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java?rev=
> 1762349&r1=1762348&r2=1762349&view=diff
> ============================================================
> ==================
> --- ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java
> (original)
> +++ ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java
> Mon Sep 26 17:20:20 2016
> @@ -68,16 +68,15 @@ public class DelegatorUnitTests {
>
>      @Test
>      public void delegatorCreationUsingFactoryGetDelegator() {
> -        DelegatorFactory df = new DelegatorFactoryImpl();
> -        Delegator delegator = df.getDelegator("default");
> +        Delegator delegator = DelegatorFactory.getDelegator("default");
>          assertNotNull(delegator);
>          assertTrue(delegator instanceof GenericDelegator);
>          assertEquals(delegator.getOriginalDelegatorName(), "default");
>          assertEquals(delegator.getDelegatorBaseName(), "default");
>          assertEquals(delegator.getDelegatorName(), "default");
> -        Delegator delegatorWithSameName = df.getDelegator("default");
> +        Delegator delegatorWithSameName = DelegatorFactory.getDelegator(
> "default");
>          assertSame(delegator, delegatorWithSameName);
> -        Delegator delegatorWithNullName = df.getDelegator(null);
> +        Delegator delegatorWithNullName = DelegatorFactory.getDelegator(
> null);
>          assertSame(delegator, delegatorWithNullName);
>      }
>
>
> Modified: ofbiz/trunk/framework/entity/src/test/java/org/apache/
> ofbiz/entity/util/EntitySaxReaderTests.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/
> src/test/java/org/apache/ofbiz/entity/util/EntitySaxReaderTests.java?rev=
> 1762349&r1=1762348&r2=1762349&view=diff
> ============================================================
> ==================
> --- ofbiz/trunk/framework/entity/src/test/java/org/apache/
> ofbiz/entity/util/EntitySaxReaderTests.java (original)
> +++ ofbiz/trunk/framework/entity/src/test/java/org/apache/
> ofbiz/entity/util/EntitySaxReaderTests.java Mon Sep 26 17:20:20 2016
> @@ -33,7 +33,7 @@ public class EntitySaxReaderTests {
>          EntitySaxReader esr = new EntitySaxReader(delegator); // create a
> reader with default tx timeout
>          verify(delegator).cloneDelegator();
>          verifyNoMoreInteractions(delegator);
> -        assertEquals(esr.DEFAULT_TX_TIMEOUT,
> esr.getTransactionTimeout());
> +        assertEquals(EntitySaxReader.DEFAULT_TX_TIMEOUT,
> esr.getTransactionTimeout());
>      }
>
>      @Test
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1762349 - in /ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity: DelegatorUnitTests.java util/EntitySaxReaderTests.java

taher
Thank you Jacopo, it was only a minor fix :) I've to note it's GREAT to see
more unit tests getting into the code base.

On Tue, Sep 27, 2016 at 11:19 AM, Jacopo Cappellato <
[hidden email]> wrote:

> Taher,
>
> thanks for your review and for improving the code in the tests I have
> recently implemented!
>
> Much appreciated,
>
> Jacopo
>
> On Mon, Sep 26, 2016 at 7:20 PM, <[hidden email]> wrote:
>
> > Author: taher
> > Date: Mon Sep 26 17:20:20 2016
> > New Revision: 1762349
> >
> > URL: http://svn.apache.org/viewvc?rev=1762349&view=rev
> > Log:
> > Fixed: Adjusting access to static resources statically in entity unit
> tests
> >
> > Minor fix in the preparation of resources to be used in unit tests to be
> > accessed statically instead of dynamically.
> >
> > Modified:
> >     ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/
> > DelegatorUnitTests.java
> >     ofbiz/trunk/framework/entity/src/test/java/org/apache/
> > ofbiz/entity/util/EntitySaxReaderTests.java
> >
> > Modified: ofbiz/trunk/framework/entity/src/test/java/org/apache/
> > ofbiz/entity/DelegatorUnitTests.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/
> > src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java?rev=
> > 1762349&r1=1762348&r2=1762349&view=diff
> > ============================================================
> > ==================
> > --- ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/
> DelegatorUnitTests.java
> > (original)
> > +++ ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/
> DelegatorUnitTests.java
> > Mon Sep 26 17:20:20 2016
> > @@ -68,16 +68,15 @@ public class DelegatorUnitTests {
> >
> >      @Test
> >      public void delegatorCreationUsingFactoryGetDelegator() {
> > -        DelegatorFactory df = new DelegatorFactoryImpl();
> > -        Delegator delegator = df.getDelegator("default");
> > +        Delegator delegator = DelegatorFactory.getDelegator("default");
> >          assertNotNull(delegator);
> >          assertTrue(delegator instanceof GenericDelegator);
> >          assertEquals(delegator.getOriginalDelegatorName(), "default");
> >          assertEquals(delegator.getDelegatorBaseName(), "default");
> >          assertEquals(delegator.getDelegatorName(), "default");
> > -        Delegator delegatorWithSameName = df.getDelegator("default");
> > +        Delegator delegatorWithSameName = DelegatorFactory.getDelegator(
> > "default");
> >          assertSame(delegator, delegatorWithSameName);
> > -        Delegator delegatorWithNullName = df.getDelegator(null);
> > +        Delegator delegatorWithNullName = DelegatorFactory.getDelegator(
> > null);
> >          assertSame(delegator, delegatorWithNullName);
> >      }
> >
> >
> > Modified: ofbiz/trunk/framework/entity/src/test/java/org/apache/
> > ofbiz/entity/util/EntitySaxReaderTests.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/
> > src/test/java/org/apache/ofbiz/entity/util/
> EntitySaxReaderTests.java?rev=
> > 1762349&r1=1762348&r2=1762349&view=diff
> > ============================================================
> > ==================
> > --- ofbiz/trunk/framework/entity/src/test/java/org/apache/
> > ofbiz/entity/util/EntitySaxReaderTests.java (original)
> > +++ ofbiz/trunk/framework/entity/src/test/java/org/apache/
> > ofbiz/entity/util/EntitySaxReaderTests.java Mon Sep 26 17:20:20 2016
> > @@ -33,7 +33,7 @@ public class EntitySaxReaderTests {
> >          EntitySaxReader esr = new EntitySaxReader(delegator); // create
> a
> > reader with default tx timeout
> >          verify(delegator).cloneDelegator();
> >          verifyNoMoreInteractions(delegator);
> > -        assertEquals(esr.DEFAULT_TX_TIMEOUT,
> > esr.getTransactionTimeout());
> > +        assertEquals(EntitySaxReader.DEFAULT_TX_TIMEOUT,
> > esr.getTransactionTimeout());
> >      }
> >
> >      @Test
> >
> >
> >
>