Author: bfoster
Date: Tue Feb 28 08:19:28 2012
New Revision: 1294520

URL: http://svn.apache.org/viewvc?rev=1294520&view=rev
Log:
- Integrated CAS-Protocol with CAS-CLI

--------------
OODT-394

Added:
    oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/BasicVerifyCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/CrossProtocolTransferCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/DownloadCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/GetSupportedFactoriesCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/ProtocolCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/ProtocolCommandLine.java
   (contents, props changed)
      - copied, changed from r1294497, 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/CLProtocolManager.java
    oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-actions.xml   
(with props)
    oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-options.xml   
(with props)
    oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/
    oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/
    
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/MockProtocolCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestBasicVerifyCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestDownloadCliAction.java
   (with props)
    
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestProtocolCliAction.java
   (with props)
Removed:
    oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/action/
    
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/CLProtocolManager.java
    oodt/trunk/protocol/api/src/main/resources/policy/protocol-action-beans.xml
    
oodt/trunk/protocol/api/src/main/resources/policy/protocol-cmd-line-beans.xml
    oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/action/
Modified:
    oodt/trunk/protocol/api/pom.xml
    oodt/trunk/protocol/api/src/main/bin/protocol
    oodt/trunk/protocol/api/src/main/resources/policy/protocol-config.xml

Modified: oodt/trunk/protocol/api/pom.xml
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/pom.xml?rev=1294520&r1=1294519&r2=1294520&view=diff
==============================================================================
--- oodt/trunk/protocol/api/pom.xml (original)
+++ oodt/trunk/protocol/api/pom.xml Tue Feb 28 08:19:28 2012
@@ -76,6 +76,15 @@
                                </executions>
                        </plugin>
                </plugins>
+    <resources>
+      <resource>
+        <targetPath>org/apache/oodt/cas/protocol</targetPath>
+        <directory>${basedir}/src/main/resources/policy</directory>
+        <includes>
+          <include>protocol-config.xml</include>
+        </includes>
+      </resource>
+    </resources>
        </build>
        <dependencies>
                <dependency>
@@ -88,6 +97,11 @@
                        <artifactId>cas-metadata</artifactId>
                        <version>${project.parent.version}</version>
                </dependency>
+    <dependency>
+      <groupId>org.apache.oodt</groupId>
+      <artifactId>cas-cli</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
                <dependency>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>

