[prev in list] [next in list] [prev in thread] [next in thread] 

List:       synapse-dev
Subject:    Re: svn commit: r1731416 - /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventin
From:       Isuru Udana <isudana () gmail ! com>
Date:       2016-02-20 16:31:30
Message-ID: CAJxmC72XyVn_W-GH0HiBvYvWk9ExWOrs_v7sV1iQPhWWhZm4gg () mail ! gmail ! com
[Download RAW message or body]

On Sat, Feb 20, 2016 at 9:28 PM, Andreas Veithen <andreas.veithen@gmail.com>
wrote:

> On Sat, Feb 20, 2016 at 3:52 PM, Isuru Udana <isudana@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, <veithen@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/apach \
> e/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
<isudana@gmail.com> blog: http://mytecheye.blogspot.com/
<http://mytecheye.blogspot.com/>*


[Attachment #3 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb \
20, 2016 at 9:28 PM, Andreas Veithen <span dir="ltr">&lt;<a \
href="mailto:andreas.veithen@gmail.com" \
target="_blank">andreas.veithen@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span \
class="">On Sat, Feb 20, 2016 at 3:52 PM, Isuru Udana &lt;<a \
href="mailto:isudana@gmail.com">isudana@gmail.com</a>&gt; wrote:<br> &gt; Hi \
Andreas,<br> &gt;<br>
&gt; It looks like following two tests are failing as<br>
&gt; testSubscriptionMessageBuilderScenarioFive is getting executed before them.<br>
&gt;<br>
&gt; testSubscriptionMessageBuilderScenarioFour(org.apache.synapse.eventing.builders.MessageBuilderTest):<br>
 &gt; testSubscriptionMessageBuilderScenarioThree(org.apache.synapse.eventing.builders.MessageBuilderTest):<br>
 &gt;<br>
&gt; Then cause is static variables in SubscriptionMessageBuilder class.<br>
&gt;<br>
&gt; private static String errorSubCode = null;<br>
&gt; private static String errorReason = null;<br>
&gt; private static String errorCode = null;<br>
<br>
</span>Yes, that is also my theory:<br>
<br>
<a href="http://markmail.org/message/5pqsmf55zds77wqn" rel="noreferrer" \
target="_blank">http://markmail.org/message/5pqsmf55zds77wqn</a><br> <span \
class=""><br> &gt; I think we need a proper fix rather than enforcing the test \
order.<br> <br>
</span>Feel free to develop a proper fix :-)<br></blockquote><div>Did a different fix \
in   r1731418.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div \
class="h5"> &gt; Thanks.<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Feb 20, 2016 at 9:11 PM, &lt;<a \
href="mailto:veithen@apache.org">veithen@apache.org</a>&gt; wrote:<br> &gt;&gt;<br>
&gt;&gt; Author: veithen<br>
&gt;&gt; Date: Sat Feb 20 15:41:12 2016<br>
&gt;&gt; New Revision: 1731416<br>
&gt;&gt;<br>
&gt;&gt; URL: <a href="http://svn.apache.org/viewvc?rev=1731416&amp;view=rev" \
rel="noreferrer" target="_blank">http://svn.apache.org/viewvc?rev=1731416&amp;view=rev</a><br>
 &gt;&gt; Log:<br>
&gt;&gt; Attempt to fix flaky test case.<br>
&gt;&gt;<br>
&gt;&gt; Modified:<br>
&gt;&gt;<br>
&gt;&gt; synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java<br>
 &gt;&gt;<br>
&gt;&gt; Modified:<br>
&gt;&gt; synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java<br>
 &gt;&gt; URL:<br>
&gt;&gt; <a href="http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/tes \
t/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java?rev=1731416&amp;r1=1731415&amp;r2=1731416&amp;view=diff" \
rel="noreferrer" target="_blank">http://svn.apache.org/viewvc/synapse/trunk/java/modul \
es/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java?rev=1731416&amp;r1=1731415&amp;r2=1731416&amp;view=diff</a><br>
 &gt;&gt;<br>
&gt;&gt; ==============================================================================<br>
 &gt;&gt; ---<br>
&gt;&gt; synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java<br>
 &gt;&gt; (original)<br>
&gt;&gt; +++<br>
&gt;&gt; synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java<br>
 &gt;&gt; Sat Feb 20 15:41:12 2016<br>
