jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edgarp...@apache.org
Subject svn commit: r233332 - in /incubator/jackrabbit/trunk/contrib/jcr-commands: ./ src/java/org/apache/jackrabbit/chain/ src/java/org/apache/jackrabbit/chain/cli/ src/java/org/apache/jackrabbit/chain/command/ src/test/org/apache/jackrabbit/chain/test/
Date Thu, 18 Aug 2005 16:38:46 GMT
Author: edgarpoce
Date: Thu Aug 18 09:38:24 2005
New Revision: 233332

URL: http://svn.apache.org/viewcvs?rev=233332&view=rev
Log:
added. connect to rmi server

Added:
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/ConnectToRmiServer.java
  (with props)
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractChainTest.java
  (with props)
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/JcrRmiServer.java
  (with props)
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/RemoteCommandsTest.java
  (with props)
Removed:
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractCommandTest.java
Modified:
    incubator/jackrabbit/trunk/contrib/jcr-commands/project.xml
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/RepositoryPool.java
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/command-line.xml
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/resources.properties
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/StartOrGetJackrabbitSingleton.java
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CliTest.java
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CommandsTest.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/project.xml?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/project.xml (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/project.xml Thu Aug 18 09:38:24 2005
@@ -136,6 +136,12 @@
       <type>jar</type>
       <url>http://www.day.com/maven/jsr170/jars/jcr-1.0.jar</url>
     </dependency>
+    <dependency>
+      <groupId>jcr-rmi</groupId>
+      <artifactId>jcr-rmi</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <type>jar</type>
+    </dependency>
   </dependencies>
   <build>
     <sourceDirectory>src/java</sourceDirectory>
@@ -169,4 +175,5 @@
       </resource>
     </resources>
   </build>
-</project>
\ No newline at end of file
+</project>
+

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/RepositoryPool.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/RepositoryPool.java?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/RepositoryPool.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/RepositoryPool.java
Thu Aug 18 09:38:24 2005
@@ -41,6 +41,11 @@
         super();
     }
 
+    public synchronized Repository get(String key)
+    {
+        return (Repository) cache.get(key);
+    }
+
     public synchronized Repository get(String conf, String home)
     {
         return (Repository) cache.get(getKey(conf, home));
@@ -54,6 +59,16 @@
                 "There's already a repository for the given key. Remove it first.");
         }
         cache.put(getKey(conf, home), repo);
+    }
+
+    public synchronized void put(String key, Repository repo)
+    {
+        if (cache.containsKey(key))
+        {
+            throw new IllegalArgumentException(
+                "There's already a repository for the given key. Remove it first.");
+        }
+        cache.put(key, repo);
     }
 
     private String getKey(String conf, String home)

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/command-line.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/command-line.xml?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/command-line.xml
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/command-line.xml
Thu Aug 18 09:38:24 2005
@@ -110,6 +110,14 @@
 			description="copy.to"
 			required="true"/>
 	</command>
+	
+	<command name="connect" impl="org.apache.jackrabbit.chain.command.ConnectToRmiServer">
+		<argument 
+			name="url" 
+			position="0" 
+			arg-name="url" 
+			required="true"/>
+	</command>
 		
 	<command name="currentnode" impl="org.apache.jackrabbit.chain.command.CurrentNode">
 		<alias name="cd"/>

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/resources.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/resources.properties?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/resources.properties
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/cli/resources.properties
Thu Aug 18 09:38:24 2005
@@ -73,6 +73,10 @@
 collectproperties=Collect properties under the current working node
 collectproperties.target=target variable where the collected properties will be stored
 
