@Test public void isErrorFunction() throws Exception { FunctionLibrary funcLib = new FunctionLibrary(); DialogLibrary dialogLib = new DialogLibrary(); HashMap<Object, Object> context = new HashMap<>(); Function f = new IsErrorFunction(true, new ConfigThingy("", "\"test\""), funcLib, dialogLib, context); assertEquals(0, f.parameters().length); assertEquals("false", f.getString(null)); assertFalse(f.getBoolean(null)); Collection<String> dialogFunctions = new ArrayList<>(); f.getFunctionDialogReferences(dialogFunctions); assertTrue(dialogFunctions.isEmpty()); f = new IsErrorFunction(false, new ConfigThingy("", String.format("\"%s\"", FunctionLibrary.ERROR)), funcLib, dialogLib, context); assertEquals(0, f.parameters().length); assertEquals("true", f.getString(null)); assertTrue(f.getBoolean(null)); assertThrows(ConfigurationErrorException.class, () -> new IsErrorFunction(false, new ConfigThingy("", "\"test\" \"test\""), funcLib, dialogLib, context)); }
public IsErrorFunction(boolean objectCompare, ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { if (conf.count() != 1) throw new ConfigurationErrorException(L.m( "Funktion %1 muss genau einen Parameter haben", conf.getName())); this.objectCompare = objectCompare; func = FunctionFactory.parseChildren(conf, funcLib, dialogLib, context); }
IsErrorFunction implements Function { public IsErrorFunction(boolean objectCompare, ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { if (conf.count() != 1) throw new ConfigurationErrorException(L.m( "Funktion %1 muss genau einen Parameter haben", conf.getName())); this.objectCompare = objectCompare; func = FunctionFactory.parseChildren(conf, funcLib, dialogLib, context); } }
IsErrorFunction implements Function { public IsErrorFunction(boolean objectCompare, ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { if (conf.count() != 1) throw new ConfigurationErrorException(L.m( "Funktion %1 muss genau einen Parameter haben", conf.getName())); this.objectCompare = objectCompare; func = FunctionFactory.parseChildren(conf, funcLib, dialogLib, context); } IsErrorFunction(boolean objectCompare, ConfigThingy conf,
      FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context); }
IsErrorFunction implements Function { public IsErrorFunction(boolean objectCompare, ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { if (conf.count() != 1) throw new ConfigurationErrorException(L.m( "Funktion %1 muss genau einen Parameter haben", conf.getName())); this.objectCompare = objectCompare; func = FunctionFactory.parseChildren(conf, funcLib, dialogLib, context); } IsErrorFunction(boolean objectCompare, ConfigThingy conf,
      FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context); @Override String[] parameters(); @Override void getFunctionDialogReferences(Collection<String> set); @Override String getString(Values parameters); @Override boolean getBoolean(Values parameters); }
IsErrorFunction implements Function { public IsErrorFunction(boolean objectCompare, ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { if (conf.count() != 1) throw new ConfigurationErrorException(L.m( "Funktion %1 muss genau einen Parameter haben", conf.getName())); this.objectCompare = objectCompare; func = FunctionFactory.parseChildren(conf, funcLib, dialogLib, context); } IsErrorFunction(boolean objectCompare, ConfigThingy conf,
      FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context); @Override String[] parameters(); @Override void getFunctionDialogReferences(Collection<String> set); @Override String getString(Values parameters); @Override boolean getBoolean(Values parameters);  }