Examples of ProjectAdapter


Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

    public void slingContentProjectIsExportable() throws CoreException, InterruptedException {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        assertThat("Sling content project can be exported",
                new ContentResourceTester().test(contentProject, "canBeExported", null, null), equalTo(true));
    }
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

    public void slingContentProjectSyncedResourcesAreExportable() throws CoreException, InterruptedException {
       
        // create faceted project
        IProject contentProject = projectRule.getProject();
       
        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
       
        // install bundle facet
        project.installFacet("sling.content", "1.0");
       
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"), new ByteArrayInputStream(
                "goodbye, world".getBytes()));
       
        assertThat("Content sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root"), "canBeExported", null, null), equalTo(true));
        assertThat("Dir under sync dir can be exported",
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

    public void slingContentProjectUnrelatedResourcesAreNotExportable() throws CoreException, InterruptedException {
       
        // create faceted project
        IProject contentProject = projectRule.getProject();
       
        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
       
        // install bundle facet
        project.installFacet("sling.content", "1.0");
       
        project.createOrUpdateFile(Path.fromPortableString("res/hello.txt"), new ByteArrayInputStream(
                "goodbye, world".getBytes()));
       
        assertThat("Dir not under content sync dir can not be exported",
                new ContentResourceTester().test(contentProject.findMember("res"), "canBeExported", null, null), equalTo(false));
        assertThat("File not under content sync dir can not be exported",
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

    public void projectMembersContainContentXmlFirst() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/1_file.txt"), new ByteArrayInputStream(
                new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/2_folder/filler.txt"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/3_file.txt"), new ByteArrayInputStream(
                new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/4_folder/filler.txt"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/5_file.txt"), new ByteArrayInputStream(
                new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/.content.xml"), new ByteArrayInputStream(
                new byte[0]));

        IModule module = ServerUtil.getModule(contentProject);

        SlingContentModuleFactory moduleFactory = new SlingContentModuleFactory();
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

    public void projectMembersContainDotDirFoldersLast() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/testproject/_jcr_content/image/file"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(
                Path.fromPortableString("jcr_root/content/testproject/_jcr_content/image/file.dir/.content.xml"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(
                Path.fromPortableString("jcr_root/content/testproject/_jcr_content/image/file.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png"),
                new ByteArrayInputStream(new byte[0]));

        IModule module = ServerUtil.getModule(contentProject);
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

    public void slingContentProjectSyncedResourcesAreExportable() throws CoreException, InterruptedException {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        project.createVltFilterWithRoots();
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"), new ByteArrayInputStream(
                "goodbye, world".getBytes()));


        IPath filterPath = ProjectUtil.findFilterPath(contentProject);
        assertThat("filterPath.absolute", filterPath.isAbsolute(), equalTo(true));
View Full Code Here

Examples of org.objectstyle.wolips.core.resources.types.project.ProjectAdapter

    }
    IProject iProject = ResourcesPlugin.getWorkspace().getRoot().getProject(argument);
    if (iProject == null || !iProject.exists() || !iProject.isAccessible()) {
      throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, IStatus.ERROR, "Could not find or open project: " + argument, null)); //$NON-NLS-1$
    }
    ProjectAdapter project = (ProjectAdapter) iProject.getAdapter(ProjectAdapter.class);
    IPath workingDir = null;
    if (project != null) {
      workingDir = project.getWorkingDir();
    }
    if (workingDir == null) {
      throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, IStatus.ERROR, "Could not find working dir for project: " + argument, null)); //$NON-NLS-1$
    }
    return workingDir.toString();
View Full Code Here

Examples of org.objectstyle.wolips.core.resources.types.project.ProjectAdapter

  public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, IJavaProject project) throws CoreException {
    if (project == null || entry == null) {
      // cannot resolve without entry or project context
      return new IRuntimeClasspathEntry[0];
    }
    ProjectAdapter projectAdapter = (ProjectAdapter)project.getProject().getAdapter(ProjectAdapter.class);
    IClasspathEntry cp = entry.getClasspathEntry();
    if (projectAdapter != null && projectAdapter.isFramework()) {
      if (cp != null && !cp.isExported() && cp.getPath() != null && cp.getPath().segmentCount() > 0 && WOFrameworkClasspathContainer.ID.equals(cp.getPath().segment(0))) {
        return new IRuntimeClasspathEntry[0];
      }
    }
    IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
View Full Code Here

Examples of org.objectstyle.wolips.core.resources.types.project.ProjectAdapter

   */
  public File verifyWorkingDirectory(ILaunchConfiguration configuration) throws CoreException {
    IProject theProject = this.getJavaProject(configuration).getProject();

    // IPath wd = getWorkingDirectoryPath(configuration);
    ProjectAdapter projectAdaptor = (ProjectAdapter) theProject.getAdapter(ProjectAdapter.class);

    IContainer workingDirectoryFolder = projectAdaptor.getWorkingDirFolder();
    File workingDirectoryFile;
    if (workingDirectoryFolder == null) {
      workingDirectoryFile = super.verifyWorkingDirectory(configuration);
    } else {
      workingDirectoryFile = workingDirectoryFolder.getLocation().toFile();
View Full Code Here

Examples of org.objectstyle.wolips.core.resources.types.project.ProjectAdapter

      visitedProjects.add(project);
      if (project.equals(buildProject)) {
        searchPathBuffer.append("\"..\",\"../..\"");
      }
      if (isValidProjectPath(project)) {
        ProjectAdapter projectAdapter = (ProjectAdapter) project.getAdapter(ProjectAdapter.class);
        if (projectAdapter != null && projectAdapter.isFramework()) {
          searchPathBuffer.append(",\"");
          searchPathBuffer.append(project.getLocation().toOSString());
          searchPathBuffer.append("\"");
        }
      } else {
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.