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

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


      cliAction.setVersionConverter(VERSION_CONV);
      cliAction.execute(printer); // Should not throw exception.
   }

   public void testClientTransTrueAndFlatProduct() throws CmdLineActionException, IOException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockSqlQueryCliAction cliAction = new MockSqlQueryCliAction();
      cliAction.setQuery(QUERY);
      cliAction.setSortBy(SORT_BY);
      cliAction.setOutputFormat(OUTPUT_FORMAT);
      cliAction.setDelimiter(DELIMITER);
      cliAction.setFilterAlgor(FILTER_ALGOR);
      cliAction.setStartDateTimeMetKey(START_DATE_TIME_MET_KEY);
      cliAction.setEndDateTimeMetKey(END_DATE_TIME_MET_KEY);
      cliAction.setPriorityMetKey(PRIORITY_DATE_TIME_MET_KEY);
      cliAction.setVersionConverter(VERSION_CONV);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("Filename = data.dat", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals(SORT_BY, clientSetComplexQuery.getSortByMetKey());
      assertEquals(OUTPUT_FORMAT, clientSetComplexQuery.getToStringResultFormat());
      assertNull(clientSetComplexQuery.getReducedProductTypeNames());
      assertNull(clientSetComplexQuery.getReducedMetadata());
      assertEquals(FILTER_ALGOR, clientSetComplexQuery.getQueryFilter().getFilterAlgor());
View Full Code Here


      assertEquals(PRIORITY_DATE_TIME_MET_KEY, clientSetComplexQuery.getQueryFilter().getPriorityMetKey());
      assertEquals(VERSION_CONV, clientSetComplexQuery.getQueryFilter().getConverter());
   }

   public void testClientTransTrueAndFlatProductAndNoOutputFormat() throws CmdLineActionException, IOException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockSqlQueryCliAction cliAction = new MockSqlQueryCliAction();
      cliAction.setQuery(QUERY);
      cliAction.setSortBy(SORT_BY);
      cliAction.setDelimiter(DELIMITER);
      cliAction.setFilterAlgor(FILTER_ALGOR);
      cliAction.setStartDateTimeMetKey(START_DATE_TIME_MET_KEY);
      cliAction.setEndDateTimeMetKey(END_DATE_TIME_MET_KEY);
      cliAction.setPriorityMetKey(PRIORITY_DATE_TIME_MET_KEY);
      cliAction.setVersionConverter(VERSION_CONV);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      String msg = printer.getPrintedMessages().get(0);
      assertTrue(msg.contains("data.dat"));
      assertTrue(msg.contains("Bob,Billy"));
      assertEquals(",", msg.replace("data.dat","").replace("Bob,Billy",""));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals(SORT_BY, clientSetComplexQuery.getSortByMetKey());
      assertNull(clientSetComplexQuery.getToStringResultFormat());
      assertNull(clientSetComplexQuery.getReducedProductTypeNames());
      assertNull(clientSetComplexQuery.getReducedMetadata());
      assertEquals(FILTER_ALGOR, clientSetComplexQuery.getQueryFilter().getFilterAlgor());
View Full Code Here

   public void setUp() {
      referencePassedToClient = null;
   }

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

      cliAction.setOrigRef(ORIG_REF);
      cliAction.execute(printer); // Should not throw exception.
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetFilePercentTransferredCliAction cliAction = new MockGetFilePercentTransferredCliAction();
      cliAction.setOrigRef(ORIG_REF);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("Reference: [origRef=" + ORIG_REF + ",transferPct="
            + PERCENT_TRANS + "]", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));

      assertEquals(ORIG_REF, referencePassedToClient.getOrigReference());
   }
View Full Code Here

   private static final String PRODUCT_STRUCTURE = "Flat";
   private static final String PRODUCT_STATUS = "DONE";
   private static final String PRODUCT_TYPE_NAME = "TestProductType";

   public void testValidateErrors() {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetFirstPageCliAction cliAction = new MockGetFirstPageCliAction();
      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();
      MockGetFirstPageCliAction cliAction = new MockGetFirstPageCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.execute(printer);
      assertEquals(6, printer.getPrintedMessages().size());
      assertEquals("Page: [num=" + PAGE_NUM + ", totalPages=" + TOTAL_PAGES
            + ", pageSize=" + PAGE_SIZE + "]", printer.getPrintedMessages()
            .get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals("Products:", printer.getPrintedMessages().get(2));
      assertEquals("\n", printer.getPrintedMessages().get(3));
      assertEquals("Product: [id=" + PRODUCT_ID + ",name=" + PRODUCT_NAME
            + ",type=" + PRODUCT_TYPE_NAME + ",structure=" + PRODUCT_STRUCTURE
            + ", transferStatus=" + PRODUCT_STATUS + "]", printer
            .getPrintedMessages().get(4));
      assertEquals("\n", printer.getPrintedMessages().get(5));
   }
View Full Code Here

   private static final boolean HAS_PRODUCT = true;
   private static final String PRODUCT_NAME = "ProductName";

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

      cliAction.setProductName(PRODUCT_NAME);
      cliAction.execute(printer); // Should not throw exception.
   }
  
   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockHasProductCliAction cliAction = new MockHasProductCliAction();
      cliAction.setProductName(PRODUCT_NAME);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("hasProduct: Result: " + HAS_PRODUCT, 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();
      MockDeleteProductByIdCliAction cliAction = new MockDeleteProductByIdCliAction();
      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();
      MockDeleteProductByIdCliAction cliAction = new MockDeleteProductByIdCliAction();
      cliAction.setProductId(PRODUCT_ID);
      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

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.