+#connect 
+connect=Connect to a remote repository through jcr-rmi
+connect.url=remote server url 
+
 # copy
 copy=copy a node
 copy.from=source, absolute or relative path

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/ConnectToRmiServer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/ConnectToRmiServer.java?rev=233332&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/ConnectToRmiServer.java
(added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/ConnectToRmiServer.java
Thu Aug 18 09:38:24 2005
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.chain.command;
+
+import javax.jcr.Repository;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.jackrabbit.chain.CtxHelper;
+import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory;
+
+/**
+ * Connect to a JCR-RMI server<br>
+ * The Command attributes are set from the specified literal values, or from the
+ * context attributes stored under the given keys.
+ */
+public class ConnectToRmiServer implements Command
+{
+    // ---------------------------- < literals >
+    /** url */
+    private String url;
+
+    // ---------------------------- < keys >
+    /** url key */
+    private String urlKey;
+
+    /**
+     * @inheritDoc
+     */
+    public boolean execute(Context ctx) throws Exception
+    {
+        String url = CtxHelper.getAttr(this.url, this.urlKey, ctx);
+        ClientRepositoryFactory factory = new ClientRepositoryFactory();
+        Repository repository = factory.getRepository(url);
+        CtxHelper.setRepository(ctx, repository);
+        return false;
+    }
+
+    /**
+     * @return Returns the url.
+     */
+    public String getUrl()
+    {
+        return url;
+    }
+
+    /**
+     * @param url
+     *            The url to set.
+     */
+    public void setUrl(String url)
+    {
+        this.url = url;
+    }
+
+    /**
+     * @return Returns the urlKey.
+     */
+    public String getUrlKey()
+    {
+        return urlKey;
+    }
+
+    /**
+     * @param urlKey
+     *            The urlKey to set.
+     */
+    public void setUrlKey(String urlKey)
+    {
+        this.urlKey = urlKey;
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/ConnectToRmiServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/StartOrGetJackrabbitSingleton.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/StartOrGetJackrabbitSingleton.java?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/StartOrGetJackrabbitSingleton.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/chain/command/StartOrGetJackrabbitSingleton.java
Thu Aug 18 09:38:24 2005
@@ -66,7 +66,6 @@
                 if (repo == null)
                 {
                     String msg = "Starting Jakrabbit instance";
-                    System.out.println(msg);
                     log.info(msg);
                     RepositoryConfig conf = RepositoryConfig.create(config, home);
                     repo = RepositoryImpl.create(conf);

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractChainTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractChainTest.java?rev=233332&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractChainTest.java
(added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractChainTest.java
Thu Aug 18 09:38:24 2005
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.chain.test;
+
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.chain.Catalog;
+import org.apache.commons.chain.Context;
+import org.apache.commons.chain.config.ConfigParser;
+import org.apache.commons.chain.impl.CatalogFactoryBase;
+import org.apache.commons.chain.impl.ContextBase;
+import org.apache.jackrabbit.chain.CtxHelper;
+import org.apache.jackrabbit.chain.JcrCommandException;
+import org.apache.jackrabbit.chain.command.ClearWorkspace;
+import org.apache.jackrabbit.chain.command.Login;
+import org.apache.jackrabbit.chain.command.Logout;
+import org.apache.jackrabbit.chain.command.StartOrGetJackrabbitSingleton;
+
+/**
+ * Commands Test superclass
+ */
+public abstract class AbstractChainTest extends TestCase
+{
+    /** config */
+    protected static String CONFIG = "applications/test/repository.xml";
+
+    /** home */
+    protected static String HOME = "applications/test/repository";
+
+    static
+    {
+        try
+        {
+            ConfigParser parser = new ConfigParser();
+            parser.parse(AbstractChainTest.class.getResource("chains.xml"));
+        } catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /** Context */
+    protected Context ctx = new ContextBase();
+
+    /** catalog */
+    protected Catalog catalog = CatalogFactoryBase.getInstance().getCatalog("test");
+
+    /** clear workspace */
+    private ClearWorkspace cw = new ClearWorkspace();
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+
+        // Start
+        StartOrGetJackrabbitSingleton startCmd = new StartOrGetJackrabbitSingleton();
+        startCmd.setConfig(CONFIG);
+        startCmd.setHome(HOME);
+        startCmd.execute(ctx);
+        assertTrue(CtxHelper.getRepository(ctx) instanceof Repository);
+
+        // Login
+        Login loginCmd = new Login();
+        loginCmd.setUser("user");
+        loginCmd.setPassword("password");
+        loginCmd.execute(ctx);
+        assertTrue(CtxHelper.getSession(ctx) != null);
+        assertTrue(CtxHelper.getCurrentNode(ctx).getPath().equals("/"));
+
+        // clear workspace
+        cw.execute(ctx);
+
+    }
+
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+
+        cw.execute(ctx);
+
+        // Logout
+        Logout logoutCmd = new Logout();
+        logoutCmd.execute(ctx);
+
+        ctx.clear();
+    }
+    
+    protected void addTestNode() throws Exception
+    {
+        catalog.getCommand("addTestNode").execute(ctx);
+    }    
+
+    protected Node getRoot() throws PathNotFoundException, JcrCommandException, RepositoryException
{
+        return CtxHelper.getNode(ctx, "/") ;
+    }
+    
+    
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/AbstractChainTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CliTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CliTest.java?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CliTest.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CliTest.java
Thu Aug 18 09:38:24 2005
@@ -24,7 +24,7 @@
 /**
  * Command line interfaces tests
  */
-public class CliTest extends AbstractCommandTest
+public class CliTest extends AbstractChainTest
 {
     JcrParser parser = new JcrParser();
 

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CommandsTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CommandsTest.java?rev=233332&r1=233331&r2=233332&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CommandsTest.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/CommandsTest.java
Thu Aug 18 09:38:24 2005
@@ -28,7 +28,7 @@
 /**
  * Commands tests
  */
-public class CommandsTest extends AbstractCommandTest
+public class CommandsTest extends AbstractChainTest
 {
 
     /**

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/JcrRmiServer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/JcrRmiServer.java?rev=233332&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/JcrRmiServer.java
(added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/JcrRmiServer.java
Thu Aug 18 09:38:24 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.chain.test;
+
+import java.net.MalformedURLException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+
+import org.apache.jackrabbit.core.RepositoryImpl;
+import org.apache.jackrabbit.core.config.RepositoryConfig;
+import org.apache.jackrabbit.rmi.remote.RemoteRepository;
+import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
+import org.apache.jackrabbit.rmi.server.ServerAdapterFactory;
+
+/**
+ * 16/08/2005
+ */
+public class JcrRmiServer
+{
+    /** config */
+    private static String CONFIG = "applications/test/repository.xml";
+
+    /** home */
+    private static String HOME = "applications/test/repository";
+
+    /** rmi url */
+    private static String URL = "jcr/repository";
+
+    public static void main(String[] args) throws RepositoryException, MalformedURLException,
RemoteException, AlreadyBoundException
+    {
+        RepositoryConfig conf = RepositoryConfig.create(CONFIG, HOME);
+        Repository repo = RepositoryImpl.create(conf);
+       
+        RemoteAdapterFactory factory = new ServerAdapterFactory();
+        RemoteRepository remote = factory.getRemoteRepository(repo);
+        Naming.bind(URL, remote);  
+        
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/JcrRmiServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/RemoteCommandsTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/RemoteCommandsTest.java?rev=233332&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/RemoteCommandsTest.java
(added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/RemoteCommandsTest.java
Thu Aug 18 09:38:24 2005
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.chain.test;
+
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+
+import javax.jcr.Repository;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.chain.CtxHelper;
+import org.apache.jackrabbit.chain.command.ClearWorkspace;
+import org.apache.jackrabbit.chain.command.ConnectToRmiServer;
+import org.apache.jackrabbit.chain.command.Login;
+import org.apache.jackrabbit.core.RepositoryImpl;
+import org.apache.jackrabbit.core.config.RepositoryConfig;
+import org.apache.jackrabbit.rmi.remote.RemoteRepository;
+import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
+import org.apache.jackrabbit.rmi.server.ServerAdapterFactory;
+
+/**
+ * Commands tests
+ */
+public class RemoteCommandsTest extends CommandsTest
+{
+    private static Log log = LogFactory.getLog(RemoteCommandsTest.class);
+
+    /** rmi url */
+    private static String URL = "jcr/repository";
+
+    /** registry */
+    private static Registry REGISTRY;
+
+    /** clear workspace */
+    private ClearWorkspace cw = new ClearWorkspace();
+
+    /**
+     * override setup. creates a connection to a remote repository.
+     */
+    protected void setUp() throws Exception
+    {
+        // create registry & bind jcr server
+        if (REGISTRY == null)
+        {
+            RepositoryConfig conf = RepositoryConfig.create(CONFIG, HOME);
+            Repository repo = RepositoryImpl.create(conf);
+            RemoteAdapterFactory factory = new ServerAdapterFactory();
+            RemoteRepository remote = factory.getRemoteRepository(repo);
+            REGISTRY = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
+            REGISTRY.bind(URL, remote);
+            // give jackrabbit some time to start
+            Thread.sleep(5000);
+            log.info("rmi server started");
+        }
+        ConnectToRmiServer cmd = new ConnectToRmiServer();
+        cmd.setUrl(URL);
+        cmd.execute(ctx);
+        assertTrue(CtxHelper.getRepository(ctx) != null);
+        
+        // Login
+        Login loginCmd = new Login();
+        loginCmd.setUser("user");
+        loginCmd.setPassword("password");
+        loginCmd.execute(ctx);
+        assertTrue(CtxHelper.getSession(ctx) != null);
+        assertTrue(CtxHelper.getCurrentNode(ctx).getPath().equals("/"));
+        
+        // clear workspace
+        cw.execute(ctx);
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/test/org/apache/jackrabbit/chain/test/RemoteCommandsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message