File: TestXdmfEquals.java

package info (click to toggle)
xdmf 3.0%2Bgit20160803-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 35,388 kB
  • ctags: 36,627
  • sloc: ansic: 265,382; cpp: 162,889; python: 10,976; f90: 1,378; yacc: 687; fortran: 464; xml: 200; java: 187; lex: 125; makefile: 82; sh: 28
file content (149 lines) | stat: -rw-r--r-- 5,517 bytes parent folder | download | duplicates (6)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import mil.army.arl.xdmf.*;

public class TestXdmfEquals
{
    public static void main (String argv[])
	{
        System.out.println("Hello World");

	System.out.println("Checking XdmfAttributeCenter");	
	XdmfAttributeCenter xac1 = XdmfAttributeCenter.Grid();
	XdmfAttributeCenter xac2 = XdmfAttributeCenter.Grid();
	XdmfAttributeCenter xac3 = XdmfAttributeCenter.Cell();
	
	// Check IsEquals
	if(!(xac1.IsEqual(xac2))) /*True*/
		throw new SecurityException("Failed True Check");
	if((xac1.IsEqual(xac3))) /*False*/ 
    		throw new SecurityException("Failed False Check");	

	// Check equals
	if(!(xac1.equals(xac2))) /*True*/ 
		throw new SecurityException("Failed True Check (equals)");
	if(xac1.equals(xac3)) /*False*/ 
		throw new SecurityException("Failed False Check (equals)");

    	// Check ==
	if(xac1 == xac2) /*False*/ 
		throw new SecurityException("Failed True Check (==)");
	if(xac1 == xac3) /*False*/ 
		throw new SecurityException("Failed False Check (==)");

	System.out.println("Checking XdmfAttributeType");	
	XdmfAttributeType xat1 = XdmfAttributeType.Scalar();
	XdmfAttributeType xat2 = XdmfAttributeType.Scalar();
	XdmfAttributeType xat3 = XdmfAttributeType.Tensor();
	
	// Check IsEquals
	if(!(xat1.IsEqual(xat2))) /*True*/
		throw new SecurityException("Failed True Check");
	if((xat1.IsEqual(xat3))) /*False*/ 
    		throw new SecurityException("Failed False Check");	

	// Check equals
	if(!(xat1.equals(xat2))) /*True*/ 
		throw new SecurityException("Failed True Check (equals)");
	if(xat1.equals(xat3)) /*False*/ 
		throw new SecurityException("Failed False Check (equals)");

    	// Check ==
	if(xat1 == xat2) /*False*/ 
		throw new SecurityException("Failed True Check (==)");
	if(xat1 == xat3) /*False*/ 
		throw new SecurityException("Failed False Check (==)");

	System.out.println("Checking XdmfGeometryType");	
	XdmfGeometryType xgt1 = XdmfGeometryType.XYZ();
	XdmfGeometryType xgt2 = XdmfGeometryType.XYZ();
	XdmfGeometryType xgt3 = XdmfGeometryType.XY();
	
	// Check IsEquals
	if(!(xgt1.IsEqual(xgt2))) /*True*/
		throw new SecurityException("Failed True Check");
	if((xgt1.IsEqual(xgt3))) /*False*/ 
    		throw new SecurityException("Failed False Check");	

	// Check equals
	if(!(xgt1.equals(xgt2))) /*True*/ 
		throw new SecurityException("Failed True Check (equals)");
	if(xgt1.equals(xgt3)) /*False*/ 
		throw new SecurityException("Failed False Check (equals)");

    	// Check ==
	if(xgt1 == xgt2) /*False*/ 
		throw new SecurityException("Failed True Check (==)");
	if(xgt1 == xgt3) /*False*/ 
		throw new SecurityException("Failed False Check (==)");

	System.out.print("Checking XdmfGridCollection");
	XdmfGridCollectionType xgct1 = XdmfGridCollectionType.Spatial();
        XdmfGridCollectionType xgct2 = XdmfGridCollectionType.Spatial();
        XdmfGridCollectionType xgct3 = XdmfGridCollectionType.Temporal();

        // Check IsEquals
        if(!(xgct1.IsEqual(xgct2))) /*True*/
                throw new SecurityException("Failed True Check");
        if((xgct1.IsEqual(xgct3))) /*False*/
                throw new SecurityException("Failed False Check");

        // Check equals
        if(!(xgct1.equals(xgct2))) /*True*/
                throw new SecurityException("Failed True Check (equals)");
        if(xgct1.equals(xgct3)) /*False*/
                throw new SecurityException("Failed False Check (equals)");

        // Check ==
        if(xgct1 == xgct2) /*False*/
                throw new SecurityException("Failed True Check (==)");
        if(xgct1 == xgct3) /*False*/
                throw new SecurityException("Failed False Check (==)");
	
	System.out.println("Checking XdmfSetType");
	XdmfSetType xst1 = XdmfSetType.Node();
        XdmfSetType xst2 = XdmfSetType.Node();
        XdmfSetType xst3 = XdmfSetType.Face();

        // Check IsEquals
        if(!(xst1.IsEqual(xst2))) /*True*/
                throw new SecurityException("Failed True Check");
        if((xst1.IsEqual(xst3))) /*False*/
                throw new SecurityException("Failed False Check");

        // Check equals
        if(!(xst1.equals(xst2))) /*True*/
                throw new SecurityException("Failed True Check (equals)");
        if(xst1.equals(xst3)) /*False*/
                throw new SecurityException("Failed False Check (equals)");

        // Check ==
        if(xst1 == xst2) /*False*/
                throw new SecurityException("Failed True Check (==)");
        if(xst1 == xst3) /*False*/
                throw new SecurityException("Failed False Check (==)");


	System.out.println("Checking XdmfTopologyType");
 	XdmfTopologyType xtt1 = XdmfTopologyType.Polyvertex();
        XdmfTopologyType xtt2 = XdmfTopologyType.Polyvertex();
        XdmfTopologyType xtt3 = XdmfTopologyType.Polyline(0);

        // Check IsEquals
        if(!(xtt1.IsEqual(xtt2))) /*True*/
                throw new SecurityException("Failed True Check");
        if((xtt1.IsEqual(xtt3))) /*False*/
                throw new SecurityException("Failed False Check");

        // Check equals
        if(!(xtt1.equals(xtt2))) /*True*/
                throw new SecurityException("Failed True Check (equals)");
        if(xtt1.equals(xtt3)) /*False*/
                throw new SecurityException("Failed False Check (equals)");

        // Check ==
        if(xtt1 == xtt2) /*False*/
                throw new SecurityException("Failed True Check (==)");
        if(xtt1 == xtt3) /*False*/
                throw new SecurityException("Failed False Check (==)");

    }
}