@Test
	public void testBlowingUpWithDuplicateLoaders() {
		KeyValuePairLoader kvpl = new KeyValuePairLoader();
		kvpl.setKeyValuePairs(cmdLineArgsWFullClassName);
		try {
			AndHowConfiguration config = AndHowTestConfig.instance()
				.setLoaders(kvpl, kvpl)
				.addOverrideGroups(configPtGroups);
			AndHow.setConfig(config);
			AndHow.instance();
			fail();	//The line above should throw an error
		} 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);
		}
	}
@Test
	public void testBlowingUpWithDuplicateLoaders() {
		KeyValuePairLoader kvpl = new KeyValuePairLoader();
		kvpl.setKeyValuePairs(cmdLineArgsWFullClassName);
		try {
			AndHowConfiguration config = AndHowTestConfig.instance()
				.setLoaders(kvpl, kvpl)
				.addOverrideGroups(configPtGroups);
			AndHow.setConfig(config);
			AndHow.instance();
			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);
		}
	}
@test public void testblowingupwithduplicateloaders() { keyvaluepairloader kvpl = new keyvaluepairloader(); kvpl.setkeyvaluepairs(cmdlineargswfullclassname); try { andhowconfiguration config = andhowtestconfig.instance() .setloaders(kvpl, kvpl) .addoverridegroups(configptgroups); andhow.setconfig(config); andhow.instance(); 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); } }