MCPcopy Create free account
hub / github.com/apple/foundationdb / smokeTest

Method smokeTest

recipes/java-recipes/MicroGraph.java:159–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157 }
158
159 public static void smokeTest(){
160 /*
161 * A simple directed graph:
162 *
163 * A <-> B -> C
164 * ^
165 * |
166 * D <- E
167 */
168
169 setEdge(db,"A","B");
170 setEdge(db,"B","A");
171 setEdge(db,"B","C");
172 setEdge(db,"D","B");
173 setEdge(db,"E","D");
174
175 String[] nodes = {"A","B","C","D","E"};
176
177 for(String node : nodes){
178 System.out.println(node + " "
179 + getOutNeighbors(db,node).toString() + " "
180 + getInNeighbors(db,node).toString());
181 }
182
183 /*
184 * Simple weighted graph.
185 *
186 * A -4-> B <-2- C
187 * ^
188 * 3
189 * |
190 * D -(-1)-> E
191 */
192 setEdgeWeighted(db,"A","B",4l);
193 setEdgeWeighted(db,"C","B",2l);
194 setEdgeWeighted(db,"D","B",3l);
195 setEdgeWeighted(db,"D","E",-1l);
196
197 System.out.println(getWeight(db,"A","B"));
198 System.out.println(getWeight(db,"C","B"));
199 System.out.println(getWeight(db,"D","B"));
200 System.out.println(getWeight(db,"D","E"));
201
202 updateEdgeWeight(db,"D","B",27l);
203
204 System.out.println(getWeight(db,"A","B"));
205 System.out.println(getWeight(db,"C","B"));
206 System.out.println(getWeight(db,"D","B"));
207 System.out.println(getWeight(db,"D","E"));
208 }
209
210 public static void main(String[] args) {
211 clearSubspace(db, graph);

Callers 1

mainMethod · 0.95

Calls 7

setEdgeMethod · 0.95
getOutNeighborsMethod · 0.95
getInNeighborsMethod · 0.95
setEdgeWeightedMethod · 0.95
getWeightMethod · 0.95
updateEdgeWeightMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected