package com.boundary.metrics.vmware.poller;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.Resources;

public class MORCatalogFactory {
	
	private final static String DEFAULT_CATALOG_FILE = "collection-catalog.json";
	
	public static MORCatalog create() {
		return create(DEFAULT_CATALOG_FILE);
	}
	public static MORCatalog create(String resource) {
		ObjectMapper mapper = new ObjectMapper();
		MORCatalog catalog = null;

		try {
			File catalogFile = new File(Resources.getResource(resource)
					.toURI());
			catalog = mapper.readValue(catalogFile, MORCatalog.class);
		} catch (URISyntaxException e) {

			e.printStackTrace();
		} catch (JsonParseException e) {

			e.printStackTrace();
		} catch (JsonMappingException e) {

			e.printStackTrace();
		} catch (IOException e) {

			e.printStackTrace();
		}
	
		return catalog;
	}

}

@@ -42,100 +42,8 @@
 r;%0A%0A
-import static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0A%0A
 impo
@@ -126,31 +126,8 @@
 ion;
-%0Aimport java.util.List;
 %0A%0Aim

Remove unused imports