Examples of ModelWrapper


Examples of org.geppetto.core.model.ModelWrapper

  private static final String COLLADA = "COLLADA";

  @Override
  public IModel readModel(URL url, List<URL> recordings, String instancePath) throws ModelInterpreterException
  {
    ModelWrapper collada = new ModelWrapper(instancePath);
    try
    {
      Scanner scanner = new Scanner(url.openStream(), "UTF-8");
      String colladaContent = scanner.useDelimiter("\\A").next();
      scanner.close();
      collada.wrapModel(COLLADA, colladaContent);
    }
    catch(IOException e)
    {
      throw new ModelInterpreterException(e);
    }
View Full Code Here

Examples of org.geppetto.core.model.ModelWrapper

  private static final String OBJ = "OBJ";

  @Override
  public IModel readModel(URL url, List<URL> recordings, String instancePath) throws ModelInterpreterException
  {
    ModelWrapper collada = new ModelWrapper(instancePath);
    try
    {
      Scanner scanner = new Scanner(url.openStream(), "UTF-8");
      String objContent = scanner.useDelimiter("\\A").next();
      scanner.close();
      collada.wrapModel(OBJ, objContent);
    }
    catch(IOException e)
    {
      throw new ModelInterpreterException(e);
    }
View Full Code Here

Examples of org.jboss.seam.rest.templating.ModelWrapper

        model.getData().put(annotation.responseName(), o);

        try {
            OutputStreamWriter writer = new OutputStreamWriter(os);
            template.process(new ModelWrapper(model.getData(), manager), writer);
            writer.flush();
        } catch (TemplateException e) {
            throw new RuntimeException("Unable to write FreeMarker response.", e);
        }
    }
View Full Code Here

Examples of org.jboss.seam.rest.templating.ModelWrapper

        Velocity.init(properties);
    }

    public void writeTo(Object o, ResponseTemplate annotation, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders, OutputStream os) throws IOException {
        ModelWrapper model = new ModelWrapper(this.model.getData(), manager);
        model.put(annotation.responseName(), o);

        Template template = null;
        template = Velocity.getTemplate(annotation.value());

        OutputStreamWriter writer = new OutputStreamWriter(os);
View Full Code Here

Examples of org.openengsb.core.api.model.ModelWrapper

        assertThat(bool, is(model.getTestBoolean()));
    }

    @Test
    public void testIfAddOpenEngSBModelEntryWork_shouldWork() throws Exception {
        ModelWrapper wrapper = ModelWrapper.wrap(new TestModel());
        wrapper.addOpenEngSBModelEntry(new OpenEngSBModelEntry("test", "test", String.class));
        List<OpenEngSBModelEntry> entries = wrapper.toOpenEngSBModelEntries();
        String test = null;
        for (OpenEngSBModelEntry entry : entries) {
            if (entry.getKey().equals("test")) {
                test = (String) entry.getValue();
            }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelWrapper

        assertThat(test, is("test"));
    }
   
    @Test
    public void testIfToOpenEngSBModelValuesWork_shouldWork() throws Exception {
        ModelWrapper wrapper = ModelWrapper.wrap(new TestModel());
        int before = wrapper.toOpenEngSBModelValues().size();
        wrapper.addOpenEngSBModelEntry(new OpenEngSBModelEntry("test", "test", String.class));
        int after = wrapper.toOpenEngSBModelValues().size();
        assertThat(before, is(after));
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelWrapper

        assertThat(before, is(after));
    }

    @Test
    public void testIfRemoveOpenEngSBModelEntryWork_shouldWork() throws Exception {
        ModelWrapper wrapper = ModelWrapper.wrap(new TestModel());
        wrapper.addOpenEngSBModelEntry(new OpenEngSBModelEntry("test", "test", String.class));
        wrapper.removeOpenEngSBModelEntry("test");
        // the result has three elements even though the model has four properties,
        // since the third property is ignored
        assertThat(wrapper.toOpenEngSBModelEntries().size(), is(3));
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelWrapper

        assertThat(id, is(model.getId()));
    }

    @Test
    public void testIfModelTailRetrievingWorks_shouldWork() throws Exception {
        ModelWrapper wrapper = ModelWrapper.wrap(new TestModel());
        wrapper.addOpenEngSBModelEntry(new OpenEngSBModelEntry("test", "test", String.class));
        List<OpenEngSBModelEntry> tail = wrapper.getOpenEngSBModelTail();
        assertThat(tail.size(), is(1));
        assertThat(tail.get(0).getKey(), is("test"));
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelWrapper

        assertThat(tail.get(0).getKey(), is("test"));
    }

    @Test
    public void testIfModelTailSettingWorks_shouldWork() throws Exception {
        ModelWrapper wrapper = ModelWrapper.wrap(new TestModel());
        List<OpenEngSBModelEntry> entries = new ArrayList<OpenEngSBModelEntry>();
        entries.add(new OpenEngSBModelEntry("test", "test", String.class));
        entries.add(new OpenEngSBModelEntry("test2", "test2", String.class));
        entries.add(new OpenEngSBModelEntry("test3", "test3", String.class));
        wrapper.setOpenEngSBModelTail(entries);
        assertThat(wrapper.getOpenEngSBModelTail().size(), is(3));
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelWrapper

        assertThat(wrapper.getOpenEngSBModelTail().size(), is(3));
    }

    @Test
    public void testIfNullModelTailSettingWorks_shouldThrowNoException() throws Exception {
        ModelWrapper wrapper = ModelWrapper.wrap(new TestModel());
        wrapper.setOpenEngSBModelTail(null);
        assertThat(wrapper.getOpenEngSBModelTail().size(), is(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.