[ 
https://issues.apache.org/jira/browse/SCB-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16478764#comment-16478764
 ] 

ASF GitHub Bot commented on SCB-584:
------------------------------------

WillemJiang closed pull request #192: [SCB-584] Clear up testing code for Dubbo 
filter tests
URL: https://github.com/apache/incubator-servicecomb-saga/pull/192
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
index e601edac..cae2dcec 100644
--- 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
+++ 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
@@ -17,7 +17,6 @@
 
 import com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory;
 import com.alibaba.dubbo.rpc.Invocation;
-import org.apache.servicecomb.saga.omega.context.IdGenerator;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import 
org.apache.servicecomb.saga.omega.transport.dubbo.SagaDubboConsumerFilter;
 import org.junit.After;
@@ -38,8 +37,6 @@
 
   private static final String globalTxId = UUID.randomUUID().toString();
   private static final String localTxId = UUID.randomUUID().toString();
-  @SuppressWarnings("unchecked")
-  private final IdGenerator<String> idGenerator = mock(IdGenerator.class);
 
   private final OmegaContext omegaContext = new OmegaContext(() -> "ignored");
   private final Invocation invocation = mock(Invocation.class);
@@ -48,7 +45,7 @@
 
   @Before
   public void setUp() {
-    when(idGenerator.nextId()).thenReturn(globalTxId, localTxId);
+    omegaContext.clear();
     when(applicationContext.containsBean("omegaContext")).thenReturn(true);
     when(applicationContext.getBean("omegaContext")).thenReturn(omegaContext);
     SpringExtensionFactory.addApplicationContext(applicationContext);
diff --git 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
index 0a5f576a..1b953390 100644
--- 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
+++ 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
@@ -45,7 +45,6 @@
   @Before
   public void setUp() {
     omegaContext.clear();
-    ApplicationContext applicationContext = mock(ApplicationContext.class);
     when(applicationContext.containsBean("omegaContext")).thenReturn(true);
     when(applicationContext.getBean("omegaContext")).thenReturn(omegaContext);
     SpringExtensionFactory.addApplicationContext(applicationContext);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> DubboConsumerFilterTest fails on linux
> --------------------------------------
>
>                 Key: SCB-584
>                 URL: https://issues.apache.org/jira/browse/SCB-584
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Saga
>    Affects Versions: saga-0.2.0
>         Environment: ybo@yangbo:~/repos/incubator-servicecomb-saga$ mvn -v
> Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 
> 2017-10-18T15:58:13+08:00)
> Maven home: /opt/maven
> Java version: 1.8.0_151, vendor: Oracle Corporation
> Java home: /opt/jdk1.8.0_151/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "4.4.0-104-generic", arch: "amd64", family: "unix"
>            Reporter: Yang Bo
>            Priority: Minor
>             Fix For: saga-0.2.0
>
>
> The DubboConsumerFilterTest fails with the following error:
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running SagaDubboProviderFilterTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.518 sec - 
> in SagaDubboProviderFilterTest
> Running SagaDubboConsumerFilterTest
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.017 sec <<< 
> FAILURE! - in SagaDubboConsumerFilterTest
> interceptTransactionIdInHeaderIfContextPresent(SagaDubboConsumerFilterTest) 
> Time elapsed: 0.005 sec <<< FAILURE!
> java.lang.AssertionError:
> Expected: is "cf4a9f4a-b9e5-43f5-a7d9-837fa96ee4c0"
>  but: was "3ef495de-2f2a-4afa-b991-237cd8de7e1e"
>  at 
> SagaDubboConsumerFilterTest.interceptTransactionIdInHeaderIfContextPresent(SagaDubboConsumerFilterTest.java:82)
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to