Examples of createResource()


Examples of org.eclipse.bpmn2.util.Bpmn2ResourceFactoryImpl.createResource()

  @SuppressWarnings("unused")
  public static void main(String[] args) throws IOException, DocumentException {
    // TODO Auto-generated method stub
    Bpmn2ResourceFactoryImpl ddd = new Bpmn2ResourceFactoryImpl();
 
    Resource ddddResource = ddd.createResource(URI.createFileURI("/Users/jiangnan/Documents/MyCode/irondino/fixlogic/app/modules/lhl002/bpmn/testflow.bpmn"));

    ddddResource.load( null);
    Definitions myWeb = (Definitions) ddddResource.getContents().get(0).eContents().get(0);
    Object dddObject = myWeb;
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.Resource.Factory.createResource()

      return null;

    Map<String, String> options = Maps.newHashMap();
    options.put(XtextResource.OPTION_ENCODING, getEncodingProvider().getEncoding(uri));

    Resource r = factory.createResource(uri);
    resourceSet.getResources().add(r);
    r.load(in, options);

    return r;
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.ResourceSet.createResource()

              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource()

              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

Examples of org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryResourceFactoryImpl.createResource()

      EPackage.Registry.INSTANCE.put(JSF_LIBRARY_REGISTRY_NSURI, JSFLibraryRegistryPackageImpl.init());
      URI jsfLibRegURI = JSFLibraryRegistryUpgradeUtil.getRegistryURI(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_LATESTVERSION_URL);     
      JSFLibraryRegistryUpgradeUtil.getInstance().upgradeRegistryIfNecessary(JSFLibraryRegistryUpgradeUtil.LATESTVERSION);

      JSFLibraryRegistryResourceFactoryImpl resourceFactory = new JSFLibraryRegistryResourceFactoryImpl();
      jsfLibraryRegistryResource = (JSFLibraryRegistryResourceImpl)resourceFactory.createResource(jsfLibRegURI);
      try {
        Map options = new HashMap();
        //disable notifications during load to avoid changing stored default implementation
        options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
        jsfLibraryRegistryResource.load(options);
View Full Code Here

Examples of org.eclipse.jst.jsf.facesconfig.util.FacesConfigResourceFactory.createResource()

        tempFileStream.close();
        tempFileStream = null;
 
        FacesConfigResourceFactory factory = FacesConfigResourceFactory.createResourceFactoryForJar();
        //FacesConfigResourceFactory.register(tempFile.toURI().toString());
        Resource resource = factory.createResource(URI.createFileURI(tempFile.getAbsolutePath()));
       
        try {
                    if (resource != null) {
                        resource.load(Collections.EMPTY_MAP);
            EList resourceContents = resource.getContents();
View Full Code Here

Examples of org.eclipse.jst.tapestry.core.internal.tapestrylibraryregistry.util.TapestryLibraryRegistryResourceFactoryImpl.createResource()

      EPackage.Registry.INSTANCE.put(JSF_LIBRARY_REGISTRY_NSURI, TapestryLibraryRegistryPackageImpl.init());
      URI jsfLibRegURI = TapestryLibraryRegistryUpgradeUtil.getRegistryURI(TapestryLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_LATESTVERSION_URL);     
      TapestryLibraryRegistryUpgradeUtil.getInstance().upgradeRegistryIfNecessary(TapestryLibraryRegistryUpgradeUtil.LATESTVERSION);

      TapestryLibraryRegistryResourceFactoryImpl resourceFactory = new TapestryLibraryRegistryResourceFactoryImpl();
      jsfLibraryRegistryResource = (TapestryLibraryRegistryResourceImpl)resourceFactory.createResource(jsfLibRegURI);
      try {
        Map options = new HashMap();
        //disable notifications during load to avoid changing stored default implementation
        options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
        jsfLibraryRegistryResource.load(options);
View Full Code Here

Examples of org.guvnor.tools.utils.webdav.IWebDavClient.createResource()

                // Hack: When creating a file, if the actual contents are passed first,
                // the client hangs for about 20 seconds when closing the InputStream.
                // Don't know why...
                // But, if the file is created with empty contents, and then the contents
                // set, the operation is fast (less than a couple of seconds)
                res = client.createResource(fullPath, new ByteArrayInputStream(new byte[0]), false);
                if (res) {
                    client.putResource(fullPath, selectedFile.getContents());
                }
            } catch (WebDavException wde) {
                if (wde.getErrorCode() != IResponse.SC_UNAUTHORIZED) {
View Full Code Here

Examples of org.jboss.as.controller.OperationContext.createResource()

        final OperationContext context = Mockito.mock(OperationContext.class);
        Resource resource = Mockito.mock(Resource.class);
        Mockito.when(resource.getModel()).thenReturn(result);
        Mockito.when(context.getServiceRegistry(true)).thenReturn(serviceRegistry);
        Mockito.when(context.completeStep()).thenReturn(stepResult);
        Mockito.when(context.createResource(PathAddress.EMPTY_ADDRESS)).thenReturn(resource);
        Mockito.when(context.readResource(PathAddress.EMPTY_ADDRESS)).thenReturn(resource);
        Mockito.when(context.getProcessType()).thenReturn(ProcessType.STANDALONE_SERVER);
        Mockito.when(context.getRunningMode()).thenReturn(RunningMode.NORMAL);
        Mockito.when(context.isNormalServer()).thenReturn(true);
        Mockito.doAnswer(new Answer<Void>() {
View Full Code Here

Examples of org.jboss.on.plugins.tomcat.TomcatVHostComponent.createResource()

        when(mockContentContext.getContentServices()).thenReturn(mockContentServices);

        when(objectUnderTest.isWebApplication(any(File.class))).thenReturn(Boolean.TRUE);

        //run code under test
        when(objectUnderTest.createResource(any(CreateResourceReport.class))).thenCallRealMethod();
        objectUnderTest.createResource(mockCreateResourceReport);

        //verify the results (Assert and mock verification)
        verify(objectUnderTest).getEmsBean();
        verify(objectUnderTest, times(2)).getResourceContext();
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.