Source code: com/phoenixst/plexus/StaticGraphTest.java
1 /*
2 * $Id: StaticGraphTest.java,v 1.4 2003/10/09 20:57:22 rconner Exp $
3 *
4 * Copyright (C) 1994-2003 by Phoenix Software Technologists,
5 * Inc. and others. All rights reserved.
6 *
7 * THIS PROGRAM AND DOCUMENTATION IS PROVIDED UNDER THE TERMS OF THE
8 * COMMON PUBLIC LICENSE ("AGREEMENT") WHICH ACCOMPANIES IT. ANY
9 * USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
10 * RECIPIENT'S ACCEPTANCE OF THE AGREEMENT.
11 *
12 * The license text can also be found at
13 * http://opensource.org/licenses/cpl.php
14 */
15
16 package com.phoenixst.plexus;
17
18 import junit.framework.*;
19
20
21 /**
22 * A {@link Graph} tester which uses a single static graph, mostly
23 * for ease of use when testing with beanshell.
24 *
25 * @version $Revision: 1.4 $
26 * @author Ray A. Conner
27 *
28 * @since 1.0
29 */
30 public class StaticGraphTest
31 {
32
33 protected static Graph staticGraph;
34
35
36 public static Graph getGraph()
37 {
38 return staticGraph;
39 }
40
41
42 public static void setGraph( Graph graph )
43 {
44 staticGraph = graph;
45 }
46
47
48 public static Test suite()
49 {
50 String suiteName;
51 if( staticGraph instanceof DefaultGraph ) {
52 suiteName = "";
53 } else {
54 suiteName = staticGraph.toString();
55 }
56 return DefaultGraphTest.suite( staticGraph, suiteName );
57 }
58
59 }