You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/10/01 06:42:08 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #3552: test: add service reset command test case

kezhenxu94 commented on a change in pull request #3552: test: add service reset command test case
URL: https://github.com/apache/skywalking/pull/3552#discussion_r329898735
 
 

 ##########
 File path: apm-protocol/apm-network/src/test/java/org/apache/skywalking/api/network/trace/component/command/ServiceResetCommandTest.java
 ##########
 @@ -0,0 +1,72 @@
+/*
+ * 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
+ *
+ * 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.skywalking.api.network.trace.component.command;
+
+import org.apache.skywalking.apm.network.common.Command;
+import org.apache.skywalking.apm.network.common.KeyStringValuePair;
+import org.apache.skywalking.apm.network.trace.component.command.ServiceResetCommand;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author jsbxyyx
+ */
+public class ServiceResetCommandTest {
+
+    @Test
+    public void test_serialize() throws Exception {
+        ServiceResetCommand command = new ServiceResetCommand("aa");
+        Command.Builder builder = command.serialize();
+
+        Assert.assertEquals(ServiceResetCommand.NAME, builder.getCommand());
+        Assert.assertEquals("aa", builder.getArgs(0).getValue());
+    }
+
+    @Test
+    public void test_deserialize() throws Exception {
 
 Review comment:
   > How do you see this name? `methodName_DoesWhat_WhenTheseConditions`
   
   Looks good to me but we prefer camel case in the project as @wu-sheng suggests, so please use the camel case style
   
   And if the method name becomes too long or hard to describe, consider using an assert method with `message`, like `org.junit.Assert#assertEquals(java.lang.String, java.lang.Object, java.lang.Object)`, thanks :)

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


With regards,
Apache Git Services