source: trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestOMCProxy.java @ 126

Last change on this file since 126 was 121, checked in by boris, 19 years ago
  • implemented the backend part for tree view browsing of file system based modelica packages
  • regressions test added for testing hierarchy of file system based packages
  • some API changes
  • general cleanups
File size: 1.0 KB
Line 
1
2package org.modelica.mdt.test;
3
4import java.util.Collections;
5import java.util.Vector;
6
7import org.modelica.mdt.internal.omcproxy.InitializationException;
8import org.modelica.mdt.internal.omcproxy.OMCProxy;
9
10import junit.framework.TestCase;
11
12public class TestOMCProxy extends TestCase
13{
14    private Vector<String> modelicaLibraryPackages = new Vector<String>(12);
15   
16    protected void setUp()
17    {
18        assertTrue(Collections.addAll(modelicaLibraryPackages,
19                "UsersGuide",
20                "Media",
21                "Utilities",
22                "Mechanics",
23                "Electrical",
24                "Math",
25                "Blocks",
26                "Thermal",
27                "Icons",
28                "Constants",
29                "SIunits",
30                "StateGraph"));
31    }
32    public void testGetPackages()
33    {
34        try
35        {
36            String[] str = OMCProxy.getPackages("Modelica");
37
38            assertNotNull("Could not fetch Modelica package", str);
39           
40            Vector<String> packages = new Vector<String>();
41            for(String s : str)
42            {
43                packages.addElement(s);
44            }
45
46            assertTrue(packages.containsAll(modelicaLibraryPackages));
47        }
48        catch(InitializationException e)
49        {
50            fail(e.getMessage());
51        }
52    }
53}
Note: See TracBrowser for help on using the repository browser.