// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package dyndi;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import dyndi.params.Param;

public class Test {
    private static final String[] lines = new String[] {
        "UPDATE 12.7543.81 ParmA=\"dk.asterix.org\" [Denmark] (9.1) ParmB=\"de.asterix.org\" [Germany] (1.0) Called=49xxxxxxx (GBH) Calling=45xxxxxxxx (LOA) Internal=0 State=2",
        "UPDATE 12.7543.81 ParmB=\"de.asterix.org\" [Germany] (1.0) ParmA=\"dk.asterix.org\" [Denmark] (9.1) Called=49xxxxxxx (GBH) Calling=45xxxxxxxx (LOA) Internal=0 State=2",
        "UPDATE 12.7543.81 Internal=0 State=2 ParmB=\"de.asterix.org\" [Germany] (1.0) ParmA=\"dk.asterix.org\" [Denmark] (9.1) Called=49xxxxxxx (GBH) Calling=45xxxxxxxx (LOA)",
        "UPDATE 12.7543.81 Internal=0 State=2 ParmB=\"de.asterix.org\" [Germany] (1.0) Calling=90xxxxxx (LOA) ParmA=\"dk.asterix.org\" [Denmark] (9.1) Called=49xxxxxxx (GBH)"
    };
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("config.xml");
        for (String line : lines) {
            System.out.println(line);
            CommandUpdate cu = ctx.getBean(CommandUpdate.class);
            cu.init(line);
            for (Param p : cu.getParams()) {
                System.out.println(p);
            }
        }
    }
}
