net.sf.farrago.test
Class JmiModelTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.test.DiffTestCase
              extended by net.sf.farrago.test.ResultSetTestCase
                  extended by net.sf.farrago.test.FarragoTestCase
                      extended by net.sf.farrago.test.JmiModelTest
All Implemented Interfaces:
Test

public class JmiModelTest
extends FarragoTestCase

JmiModelTest is a unit test for JmiModelGraph and JmiModelView.

NOTE: this test lives here rather than under org.eigenbase because it currently depends on MDR for a JMI implementation.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/test/JmiModelTest.java#11 $
Author:
John V. Sichi

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.farrago.test.FarragoTestCase
FarragoTestCase.Cleanup, FarragoTestCase.CleanupFactory
 
Field Summary
 
Fields inherited from class net.sf.farrago.test.FarragoTestCase
allocOwner, connection, preparedStmt, repos, stmt, tracer
 
Fields inherited from class net.sf.farrago.test.ResultSetTestCase
resultSet
 
Fields inherited from class org.eigenbase.test.DiffTestCase
logFile, logOutputStream, refFile
 
Constructor Summary
JmiModelTest(String testName)
          Creates a new JmiModelTest object.
 
Method Summary
private
<V,E> void
diffGraph(org.jgrapht.DirectedGraph<V,E> graph)
           
private
<T> void
dumpList(PrintWriter pw, List<T> list)
           
private
<T> void
dumpNamedSet(PrintWriter pw, String name, Set<T> set)
           
private  void dumpViewVertex(PrintWriter pw, JmiModelView view, JmiClassVertex vertex)
           
private  JmiModelGraph getMofModelGraph()
           
static Test suite()
           
 void testAssocGraph()
          Tests construction of the association graph for the MOF model.
 void testInheritanceGraph()
          Tests construction of the inheritance graph for the MOF model.
 void testModelGraph()
          Tests construction of the JmiModelGraph for the MOF model.
 void testModelView()
          Tests construction of a JmiModelView for the MOF model.
 
Methods inherited from class net.sf.farrago.test.FarragoTestCase
forceShutdown, getJdbcUri, getSession, getTestlogRoot, getTestlogRootStatic, newConnection, newJdbcEngineDriver, restoreParameters, restoreParameters, runCleanup, runSqlLineTest, runSqlLineTest, saveParameters, saveParameters, setRefFileDiffMasks, setUp, shouldDiff, staticSetUp, staticTearDown, tearDown, tearDownImpl, wrappedSuite, wrappedSuite
 
Methods inherited from class net.sf.farrago.test.ResultSetTestCase
compareResultList, compareResultLists, compareResultSet, compareResultSetWithDelta, compareResultSetWithPattern, getResultSetCount
 
Methods inherited from class org.eigenbase.test.DiffTestCase
addDiffMask, addIgnorePattern, diffFile, diffLines, diffTestLog, fileContents, openTestLog, openTestLogOutputStream, setGC, setVerbose
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JmiModelTest

public JmiModelTest(String testName)
             throws Exception
Creates a new JmiModelTest object.

Parameters:
testName - JUnit test name
Throws:
Exception - .
Method Detail

suite

public static Test suite()

testModelGraph

public void testModelGraph()
                    throws Exception
Tests construction of the JmiModelGraph for the MOF model.

Throws:
Exception

testInheritanceGraph

public void testInheritanceGraph()
                          throws Exception
Tests construction of the inheritance graph for the MOF model.

Throws:
Exception

testAssocGraph

public void testAssocGraph()
                    throws Exception
Tests construction of the association graph for the MOF model.

Throws:
Exception

testModelView

public void testModelView()
                   throws Exception
Tests construction of a JmiModelView for the MOF model.

Throws:
Exception

getMofModelGraph

private JmiModelGraph getMofModelGraph()
                                throws Exception
Throws:
Exception

diffGraph

private <V,E> void diffGraph(org.jgrapht.DirectedGraph<V,E> graph)
                throws Exception
Throws:
Exception

dumpViewVertex

private void dumpViewVertex(PrintWriter pw,
                            JmiModelView view,
                            JmiClassVertex vertex)

dumpNamedSet

private <T> void dumpNamedSet(PrintWriter pw,
                              String name,
                              Set<T> set)

dumpList

private <T> void dumpList(PrintWriter pw,
                          List<T> list)