This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Avoid direct access to apache thrift from jaeger-core via transitive … #374
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
66341f9
Avoid direct access to apache thrift from jaeger-core via transitive …
objectiser 36a3454
Changed abstract send method to throw SenderException, fixed copyrigh…
objectiser 7b19fae
Fix exception to use spans.size()
objectiser a809a02
Refactored to improve test code coverage
objectiser 3df898d
More test coverage
objectiser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
jaeger-core/src/test/java/com/uber/jaeger/senders/ThriftSenderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2017-2018, The Jaeger Authors | ||
* | ||
* Licensed 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.uber.jaeger.senders; | ||
|
||
import com.uber.jaeger.exceptions.SenderException; | ||
import com.uber.jaeger.thrift.senders.ThriftSenderBase.ProtocolType; | ||
import com.uber.jaeger.thriftjava.Process; | ||
import com.uber.jaeger.thriftjava.Span; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* This class tests the abstract ThriftSender. | ||
*/ | ||
public class ThriftSenderTest { | ||
|
||
@Test(expected = SenderException.class) | ||
public void calculateProcessSizeNull() throws Exception { | ||
ThriftSender sender = new ThriftSender(ProtocolType.Compact, 0) { | ||
@Override | ||
public void send(Process process, List<Span> spans) throws SenderException { | ||
} | ||
}; | ||
|
||
sender.calculateProcessSize(null); | ||
} | ||
|
||
@Test(expected = SenderException.class) | ||
public void calculateSpanSizeNull() throws Exception { | ||
ThriftSender sender = new ThriftSender(ProtocolType.Compact, 0) { | ||
@Override | ||
public void send(Process process, List<Span> spans) throws SenderException { | ||
} | ||
}; | ||
|
||
sender.calculateSpanSize(null); | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am not sure I fully understand this change. Don't these imports still retain the dependency on jaeger-thrift?
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.
Yes there is still a dependency from core to jaeger-thrift. This PR was about removing direct use of apache thrift from core, as a dependency leak.
More work is required to make a true transport abstraction. Is this something also for 1.0?