@Test public void testBlowingUpWithDuplicateLoaders() { KeyValuePairLoader kvpl = new KeyValuePairLoader(); kvpl.setKeyValuePairs(cmdLineArgsWFullClassName); try { AndHowConfiguration config = AndHowCoreTestConfig.instance() .setLoaders(kvpl, kvpl) .groups(configPtGroups); AndHow.instance(config); fail(); } catch (AppFatalException ce) { assertEquals(1, ce.getProblems().filter(ConstructionProblem.class).size()); assertTrue(ce.getProblems().filter(ConstructionProblem.class).get(0) instanceof ConstructionProblem.DuplicateLoader); ConstructionProblem.DuplicateLoader dl = (ConstructionProblem.DuplicateLoader)ce.getProblems().filter(ConstructionProblem.class).get(0); assertEquals(kvpl, dl.getLoader()); assertTrue(ce.getSampleDirectory().length() > 0); File sampleDir = new File(ce.getSampleDirectory()); assertTrue(sampleDir.exists()); assertTrue(sampleDir.listFiles().length > 0); } }
public static AndHow instance() throws AppFatalException { if (singleInstance != null && singleInstance.core != null) { return singleInstance; } else { synchronized (LOCK) { if (singleInstance == null || singleInstance.core == null) { return instance(AndHowUtil.findConfiguration(StdConfig.instance())); } else { return singleInstance; } } } }
AndHow implements StaticPropertyConfiguration, ValidatedValues { public static AndHow instance() throws AppFatalException { if (singleInstance != null && singleInstance.core != null) { return singleInstance; } else { synchronized (LOCK) { if (singleInstance == null || singleInstance.core == null) { return instance(AndHowUtil.findConfiguration(StdConfig.instance())); } else { return singleInstance; } } } } }
AndHow implements StaticPropertyConfiguration, ValidatedValues { public static AndHow instance() throws AppFatalException { if (singleInstance != null && singleInstance.core != null) { return singleInstance; } else { synchronized (LOCK) { if (singleInstance == null || singleInstance.core == null) { return instance(AndHowUtil.findConfiguration(StdConfig.instance())); } else { return singleInstance; } } } } private  AndHow(AndHowConfiguration config); }
AndHow implements StaticPropertyConfiguration, ValidatedValues { public static AndHow instance() throws AppFatalException { if (singleInstance != null && singleInstance.core != null) { return singleInstance; } else { synchronized (LOCK) { if (singleInstance == null || singleInstance.core == null) { return instance(AndHowUtil.findConfiguration(StdConfig.instance())); } else { return singleInstance; } } } } private  AndHow(AndHowConfiguration config); static AndHowConfiguration<? extends AndHowConfiguration> findConfig(); static AndHow instance(); static AndHow instance(AndHowConfiguration config); static boolean isInitialize(); static StackTraceElement[] getInitializationTrace(); @Override boolean isExplicitlySet(Property<?> prop); @Override T getExplicitValue(Property<T> prop); @Override T getValue(Property<T> prop); @Override List<EffectiveName> getAliases(Property<?> property); @Override String getCanonicalName(Property<?> prop); @Override GroupProxy getGroupForProperty(Property<?> prop); @Override NamingStrategy getNamingStrategy(); }
AndHow implements StaticPropertyConfiguration, ValidatedValues { public static AndHow instance() throws AppFatalException { if (singleInstance != null && singleInstance.core != null) { return singleInstance; } else { synchronized (LOCK) { if (singleInstance == null || singleInstance.core == null) { return instance(AndHowUtil.findConfiguration(StdConfig.instance())); } else { return singleInstance; } } } } private  AndHow(AndHowConfiguration config); static AndHowConfiguration<? extends AndHowConfiguration> findConfig(); static AndHow instance(); static AndHow instance(AndHowConfiguration config); static boolean isInitialize(); static StackTraceElement[] getInitializationTrace(); @Override boolean isExplicitlySet(Property<?> prop); @Override T getExplicitValue(Property<T> prop); @Override T getValue(Property<T> prop); @Override List<EffectiveName> getAliases(Property<?> property); @Override String getCanonicalName(Property<?> prop); @Override GroupProxy getGroupForProperty(Property<?> prop); @Override NamingStrategy getNamingStrategy(); static final String ANDHOW_INLINE_NAME; static final String ANDHOW_NAME; static final String ANDHOW_URL; static final String ANDHOW_TAG_LINE; }