Search in sources :

Example 26 with JcrNode

use of org.apache.sling.ide.eclipse.ui.nav.model.JcrNode in project sling by apache.

the class JcrNodeCreationTest method createNtFolderNode.

@Test
public void createNtFolderNode() throws Exception {
    JcrNode contentNode = syncDirNode.getNode("/content/test-root");
    contentNode.createChild("folder", "nt:folder");
    assertThat(projectRule.getProject(), hasFolder("/jcr_root/content/test-root/folder"));
}
Also used : JcrNode(org.apache.sling.ide.eclipse.ui.nav.model.JcrNode) Test(org.junit.Test)

Example 27 with JcrNode

use of org.apache.sling.ide.eclipse.ui.nav.model.JcrNode in project sling by apache.

the class JcrNodeCreationTest method createFullCoverageNodeUnderFolder.

@Test
public void createFullCoverageNodeUnderFolder() throws Exception {
    JcrNode contentNode = syncDirNode.getNode("/content/test-root");
    contentNode.createChild("messages", "sling:OsgiConfig");
    assertThat(projectRule.getProject(), hasFile("/jcr_root/content/test-root/messages.xml"));
}
Also used : JcrNode(org.apache.sling.ide.eclipse.ui.nav.model.JcrNode) Test(org.junit.Test)

Aggregations

JcrNode (org.apache.sling.ide.eclipse.ui.nav.model.JcrNode)27 ISelection (org.eclipse.jface.viewers.ISelection)10 Test (org.junit.Test)8 SyncDir (org.apache.sling.ide.eclipse.ui.nav.model.SyncDir)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 JcrContentContentProvider (org.apache.sling.ide.eclipse.ui.nav.JcrContentContentProvider)3 Shell (org.eclipse.swt.widgets.Shell)3 PartInitException (org.eclipse.ui.PartInitException)3 IPropertyDescriptor (org.eclipse.ui.views.properties.IPropertyDescriptor)3 Map (java.util.Map)2 Entry (java.util.Map.Entry)2 IFile (org.eclipse.core.resources.IFile)2 IProject (org.eclipse.core.resources.IProject)2 Point (org.eclipse.swt.graphics.Point)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 NodeType (javax.jcr.nodetype.NodeType)1 PropertyDefinition (javax.jcr.nodetype.PropertyDefinition)1 JcrProperty (org.apache.sling.ide.eclipse.ui.nav.model.JcrProperty)1