You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/10/27 05:47:20 UTC

[GitHub] [dubbo-go-samples] justxuewei commented on a change in pull request #282: format java samples

justxuewei commented on a change in pull request #282:
URL: https://github.com/apache/dubbo-go-samples/pull/282#discussion_r737121606



##########
File path: generic/default/java-server/src/main/java/org/apache/dubbo/ApiProvider.java
##########
@@ -35,6 +35,5 @@ public static void main(String[] args) throws InterruptedException {
         service.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
         service.export();
         System.out.println("dubbo service started");
-        new CountDownLatch(1).await();

Review comment:
       Why remove CountDownLatch here? If removed, the application will exit immediately once initialization finished.

##########
File path: helloworld/java-client/src/test/java/com/apache/dubbo/sample/TestHelloWorld.java
##########
@@ -1,62 +0,0 @@
-/*
- *  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 com.apache.dubbo.sample;
-
-import org.junit.Test;
-import junit.framework.TestCase;
-import static org.junit.Assert.*;
-
-import org.apache.dubbo.common.constants.CommonConstants;
-import org.apache.dubbo.config.ApplicationConfig;
-import org.apache.dubbo.config.ReferenceConfig;
-import org.apache.dubbo.config.RegistryConfig;
-import org.apache.dubbo.sample.hello.Helloworld;
-
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
-import com.apache.dubbo.sample.basic.*;
-
-public class TestHelloWorld {
-
-    @Test
-    public void testHelloWorld() throws Exception {
-        ReferenceConfig<IGreeter> ref = new ReferenceConfig<>();
-        ref.setInterface(IGreeter.class);
-        ref.setCheck(false);
-        ref.setProtocol(CommonConstants.TRIPLE);
-        ref.setLazy(true);
-        ref.setTimeout(100000);
-        ref.setApplication(new ApplicationConfig("demo-consumer"));
-        ref.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
-        final IGreeter iGreeter = ref.get();
-
-        System.out.println("dubbo ref started");
-        Helloworld.HelloRequest req = Helloworld.HelloRequest.newBuilder().setName("laurence").build();
-        try {
-            final Helloworld.User reply = iGreeter.sayHello(req);
-            TimeUnit.SECONDS.sleep(1);
-            System.out.println("Reply:" + reply);
-            TestCase.assertEquals(reply.getName(), "Hello laurence");
-            TestCase.assertEquals(reply.getId(), "12345");
-            TestCase.assertEquals(reply.getAge(), 21);
-        } catch (IllegalStateException t) {
-            t.printStackTrace();
-        }
-    }
-}

Review comment:
       Why delete this file? This unit test is for dubbo-go and dubbo-java integrate test.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org