Package org.openiaml.model.model

Examples of org.openiaml.model.model.InternetApplication


          }
         
        };
       
        EObject model = ModelLoader.load(modelFile);
        InternetApplication root = (InternetApplication) model;
       
        // try inferring it
        resetInferenceCache();
        infer(root, true, reloader);
       
        // now iterate over its contents       
        handleEObject(root, rc);
        TreeIterator<EObject> it = root.eAllContents();
        while (it.hasNext()) {
          handleEObject(it.next(), rc);
        }
      } catch (ModelLoadException e) {
        // ignore
View Full Code Here


    copyFiles();
   
    // try and load the file directly
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(targetModel.getFullPath().toString(), false), true);   
    InternetApplication model = (InternetApplication) resource.getContents().get(0);
   
    // get the Frame
    assertEquals(0, model.getIterators().size());
    assertEquals(0, model.getLoginHandlers().size());
    assertEquals(0, model.getAccessHandlers().size());
    assertEquals(1, model.getScopes().size());
    Frame page = (Frame) model.getScopes().get(0);
   
    assertEquals(3, page.getWires().size());
   
    for (Wire w : model.getWires()) {
      assertNotNull(w.getFrom());
      assertNull(w.getTo());
    }
  }
View Full Code Here

    act.doExecute(targetModel, new NullProgressMonitor());

    // try and load the file directly
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(targetModel.getFullPath().toString(), false), true);   
    InternetApplication model = (InternetApplication) resource.getContents().get(0);
   
    // get the Frame
    assertEquals(0, model.getIterators().size());
    assertEquals(0, model.getLoginHandlers().size());
    assertEquals(0, model.getAccessHandlers().size());
    assertEquals(1, model.getScopes().size());
    Frame page = (Frame) model.getScopes().get(0);

    // no more wires
    assertEquals(0, page.getWires().size());

  }
View Full Code Here

    // do the action
    RewriteElementIDs action = new RewriteElementIDs();
    runAction(action, targetModel);
   
    // get the rewritten model
    InternetApplication model = (InternetApplication) action.getModel();
   
    // none of the contained elements should have an ID containing '.' or 'model'
    Iterator<EObject> it = model.eAllContents();
    while (it.hasNext()) {
      EObject obj = it.next();
      if (obj instanceof GeneratedElement) {
        assertFalse("Object " + obj + " contains an invalid ID", ((GeneratedElement) obj).getId().contains("."));
        assertFalse("Object " + obj + " contains an invalid ID", ((GeneratedElement) obj).getId().contains("model"));
        assertFalse("Object " + obj + " contains an invalid ID", ((GeneratedElement) obj).getId().contains("visual"));
      }
    }
   
    // also check the root element
    assertFalse("Object " + model + " contains an invalid ID", model.getId().contains("."));
    assertFalse("Object " + model + " contains an invalid ID", model.getId().contains("model"));
    assertFalse("Object " + model + " contains an invalid ID", model.getId().contains("visual"));
   
  }
View Full Code Here

      IModelReloader reloader = new IModelReloader() {
        @Override
        public EObject reload() throws InferenceException {
          try {
            InternetApplication root = (InternetApplication) DroolsPerformanceTest.this.reload();
            ICreateElementsFactory factory = CachedModelInferer.getInstance().createCreateElementsFactory();
            EcoreCreateElementsHelper handler = (EcoreCreateElementsHelper) factory.createHandler(root);
           
            // add the pages etc
            for (int j = 0; j < i_copy; j++) {
              Frame page = handler.createFrame(root);
              page.setName("test page " + j);
             
              /*
              Button button = (Button) handler.createElement(page, VisualPackage.eINSTANCE.getButton(), ModelPackage.eINSTANCE.getInternetApplication_Children());
              button.setName("test button " + j);
              */
             
              InputTextField text = (InputTextField) handler.createElement(page, VisualPackage.eINSTANCE.getInputTextField(), VisualPackage.eINSTANCE.getFrame_Children());
              text.setName("test field " + j);
             
            }
           
            return root;
          } catch (ModelLoadException e) {
            throw new InferenceException(e);
          }
        }
      };
     
      InternetApplication root = (InternetApplication) reloader.reload();
     
      infer(root, false, reloader);
    }
   
  }
View Full Code Here

    EObject model = loadModelDirectly(getTargetModel());
   
    // it should be an InternetApplication
    assertInstanceOf(InternetApplication.class, model);
   
    InternetApplication root = (InternetApplication) model;
    migratedModelTests(root);
  }
View Full Code Here

    Resource resource = resourceSet.createResource(uri);
    assertNotNull(resource);
    assertEquals("The new model should be empty.", 0, resource.getContents().size());

    // create a new object
    InternetApplication a = ModelFactory.eINSTANCE.createInternetApplication();
    resource.getContents().add(a);
   
    // return
    return a;
  }
View Full Code Here

      IProgressMonitor monitor) throws Exception {
    if (!inferCache.containsKey(loadClass)) {
      logTimed("infer", "loading model", "", "");
     
      // reload
      InternetApplication root = loader.loadDirectly(loadClass, logRuleSource);
     
      // we now try to do inference
      Resource resource = root.eResource();
      if (resource == null) {
        throw new IllegalArgumentException("EObject '" + root + "' has a null resource.");
      }
     
      ICreateElementsFactory handler = createCreateElementsFactory();
View Full Code Here

   * @throws IOException
   * @throws InferenceException
   * @throws FileNotFoundException
   */
  public InternetApplication loadAndInfer(IProvidesInferenceEngine provider, final String modelFile) throws ModelLoadException, FileNotFoundException, InferenceException, IOException {
    InternetApplication root = (InternetApplication) loader.loadModelDirectly(modelFile);
    return infer(provider, root, false, new IModelReloader() {

      @Override
      public EObject reload() throws InferenceException {
        try {
View Full Code Here

   * @param logRuleSource should the source of rules be logged?
   * @return The loaded InternetApplication
   * @throws Exception
   */
  protected InternetApplication loadAndCodegen(Class<?> modelFile, boolean logRuleSource) throws Exception {
    InternetApplication root = loadAndInfer(modelFile, logRuleSource);
    doCodegen(modelFile, root);
    return root;
  }
View Full Code Here

TOP

Related Classes of org.openiaml.model.model.InternetApplication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.