Search in sources :

Example 11 with CmdletDescriptor

use of org.smartdata.model.CmdletDescriptor in project SSM by Intel-bigdata.

the class TestCmdletDescriptor method testStringToDescriptor.

@Test
public void testStringToDescriptor() throws Exception {
    String cmd = "someaction -arg1 -arg2 /dir/foo ; cache -file /testFile; action3";
    CmdletDescriptor des = CmdletDescriptor.fromCmdletString(cmd);
    Assert.assertTrue(des.getActionSize() == 3);
    Assert.assertTrue(des.getActionName(2).equals("action3"));
    Assert.assertTrue(des.getActionArgs(2).size() == 0);
}
Also used : CmdletDescriptor(org.smartdata.model.CmdletDescriptor) Test(org.junit.Test)

Aggregations

CmdletDescriptor (org.smartdata.model.CmdletDescriptor)11 Test (org.junit.Test)5 ActionInfo (org.smartdata.model.ActionInfo)3 CmdletInfo (org.smartdata.model.CmdletInfo)3 IOException (java.io.IOException)2 ParseException (java.text.ParseException)2 MetaStore (org.smartdata.metastore.MetaStore)2 MetaStoreException (org.smartdata.metastore.MetaStoreException)2 HashMap (java.util.HashMap)1 QueueFullException (org.smartdata.exception.QueueFullException)1 BackUpInfo (org.smartdata.model.BackUpInfo)1 FileDiff (org.smartdata.model.FileDiff)1 RuleExecutorPlugin (org.smartdata.model.rule.RuleExecutorPlugin)1 TranslateResult (org.smartdata.model.rule.TranslateResult)1