JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
TestRBLoading.java
Go to the documentation of this file.
1 
4 package rb.test;
5 
6 import static org.junit.Assert.assertTrue;
7 import static org.junit.Assert.fail;
9 import jarmos.ModelType;
13 
14 import org.junit.Test;
15 
16 import rb.RBContainer;
17 
23 public class TestRBLoading {
24 
28  @Test
29  public void testModelLoading() {
30  FileModelManager f = new FileModelManager();
31  try {
32  for (ModelDescriptor m : f.getModelDescriptors()) {
33  if (m.type == ModelType.JRB || m.type == ModelType.rbappmit) {
34  System.out.println("\n----------------- Trying to load model " + m.title + " from folder "
35  + m.modeldir + " -----------------\n");
36  try {
37  f.useModel(m.modeldir);
38  } catch (ModelManagerException e) {
39  e.printStackTrace();
40  fail(e.getMessage());
41  }
42 
43  assertTrue(f.modelFileExists(AModelManager.CLASSES_JARFILE));
44 
45  RBContainer rb = new RBContainer();
46  assertTrue(rb.loadModel(f));
47  }
48  }
49  } catch (ModelManagerException e) {
50  e.printStackTrace();
51  fail(e.getMessage());
52  }
53  }
54 
55 }
Manages models loaded from the file system available via the java.io classes.
Base class for RB models and systems.
Known model types within the JaRMoSBase project.
Definition: ModelType.java:9
This class serves as base class for accessing various types of models at different locations...
Represents a short description of a model managed by a model manager.
This Exception gets thrown when an error occurs regarding the functionality of the ModelManager...