This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
867 additions
and
133 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
|
||
|
||
## [0.4.0] - 2020-06-11 | ||
### Added | ||
- This CHANGELOG file | ||
- Test cases | ||
- New commandline flag `-bottom-top` to set bottom top layout | ||
- New component kind: [`container-service`](./examples/cos.yml) | ||
- New component kind: [`waf`](./examples/waf.yml) | ||
- New example [./examples/system-view.yml](./examples/system-view.yml) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package draft | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/emicklei/dot" | ||
) | ||
|
||
func TestLoadBalancerComponentNextID(t *testing.T) { | ||
tests := []struct { | ||
want string | ||
}{ | ||
{"lb1"}, | ||
{"lb2"}, | ||
{"lb3"}, | ||
{"lb4"}, | ||
} | ||
|
||
s := balancer{} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.want, func(t *testing.T) { | ||
if got := s.nextID(); got != tt.want { | ||
t.Errorf("got [%v] want [%v]", got, tt.want) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestLoadBalancerComponent(t *testing.T) { | ||
want := `label="LB",shape="Mdiamond",style="filled"` | ||
g := dot.NewGraph(dot.Directed) | ||
|
||
sketcher := balancer{} | ||
sketcher.sketch(g, Component{}) | ||
|
||
if got := flatten(g.String()); !verify(got, want) { | ||
t.Errorf("got [%v] want [%v]", got, want) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package draft | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/emicklei/dot" | ||
) | ||
|
||
func TestBrokerComponentNextID(t *testing.T) { | ||
tests := []struct { | ||
want string | ||
}{ | ||
{"br1"}, | ||
{"br2"}, | ||
{"br3"}, | ||
{"br4"}, | ||
} | ||
|
||
s := broker{} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.want, func(t *testing.T) { | ||
if got := s.nextID(); got != tt.want { | ||
t.Errorf("got [%v] want [%v]", got, tt.want) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestBrokerComponent(t *testing.T) { | ||
want := `label="Message Broker",shape="cds",style="filled"` | ||
g := dot.NewGraph(dot.Directed) | ||
|
||
sketcher := broker{} | ||
sketcher.sketch(g, Component{}) | ||
|
||
if got := flatten(g.String()); !verify(got, want) { | ||
t.Errorf("got [%v] want [%v]", got, want) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package draft | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/emicklei/dot" | ||
) | ||
|
||
func TestCDNComponentNextID(t *testing.T) { | ||
tests := []struct { | ||
want string | ||
}{ | ||
{"cn1"}, | ||
{"cn2"}, | ||
{"cn3"}, | ||
{"cn4"}, | ||
} | ||
|
||
s := cdn{} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.want, func(t *testing.T) { | ||
if got := s.nextID(); got != tt.want { | ||
t.Errorf("got [%v] want [%v]", got, tt.want) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestCDNComponent(t *testing.T) { | ||
want := `label="CDN",shape="Mcircle",style="filled"` | ||
g := dot.NewGraph(dot.Directed) | ||
|
||
sketcher := cdn{} | ||
sketcher.sketch(g, Component{}) | ||
|
||
if got := flatten(g.String()); !verify(got, want) { | ||
t.Errorf("got [%v] want [%v]", got, want) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package draft | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/emicklei/dot" | ||
) | ||
|
||
func TestClientComponentNextID(t *testing.T) { | ||
tests := []struct { | ||
want string | ||
}{ | ||
{"cl1"}, | ||
{"cl2"}, | ||
{"cl3"}, | ||
{"cl4"}, | ||
} | ||
|
||
s := client{} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.want, func(t *testing.T) { | ||
if got := s.nextID(); got != tt.want { | ||
t.Errorf("got [%v] want [%v]", got, tt.want) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestClientComponent(t *testing.T) { | ||
want := `shape="underline",style="filled"` | ||
g := dot.NewGraph(dot.Directed) | ||
|
||
sketcher := client{} | ||
sketcher.sketch(g, Component{}) | ||
|
||
if got := flatten(g.String()); !verify(got, want) { | ||
t.Errorf("got [%v] want [%v]", got, want) | ||
} | ||
} |
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
Oops, something went wrong.