Source:
public void testPrintProperties() throws Exception { Map<String, Field> expProps = new HashMap<>(); for (Field field : IgniteSystemProperties.class.getFields()) { int mod = field.getModifiers(); if (isPublic(mod) && isStatic(mod) && isFinal(mod) && String.class.equals(field.getType())) { expProps.put(U.staticField(IgniteSystemProperties.class, field.getName()), field); assertTrue("Ignite system property must be annotated by @" + SystemProperty.class.getSimpleName() + " [field=" + field + ']', field.isAnnotationPresent(SystemProperty.class)); } } for (Class<?> cls : PROPS_CLS) { if (cls.equals(IgniteSystemProperties.class)) continue; for (Field field : cls.getFields()) { SystemProperty ann = field.getAnnotation(SystemProperty.class); if (ann == null) continue; assertFalse(field.getName() + " value shouldn't ends with dot.", ann.value().endsWith(".")); assertFalse(field.getName() + " defaults shouldn't ends with dot.", ann.defaults().endsWith(".")); expProps.put(U.staticField(cls, field.getName()), field); } } assertFalse(expProps.isEmpty()); GridJavaProcess proc = GridJavaProcess.exec( CommandLineStartup.class, PRINT_PROPS_COMMAND, log, s -> { Matcher matcher = propPtrn.matcher(s); if (matcher.matches()) { String name = matcher.group(1); boolean deprecated = !matcher.group(2).isEmpty(); String desc = matcher.group(3); Field field = expProps.remove(name); assertNotNull("Unexpected or duplicated property found [name=" + name + ']', field); assertEquals(field.isAnnotationPresent(Deprecated.class), deprecated); assertFalse("Description is empty.", desc.isEmpty()); } }, null); proc.getProcess().waitFor(); assertEquals(0, proc.getProcess().exitValue()); assertTrue("Not all properties printed: " + expProps, expProps.isEmpty()); }

Target:
public void testPrintProperties() throws Exception { Map<String, Field> expProps = new HashMap<>(); for (Field field : IgniteSystemProperties.class.getFields()) { int mod = field.getModifiers(); if (isPublic(mod) && isStatic(mod) && isFinal(mod) && String.class.equals(field.getType())) { expProps.put(U.staticField(IgniteSystemProperties.class, field.getName()), field); SystemProperty ann = field.getAnnotation(SystemProperty.class); assertFalse(field.getName() + " value shouldn't ends with dot.", ann.value().endsWith(".")); assertFalse(field.getName() + " defaults shouldn't ends with dot.", ann.defaults().endsWith(".")); assertTrue("Ignite system property must be annotated by @" + SystemProperty.class.getSimpleName() + " [field=" + field + ']', field.isAnnotationPresent(SystemProperty.class)); } } for (Class<?> cls : PROPS_CLS) { if (cls.equals(IgniteSystemProperties.class)) continue; for (Field field : cls.getFields()) { SystemProperty ann = field.getAnnotation(SystemProperty.class); if (ann == null) continue; assertFalse(field.getName() + " value shouldn't ends with dot.", ann.value().endsWith(".")); assertFalse(field.getName() + " defaults shouldn't ends with dot.", ann.defaults().endsWith(".")); expProps.put(U.staticField(cls, field.getName()), field); } } assertFalse(expProps.isEmpty()); GridJavaProcess proc = GridJavaProcess.exec( CommandLineStartup.class, PRINT_PROPS_COMMAND, log, s -> { Matcher matcher = propPtrn.matcher(s); if (matcher.matches()) { String name = matcher.group(1); boolean deprecated = !matcher.group(2).isEmpty(); String desc = matcher.group(3); Field field = expProps.remove(name); assertNotNull("Unexpected or duplicated property found [name=" + name + ']', field); assertEquals(field.isAnnotationPresent(Deprecated.class), deprecated); assertFalse("Description is empty.", desc.isEmpty()); } }, null); proc.getProcess().waitFor(); assertEquals(0, proc.getProcess().exitValue()); assertTrue("Not all properties printed: " + expProps, expProps.isEmpty()); }