-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtracker_test.go
35 lines (30 loc) · 886 Bytes
/
tracker_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"fmt"
"testing"
"time"
)
func TestTracker(t *testing.T) {
fmt.Printf("Tracker\n")
conf := Config{
"http://central.maven.org/maven2",
"/tmp/down-test",
"{{.Id}}-{{.Version}}.{{.Ext}}",
true,
5,
}
tracker := NewTracker(conf)
tracker.Request(Artifact{"commons-lang", "commons-lang", "2.4", "jar", "jar"})
tracker.Request(Artifact{"org.hibernate", "hibernate-core", "4.3.9.Final", "jar", "jar"})
tracker.Request(Artifact{"org.apache.ant", "ant", "1.9.4", "jar", "jar"})
tracker.Request(Artifact{"org.springframework", "spring-core", "4.1.6.RELEASE", "jar", "jar"})
go func() {
time.Sleep(100)
//tracker.Request(Artifact { "commons-io", "commons-io", "2.6", "jar", "jar"})
tracker.Request(Artifact{"commons-lang", "commons-lang", "2.4", "jar", "jar"})
}()
err := tracker.Wait()
if err != nil {
fmt.Printf("[ERROR] %s\n", err)
}
}