Package org.apache.oodt.cas.cli.action.CmdLineAction

Examples of org.apache.oodt.cas.cli.action.CmdLineAction.ActionMessagePrinter


      MockAddProductTypeCliAction cliAction = new MockAddProductTypeCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.setProductTypeDescription(PRODUCT_TYPE_DESC);
      cliAction.setFileRepositoryPath(PRODUCT_TYPE_REPO);
      cliAction.setVersioner(PRODUCT_TYPE_VERSIONER);
      ActionMessagePrinter printer = new ActionMessagePrinter();
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("addProductType: Result: " + PRODUCT_TYPE_ID, printer
            .getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));

      assertEquals(PRODUCT_TYPE_NAME, productTypePassedToClient.getName());
      assertEquals(PRODUCT_TYPE_DESC,
            productTypePassedToClient.getDescription());
      assertEquals(PRODUCT_TYPE_REPO,
View Full Code Here


   private static final String ORIG_REF_2 = "file:/orig/ref/2/path";
   private static final String DS_REF_2 = "file:/ds/ref/2/path";
   private static final int FILE_SIZE_REF_2 = 2;

   public void testValidateErrors() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      GetProductByNameCliAction cliAction = new MockGetProductByNameCliAction();
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
      } catch (CmdLineActionException ignore) {
View Full Code Here

      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetProductByNameCliAction cliAction = new MockGetProductByNameCliAction();
      cliAction.setProductName(PRODUCT_NAME);
      cliAction.execute(printer);
      assertEquals(20, printer.getPrintedMessages().size());
      assertEquals("Product:", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals(" - ID: " + PRODUCT_ID, printer.getPrintedMessages().get(2));
      assertEquals("\n", printer.getPrintedMessages().get(3));
      assertEquals(" - Name: " + PRODUCT_NAME, printer.getPrintedMessages()
            .get(4));
      assertEquals("\n", printer.getPrintedMessages().get(5));
      assertEquals(" - ProductType: " + PRODUCT_TYPE_NAME, printer
            .getPrintedMessages().get(6));
      assertEquals("\n", printer.getPrintedMessages().get(7));
      assertEquals(" - Structure: " + PRODUCT_STRUCTURE, printer
            .getPrintedMessages().get(8));
      assertEquals("\n", printer.getPrintedMessages().get(9));
      assertEquals(" - Status: " + PRODUCT_STATUS, printer.getPrintedMessages()
            .get(10));
      assertEquals("\n", printer.getPrintedMessages().get(11));
      assertEquals(" - RootRef: " + ROOT_REF,
            printer.getPrintedMessages().get(12));
      assertEquals("\n", printer.getPrintedMessages().get(13));
      assertEquals(" - References: ", printer.getPrintedMessages().get(14));
      assertEquals("\n", printer.getPrintedMessages().get(15));
      assertEquals("    - " + DS_REF_1 + " (" + FILE_SIZE_REF_1 + ")", printer
            .getPrintedMessages().get(16));
      assertEquals("\n", printer.getPrintedMessages().get(17));
      assertEquals("    - " + DS_REF_2 + " (" + FILE_SIZE_REF_2 + ")", printer
            .getPrintedMessages().get(18));
      assertEquals("\n", printer.getPrintedMessages().get(19));
   }
View Full Code Here

   private static final String ORIG_REF_2 = "file:/orig/ref/2/path";
   private static final String DS_REF_2 = "file:/ds/ref/2/path";
   private static final int FILE_SIZE_REF_2 = 2;

   public void testValidateErrors() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetProductByIdCliAction cliAction = new MockGetProductByIdCliAction();
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
      } catch (CmdLineActionException ignore) {
View Full Code Here

      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetProductByIdCliAction cliAction = new MockGetProductByIdCliAction();
      cliAction.setProductId(PRODUCT_ID);
      cliAction.execute(printer);
      assertEquals(20, printer.getPrintedMessages().size());
      assertEquals("Product:", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals(" - ID: " + PRODUCT_ID, printer.getPrintedMessages().get(2));
      assertEquals("\n", printer.getPrintedMessages().get(3));
      assertEquals(" - Name: " + PRODUCT_NAME, printer.getPrintedMessages()
            .get(4));
      assertEquals("\n", printer.getPrintedMessages().get(5));
      assertEquals(" - ProductType: " + PRODUCT_TYPE_NAME, printer
            .getPrintedMessages().get(6));
      assertEquals("\n", printer.getPrintedMessages().get(7));
      assertEquals(" - Structure: " + PRODUCT_STRUCTURE, printer
            .getPrintedMessages().get(8));
      assertEquals("\n", printer.getPrintedMessages().get(9));
      assertEquals(" - Status: " + PRODUCT_STATUS, printer.getPrintedMessages()
            .get(10));
      assertEquals("\n", printer.getPrintedMessages().get(11));
      assertEquals(" - RootRef: " + ROOT_REF,
            printer.getPrintedMessages().get(12));
      assertEquals("\n", printer.getPrintedMessages().get(13));
      assertEquals(" - References: ", printer.getPrintedMessages().get(14));
      assertEquals("\n", printer.getPrintedMessages().get(15));
      assertEquals("    - " + DS_REF_1 + " (" + FILE_SIZE_REF_1 + ")", printer
            .getPrintedMessages().get(16));
      assertEquals("\n", printer.getPrintedMessages().get(17));
      assertEquals("    - " + DS_REF_2 + " (" + FILE_SIZE_REF_2 + ")", printer
            .getPrintedMessages().get(18));
      assertEquals("\n", printer.getPrintedMessages().get(19));
   }
View Full Code Here

   public void setUp() {
      status = null;
   }

   public void testValidateErrors() {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      NullStatusGetCurrentTransfersCliAction cliAction = new NullStatusGetCurrentTransfersCliAction();
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
      } catch (CmdLineActionException ignore) {
View Full Code Here

      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetCurrentTransfersCliAction cliAction = new MockGetCurrentTransfersCliAction();
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("File Transfer: [ref={orig=" + ORIG_REF + ",ds=" + DS_REF
            + "},product=" + PRODUCT_NAME + ",fileSize=" + FILE_SIZE
            + ",amtTransferred=" + BYTE_TRANS + ",pct=0.5]", printer
            .getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
   }
View Full Code Here

      super.setUp();
      clientSetProduct = null;
   }

   public void testValidateErrors() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockDeleteProductByNameCliAction cliAction = new MockDeleteProductByNameCliAction();
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
      } catch (CmdLineActionException ignore) {
View Full Code Here

      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockDeleteProductByNameCliAction cliAction = new MockDeleteProductByNameCliAction();
      cliAction.setProductName(PRODUCT_NAME);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("Successfully deleted product '" + PRODUCT_NAME + "'",
            printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals(PRODUCT_ID, clientSetProduct.getProductId());
      assertEquals(PRODUCT_NAME, clientSetProduct.getProductName());
      assertEquals(2, clientSetProduct.getProductReferences().size());
      assertEquals(REF_1, clientSetProduct.getProductReferences().get(0)
            .getDataStoreReference());
View Full Code Here

   private static final String TEST_FILENAME = "data.dat";

   private ComplexQuery clientSetComplexQuery;

   public void testValidateErrors() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockSqlQueryCliAction cliAction = new MockSqlQueryCliAction();
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
      } catch (CmdLineActionException ignore) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.cli.action.CmdLineAction.ActionMessagePrinter

Copyright © 2018 www.massapicom. 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.