From 8869faf7498a488464aa257f851f3ce17196b8ef Mon Sep 17 00:00:00 2001 From: Andrea Aime Date: Fri, 30 Dec 2005 17:57:40 +0000 Subject: [PATCH] Updated tests to check for the new view behaviours and to avoid the comeback of the bugs I fixed today --- testdata/dot-ref/MultiAssoc.dot | 17 ++++++++++ testdata/dot-ref/ViewAll.dot | 18 +++++----- testdata/dot-ref/ViewAllDetailed.dot | 18 +++++----- testdata/dot-ref/ViewAtt.dot | 18 +++++----- testdata/dot-ref/ViewColors.dot | 33 +++++++++++++++++++ testdata/dot-ref/ViewProduct.dot | 6 ++-- testdata/java/MultiAssoc.java | 18 ++++++++++ .../java/gr/spinellis/product/Category.java | 5 +++ testdata/java/gr/spinellis/views/ViewAll.java | 1 + .../gr/spinellis/views/ViewAllDetailed.java | 1 + testdata/java/gr/spinellis/views/ViewAtt.java | 1 + .../java/gr/spinellis/views/ViewColors.java | 12 +++++++ 12 files changed, 118 insertions(+), 30 deletions(-) create mode 100644 testdata/dot-ref/MultiAssoc.dot create mode 100644 testdata/dot-ref/ViewColors.dot create mode 100644 testdata/java/MultiAssoc.java create mode 100644 testdata/java/gr/spinellis/views/ViewColors.java diff --git a/testdata/dot-ref/MultiAssoc.dot b/testdata/dot-ref/MultiAssoc.dot new file mode 100644 index 0000000..fe66aa6 --- /dev/null +++ b/testdata/dot-ref/MultiAssoc.dot @@ -0,0 +1,17 @@ +#!/usr/local/bin/dot +# +# Class diagram +# Generated by UmlGraph version 4.1 (http://www.spinellis.gr/sw/umlgraph) +# + +digraph G { + edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; + node [fontname="Helvetica",fontsize=10,shape=record]; + // A + c73 [label="A", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + // C + c75 [label="C", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + // A depend C + c73 -> c75 [taillabel="", label="", headlabel="", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=open, style=dashed]; +} + diff --git a/testdata/dot-ref/ViewAll.dot b/testdata/dot-ref/ViewAll.dot index e40bc79..7d208cd 100644 --- a/testdata/dot-ref/ViewAll.dot +++ b/testdata/dot-ref/ViewAll.dot @@ -8,22 +8,22 @@ digraph G { edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; node [fontname="Helvetica",fontsize=10,shape=record]; // gr.spinellis.invoice.InvoiceItem - c27 [label="InvoiceItem", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c140 [label="InvoiceItem", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.invoice.Invoice - c28 [label="Invoice", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c141 [label="Invoice", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.invoice.Customer - c29 [label="Customer", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c142 [label="Customer", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.product.Product - c30 [label="Product", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c143 [label="Product", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.product.Category - c31 [label="Category", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c144 [label="Category", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.invoice.InvoiceItem assoc gr.spinellis.product.Product - c27 -> c30 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c140 -> c143 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; // gr.spinellis.invoice.Invoice assoc gr.spinellis.invoice.Customer - c28 -> c29 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c141 -> c142 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; // gr.spinellis.invoice.Invoice composed gr.spinellis.invoice.InvoiceItem - c28 -> c27 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; + c141 -> c140 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; // gr.spinellis.product.Product assoc gr.spinellis.product.Category - c30 -> c31 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c143 -> c144 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; } diff --git a/testdata/dot-ref/ViewAllDetailed.dot b/testdata/dot-ref/ViewAllDetailed.dot index 30823d2..99d0125 100644 --- a/testdata/dot-ref/ViewAllDetailed.dot +++ b/testdata/dot-ref/ViewAllDetailed.dot @@ -8,22 +8,22 @@ digraph G { edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; node [fontname="Helvetica",fontsize=10,shape=record]; // gr.spinellis.invoice.InvoiceItem - c18 [label="{InvoiceItem\n|product : Product\lquantity : int\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c130 [label="{InvoiceItem\n|product : Product\lquantity : int\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.invoice.Invoice - c19 [label="{Invoice\n|total : double\litems : InvoiceItem[]\lcustomer : Customer\l|addItem(p : Product, quantity : int)\l}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c131 [label="{Invoice\n|total : double\litems : InvoiceItem[]\lcustomer : Customer\l|addItem(p : Product, quantity : int)\l}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.invoice.Customer - c20 [label="{Customer\n|name : String\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c132 [label="{Customer\n|name : String\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.product.Product - c21 [label="{Product\n|name : String\lstock : int\lprice : double\lcategory : Category\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c133 [label="{Product\n|name : String\lstock : int\lprice : double\lcategory : Category\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.product.Category - c22 [label="{Category\n|name : String\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c134 [label="{Category\n|name : String\lproducts : List\<\>\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.invoice.InvoiceItem assoc gr.spinellis.product.Product - c18 -> c21 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c130 -> c133 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; // gr.spinellis.invoice.Invoice assoc gr.spinellis.invoice.Customer - c19 -> c20 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c131 -> c132 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; // gr.spinellis.invoice.Invoice composed gr.spinellis.invoice.InvoiceItem - c19 -> c18 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; + c131 -> c130 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; // gr.spinellis.product.Product assoc gr.spinellis.product.Category - c21 -> c22 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c133 -> c134 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; } diff --git a/testdata/dot-ref/ViewAtt.dot b/testdata/dot-ref/ViewAtt.dot index 90ca787..dd5ba21 100644 --- a/testdata/dot-ref/ViewAtt.dot +++ b/testdata/dot-ref/ViewAtt.dot @@ -8,22 +8,22 @@ digraph G { edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; node [fontname="Helvetica",fontsize=10,shape=record]; // gr.spinellis.invoice.InvoiceItem - c9 [label="{InvoiceItem\n|product\lquantity\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; + c120 [label="{InvoiceItem\n|product\lquantity\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; // gr.spinellis.invoice.Invoice - c10 [label="{Invoice\n|total\litems\lcustomer\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; + c121 [label="{Invoice\n|total\litems\lcustomer\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; // gr.spinellis.invoice.Customer - c11 [label="{Customer\n|name\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; + c122 [label="{Customer\n|name\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; // gr.spinellis.product.Product - c12 [label="{Product\n|name\lstock\lprice\lcategory\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; + c123 [label="{Product\n|name\lstock\lprice\lcategory\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; // gr.spinellis.product.Category - c13 [label="{Category\n|name\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; + c124 [label="{Category\n|name\lproducts\l|}", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=16.0]; // gr.spinellis.invoice.InvoiceItem assoc gr.spinellis.product.Product - c9 -> c12 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c120 -> c123 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; // gr.spinellis.invoice.Invoice assoc gr.spinellis.invoice.Customer - c10 -> c11 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c121 -> c122 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; // gr.spinellis.invoice.Invoice composed gr.spinellis.invoice.InvoiceItem - c10 -> c9 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; + c121 -> c120 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; // gr.spinellis.product.Product assoc gr.spinellis.product.Category - c12 -> c13 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c123 -> c124 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; } diff --git a/testdata/dot-ref/ViewColors.dot b/testdata/dot-ref/ViewColors.dot new file mode 100644 index 0000000..01317a4 --- /dev/null +++ b/testdata/dot-ref/ViewColors.dot @@ -0,0 +1,33 @@ +#!/usr/local/bin/dot +# +# Class diagram +# Generated by UmlGraph version 4.1 (http://www.spinellis.gr/sw/umlgraph) +# + +digraph G { + edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; + node [fontname="Helvetica",fontsize=10,shape=record]; + // gr.spinellis.invoice.InvoiceItem + c0 [label="InvoiceItem", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=10.0]; + // gr.spinellis.invoice.Invoice + c1 [label="Invoice", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=10.0]; + // gr.spinellis.invoice.Customer + c2 [label="Customer", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=10.0]; + // gr.spinellis.product.Product + c3 [label="Product", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=10.0]; + // gr.spinellis.product.Category + c4 [label="Category", fontname="Helvetica", style=filled, fillcolor="yellow", fontcolor="black", fontsize=10.0]; + // gr.spinellis.invoice.InvoiceItem assoc gr.spinellis.product.Product + c0 -> c3 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + // gr.spinellis.invoice.Invoice assoc gr.spinellis.invoice.Customer + c1 -> c2 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + // gr.spinellis.invoice.Invoice composed gr.spinellis.invoice.InvoiceItem + c1 -> c0 [taillabel="1", label="", headlabel="*", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none, arrowtail=diamond]; + // gr.spinellis.product.Product assoc gr.spinellis.product.Category + c3 -> c4 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + // gr.spinellis.product.Category depend java.util.List + c4 -> c10 [taillabel="", label="", headlabel="", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=open, style=dashed]; + // java.util.List + c10 [label="Ğinterfaceğ \nList\", fontname="Helvetica-Oblique", style=filled, fillcolor="gray", fontcolor="black", fontsize=10.0, URL="http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html"]; +} + diff --git a/testdata/dot-ref/ViewProduct.dot b/testdata/dot-ref/ViewProduct.dot index 6c36b9e..46dba2c 100644 --- a/testdata/dot-ref/ViewProduct.dot +++ b/testdata/dot-ref/ViewProduct.dot @@ -8,10 +8,10 @@ digraph G { edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; node [fontname="Helvetica",fontsize=10,shape=record]; // gr.spinellis.product.Product - c3 [label="{Product\n|name\lstock\lprice\lcategory\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c102 [label="{Product\n|name\lstock\lprice\lcategory\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.product.Category - c4 [label="{Category\n|name\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; + c103 [label="{Category\n|name\lproducts\l|}", fontname="Helvetica", fontcolor="black", fontsize=10.0]; // gr.spinellis.product.Product assoc gr.spinellis.product.Category - c3 -> c4 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; + c102 -> c103 [taillabel="*", label="", headlabel="1", fontname="Helvetica", fontcolor="black", fontsize=10.0, color="black", arrowhead=none]; } diff --git a/testdata/java/MultiAssoc.java b/testdata/java/MultiAssoc.java new file mode 100644 index 0000000..a7811f7 --- /dev/null +++ b/testdata/java/MultiAssoc.java @@ -0,0 +1,18 @@ +// $Id$ +// Regression test: there was a bug that made UMLGraph skip all associations +// of one kind if the first one was not to be printed (and more in general, +// to skip all those that followed the one with a hidden destination) +/** + * @opt hide B + * @hidden + */ +class UMLOptions {} + +/** + * @depend - - - B + * @depend - - - C + */ +class A {} +class B {} +class C {} + diff --git a/testdata/java/gr/spinellis/product/Category.java b/testdata/java/gr/spinellis/product/Category.java index cb9816f..c76fca5 100644 --- a/testdata/java/gr/spinellis/product/Category.java +++ b/testdata/java/gr/spinellis/product/Category.java @@ -1,6 +1,11 @@ package gr.spinellis.product; +import java.util.*; +/** + * @depend - - - java.util.List + */ public class Category { public String name; + List products; } diff --git a/testdata/java/gr/spinellis/views/ViewAll.java b/testdata/java/gr/spinellis/views/ViewAll.java index 02a21b1..baf0618 100644 --- a/testdata/java/gr/spinellis/views/ViewAll.java +++ b/testdata/java/gr/spinellis/views/ViewAll.java @@ -2,6 +2,7 @@ package gr.spinellis.views; /** * @view + * @opt hide java.* */ public class ViewAll { } diff --git a/testdata/java/gr/spinellis/views/ViewAllDetailed.java b/testdata/java/gr/spinellis/views/ViewAllDetailed.java index 847ed71..5d87b94 100644 --- a/testdata/java/gr/spinellis/views/ViewAllDetailed.java +++ b/testdata/java/gr/spinellis/views/ViewAllDetailed.java @@ -2,6 +2,7 @@ package gr.spinellis.views; /** * @view + * @opt hide java.* * * @match gr.spinellis.* * @opt attributes diff --git a/testdata/java/gr/spinellis/views/ViewAtt.java b/testdata/java/gr/spinellis/views/ViewAtt.java index cda44be..241c7fa 100644 --- a/testdata/java/gr/spinellis/views/ViewAtt.java +++ b/testdata/java/gr/spinellis/views/ViewAtt.java @@ -2,6 +2,7 @@ package gr.spinellis.views; /** * @view + * @opt hide java.* * * @match gr.spinellis.* * @opt attributes diff --git a/testdata/java/gr/spinellis/views/ViewColors.java b/testdata/java/gr/spinellis/views/ViewColors.java new file mode 100644 index 0000000..a133fe5 --- /dev/null +++ b/testdata/java/gr/spinellis/views/ViewColors.java @@ -0,0 +1,12 @@ +package gr.spinellis.views; + +/** + * @view + + * @match .* + * @opt nodefillcolor gray + * @match gr.spinellis.* + * @opt nodefillcolor yellow + */ +public class ViewColors { +}