Skip to content
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

Testing transport and server #359

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

RonCodes88
Copy link
Collaborator

No description provided.

@RonCodes88 RonCodes88 marked this pull request as ready for review October 17, 2024 20:41
@RonCodes88 RonCodes88 marked this pull request as draft October 17, 2024 20:42
@RonCodes88 RonCodes88 marked this pull request as ready for review October 17, 2024 21:42
Copy link
Contributor

@breed breed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good. it's missing the test of the public interface run().

perhaps you can add a test for that in another PR. ideally you would instantiate a TransportToBundleServerManager and call the run method and see if you get the expected results. you should have test cases for nothing to download, bad server public key, something to download and something to upload, something to download and something to upload that has already been uploaded.

@@ -4,6 +4,7 @@
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.SEVERE;

import android.content.Context;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did this and the other import get added? i don't see them used.

@@ -14,15 +13,14 @@
// |_ BundleTransmission
// |_ client - bundles to send to client + recencyBlob
// |_ server - bundles to send to server

public class TransportPaths {
public class TransportPaths{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the space

private static final Logger logger = Logger.getLogger(TransportPaths.class.getName());

public final Path toClientPath;

public final Path toServerPath;

public TransportPaths(Path rootDir) {
public TransportPaths(Path rootDir){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the space

@@ -21,6 +21,7 @@
import io.grpc.InsecureServerCredentials;
import io.grpc.Server;
import io.grpc.stub.StreamObserver;
import net.discdd.transport.TransportToBundleServerManager;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this being used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being used in the getRecencyBlob method to get the RECENCY_BLOB_BIN from TransportToBundleServerManager.


import com.google.protobuf.ByteString;
import io.grpc.Grpc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these grpc imports needed?

void tearDownEach() throws IOException {
// Clean up directories and files
if (Files.exists(toClientPath)) {
Files.walk(toClientPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should refactor this into a recursiveDelete method so that you don't duplicate it below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants