You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by se...@apache.org on 2018/01/08 08:30:34 UTC

[incubator-servicecomb-saga] 02/04: SCB-174 remove redudant test codes

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

seanyinx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit d7262946e6be01082b5a62a9edb6b9ecda1857d7
Author: Eric Lee <da...@huawei.com>
AuthorDate: Sat Jan 6 22:02:13 2018 +0800

    SCB-174 remove redudant test codes
    
    Signed-off-by: Eric Lee <da...@huawei.com>
---
 .../saga/omega/format/KryoMessageFormat.java       | 24 ++++++-------
 .../saga/omega/format/MessageFormat.java           | 24 ++++++-------
 .../saga/omega/format/KryoMessageFormatTest.java   | 42 +++++++---------------
 .../saga/omega/format/MessageFormatTestBase.java   |  6 ++++
 .../saga/omega/format/NativeMessageFormatTest.java | 42 +++++++---------------
 pom.xml                                            |  3 +-
 6 files changed, 56 insertions(+), 85 deletions(-)

diff --git a/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormat.java b/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormat.java
index 2a0dd8d..7ef16a2 100644
--- a/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormat.java
+++ b/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormat.java
@@ -1,18 +1,18 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.apache.servicecomb.saga.omega.format;
diff --git a/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/MessageFormat.java b/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/MessageFormat.java
index 8adde72..0ccac37 100644
--- a/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/MessageFormat.java
+++ b/omega/omega-format/src/main/java/org/apache/servicecomb/saga/omega/format/MessageFormat.java
@@ -1,18 +1,18 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.apache.servicecomb.saga.omega.format;
diff --git a/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormatTest.java b/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormatTest.java
index 434067e..1f63d74 100644
--- a/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormatTest.java
+++ b/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/KryoMessageFormatTest.java
@@ -1,18 +1,18 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.apache.servicecomb.saga.omega.format;
@@ -31,24 +31,6 @@ public class KryoMessageFormatTest extends MessageFormatTestBase {
   }
 
   @Test
-  @Override
-  public void serializeObjectIntoBytes() throws Exception {
-    super.serializeObjectIntoBytes();
-  }
-
-  @Test
-  @Override
-  public void serializeNullIntoBytes() throws Exception {
-    super.serializeNullIntoBytes();
-  }
-
-  @Test
-  @Override
-  public void blowsUpWhenObjectIsNotDeserializable() throws Exception {
-    super.blowsUpWhenObjectIsNotDeserializable();
-  }
-
-  @Test
   public void serializeEmptyClassIntoBytes() {
     byte[] bytes = format.serialize(eventOf(new EmptyClass()));
 
diff --git a/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/MessageFormatTestBase.java b/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/MessageFormatTestBase.java
index 2188447..17674b7 100644
--- a/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/MessageFormatTestBase.java
+++ b/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/MessageFormatTestBase.java
@@ -27,11 +27,15 @@ import static org.junit.Assert.assertThat;
 
 import org.apache.servicecomb.saga.omega.transaction.OmegaException;
 import org.apache.servicecomb.saga.omega.transaction.TxEvent;
+import org.junit.Ignore;
+import org.junit.Test;
 
+@Ignore
 public class MessageFormatTestBase {
 
   static MessageFormat format;
 
+  @Test
   public void serializeObjectIntoBytes() throws Exception {
     byte[] bytes = format.serialize(eventOf("hello", "world"));
 
@@ -40,6 +44,7 @@ public class MessageFormatTestBase {
     assertThat(asList(message), contains("hello", "world"));
   }
 
+  @Test
   public void serializeNullIntoBytes() throws Exception {
     byte[] bytes = format.serialize(eventOf((Object[]) null));
 
@@ -48,6 +53,7 @@ public class MessageFormatTestBase {
     assertThat(message, is(nullValue()));
   }
 
+  @Test
   public void blowsUpWhenObjectIsNotDeserializable() throws Exception {
     try {
       format.deserialize(new byte[0]);
diff --git a/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/NativeMessageFormatTest.java b/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/NativeMessageFormatTest.java
index e07bb61..e460f63 100644
--- a/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/NativeMessageFormatTest.java
+++ b/omega/omega-format/src/test/java/org/apache/servicecomb/saga/omega/format/NativeMessageFormatTest.java
@@ -1,18 +1,18 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.apache.servicecomb.saga.omega.format;
@@ -33,24 +33,6 @@ public class NativeMessageFormatTest extends MessageFormatTestBase {
   }
 
   @Test
-  @Override
-  public void serializeObjectIntoBytes() throws Exception {
-    super.serializeObjectIntoBytes();
-  }
-
-  @Test
-  @Override
-  public void serializeNullIntoBytes() throws Exception {
-    super.serializeNullIntoBytes();
-  }
-
-  @Test
-  @Override
-  public void blowsUpWhenObjectIsNotDeserializable() throws Exception {
-    super.blowsUpWhenObjectIsNotDeserializable();
-  }
-
-  @Test
   public void blowsUpWhenSerializeEmptyClass() {
     try {
       format.serialize(eventOf(new EmptyClass()));
diff --git a/pom.xml b/pom.xml
index 2458bc8..f2d275b 100755
--- a/pom.xml
+++ b/pom.xml
@@ -58,6 +58,7 @@
     <rat.version>0.12</rat.version>
     <maven.failsafe.version>2.19.1</maven.failsafe.version>
     <grpc.version>1.8.0</grpc.version>
+    <kryo.version>4.0.1</kryo.version>
   </properties>
 
   <name>ServiceComb Saga</name>
@@ -332,7 +333,7 @@
       <dependency>
         <groupId>com.esotericsoftware</groupId>
         <artifactId>kryo</artifactId>
-        <version>4.0.1</version>
+        <version>${kryo.version}</version>
       </dependency>
 
       <!-- test dependencies -->

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.