Modified: oodt/trunk/protocol/api/src/main/bin/protocol
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/bin/protocol?rev=1294520&r1=1294519&r2=1294520&view=diff
==============================================================================
--- oodt/trunk/protocol/api/src/main/bin/protocol (original)
+++ oodt/trunk/protocol/api/src/main/bin/protocol Tue Feb 28 08:19:28 2012
@@ -3,11 +3,12 @@
 set args
 
 if ( $#args > 0 ) then
-       set args = "$*"
+        set args = "$*"
 endif
 
 ${JAVA_HOME}/bin/java \
-       -Djava.ext.dirs=../lib \
-       -Djava.util.logging.config.file=../etc/logging.properties \
-       
-Dorg.apache.oodt.cas.protocol.manager.config.file=../policy/protocol-config.xml
 \
-       org.apache.oodt.cas.protocol.system.CLProtocolManager ${args}
\ No newline at end of file
+        -Djava.ext.dirs=../lib \
+        -Djava.util.logging.config.file=../etc/logging.properties \
+        
-Dorg.apache.oodt.cas.cli.action.spring.config=../policy/cmd-line-actions.xml \
+        
-Dorg.apache.oodt.cas.cli.option.spring.config=../policy/cmd-line-options.xml \
+        org.apache.oodt.cas.protocol.system.ProtocolCommandLine ${args}

Added: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/BasicVerifyCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/BasicVerifyCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/BasicVerifyCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/BasicVerifyCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//OODT imports
+import org.apache.oodt.cas.cli.exception.CmdLineActionException;
+import org.apache.oodt.cas.protocol.Protocol;
+import org.apache.oodt.cas.protocol.ProtocolFactory;
+import org.apache.oodt.cas.protocol.system.ProtocolManager;
+import org.apache.oodt.cas.protocol.verify.ProtocolVerifier;
+
+/**
+ * Action for determining whether a given {@link Protocol} or auto-determined
+ * {@link Protocol} via {@link ProtocolManager} can connect and pass
+ * verification of the given {@link Verifier} for given site.
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class BasicVerifyCliAction extends ProtocolCliAction {
+
+   private ProtocolVerifier verifier;
+   private ProtocolFactory factory;
+
+   private boolean lastVerificationResult;
+
+   @Override
+   public void execute(ActionMessagePrinter printer)
+         throws CmdLineActionException {
+      try {
+         if (factory != null) {
+            Protocol protocol = factory.newInstance();
+            if (lastVerificationResult = verifier.verify(protocol, getSite(),
+                  getAuthentication())) {
+               printer.println("Protocol '"
+                     + protocol.getClass().getCanonicalName()
+                     + "' PASSED verification!");
+            } else {
+               printer.println("Protocol '"
+                     + protocol.getClass().getCanonicalName()
+                     + "' FAILED verification!");
+            }
+         } else {
+            Protocol protocol = getProtocolManager().getProtocolBySite(
+                  getSite(), getAuthentication(), verifier);
+            if (lastVerificationResult = protocol != null) {
+               printer.println("Protocol '"
+                     + protocol.getClass().getCanonicalName()
+                     + "' PASSED verification!");
+            } else {
+               printer.println("No Protocol determined, FAILED verification!");
+            }
+         }
+      } catch (Exception e) {
+         throw new CmdLineActionException("Failed to verify factory '"
+               + factory + "' : " + e.getMessage(), e);
+      }
+   }
+
+   public void setVerifier(ProtocolVerifier verifier) {
+      this.verifier = verifier;
+   }
+
+   public void setProtocolFactory(ProtocolFactory factory) {
+      this.factory = factory;
+   }
+
+   protected boolean getLastVerificationResults() {
+      return lastVerificationResult;
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/BasicVerifyCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/CrossProtocolTransferCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/CrossProtocolTransferCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/CrossProtocolTransferCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/CrossProtocolTransferCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//OODT imports
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+//OODT imports
+import org.apache.oodt.cas.cli.exception.CmdLineActionException;
+import org.apache.oodt.cas.protocol.Protocol;
+import org.apache.oodt.cas.protocol.ProtocolFile;
+import org.apache.oodt.cas.protocol.auth.Authentication;
+import org.apache.oodt.cas.protocol.auth.BasicAuthentication;
+import org.apache.oodt.cas.protocol.auth.NoAuthentication;
+import org.apache.oodt.cas.protocol.system.ProtocolManager;
+import org.apache.oodt.cas.protocol.verify.ProtocolVerifier;
+import org.apache.oodt.cas.protocol.verify.ProtocolVerifierFactory;
+
+/**
+ * {@link ProtocolAction} for transferring a file from one host to another
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class CrossProtocolTransferCliAction extends ProtocolCliAction {
+
+   private URI fromUri;
+   private URI toUri;
+   private ProtocolVerifierFactory verifierFactory;
+
+   @Override
+   public void execute(ActionMessagePrinter printer)
+         throws CmdLineActionException {
+      try {
+         ProtocolVerifier verifier = null;
+         if (verifierFactory != null) {
+            verifier = verifierFactory.newInstance();
+         }
+
+         File localFile = createTempDownloadFile();
+         if (localFile == null) {
+            throw new Exception("Failed to create tempory local file");
+         }
+
+         ProtocolManager protocolManager = getProtocolManager();
+         Protocol fromProtocol = protocolManager.getProtocolBySite(fromUri,
+               getAuthentication(fromUri), verifier);
+         if (fromProtocol == null) {
+            throw new Exception("Failed to get protocol for 'from' URI '"
+                  + fromUri + "'");
+         }
+
+         Protocol toProtocol = protocolManager.getProtocolBySite(toUri,
+               getAuthentication(toUri), verifier);
+         if (toProtocol == null) {
+            throw new Exception("Failed to get protocol for 'to' URI '" + toUri
+                  + "'");
+         }
+
+         fromProtocol
+               .get(new ProtocolFile(fromUri.getPath(), false), localFile);
+         toProtocol.put(localFile, new ProtocolFile(toUri.getPath(), false));
+      } catch (Exception e) {
+         throw new CmdLineActionException(
+               "Failed to transfer between 2 protocols : " + e.getMessage(), 
e);
+      }
+   }
+
+   public void setFromUri(String fromUri) throws URISyntaxException {
+      this.fromUri = new URI(fromUri);
+   }
+
+   public void setToUri(String toUri) throws URISyntaxException {
+      this.toUri = new URI(toUri);
+   }
+
+   public void setVerifierFactory(ProtocolVerifierFactory verifierFactory) {
+      this.verifierFactory = verifierFactory;
+   }
+
+   private File createTempDownloadFile() {
+      File bogusFile = null;
+      try {
+         bogusFile = File.createTempFile("bogus", "bogus");
+         File tmpDir = new File(bogusFile.getParentFile(), "ProtocolTransfer/"
+               + UUID.randomUUID().toString());
+         tmpDir.mkdirs();
+         return new File(tmpDir, "temp_file");
+      } catch (Exception e) {
+         return null;
+      } finally {
+         try {
+            bogusFile.delete();
+         } catch (Exception e) {
+         }
+      }
+   }
+
+   private Authentication getAuthentication(URI uri) {
+      if (uri.getUserInfo() != null) {
+         String[] userInfo = uri.getUserInfo().split("\\:");
+         return new BasicAuthentication(userInfo[0], userInfo[1]);
+      } else {
+         return new NoAuthentication();
+      }
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/CrossProtocolTransferCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/DownloadCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/DownloadCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/DownloadCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/DownloadCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//JDK imports
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+//OODT imports
+import org.apache.oodt.cas.cli.exception.CmdLineActionException;
+import org.apache.oodt.cas.protocol.Protocol;
+import org.apache.oodt.cas.protocol.ProtocolFile;
+import org.apache.oodt.cas.protocol.system.ProtocolManager;
+
+/**
+ * A {@link ProtocolAction} which will downlaod a url
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class DownloadCliAction extends ProtocolCliAction {
+
+   protected URI uri;
+   protected String toDir;
+   protected Protocol usedProtocol;
+
+   @Override
+   public void execute(ActionMessagePrinter printer)
+         throws CmdLineActionException {
+      try {
+         usedProtocol = createProtocol(getProtocolManager());
+         ProtocolFile fromFile = createProtocolFile();
+         String toFilename = fromFile.equals(ProtocolFile.SEPARATOR)
+               || fromFile.getName().isEmpty() ? uri.getHost() : fromFile
+               .getName();
+         File toFile = (toDir != null) ? new File(toDir, toFilename)
+               : new File(toFilename);
+         usedProtocol.get(fromFile, toFile.getAbsoluteFile());
+      } catch (Exception e) {
+         throw new CmdLineActionException("Failed to download : "
+               + e.getMessage(), e);
+      }
+   }
+
+   public void setUrl(String urlString) throws URISyntaxException {
+      uri = new URI(urlString);
+   }
+
+   public void setToDir(String toDir) {
+      this.toDir = toDir;
+   }
+
+   protected Protocol getUsedProtocol() {
+      return usedProtocol;
+   }
+
+   protected ProtocolFile createProtocolFile() throws URISyntaxException {
+      return new ProtocolFile(uri.getPath(), false);
+   }
+
+   protected Protocol createProtocol(ProtocolManager protocolManager)
+         throws URISyntaxException {
+      return protocolManager.getProtocolBySite(
+            new URI(uri.getScheme(), uri.getHost(), null, null),
+            getAuthentication(), null);
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/DownloadCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/GetSupportedFactoriesCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/GetSupportedFactoriesCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/GetSupportedFactoriesCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/GetSupportedFactoriesCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//OODT imports
+import org.apache.oodt.cas.cli.exception.CmdLineActionException;
+import org.apache.oodt.cas.protocol.ProtocolFactory;
+
+/**
+ * {@link ProtocolAction} for get a list of supported {@link ProtocolFactory}s.
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class GetSupportedFactoriesCliAction extends ProtocolCliAction {
+
+   @Override
+   public void execute(ActionMessagePrinter printer)
+         throws CmdLineActionException {
+      try {
+         printer.println("Supported Factories:");
+         for (ProtocolFactory factory : getProtocolManager().getFactories()) {
+            System.out.println(" - " + factory.getClass().getCanonicalName());
+         }
+      } catch (Exception e) {
+         throw new CmdLineActionException(
+               "Failed to get supported factories : " + e.getMessage(), e);
+      }
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/GetSupportedFactoriesCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/ProtocolCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/ProtocolCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/ProtocolCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/ProtocolCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//JDK imports
+import java.net.URI;
+import java.net.URISyntaxException;
+
+//OODT imports
+import org.apache.oodt.cas.cli.action.CmdLineAction;
+import org.apache.oodt.cas.metadata.util.PathUtils;
+import org.apache.oodt.cas.protocol.auth.Authentication;
+import org.apache.oodt.cas.protocol.auth.BasicAuthentication;
+import org.apache.oodt.cas.protocol.auth.NoAuthentication;
+import org.apache.oodt.cas.protocol.config.SpringProtocolConfig;
+import org.apache.oodt.cas.protocol.system.ProtocolManager;
+
+/**
+ * Action used to perform some task via a {@link ProtocolManager}
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public abstract class ProtocolCliAction extends CmdLineAction {
+
+   private String user;
+   private String pass;
+   private String site;
+   private ProtocolManager protocolManager;
+
+   public void setUser(String user) {
+      this.user = user;
+   }
+
+   public void setPass(String pass) {
+      this.pass = pass;
+   }
+
+   public void setSite(String site) {
+      this.site = site;
+   }
+
+   public URI getSite() throws URISyntaxException {
+      return site != null ? new URI(site) : null;
+   }
+
+   public Authentication getAuthentication() {
+      if (user == null || pass == null) {
+         return new NoAuthentication();
+      } else {
+         return new BasicAuthentication(user, pass);
+      }
+   }
+
+   public void setProtocolManager(ProtocolManager protocolManager) {
+      this.protocolManager = protocolManager;
+   }
+
+   public ProtocolManager getProtocolManager() throws Exception {
+      if (protocolManager != null) {
+         return protocolManager;
+      }
+      String protocolConfig = PathUtils
+            .doDynamicReplacement(System
+                  .getProperty(
+                        "org.apache.oodt.cas.protocol.manager.config.file",
+                        
"classpath:/org/apache/oodt/cas/protocol/protocol-config.xml"));
+      return protocolManager = new ProtocolManager(new SpringProtocolConfig(
+            protocolConfig));
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/cli/action/ProtocolCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/ProtocolCommandLine.java
 (from r1294497, 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/CLProtocolManager.java)
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/ProtocolCommandLine.java?p2=oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/ProtocolCommandLine.java&p1=oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/CLProtocolManager.java&r1=1294497&r2=1294520&rev=1294520&view=diff
==============================================================================
--- 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/CLProtocolManager.java
 (original)
+++ 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/ProtocolCommandLine.java
 Tue Feb 28 08:19:28 2012
@@ -16,53 +16,16 @@
  */
 package org.apache.oodt.cas.protocol.system;
 
-//JDK imports
-import java.util.List;
-
 //OODT imports
-import org.apache.oodt.cas.metadata.util.PathUtils;
-import org.apache.oodt.cas.protocol.action.ProtocolAction;
-import org.apache.oodt.cas.protocol.config.ProtocolConfig;
-import org.apache.oodt.cas.protocol.config.SpringProtocolConfig;
-import org.apache.oodt.commons.option.CmdLineOptionInstance;
-import org.apache.oodt.commons.option.util.CmdLineOptionUtils;
-
-//Spring imports
-import org.springframework.context.support.FileSystemXmlApplicationContext;
+import org.apache.oodt.cas.cli.CmdLineUtility;
 
 /**
- * Command-Line {@link ProtocolManager} which {@link ProtocolAction}s to be
- * invoked
- * 
- * @author bfoster
+ * @author bfoster (Brian Foster)
  */
-public class CLProtocolManager extends ProtocolManager {
-
-       public CLProtocolManager(ProtocolConfig protocolConfig) {
-               super(protocolConfig);
-       }
+public class ProtocolCommandLine {
 
        public static void main(String[] args) throws Exception {
-               String protocolConfig = PathUtils
-                               .doDynamicReplacement(System
-                                               .getProperty(
-                                                               
"org.apache.oodt.cas.protocol.manager.config.file",
-                                                               
"classpath:/org/apache/oodt/cas/protocol/actions/protocol-config.xml"));
-
-               FileSystemXmlApplicationContext appContext = new 
FileSystemXmlApplicationContext(
-                               protocolConfig);
-               List<CmdLineOptionInstance> optionInstances = CmdLineOptionUtils
-                               .loadValidateAndHandleInstances(appContext, 
args);
-               CmdLineOptionInstance actionInstance = CmdLineOptionUtils
-                               .getOptionInstanceByName("action", 
optionInstances);
-               String actionArgValue = actionInstance.getValues().get(0);
-               ProtocolAction action = ((ProtocolAction) appContext.getBean(
-                               actionArgValue, ProtocolAction.class));
-               try {
-                       action.performAction(new CLProtocolManager(
-                                       new 
SpringProtocolConfig(protocolConfig)));
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
+      CmdLineUtility cmdLineUtility = new CmdLineUtility();
+      cmdLineUtility.run(args);
        }
 }

Propchange: 
oodt/trunk/protocol/api/src/main/java/org/apache/oodt/cas/protocol/system/ProtocolCommandLine.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-actions.xml
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-actions.xml?rev=1294520&view=auto
==============================================================================
--- oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-actions.xml 
(added)
+++ oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-actions.xml Tue 
Feb 28 08:19:28 2012
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+  Author: bfoster 
+  Description: ProtocolManager Configuration
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:p="http://www.springframework.org/schema/p";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";>
+
+       <bean id="download" 
class="org.apache.oodt.cas.protocol.cli.action.DownloadCliAction">
+               <property name="description" value="Downloads a file" />
+       </bean>
+       <bean id="getSupportedFactories" 
class="org.apache.oodt.cas.protocol.cli.action.GetSupportedFactoriesCliAction">
+               <property name="description" value="Prints out list of 
supported ProtocolFactory(s)" />
+       </bean>
+       <bean id="crossProtocolTransfer" 
class="org.apache.oodt.cas.protocol.cli.action.CrossProtocolTransferCliAction">
+               <property name="description" value="Transfers a file across 2 
different protocols" />
+               <property name="verifierFactory" ref="BasicVerifier" />
+       </bean>
+
+       <bean id="BasicVerifier" 
class="org.apache.oodt.cas.protocol.verify.BasicProtocolVerifierFactory" />
+</beans>

Propchange: 
oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-actions.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-options.xml
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-options.xml?rev=1294520&view=auto
==============================================================================
--- oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-options.xml 
(added)
+++ oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-options.xml Tue 
Feb 28 08:19:28 2012
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Author: bfoster Description: ProtocolManager Configuration -->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:p="http://www.springframework.org/schema/p";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";>
+
+       <bean id="user" 
class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption">
+               <property name="shortOption" value="u" />
+               <property name="longOption" value="user" />
+               <property name="description" value="Username for 
authentication" />
+               <property name="hasArgs" value="true" />
+               <property name="argsDescription" value="username" />
+    <property name="requirementRules">
+      <list>
+        <bean 
class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule"
+          p:actionName="download" p:relation="OPTIONAL" />
+      </list>
+    </property>
+    <property name="handler">
+      <bean 
class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler">
+        <property name="applyToActions">
+          <list>
+            <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction"
+              p:actionName="download" />
+          </list>
+        </property>
+      </bean>
+    </property>
+       </bean>
+
+       <bean id="pass" 
class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption">
+               <property name="shortOption" value="p" />
+               <property name="longOption" value="pass" />
+               <property name="description" value="Password for 
authentication" />
+               <property name="hasArgs" value="true" />
+               <property name="argsDescription" value="password" />
+    <property name="requirementRules">
+      <list>
+        <bean 
class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule"
+          p:actionName="download" p:relation="OPTIONAL" />
+      </list>
+    </property>
+    <property name="handler">
+      <bean 
class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler">
+        <property name="applyToActions">
+          <list>
+            <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction"
+              p:actionName="download" />
+          </list>
+        </property>
+      </bean>
+    </property>
+       </bean>
+
+       <bean id="url" 
class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption">
+               <property name="shortOption" value="url" />
+               <property name="longOption" value="url" />
+               <property name="description" value="URL to download" />
+               <property name="hasArgs" value="true" />
+               <property name="argsDescription" value="URL" />
+    <property name="requirementRules">
+      <list>
+        <bean 
class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule"
+          p:actionName="download" p:relation="REQUIRED" />
+      </list>
+    </property>
+    <property name="handler">
+      <bean 
class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler">
+        <property name="applyToActions">
+          <list>
+            <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction"
+              p:actionName="download" />
+          </list>
+        </property>
+      </bean>
+    </property>
+       </bean>
+
+       <bean id="fromUrl" 
class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption">
+               <property name="shortOption" value="fu" />
+               <property name="longOption" value="fromUrl" />
+               <property name="description" value="URL to get file" />
+               <property name="hasArgs" value="true" />
+               <property name="argsDescription" value="URL" />
+    <property name="requirementRules">
+      <list>
+        <bean 
class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule"
+          p:actionName="crossProtocolTransfer" p:relation="REQUIRED" />
+      </list>
+    </property>
+    <property name="handler">
+      <bean 
class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler">
+        <property name="applyToActions">
+          <list>
+            <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction"
+              p:actionName="CrossProtocolTransfer" p:methodName="setFromUri" />
+          </list>
+        </property>
+      </bean>
+    </property>
+       </bean>
+
+       <bean id="toUrl" 
class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption">
+               <property name="shortOption" value="tu" />
+               <property name="longOption" value="toUrl" />
+               <property name="description" value="URL to send file" />
+               <property name="hasArgs" value="true" />
+               <property name="argsDescription" value="URL" />
+    <property name="requirementRules">
+      <list>
+        <bean 
class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule"
+          p:actionName="crossProtocolTransfer" p:relation="REQUIRED" />
+      </list>
+    </property>
+    <property name="handler">
+      <bean 
class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler">
+        <property name="applyToActions">
+          <list>
+            <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction"
+              p:actionName="CrossProtocolTransfer" p:methodName="setToUri" />
+          </list>
+        </property>
+      </bean>
+    </property>
+       </bean>
+</beans>

Propchange: 
oodt/trunk/protocol/api/src/main/resources/policy/cmd-line-options.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: oodt/trunk/protocol/api/src/main/resources/policy/protocol-config.xml
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/main/resources/policy/protocol-config.xml?rev=1294520&r1=1294519&r2=1294520&view=diff
==============================================================================
--- oodt/trunk/protocol/api/src/main/resources/policy/protocol-config.xml 
(original)
+++ oodt/trunk/protocol/api/src/main/resources/policy/protocol-config.xml Tue 
Feb 28 08:19:28 2012
@@ -10,8 +10,6 @@
        xmlns:p="http://www.springframework.org/schema/p";
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";>
 
-  <import resource="protocol-action-beans.xml"/>
-  <import resource="protocol-cmd-line-beans.xml"/>
        <import 
resource="classpath*:/org/apache/oodt/cas/protocol/**/*-protocol-config.xml"/>
        
 </beans>
\ No newline at end of file

Added: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/MockProtocolCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/MockProtocolCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/MockProtocolCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/MockProtocolCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//OODT imports
+import org.apache.oodt.cas.cli.exception.CmdLineActionException;
+
+/**
+ * Mock class for {@ProtocolAction}.
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class MockProtocolCliAction extends ProtocolCliAction {
+
+   @Override
+   public void execute(ActionMessagePrinter printer)
+         throws CmdLineActionException {      
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/MockProtocolCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestBasicVerifyCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestBasicVerifyCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestBasicVerifyCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestBasicVerifyCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//JDK imports
+import java.net.URI;
+
+//JUnit imports
+import junit.framework.TestCase;
+
+//OODT imports
+import org.apache.oodt.cas.cli.action.CmdLineAction.ActionMessagePrinter;
+import org.apache.oodt.cas.protocol.Protocol;
+import org.apache.oodt.cas.protocol.auth.Authentication;
+import org.apache.oodt.cas.protocol.config.MockSpringProtocolConfig;
+import org.apache.oodt.cas.protocol.system.ProtocolManager;
+import org.apache.oodt.cas.protocol.verify.ProtocolVerifier;
+
+/**
+ * Test class for {@link BasicVerifyCliAction}
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class TestBasicVerifyCliAction extends TestCase {
+
+   public void testVerification() throws Exception {
+      BasicVerifyCliAction bva = new BasicVerifyCliAction();
+      bva.setSite("http://localhost";);
+      bva.setVerifier(new ProtocolVerifier() {
+         public boolean verify(Protocol protocol, URI site,
+               Authentication auth) {
+            return auth != null && site.toString().equals("http://localhost";);
+         }
+      });
+      bva.setProtocolManager(new ProtocolManager(new 
MockSpringProtocolConfig()));
+      bva.execute(new ActionMessagePrinter());
+      assertTrue(bva.getLastVerificationResults());
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestBasicVerifyCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestDownloadCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestDownloadCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestDownloadCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestDownloadCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//JDK imports
+import java.net.URISyntaxException;
+
+//OODT imports
+import org.apache.oodt.cas.cli.action.CmdLineAction.ActionMessagePrinter;
+import org.apache.oodt.cas.protocol.MockProtocol;
+import org.apache.oodt.cas.protocol.Protocol;
+import org.apache.oodt.cas.protocol.ProtocolFile;
+import org.apache.oodt.cas.protocol.config.MockSpringProtocolConfig;
+import org.apache.oodt.cas.protocol.system.ProtocolManager;
+
+//JUnit imports
+import junit.framework.TestCase;
+
+/**
+ * Test class for {@link DownloadCliAction}.
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class TestDownloadCliAction extends TestCase {
+   
+   private ProtocolManager pm;
+   
+   @Override
+   public void setUp() {
+      pm = new ProtocolManager(new MockSpringProtocolConfig());
+   }
+   
+   public void testCreateProtocol() throws URISyntaxException {
+      DownloadCliAction da = new DownloadCliAction();
+      da.setUrl("http://localhost/some/file";);
+      Protocol protocol = da.createProtocol(pm);
+      assertNotNull(protocol);
+      assertTrue(protocol instanceof MockProtocol);
+      assertEquals("http1", ((MockProtocol) protocol).getFactoryId());
+   }
+   
+   public void testCreateProtocolFile() throws URISyntaxException {
+      DownloadCliAction da = new DownloadCliAction();
+      da.setUrl("http://localhost/some/file";);
+      ProtocolFile file = da.createProtocolFile();
+      assertNotNull(file);
+      assertEquals("/some/file", file.getPath());
+      assertFalse(file.isRelative());
+      assertFalse(file.isDir());
+   }
+   
+   public void testFileDownload() throws Exception {
+      DownloadCliAction da = new DownloadCliAction();
+      da.setUrl("http://localhost/some/file";);
+      da.setProtocolManager(pm);
+      da.execute(new ActionMessagePrinter());
+      assertNotNull(da.getUsedProtocol());
+      assertTrue(da.getUsedProtocol() instanceof MockProtocol);
+      assertEquals(1, ((MockProtocol) 
da.getUsedProtocol()).getGetFiles().size());
+      assertEquals("/some/file", ((MockProtocol) 
da.getUsedProtocol()).getGetFiles().get(0).getPath());
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestDownloadCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestProtocolCliAction.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestProtocolCliAction.java?rev=1294520&view=auto
==============================================================================
--- 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestProtocolCliAction.java
 (added)
+++ 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestProtocolCliAction.java
 Tue Feb 28 08:19:28 2012
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oodt.cas.protocol.cli.action;
+
+//JDK imports
+import java.net.URISyntaxException;
+
+//JUnit imports
+import junit.framework.TestCase;
+
+/**
+ * Test class for {@link ProtocolCliAction}.
+ * 
+ * @author bfoster (Brian Foster)
+ */
+public class TestProtocolCliAction extends TestCase {
+
+   public void testInitialState() throws URISyntaxException {
+      MockProtocolCliAction action = new MockProtocolCliAction();
+      action.setUser("user");
+      action.setPass("pass");
+      action.setSite("http://some-site";);
+      assertEquals("user", action.getAuthentication().getUser());
+      assertEquals("pass", action.getAuthentication().getPass());
+      assertEquals("http://some-site";, action.getSite().toString());
+   }
+}

Propchange: 
oodt/trunk/protocol/api/src/test/org/apache/oodt/cas/protocol/cli/action/TestProtocolCliAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain


Reply via email to