test_class.declarator: expectedException = ExpectedException.none()
test_class.modifier: @Rule
    public
test_class.original_string: @Rule
    public ExpectedException expectedException = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedException
test_class.file: smart-engine/src/test/java/org/smartdata/server/engine/cmdlet/TestCmdletFactory.java
test_class.identifier: TestCmdletFactory
test_case.body: @Test
    public void testCreateAction() throws ActionException {
      SmartContext smartContext = mock(SmartContext.class);
      SmartConf conf = new SmartConf();
      conf.set(DFS_NAMENODE_HTTP_ADDRESS_KEY, "http://0.0.0.0:8088");
      conf.set(SmartConfKeys.SMART_DFS_NAMENODE_RPCSERVER_KEY, "hdfs://0.0.0.0:8089");
      when(smartContext.getConf()).thenReturn(conf);
      CmdletFactory cmdletFactory = new CmdletFactory(smartContext);
  
      LaunchAction launchAction1 = new LaunchAction(10, "allssd", new HashMap<String, String>());
  //    SmartAction action = cmdletFactory.createAction(launchAction1);
  //    Assert.assertNotNull(action);
  //    Assert.assertEquals(10, action.getActionId());
  //
  //    LaunchAction launchAction = new LaunchAction(10, "test", new HashMap<String, String>());
  //    expectedException.expect(ActionException.class);
  //    Assert.assertNull(cmdletFactory.createAction(launchAction));
    }
test_case.class_method_signature: TestCmdletFactory.testCreateAction()
test_case.full_signature: @Test public void testCreateAction()
test_case.identifier: testCreateAction
test_case.invocations: mock set set thenReturn when getConf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateAction()
focal_class.declarator: LOG = LoggerFactory.getLogger(CmdletFactory.class)
focal_class.modifier: static final
focal_class.original_string: static final Logger LOG = LoggerFactory.getLogger(CmdletFactory.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: smartContext
focal_class.modifier: private final
focal_class.original_string: private final SmartContext smartContext;
focal_class.type: SmartContext
focal_class.var_name: smartContext
focal_class.declarator: reporter
focal_class.modifier: private final
focal_class.original_string: private final StatusReporter reporter;
focal_class.type: StatusReporter
focal_class.var_name: reporter
focal_class.file: smart-engine/src/main/java/org/smartdata/server/engine/cmdlet/CmdletFactory.java
focal_class.identifier: CmdletFactory
focal_class.class_method_signature: CmdletFactory.CmdletFactory(SmartContext smartContext)
focal_class.full_signature: public  CmdletFactory(SmartContext smartContext)
focal_class.identifier: CmdletFactory
focal_class.modifiers: public
focal_class.parameters: (SmartContext smartContext)
focal_class.signature:  CmdletFactory(SmartContext smartContext)
focal_class.class_method_signature: CmdletFactory.CmdletFactory(SmartContext smartContext, StatusReporter reporter)
focal_class.full_signature: public  CmdletFactory(SmartContext smartContext, StatusReporter reporter)
focal_class.identifier: CmdletFactory
focal_class.modifiers: public
focal_class.parameters: (SmartContext smartContext, StatusReporter reporter)
focal_class.signature:  CmdletFactory(SmartContext smartContext, StatusReporter reporter)
focal_class.class_method_signature: CmdletFactory.createCmdlet(LaunchCmdlet launchCmdlet)
focal_class.full_signature: public Cmdlet createCmdlet(LaunchCmdlet launchCmdlet)
focal_class.identifier: createCmdlet
focal_class.modifiers: public
focal_class.parameters: (LaunchCmdlet launchCmdlet)
focal_class.return: Cmdlet
focal_class.signature: Cmdlet createCmdlet(LaunchCmdlet launchCmdlet)
focal_class.class_method_signature: CmdletFactory.createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_class.full_signature: public SmartAction createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_class.identifier: createAction
focal_class.modifiers: public
focal_class.parameters: (long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_class.return: SmartAction
focal_class.signature: SmartAction createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_class.class_method_signature: CmdletFactory.getRpcServerAddress()
focal_class.full_signature: private InetSocketAddress getRpcServerAddress()
focal_class.identifier: getRpcServerAddress
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: InetSocketAddress
focal_class.signature: InetSocketAddress getRpcServerAddress()
focal_method.body: public SmartAction createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)
        throws ActionException {
      SmartAction smartAction = ActionRegistry.createAction(launchAction.getActionType());
      smartAction.setContext(smartContext);
      smartAction.setCmdletId(cmdletId);
      smartAction.setLastAction(isLastAction);
      smartAction.init(launchAction.getArgs());
      smartAction.setActionId(launchAction.getActionId());
      if (smartAction instanceof HdfsAction) {
        try {
          ((HdfsAction) smartAction)
              .setDfsClient(
                  new SmartDFSClient(
                      HadoopUtil.getNameNodeUri(smartContext.getConf()),
                      smartContext.getConf(),
                      getRpcServerAddress()));
        } catch (IOException e) {
          LOG.error("smartAction aid={} setDfsClient error", launchAction.getActionId(), e);
          throw new ActionException(e);
        }
      }
      /*
      else if (smartAction instanceof AlluxioAction) {
        FileSystem fs;
        try {
          fs =  AlluxioUtil.getAlluxioFs(smartContext);
        } catch (Exception e) {
          LOG.error("smartAction aid={} alluxio filesystem error", launchAction.getActionId(), e);
          throw new ActionException(e);
        }
        ((AlluxioAction) smartAction).setFileSystem(fs);
      }
      */
      return smartAction;
    }
focal_method.class_method_signature: CmdletFactory.createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_method.full_signature: public SmartAction createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_method.identifier: createAction
focal_method.invocations: createAction getActionType setContext setCmdletId setLastAction init getArgs setActionId getActionId setDfsClient getNameNodeUri getConf getConf getRpcServerAddress error getActionId
focal_method.modifiers: public
focal_method.parameters: (long cmdletId, boolean isLastAction, LaunchAction launchAction)
focal_method.return: SmartAction
focal_method.signature: SmartAction createAction(long cmdletId, boolean isLastAction, LaunchAction launchAction)