You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2020/05/14 08:00:29 UTC

[servicecomb-java-chassis] 07/09: [SCB-1876] part-7: fix get versions may be different in windows and linux

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git

commit 5145610c63303cdc2d5e52d57f8e35ecff295c0c
Author: liubao <bi...@qq.com>
AuthorDate: Wed May 13 19:09:14 2020 +0800

    [SCB-1876] part-7: fix get versions may be different in windows and linux
---
 .../serviceregistry/api/registry/TestFrameworkVersions.java           | 4 +++-
 .../serviceregistry/api/registry/TestServiceCombVersion.java          | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestFrameworkVersions.java b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestFrameworkVersions.java
index e0dde1a..7af3d09 100644
--- a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestFrameworkVersions.java
+++ b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestFrameworkVersions.java
@@ -23,6 +23,8 @@ import org.junit.Test;
 public class TestFrameworkVersions {
   @Test
   public void testFrameworkVersions() {
-    Assert.assertEquals("ServiceComb:null", FrameworkVersions.allVersions());
+    // this.getClass().getPackage().getImplementationVersion()
+    // is not stable, may get null or 2.0.1-SNAPSHOT
+    Assert.assertTrue(FrameworkVersions.allVersions().contains("ServiceComb"));
   }
 }
diff --git a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestServiceCombVersion.java b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestServiceCombVersion.java
index 62e722c..6ceac65 100644
--- a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestServiceCombVersion.java
+++ b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/api/registry/TestServiceCombVersion.java
@@ -25,6 +25,8 @@ public class TestServiceCombVersion {
   @Test
   public void testServiceCombVersion() {
     ServiceCombVersion version = new ServiceCombVersion();
-    Assert.assertEquals("{ServiceComb=null}", version.loadVersion().toString());
+    // this.getClass().getPackage().getImplementationVersion()
+    // is not stable, may get null or 2.0.1-SNAPSHOT
+    Assert.assertTrue(version.loadVersion().toString().contains("ServiceComb"));
   }
 }