• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mizosoft / methanol / #574

18 Aug 2025 05:44PM UTC coverage: 87.381%. First build
#574

Pull #132

github

mizosoft
Add CI job for coverallsJacoco
Pull Request #132: Properly setup coveralls

2329 of 2826 branches covered (82.41%)

Branch coverage included in aggregate %.

18 of 135 new or added lines in 3 files covered. (13.33%)

7615 of 8554 relevant lines covered (89.02%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/methanol/src/main/java/com/github/mizosoft/methanol/ClientTest.java
1
/*
2
 * Copyright © 2025 Moataz Hussein
3
 *
4
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
 *
6
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
 *
8
 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
 */
10

11
package com.github.mizosoft.methanol;
12

13
import java.io.IOException;
14
import java.net.http.HttpResponse;
15
import java.nio.file.Files;
16
import java.nio.file.Path;
17
import java.time.Duration;
18
import java.util.concurrent.Executors;
19

NEW
20
public class ClientTest {
×
21
  private static final String URL = "http://localhost:8080/upload";
22

23
  public static void main(String[] args) throws IOException, InterruptedException {
NEW
24
    var client = Methanol.create();
×
25
    var progressTracker =
NEW
26
        ProgressTracker.newBuilder()
×
NEW
27
            .timePassedThreshold(Duration.ofMillis(100))
×
NEW
28
            .enclosedProgress(false)
×
NEW
29
            .build();
×
NEW
30
    var path =
×
NEW
31
        Path.of(
×
32
            "/Users/mizo/Downloads/Alex Xu_ Sahn Lam - System Design Interview – An Insider's Guide_ Volume 2-ByteByteGo Inc (2023).epub");
NEW
33
    var executor =
×
NEW
34
        Executors.newSingleThreadExecutor(
×
35
            r -> {
NEW
36
              var t = new Thread(r);
×
NEW
37
              t.setDaemon(true);
×
NEW
38
              return t;
×
39
            });
NEW
40
    var multipart =
×
NEW
41
        client.send(
×
NEW
42
            MutableRequest.POST(
×
43
                URL,
NEW
44
                progressTracker.tracking(
×
NEW
45
                    MoreBodyPublishers.ofOutputStream(out -> Files.copy(path, out), executor),
×
46
                    progress -> {
NEW
47
                      System.out.println(
×
48
                          1.0
49
                              * 1000
NEW
50
                              * progress.bytesTransferred()
×
NEW
51
                              / progress.timePassed().toMillis());
×
NEW
52
                    })),
×
NEW
53
            HttpResponse.BodyHandlers.ofString());
×
NEW
54
    System.out.println(multipart.body());
×
NEW
55
  }
×
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc