Search in sources :

Example 6 with ActionItem

use of com.fo0.robot.model.ActionItem in project Robot by fo0.

the class TypeZipChainTest method unzip.

@Test
public void unzip() {
    ActionItem item = ActionItem.builder().type(EActionType.Unzip).value("$SRC(/home/max/Schreibtisch/Robot/test/agent.zip) $DST(/home/max/Schreibtisch/Robot/test/x)").description("description example").build();
    List<KeyValue> list = item.parsedValue();
    KeyValue zipFile = list.stream().filter(e -> e.getKey().equals(CONSTANTS_PATTERN.SOURCE)).findFirst().orElse(null);
    Assert.assertEquals(CONSTANTS_PATTERN.SOURCE, zipFile.getKey());
    Assert.assertEquals("/home/max/Schreibtisch/Robot/test/agent.zip", zipFile.getValue());
    KeyValue zipDstFolder = list.stream().filter(e -> e.getKey().equals(CONSTANTS_PATTERN.DESTINATION)).findFirst().orElse(null);
    Assert.assertEquals(CONSTANTS_PATTERN.DESTINATION, zipDstFolder.getKey());
    Assert.assertEquals("/home/max/Schreibtisch/Robot/test/x", zipDstFolder.getValue());
}
Also used : KeyValue(com.fo0.robot.model.KeyValue) ActionItem(com.fo0.robot.model.ActionItem) Test(org.junit.Test)

Example 7 with ActionItem

use of com.fo0.robot.model.ActionItem in project Robot by fo0.

the class ActionContext method pop.

public Entry<Integer, ActionItem> pop() {
    ActionItem latest = map.get(current);
    SimpleEntry<Integer, ActionItem> entry = new SimpleEntry<Integer, ActionItem>(current, latest);
    current++;
    end = map.size();
    return entry;
}
Also used : SimpleEntry(java.util.AbstractMap.SimpleEntry) ActionItem(com.fo0.robot.model.ActionItem)

Aggregations

ActionItem (com.fo0.robot.model.ActionItem)7 KeyValue (com.fo0.robot.model.KeyValue)3 Test (org.junit.Test)3 EChainResponse (com.fo0.robot.chain.EChainResponse)1 AddChainItemWindow (com.fo0.robot.client.gui.sub.AddChainItemWindow)1 UpdateWindow (com.fo0.robot.client.gui.sub.UpdateWindow)1 BeanTableModelAction (com.fo0.robot.model.BeanTableModelAction)1 CardLayout (java.awt.CardLayout)1 Point (java.awt.Point)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 MouseEvent (java.awt.event.MouseEvent)1 MouseListener (java.awt.event.MouseListener)1 File (java.io.File)1 SimpleEntry (java.util.AbstractMap.SimpleEntry)1 JButton (javax.swing.JButton)1 JFileChooser (javax.swing.JFileChooser)1 JFrame (javax.swing.JFrame)1 JMenu (javax.swing.JMenu)1 JMenuBar (javax.swing.JMenuBar)1