Examples of SimpleCredentials


Examples of javax.jcr.SimpleCredentials

     * @param adminUser the name of the administrative user.
     * @return a Credentials implementation that represents the administrative user.
     */
    protected Credentials getAdministrativeCredentials(String adminUser){
        // NB: this method is overridden in the Jackrabbit Service bundle to avoid using the admin password. SLING-1282
        return new SimpleCredentials(adminUser, adminPass);
    }
View Full Code Here

Examples of javax.jcr.SimpleCredentials

    private Repository getRepository() {
      return repository;
    }
   
    private Session createSession() throws RepositoryException {
        final Credentials credentials = new SimpleCredentials("admin",
                "admin".toCharArray());
        return repository.login(credentials, "default");
    }
View Full Code Here

Examples of javax.jcr.SimpleCredentials

    private void doPropertyChangeTest(Object initialPropertyValues, Object newPropertyValues)
            throws RepositoryException, org.apache.sling.ide.transport.RepositoryException {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);
        try {
            Node contentNode = session.getRootNode().addNode("content");
            if (initialPropertyValues instanceof String) {
                contentNode.setProperty(PROP_NAME, (String) initialPropertyValues);
View Full Code Here

Examples of javax.jcr.SimpleCredentials

    @Test
    public void changeNtFolderToSlingFolderWithAddedProperty() throws Exception {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);

        InputStream cndInput = getClass().getResourceAsStream("folder.cnd");
        CndImporter.registerNodeTypes(new InputStreamReader(cndInput), session);
View Full Code Here

Examples of javax.jcr.SimpleCredentials

    @Test
    public void changeSlingFolderToNtFolderWithExistingProperty() throws Exception {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);

        InputStream cndInput = getClass().getResourceAsStream("folder.cnd");
        CndImporter.registerNodeTypes(new InputStreamReader(cndInput), session);
View Full Code Here

Examples of javax.jcr.SimpleCredentials

    @Ignore("SLING-4036")
    public void updateNtUnstructuredToNodeWithRequiredProperty() throws Exception {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);

        InputStream cndInput = getClass().getResourceAsStream("mandatory.cnd"); // TODO - should be test-definitions.cnd
        CndImporter.registerNodeTypes(new InputStreamReader(cndInput), session);
View Full Code Here

Examples of javax.jcr.SimpleCredentials

    }

    @Override
    public User getUser(final Credentials credentials) {
        if (credentials instanceof SimpleCredentials) {
            final SimpleCredentials simpleCredentials = (SimpleCredentials) credentials;
            final String userId = simpleCredentials.getUserID();
            return getUser(userId);
        }
        return null;
    }
View Full Code Here

Examples of javax.jcr.SimpleCredentials

        Repository repository = JcrUtils.getRepository(HttpTest.HTTP_BASE_URL + "/server/");
        Session jcrSession = null;
        TestEventListener listener = new TestEventListener();
        ObservationManager observationManager = null;
        try {
            jcrSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
            observationManager = jcrSession.getWorkspace().getObservationManager();
          String testNodePath = testNodeUrl.substring(HttpTest.HTTP_BASE_URL.length());
            observationManager.addEventListener(listener,
          Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED, //event types
          testNodePath, //absPath
View Full Code Here

Examples of javax.jcr.SimpleCredentials

        }

        File out = new File(new File("target"), "jackrabbit");

        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);
        List<String> finalOrder;
        try {
            Node content = session.getRootNode().addNode("content");
View Full Code Here

Examples of javax.jcr.SimpleCredentials

        testClient.createNode(url, props);

        // Oak does not support login without credentials, so to
        // verify that davex access works we do need valid repository credentials.
        final Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repository.login(creds);

        try {
            final Node node = session.getNode(path);
            assertNotNull(node);
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.