&gt;&gt; @@ -21,6 +21,8 @@ package org.apache.synapse.eventing.buil<br>
&gt;&gt;<br>
&gt;&gt;   import junit.framework.TestCase;<br>
&gt;&gt;   import org.apache.synapse.mediators.TestUtils;<br>
&gt;&gt; +import org.junit.FixMethodOrder;<br>
&gt;&gt; +import org.junit.runners.MethodSorters;<br>
&gt;&gt;   import org.apache.synapse.eventing.SynapseSubscription;<br>
&gt;&gt;   import org.apache.axis2.context.MessageContext;<br>
&gt;&gt;   import org.apache.axis2.addressing.EndpointReference;<br>
&gt;&gt; @@ -32,9 +34,10 @@ import javax.xml.namespace.QName;<br>
&gt;&gt;   import java.util.Calendar;<br>
&gt;&gt;   import java.util.Date;<br>
&gt;&gt;<br>
&gt;&gt; +@FixMethodOrder(MethodSorters.NAME_ASCENDING)<br>
&gt;&gt;   public class MessageBuilderTest extends TestCase {<br>
&gt;&gt;<br>
&gt;&gt; -      public void testSubscriptionMessageBuilderScenarioOne() {<br>
&gt;&gt; +      public void testSubscriptionMessageBuilderScenario1() {<br>
&gt;&gt;               String subManUrl =<br>
&gt;&gt; &quot;<a href="http://synapse.test.com/eventing/subscriptions" \
rel="noreferrer" target="_blank">http://synapse.test.com/eventing/subscriptions</a>&quot;;<br>
 &gt;&gt;               String addressUrl =<br>
&gt;&gt; &quot;<a href="http://www.other.example.com/OnStormWarning" rel="noreferrer" \
target="_blank">http://www.other.example.com/OnStormWarning</a>&quot;;<br> &gt;&gt;   \
String filterDialect = &quot;<a href="http://www.example.org/topicFilter" \
rel="noreferrer" target="_blank">http://www.example.org/topicFilter</a>&quot;;<br> \
&gt;&gt; @@ -86,7 +89,7 @@ public class MessageBuilderTest extends<br> &gt;&gt;       \
}<br> &gt;&gt;         }<br>
&gt;&gt;<br>
&gt;&gt; -      public void testSubscriptionMessageBuilderScenarioTwo() {<br>
&gt;&gt; +      public void testSubscriptionMessageBuilderScenario2() {<br>
&gt;&gt;               String addressUrl =<br>
&gt;&gt; &quot;<a href="http://synapse.test.com/eventing/subscriptions" \
rel="noreferrer" target="_blank">http://synapse.test.com/eventing/subscriptions</a>&quot;;<br>
 &gt;&gt;<br>
&gt;&gt;               String message = &quot;&lt;wse:Unsubscribe<br>
&gt;&gt; xmlns:wse=\&quot;<a href="http://schemas.xmlsoap.org/ws/2004/08/eventing\" \
rel="noreferrer" target="_blank">http://schemas.xmlsoap.org/ws/2004/08/eventing\</a>&quot;/&gt;&quot;;<br>
 &gt;&gt; @@ -109,7 +112,7 @@ public class MessageBuilderTest extends<br>
&gt;&gt;               }<br>
&gt;&gt;         }<br>
&gt;&gt;<br>
&gt;&gt; -      public void testSubscriptionMessageBuilderScenarioThree() {<br>
&gt;&gt; +      public void testSubscriptionMessageBuilderScenario3() {<br>
&gt;&gt;               String addressUrl =<br>
&gt;&gt; &quot;<a href="http://synapse.test.com/eventing/subscriptions" \
rel="noreferrer" target="_blank">http://synapse.test.com/eventing/subscriptions</a>&quot;;<br>
 &gt;&gt;               Date date = new Date(System.currentTimeMillis() + \
3600000);<br> &gt;&gt;               Calendar cal = Calendar.getInstance();<br>
&gt;&gt; @@ -140,7 +143,7 @@ public class MessageBuilderTest extends<br>
&gt;&gt;               }<br>
&gt;&gt;         }<br>
&gt;&gt;<br>
&gt;&gt; -      public void testSubscriptionMessageBuilderScenarioFour() {<br>
&gt;&gt; +      public void testSubscriptionMessageBuilderScenario4() {<br>
&gt;&gt;               String addressUrl =<br>
&gt;&gt; &quot;<a href="http://synapse.test.com/eventing/subscriptions" \
rel="noreferrer" target="_blank">http://synapse.test.com/eventing/subscriptions</a>&quot;;<br>
 &gt;&gt;<br>
&gt;&gt;               String message =<br>
&gt;&gt; @@ -164,7 +167,7 @@ public class MessageBuilderTest extends<br>
&gt;&gt;               }<br>
&gt;&gt;         }<br>
&gt;&gt;<br>
&gt;&gt; -      public void testSubscriptionMessageBuilderScenarioFive() {<br>
&gt;&gt; +      public void testSubscriptionMessageBuilderScenario5() {<br>
&gt;&gt;               String addressUrl =<br>
&gt;&gt; &quot;<a href="http://synapse.test.com/eventing/subscriptions" \
rel="noreferrer" target="_blank">http://synapse.test.com/eventing/subscriptions</a>&quot;;<br>
 &gt;&gt;<br>
&gt;&gt;               String message =<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Isuru Udana<br>
&gt; Associate Technical Lead<br>
&gt; ; WSO2 Inc.; <a href="http://wso2.com" rel="noreferrer" \
target="_blank">http://wso2.com</a><br> &gt;<br>
&gt; email: <a href="mailto:isudana@gmail.com">isudana@gmail.com</a><br>
&gt; blog: <a href="http://mytecheye.blogspot.com/" rel="noreferrer" \
target="_blank">http://mytecheye.blogspot.com/</a><br> &gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div>---------------------------------------------------------------------<br>
To unsubscribe, e-mail: <a \
href="mailto:dev-unsubscribe@synapse.apache.org">dev-unsubscribe@synapse.apache.org</a><br>
 For additional commands, e-mail: <a \
href="mailto:dev-help@synapse.apache.org">dev-help@synapse.apache.org</a><br> <br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><b \
style="color:rgb(102,102,102)">Isuru Udana</b><br><div \
style="font-size:small;font-weight:bold"><span style="font-weight:normal"><b><div \
style="display:inline!important"><span \
style="font-weight:normal"><b></b></span></div></b></span></div><div><font \
color="#888888" face="arial" size="2">Associate Technical Lead</font><span \
style="font-size:small;font-weight:normal"><b><div \
style="display:inline!important"><font style="font-weight:normal" \
color="#888888"><span><span>; WSO2 Inc.; <a href="http://wso2.com" \
target="_blank">http://wso2.com</a><br><br>email: <a href="mailto:isudana@gmail.com" \
target="_blank">isudana@gmail.com</a> <br>blog: <a \
href="http://mytecheye.blogspot.com/" \
target="_blank">http://mytecheye.blogspot.com/</a></span></span></font><br \
style="font-weight:normal"></div></b></span></div><br><br><br></div></div></div></div>
 </div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic