New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove netty-all
dependency
#10818
Remove netty-all
dependency
#10818
Conversation
dubbo-dependencies-bom/pom.xml
Outdated
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-codec</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-handler</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-codec-http2</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- </dependency>--> | ||
|
||
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-transport-native-epoll</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- <classifier>linux-x86_64</classifier>--> | ||
<!-- <scope>runtime</scope>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-transport-native-epoll</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- <classifier>linux-aarch_64</classifier>--> | ||
<!-- <scope>runtime</scope>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-transport-native-kqueue</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- <classifier>osx-x86_64</classifier>--> | ||
<!-- <scope>runtime</scope>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.netty</groupId>--> | ||
<!-- <artifactId>netty-transport-native-kqueue</artifactId>--> | ||
<!-- <version>${netty4_version}</version>--> | ||
<!-- <classifier>osx-aarch_64</classifier>--> | ||
<!-- <scope>runtime</scope>--> | ||
<!-- </dependency>--> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused code
<dependency> | ||
<groupId>io.netty</groupId> | ||
<artifactId>netty-transport-native-epoll</artifactId> | ||
<version>4.1.72.Final</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version should be managed in dubbo-dependenies-bom
|
||
@Override | ||
public void onError(Throwable throwable) { | ||
|
||
} | ||
|
||
@Override | ||
public void onCompleted() { | ||
observer.onCompleted(); | ||
} | ||
}); | ||
return result; | ||
}); | ||
MethodDescriptor method = Mockito.mock(MethodDescriptor.class); | ||
when(method.getParameterClasses()) | ||
.thenReturn(new Class[]{String.class}); | ||
when(method.getMethodName()) | ||
.thenReturn("sayHello"); | ||
String request = "request"; | ||
CountDownLatch latch = new CountDownLatch(11); | ||
StreamObserver<Object> responseObserver = new StreamObserver<Object>() { | ||
@Override | ||
public void onNext(Object data) { | ||
latch.countDown(); | ||
} | ||
|
||
@Override | ||
public void onError(Throwable throwable) { | ||
} | ||
|
||
@Override | ||
public void onCompleted() { | ||
latch.countDown(); | ||
} | ||
}; | ||
StreamObserver<Object> observer = StubInvocationUtil.biOrClientStreamCall(invoker, method, | ||
responseObserver); | ||
for (int i = 0; i < 10; i++) { | ||
observer.onNext(request); | ||
} | ||
observer.onCompleted(); | ||
Assertions.assertTrue(latch.await(1, TimeUnit.SECONDS)); | ||
} | ||
|
||
@Test | ||
void serverStreamCall() throws InterruptedException { | ||
Invoker<DemoService> invoker = Mockito.mock(Invoker.class); | ||
URL url = Mockito.mock(URL.class); | ||
ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class); | ||
ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class); | ||
when(consumerModel.getServiceModel()).thenReturn(serviceDescriptor); | ||
when(url.getServiceModel()) | ||
.thenReturn(consumerModel); | ||
when(url.getServiceInterface()) | ||
.thenReturn(DemoService.class.getName()); | ||
when(url.getProtocolServiceKey()) | ||
.thenReturn(DemoService.class.getName()); | ||
when(invoker.getUrl()) | ||
.thenReturn(url); | ||
when(invoker.getInterface()) | ||
.thenReturn(DemoService.class); | ||
Result result = Mockito.mock(Result.class); | ||
String response = "response"; | ||
when(invoker.invoke(any(Invocation.class))) | ||
.then(invocationOnMock -> { | ||
Invocation invocation = (Invocation) invocationOnMock.getArguments()[0]; | ||
StreamObserver<Object> observer = (StreamObserver<Object>) invocation.getArguments()[1]; | ||
for (int i = 0; i < 10; i++) { | ||
observer.onNext(response); | ||
} | ||
observer.onCompleted(); | ||
return result; | ||
}); | ||
MethodDescriptor method = Mockito.mock(MethodDescriptor.class); | ||
when(method.getParameterClasses()) | ||
.thenReturn(new Class[]{String.class}); | ||
when(method.getMethodName()) | ||
.thenReturn("sayHello"); | ||
String request = "request"; | ||
CountDownLatch latch = new CountDownLatch(11); | ||
StreamObserver<Object> responseObserver = new StreamObserver<Object>() { | ||
@Override | ||
public void onNext(Object data) { | ||
latch.countDown(); | ||
} | ||
|
||
@Override | ||
public void onError(Throwable throwable) { | ||
} | ||
|
||
@Override | ||
public void onCompleted() { | ||
latch.countDown(); | ||
} | ||
}; | ||
StubInvocationUtil.serverStreamCall(invoker, method, request, responseObserver); | ||
Assertions.assertTrue(latch.await(1, TimeUnit.SECONDS)); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this class
///* | ||
// * 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.dubbo.rpc; | ||
// | ||
//import org.apache.dubbo.common.URL; | ||
//import org.apache.dubbo.common.stream.StreamObserver; | ||
//import org.apache.dubbo.rpc.model.ConsumerModel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this class
<dependency> | ||
<groupId>io.netty</groupId> | ||
<artifactId>netty-transport-native-epoll</artifactId> | ||
<classifier>linux-x86_64</classifier> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this filed change to os auto detected
Codecov Report
@@ Coverage Diff @@
## 3.1 #10818 +/- ##
============================================
- Coverage 67.87% 64.53% -3.35%
+ Complexity 510 469 -41
============================================
Files 1348 1336 -12
Lines 66361 57004 -9357
Branches 11234 8405 -2829
============================================
- Hits 45045 36786 -8259
+ Misses 16981 16262 -719
+ Partials 4335 3956 -379
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is the purpose of the change
Brief changelog
Verifying this change
Checklist