You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Isuru Udana <is...@gmail.com> on 2016/02/20 16:52:43 UTC

Re: svn commit: r1731416 - /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java

Hi Andreas,

It looks like following two tests are failing as
testSubscriptionMessageBuilderScenarioFive is getting executed before them.

testSubscriptionMessageBuilderScenarioFour(org.apache.synapse.eventing.builders.MessageBuilderTest):
testSubscriptionMessageBuilderScenarioThree(org.apache.synapse.eventing.builders.MessageBuilderTest):

Then cause is static variables in SubscriptionMessageBuilder class.

private static String errorSubCode = null;
private static String errorReason = null;
private static String errorCode = null;

I think we need a proper fix rather than enforcing the test order.

Thanks.


On Sat, Feb 20, 2016 at 9:11 PM, <ve...@apache.org> wrote:

> Author: veithen
> Date: Sat Feb 20 15:41:12 2016
> New Revision: 1731416
>
> URL: http://svn.apache.org/viewvc?rev=1731416&view=rev
> Log:
> Attempt to fix flaky test case.
>
> Modified:
>
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
>
> Modified:
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> URL:
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java?rev=1731416&r1=1731415&r2=1731416&view=diff
>
> ==============================================================================
> ---
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> (original)
> +++
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> Sat Feb 20 15:41:12 2016
> @@ -21,6 +21,8 @@ package org.apache.synapse.eventing.buil
>
>  import junit.framework.TestCase;
>  import org.apache.synapse.mediators.TestUtils;
> +import org.junit.FixMethodOrder;
> +import org.junit.runners.MethodSorters;
>  import org.apache.synapse.eventing.SynapseSubscription;
>  import org.apache.axis2.context.MessageContext;
>  import org.apache.axis2.addressing.EndpointReference;
> @@ -32,9 +34,10 @@ import javax.xml.namespace.QName;
>  import java.util.Calendar;
>  import java.util.Date;
>
> +@FixMethodOrder(MethodSorters.NAME_ASCENDING)
>  public class MessageBuilderTest extends TestCase {
>
> -    public void testSubscriptionMessageBuilderScenarioOne() {
> +    public void testSubscriptionMessageBuilderScenario1() {
>          String subManUrl = "
> http://synapse.test.com/eventing/subscriptions";
>          String addressUrl = "http://www.other.example.com/OnStormWarning
> ";
>          String filterDialect = "http://www.example.org/topicFilter";
> @@ -86,7 +89,7 @@ public class MessageBuilderTest extends
>          }
>      }
>
> -    public void testSubscriptionMessageBuilderScenarioTwo() {
> +    public void testSubscriptionMessageBuilderScenario2() {
>          String addressUrl = "
> http://synapse.test.com/eventing/subscriptions";
>
>          String message = "<wse:Unsubscribe xmlns:wse=\"
> http://schemas.xmlsoap.org/ws/2004/08/eventing\"/>";
> @@ -109,7 +112,7 @@ public class MessageBuilderTest extends
>          }
>      }
>
> -    public void testSubscriptionMessageBuilderScenarioThree() {
> +    public void testSubscriptionMessageBuilderScenario3() {
>          String addressUrl = "
> http://synapse.test.com/eventing/subscriptions";
>          Date date = new Date(System.currentTimeMillis() + 3600000);
>          Calendar cal = Calendar.getInstance();
> @@ -140,7 +143,7 @@ public class MessageBuilderTest extends
>          }
>      }
>
> -    public void testSubscriptionMessageBuilderScenarioFour() {
> +    public void testSubscriptionMessageBuilderScenario4() {
>          String addressUrl = "
> http://synapse.test.com/eventing/subscriptions";
>
>          String message =
> @@ -164,7 +167,7 @@ public class MessageBuilderTest extends
>          }
>      }
>
> -    public void testSubscriptionMessageBuilderScenarioFive() {
> +    public void testSubscriptionMessageBuilderScenario5() {
>          String addressUrl = "
> http://synapse.test.com/eventing/subscriptions";
>
>          String message =
>
>
>


-- 
*Isuru Udana*
Associate Technical Lead




*; WSO2 Inc.; http://wso2.com <http://wso2.com>email: isudana@gmail.com
<is...@gmail.com> blog: http://mytecheye.blogspot.com/
<http://mytecheye.blogspot.com/>*

Re: svn commit: r1731416 - /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java

Posted by Isuru Udana <is...@gmail.com>.
On Sat, Feb 20, 2016 at 9:28 PM, Andreas Veithen <an...@gmail.com>
wrote:

> On Sat, Feb 20, 2016 at 3:52 PM, Isuru Udana <is...@gmail.com> wrote:
> > Hi Andreas,
> >
> > It looks like following two tests are failing as
> > testSubscriptionMessageBuilderScenarioFive is getting executed before
> them.
> >
> >
> testSubscriptionMessageBuilderScenarioFour(org.apache.synapse.eventing.builders.MessageBuilderTest):
> >
> testSubscriptionMessageBuilderScenarioThree(org.apache.synapse.eventing.builders.MessageBuilderTest):
> >
> > Then cause is static variables in SubscriptionMessageBuilder class.
> >
> > private static String errorSubCode = null;
> > private static String errorReason = null;
> > private static String errorCode = null;
>
> Yes, that is also my theory:
>
> http://markmail.org/message/5pqsmf55zds77wqn
>
> > I think we need a proper fix rather than enforcing the test order.
>
> Feel free to develop a proper fix :-)
>
Did a different fix in  r1731418.

> > Thanks.
> >
> >
> > On Sat, Feb 20, 2016 at 9:11 PM, <ve...@apache.org> wrote:
> >>
> >> Author: veithen
> >> Date: Sat Feb 20 15:41:12 2016
> >> New Revision: 1731416
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1731416&view=rev
> >> Log:
> >> Attempt to fix flaky test case.
> >>
> >> Modified:
> >>
> >>
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> >>
> >> Modified:
> >>
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> >> URL:
> >>
> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java?rev=1731416&r1=1731415&r2=1731416&view=diff
> >>
> >>
> ==============================================================================
> >> ---
> >>
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> >> (original)
> >> +++
> >>
> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
> >> Sat Feb 20 15:41:12 2016
> >> @@ -21,6 +21,8 @@ package org.apache.synapse.eventing.buil
> >>
> >>  import junit.framework.TestCase;
> >>  import org.apache.synapse.mediators.TestUtils;
> >> +import org.junit.FixMethodOrder;
> >> +import org.junit.runners.MethodSorters;
> >>  import org.apache.synapse.eventing.SynapseSubscription;
> >>  import org.apache.axis2.context.MessageContext;
> >>  import org.apache.axis2.addressing.EndpointReference;
> >> @@ -32,9 +34,10 @@ import javax.xml.namespace.QName;
> >>  import java.util.Calendar;
> >>  import java.util.Date;
> >>
> >> +@FixMethodOrder(MethodSorters.NAME_ASCENDING)
> >>  public class MessageBuilderTest extends TestCase {
> >>
> >> -    public void testSubscriptionMessageBuilderScenarioOne() {
> >> +    public void testSubscriptionMessageBuilderScenario1() {
> >>          String subManUrl =
> >> "http://synapse.test.com/eventing/subscriptions";
> >>          String addressUrl =
> >> "http://www.other.example.com/OnStormWarning";
> >>          String filterDialect = "http://www.example.org/topicFilter";
> >> @@ -86,7 +89,7 @@ public class MessageBuilderTest extends
> >>          }
> >>      }
> >>
> >> -    public void testSubscriptionMessageBuilderScenarioTwo() {
> >> +    public void testSubscriptionMessageBuilderScenario2() {
> >>          String addressUrl =
> >> "http://synapse.test.com/eventing/subscriptions";
> >>
> >>          String message = "<wse:Unsubscribe
> >> xmlns:wse=\"http://schemas.xmlsoap.org/ws/2004/08/eventing\"/>";
> >> @@ -109,7 +112,7 @@ public class MessageBuilderTest extends
> >>          }
> >>      }
> >>
> >> -    public void testSubscriptionMessageBuilderScenarioThree() {
> >> +    public void testSubscriptionMessageBuilderScenario3() {
> >>          String addressUrl =
> >> "http://synapse.test.com/eventing/subscriptions";
> >>          Date date = new Date(System.currentTimeMillis() + 3600000);
> >>          Calendar cal = Calendar.getInstance();
> >> @@ -140,7 +143,7 @@ public class MessageBuilderTest extends
> >>          }
> >>      }
> >>
> >> -    public void testSubscriptionMessageBuilderScenarioFour() {
> >> +    public void testSubscriptionMessageBuilderScenario4() {
> >>          String addressUrl =
> >> "http://synapse.test.com/eventing/subscriptions";
> >>
> >>          String message =
> >> @@ -164,7 +167,7 @@ public class MessageBuilderTest extends
> >>          }
> >>      }
> >>
> >> -    public void testSubscriptionMessageBuilderScenarioFive() {
> >> +    public void testSubscriptionMessageBuilderScenario5() {
> >>          String addressUrl =
> >> "http://synapse.test.com/eventing/subscriptions";
> >>
> >>          String message =
> >>
> >>
> >
> >
> >
> > --
> > Isuru Udana
> > Associate Technical Lead
> > ; WSO2 Inc.; http://wso2.com
> >
> > email: isudana@gmail.com
> > blog: http://mytecheye.blogspot.com/
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
*Isuru Udana*
Associate Technical Lead




*; WSO2 Inc.; http://wso2.com <http://wso2.com>email: isudana@gmail.com
<is...@gmail.com> blog: http://mytecheye.blogspot.com/
<http://mytecheye.blogspot.com/>*

Re: svn commit: r1731416 - /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java

Posted by Andreas Veithen <an...@gmail.com>.
On Sat, Feb 20, 2016 at 3:52 PM, Isuru Udana <is...@gmail.com> wrote:
> Hi Andreas,
>
> It looks like following two tests are failing as
> testSubscriptionMessageBuilderScenarioFive is getting executed before them.
>
> testSubscriptionMessageBuilderScenarioFour(org.apache.synapse.eventing.builders.MessageBuilderTest):
> testSubscriptionMessageBuilderScenarioThree(org.apache.synapse.eventing.builders.MessageBuilderTest):
>
> Then cause is static variables in SubscriptionMessageBuilder class.
>
> private static String errorSubCode = null;
> private static String errorReason = null;
> private static String errorCode = null;

Yes, that is also my theory:

http://markmail.org/message/5pqsmf55zds77wqn

> I think we need a proper fix rather than enforcing the test order.

Feel free to develop a proper fix :-)

> Thanks.
>
>
> On Sat, Feb 20, 2016 at 9:11 PM, <ve...@apache.org> wrote:
>>
>> Author: veithen
>> Date: Sat Feb 20 15:41:12 2016
>> New Revision: 1731416
>>
>> URL: http://svn.apache.org/viewvc?rev=1731416&view=rev
>> Log:
>> Attempt to fix flaky test case.
>>
>> Modified:
>>
>> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
>>
>> Modified:
>> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
>> URL:
>> http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java?rev=1731416&r1=1731415&r2=1731416&view=diff
>>
>> ==============================================================================
>> ---
>> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
>> (original)
>> +++
>> synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
>> Sat Feb 20 15:41:12 2016
>> @@ -21,6 +21,8 @@ package org.apache.synapse.eventing.buil
>>
>>  import junit.framework.TestCase;
>>  import org.apache.synapse.mediators.TestUtils;
>> +import org.junit.FixMethodOrder;
>> +import org.junit.runners.MethodSorters;
>>  import org.apache.synapse.eventing.SynapseSubscription;
>>  import org.apache.axis2.context.MessageContext;
>>  import org.apache.axis2.addressing.EndpointReference;
>> @@ -32,9 +34,10 @@ import javax.xml.namespace.QName;
>>  import java.util.Calendar;
>>  import java.util.Date;
>>
>> +@FixMethodOrder(MethodSorters.NAME_ASCENDING)
>>  public class MessageBuilderTest extends TestCase {
>>
>> -    public void testSubscriptionMessageBuilderScenarioOne() {
>> +    public void testSubscriptionMessageBuilderScenario1() {
>>          String subManUrl =
>> "http://synapse.test.com/eventing/subscriptions";
>>          String addressUrl =
>> "http://www.other.example.com/OnStormWarning";
>>          String filterDialect = "http://www.example.org/topicFilter";
>> @@ -86,7 +89,7 @@ public class MessageBuilderTest extends
>>          }
>>      }
>>
>> -    public void testSubscriptionMessageBuilderScenarioTwo() {
>> +    public void testSubscriptionMessageBuilderScenario2() {
>>          String addressUrl =
>> "http://synapse.test.com/eventing/subscriptions";
>>
>>          String message = "<wse:Unsubscribe
>> xmlns:wse=\"http://schemas.xmlsoap.org/ws/2004/08/eventing\"/>";
>> @@ -109,7 +112,7 @@ public class MessageBuilderTest extends
>>          }
>>      }
>>
>> -    public void testSubscriptionMessageBuilderScenarioThree() {
>> +    public void testSubscriptionMessageBuilderScenario3() {
>>          String addressUrl =
>> "http://synapse.test.com/eventing/subscriptions";
>>          Date date = new Date(System.currentTimeMillis() + 3600000);
>>          Calendar cal = Calendar.getInstance();
>> @@ -140,7 +143,7 @@ public class MessageBuilderTest extends
>>          }
>>      }
>>
>> -    public void testSubscriptionMessageBuilderScenarioFour() {
>> +    public void testSubscriptionMessageBuilderScenario4() {
>>          String addressUrl =
>> "http://synapse.test.com/eventing/subscriptions";
>>
>>          String message =
>> @@ -164,7 +167,7 @@ public class MessageBuilderTest extends
>>          }
>>      }
>>
>> -    public void testSubscriptionMessageBuilderScenarioFive() {
>> +    public void testSubscriptionMessageBuilderScenario5() {
>>          String addressUrl =
>> "http://synapse.test.com/eventing/subscriptions";
>>
>>          String message =
>>
>>
>
>
>
> --
> Isuru Udana
> Associate Technical Lead
> ; WSO2 Inc.; http://wso2.com
>
> email: isudana@gmail.com
> blog: http://mytecheye.blogspot.com/
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org