Author: koen.aers(a)jboss.com
Date: 2011-06-29 16:57:28 -0400 (Wed, 29 Jun 2011)
New Revision: 32461
Added:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferencesTest.java
Removed:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeInstallations.java
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeInstallationsTest.java
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializer.java
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializerTest.java
Log:
rename 'installation' into 'runtime'
Deleted:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeInstallations.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeInstallations.java 2011-06-29
20:35:01 UTC (rev 32460)
+++
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeInstallations.java 2011-06-29
20:57:28 UTC (rev 32461)
@@ -1,192 +0,0 @@
-package org.jboss.tools.forge.core.preferences;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.jboss.tools.forge.core.ForgeCorePlugin;
-import org.jboss.tools.forge.core.process.ForgeEmbeddedRuntime;
-import org.jboss.tools.forge.core.process.ForgeRuntime;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-public class ForgeInstallations {
-
- static final String PREF_FORGE_INSTALLATIONS =
"org.jboss.tools.forge.core.installations";
-
- public static final ForgeInstallations INSTANCE = new ForgeInstallations();
-
- List<ForgeRuntime> installations = null;
- ForgeRuntime defaultInstallation = null;
-
- private ForgeInstallations() {}
-
- public ForgeRuntime[] getInstallations() {
- if (installations == null) {
- initializeInstallations();
- }
- return (ForgeRuntime[])installations.toArray(new ForgeRuntime[installations.size()]);
- }
-
- public ForgeRuntime getDefault() {
- if (defaultInstallation == null) {
- initializeInstallations();
- }
- return defaultInstallation;
- }
-
- private IEclipsePreferences getForgeCorePreferences() {
- return InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID);
- }
-
- private String getForgeInstallationsPreference() {
- return getForgeCorePreferences().get(
- PREF_FORGE_INSTALLATIONS,
- ForgePreferenceInitializer.INITIAL_INSTALLATIONS_PREFERENCE);
- }
-
- private void initializeInstallations() {
- initializeFromXml(getForgeInstallationsPreference());
- }
-
- private void initializeFromXml(String xml) {
- DocumentBuilder documentBuilder = newDocumentBuilder();
- if (documentBuilder == null) return;
- InputStream inputStream = createInputStream(xml);
- if (inputStream == null) return;
- installations = new ArrayList<ForgeRuntime>();
- Document document = parseInstallations(documentBuilder, inputStream);
- Element installationsElement = document.getDocumentElement();
- String defaultInstallationName =
installationsElement.getAttribute("default");
- NodeList nodeList = installationsElement.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- String type = element.getAttribute("type");
- ForgeRuntime runtime = null;
- if ("embedded".equals(type)) {
- runtime = ForgeEmbeddedRuntime.INSTANCE;
- }
- if (runtime == null) continue;
- installations.add(runtime);
- if (defaultInstallationName.equals(runtime.getName())) {
- defaultInstallation = runtime;
- }
- }
- }
- }
-
- private Document parseInstallations(DocumentBuilder documentBuilder, InputStream
inputStream) {
- Document result = null;
- try {
- result = documentBuilder.parse(inputStream);
- } catch (SAXException e) {
- ForgeCorePlugin.log(e);
- } catch (IOException e) {
- ForgeCorePlugin.log(e);
- }
- return result;
- }
-
- private InputStream createInputStream(String string) {
- InputStream result = null;
- try {
- result = new BufferedInputStream(new
ByteArrayInputStream(string.getBytes("UTF8")));
- } catch (UnsupportedEncodingException e) {
- ForgeCorePlugin.log(e);
- }
- return result;
- }
-
- private DocumentBuilder newDocumentBuilder() {
- try {
- return DocumentBuilderFactory.newInstance().newDocumentBuilder();
- } catch (ParserConfigurationException e) {
- ForgeCorePlugin.log(e);
- return null;
- }
- }
-
-// private static Document createEmptyDocument() {
-// DocumentBuilder documentBuilder = newDocumentBuilder();
-// if (documentBuilder == null) {
-// return null;
-// } else {
-// return documentBuilder.newDocument();
-// }
-// }
-//
-// private static String serializeDocument(Document doc) throws TransformerException,
IOException {
-// ByteArrayOutputStream s = new ByteArrayOutputStream();
-// TransformerFactory factory = TransformerFactory.newInstance();
-// Transformer transformer = factory.newTransformer();
-// transformer.setOutputProperty(OutputKeys.METHOD, "xml");
-// transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-// DOMSource source = new DOMSource(doc);
-// StreamResult outputTarget = new StreamResult(s);
-// transformer.transform(source, outputTarget);
-// return s.toString("UTF8");
-// }
-//
-// private static void createInitialInstallations() {
-// try {
-// File file = FileLocator.getBundleFile(ForgeUIPlugin.getDefault().getBundle());
-// defaultInstallation = new ForgeInstallation("embedded",
file.getAbsolutePath());
-// installations = new ArrayList<ForgeInstallation>();
-// installations.add(defaultInstallation);
-// saveInstallations();
-// } catch (IOException e) {
-// ForgeUIPlugin.log(e);
-// }
-// }
-//
-// public static void setInstallations(ForgeInstallation[] installs, ForgeInstallation
defaultInstall) {
-// installations.clear();
-// for (ForgeInstallation install : installs) {
-// installations.add(install);
-// }
-// defaultInstallation = defaultInstall;
-// saveInstallations();
-// }
-//
-// private static void saveInstallations() {
-// try {
-// String xml = serializeDocument(createInstallationsDocument());
-// ForgeUIPlugin.getDefault().getPreferenceStore().setValue(PREF_FORGE_INSTALLATIONS,
xml);
-// } catch (IOException e) {
-// ForgeUIPlugin.log(e);
-// } catch (TransformerException e) {
-// ForgeUIPlugin.log(e);
-// }
-// }
-//
-// private static Document createInstallationsDocument() {
-// Document document = createEmptyDocument();
-// if (document == null) return null;
-// Element main = document.createElement("forgeInstallations");
-// document.appendChild(main);
-// for (ForgeInstallation installation : installations) {
-// Element element = document.createElement("installation");
-// element.setAttribute("name", installation.getName());
-// element.setAttribute("location", installation.getLocation());
-// main.appendChild(element);
-// }
-// main.setAttribute("default", defaultInstallation.getName());
-// return document;
-// }
-
-}
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializer.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializer.java 2011-06-29
20:35:01 UTC (rev 32460)
+++
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializer.java 2011-06-29
20:57:28 UTC (rev 32461)
@@ -7,16 +7,16 @@
public class ForgePreferenceInitializer extends AbstractPreferenceInitializer {
- static final String INITIAL_INSTALLATIONS_PREFERENCE =
+ static final String INITIAL_RUNTIMES_PREFERENCE =
"<?xml version=\"1.0\" encoding=\"UTF-8\"
standalone=\"no\"?>\n" +
- "<forgeInstallations default=\"embedded\">" +
- " <installation name=\"embedded\"
type=\"embedded\"/>" +
- "</forgeInstallations>";
+ "<forgeRuntimes default=\"embedded\">" +
+ " <runtime name=\"embedded\"
type=\"embedded\"/>" +
+ "</forgeRuntimes>";
@Override
public void initializeDefaultPreferences() {
IEclipsePreferences preferences =
InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID);
- preferences.put(ForgeInstallations.PREF_FORGE_INSTALLATIONS,
INITIAL_INSTALLATIONS_PREFERENCE);
+ preferences.put(ForgeRuntimesPreferences.PREF_FORGE_RUNTIMES,
INITIAL_RUNTIMES_PREFERENCE);
}
}
Copied:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java
(from rev 32460,
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeInstallations.java)
===================================================================
---
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java
(rev 0)
+++
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java 2011-06-29
20:57:28 UTC (rev 32461)
@@ -0,0 +1,192 @@
+package org.jboss.tools.forge.core.preferences;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.jboss.tools.forge.core.ForgeCorePlugin;
+import org.jboss.tools.forge.core.process.ForgeEmbeddedRuntime;
+import org.jboss.tools.forge.core.process.ForgeRuntime;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class ForgeRuntimesPreferences {
+
+ static final String PREF_FORGE_RUNTIMES =
"org.jboss.tools.forge.core.runtimes";
+
+ public static final ForgeRuntimesPreferences INSTANCE = new ForgeRuntimesPreferences();
+
+ List<ForgeRuntime> runtimes = null;
+ ForgeRuntime defaultRuntime = null;
+
+ private ForgeRuntimesPreferences() {}
+
+ public ForgeRuntime[] getRuntimes() {
+ if (runtimes == null) {
+ initializeRuntimes();
+ }
+ return (ForgeRuntime[])runtimes.toArray(new ForgeRuntime[runtimes.size()]);
+ }
+
+ public ForgeRuntime getDefault() {
+ if (defaultRuntime == null) {
+ initializeRuntimes();
+ }
+ return defaultRuntime;
+ }
+
+ private IEclipsePreferences getForgeCorePreferences() {
+ return InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID);
+ }
+
+ private String getForgeRuntimesPreference() {
+ return getForgeCorePreferences().get(
+ PREF_FORGE_RUNTIMES,
+ ForgePreferenceInitializer.INITIAL_RUNTIMES_PREFERENCE);
+ }
+
+ private void initializeRuntimes() {
+ initializeFromXml(getForgeRuntimesPreference());
+ }
+
+ private void initializeFromXml(String xml) {
+ DocumentBuilder documentBuilder = newDocumentBuilder();
+ if (documentBuilder == null) return;
+ InputStream inputStream = createInputStream(xml);
+ if (inputStream == null) return;
+ runtimes = new ArrayList<ForgeRuntime>();
+ Document document = parseRuntimes(documentBuilder, inputStream);
+ Element runtimeElement = document.getDocumentElement();
+ String defaultRuntimeName = runtimeElement.getAttribute("default");
+ NodeList nodeList = runtimeElement.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Element element = (Element)node;
+ String type = element.getAttribute("type");
+ ForgeRuntime runtime = null;
+ if ("embedded".equals(type)) {
+ runtime = ForgeEmbeddedRuntime.INSTANCE;
+ }
+ if (runtime == null) continue;
+ runtimes.add(runtime);
+ if (defaultRuntimeName.equals(runtime.getName())) {
+ defaultRuntime = runtime;
+ }
+ }
+ }
+ }
+
+ private Document parseRuntimes(DocumentBuilder documentBuilder, InputStream inputStream)
{
+ Document result = null;
+ try {
+ result = documentBuilder.parse(inputStream);
+ } catch (SAXException e) {
+ ForgeCorePlugin.log(e);
+ } catch (IOException e) {
+ ForgeCorePlugin.log(e);
+ }
+ return result;
+ }
+
+ private InputStream createInputStream(String string) {
+ InputStream result = null;
+ try {
+ result = new BufferedInputStream(new
ByteArrayInputStream(string.getBytes("UTF8")));
+ } catch (UnsupportedEncodingException e) {
+ ForgeCorePlugin.log(e);
+ }
+ return result;
+ }
+
+ private DocumentBuilder newDocumentBuilder() {
+ try {
+ return DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ } catch (ParserConfigurationException e) {
+ ForgeCorePlugin.log(e);
+ return null;
+ }
+ }
+
+// private static Document createEmptyDocument() {
+// DocumentBuilder documentBuilder = newDocumentBuilder();
+// if (documentBuilder == null) {
+// return null;
+// } else {
+// return documentBuilder.newDocument();
+// }
+// }
+//
+// private static String serializeDocument(Document doc) throws TransformerException,
IOException {
+// ByteArrayOutputStream s = new ByteArrayOutputStream();
+// TransformerFactory factory = TransformerFactory.newInstance();
+// Transformer transformer = factory.newTransformer();
+// transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+// transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+// DOMSource source = new DOMSource(doc);
+// StreamResult outputTarget = new StreamResult(s);
+// transformer.transform(source, outputTarget);
+// return s.toString("UTF8");
+// }
+//
+// private static void createInitialInstallations() {
+// try {
+// File file = FileLocator.getBundleFile(ForgeUIPlugin.getDefault().getBundle());
+// defaultInstallation = new ForgeInstallation("embedded",
file.getAbsolutePath());
+// installations = new ArrayList<ForgeInstallation>();
+// installations.add(defaultInstallation);
+// saveInstallations();
+// } catch (IOException e) {
+// ForgeUIPlugin.log(e);
+// }
+// }
+//
+// public static void setInstallations(ForgeInstallation[] installs, ForgeInstallation
defaultInstall) {
+// installations.clear();
+// for (ForgeInstallation install : installs) {
+// installations.add(install);
+// }
+// defaultInstallation = defaultInstall;
+// saveInstallations();
+// }
+//
+// private static void saveInstallations() {
+// try {
+// String xml = serializeDocument(createInstallationsDocument());
+// ForgeUIPlugin.getDefault().getPreferenceStore().setValue(PREF_FORGE_INSTALLATIONS,
xml);
+// } catch (IOException e) {
+// ForgeUIPlugin.log(e);
+// } catch (TransformerException e) {
+// ForgeUIPlugin.log(e);
+// }
+// }
+//
+// private static Document createInstallationsDocument() {
+// Document document = createEmptyDocument();
+// if (document == null) return null;
+// Element main = document.createElement("forgeInstallations");
+// document.appendChild(main);
+// for (ForgeInstallation installation : installations) {
+// Element element = document.createElement("installation");
+// element.setAttribute("name", installation.getName());
+// element.setAttribute("location", installation.getLocation());
+// main.appendChild(element);
+// }
+// main.setAttribute("default", defaultInstallation.getName());
+// return document;
+// }
+
+}
Deleted:
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeInstallationsTest.java
===================================================================
---
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeInstallationsTest.java 2011-06-29
20:35:01 UTC (rev 32460)
+++
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeInstallationsTest.java 2011-06-29
20:57:28 UTC (rev 32461)
@@ -1,53 +0,0 @@
-package org.jboss.tools.forge.core.preferences;
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.tools.forge.core.process.ForgeEmbeddedRuntime;
-import org.junit.Test;
-
-public class ForgeInstallationsTest {
-
- private static final String ALTERNATIVE_FORGE_INSTALLATIONS =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"
standalone=\"no\"?>\n" +
- "<forgeInstallations default=\"foo\">" +
- " <installation name=\"embedded\"
type=\"embedded\"/>" +
- " <installation name=\"foo\" location=\"foofoo\"
type=\"external\"/>" +
- " <installation name=\"bar\" location=\"barbar\"
type=\"external\"/>" +
- "</forgeInstallations>";
-
- @Test
- public void testGetDefaultInitialCase() {
- assertEquals(ForgeEmbeddedRuntime.INSTANCE, ForgeInstallations.INSTANCE.getDefault());
- }
-
- @Test
- public void testGetInstallationsInitialCase() {
- assertEquals(1, ForgeInstallations.INSTANCE.getInstallations().length);
- }
-
-// @Test
-// public void testGetDefaultAlternativeCase() {
-// ForgeInstallations.INSTANCE.defaultInstallation = null;
-// InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID).put(
-// ForgeInstallations.PREF_FORGE_INSTALLATIONS,
-// ALTERNATIVE_FORGE_INSTALLATIONS);
-// ForgeRuntime runtime = ForgeInstallations.INSTANCE.getDefault();
-// assertNotNull(ForgeInstallations.INSTANCE.defaultInstallation);
-// assertEquals("foo", runtime.getName());
-// }
-//
-// @Test
-// public void testGetInstallationsAlternativeCase() {
-// ForgeInstallations.INSTANCE.installations = null;
-// InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID).put(
-// ForgeInstallations.PREF_FORGE_INSTALLATIONS,
-// ALTERNATIVE_FORGE_INSTALLATIONS);
-// ForgeRuntime[] runtimes = ForgeInstallations.INSTANCE.getInstallations();
-// assertNotNull(ForgeInstallations.INSTANCE.installations);
-// assertEquals(3, runtimes.length);
-// }
-
-
-
-
-}
Modified:
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializerTest.java
===================================================================
---
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializerTest.java 2011-06-29
20:35:01 UTC (rev 32460)
+++
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgePreferenceInitializerTest.java 2011-06-29
20:57:28 UTC (rev 32461)
@@ -13,11 +13,11 @@
@Test
public void testInitializeDefaultPreferences() {
IEclipsePreferences preferences =
InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID);
- assertNull(preferences.get(ForgeInstallations.PREF_FORGE_INSTALLATIONS, null));
+ assertNull(preferences.get(ForgeRuntimesPreferences.PREF_FORGE_RUNTIMES, null));
new ForgePreferenceInitializer().initializeDefaultPreferences();
assertEquals(
- ForgePreferenceInitializer.INITIAL_INSTALLATIONS_PREFERENCE,
- preferences.get(ForgeInstallations.PREF_FORGE_INSTALLATIONS, null));
+ ForgePreferenceInitializer.INITIAL_RUNTIMES_PREFERENCE,
+ preferences.get(ForgeRuntimesPreferences.PREF_FORGE_RUNTIMES, null));
}
}
Copied:
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferencesTest.java
(from rev 32460,
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeInstallationsTest.java)
===================================================================
---
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferencesTest.java
(rev 0)
+++
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferencesTest.java 2011-06-29
20:57:28 UTC (rev 32461)
@@ -0,0 +1,53 @@
+package org.jboss.tools.forge.core.preferences;
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.tools.forge.core.process.ForgeEmbeddedRuntime;
+import org.junit.Test;
+
+public class ForgeRuntimesPreferencesTest {
+
+ private static final String ALTERNATIVE_FORGE_RUNTIMES =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"
standalone=\"no\"?>\n" +
+ "<forgeRuntimes default=\"foo\">" +
+ " <runtime name=\"embedded\"
type=\"embedded\"/>" +
+ " <runtime name=\"foo\" location=\"foofoo\"
type=\"external\"/>" +
+ " <runtime name=\"bar\" location=\"barbar\"
type=\"external\"/>" +
+ "</forgeInstallations>";
+
+ @Test
+ public void testGetDefaultInitialCase() {
+ assertEquals(ForgeEmbeddedRuntime.INSTANCE,
ForgeRuntimesPreferences.INSTANCE.getDefault());
+ }
+
+ @Test
+ public void testGetRuntimesInitialCase() {
+ assertEquals(1, ForgeRuntimesPreferences.INSTANCE.getRuntimes().length);
+ }
+
+// @Test
+// public void testGetDefaultAlternativeCase() {
+// ForgeInstallations.INSTANCE.defaultInstallation = null;
+// InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID).put(
+// ForgeInstallations.PREF_FORGE_INSTALLATIONS,
+// ALTERNATIVE_FORGE_INSTALLATIONS);
+// ForgeRuntime runtime = ForgeInstallations.INSTANCE.getDefault();
+// assertNotNull(ForgeInstallations.INSTANCE.defaultInstallation);
+// assertEquals("foo", runtime.getName());
+// }
+//
+// @Test
+// public void testGetInstallationsAlternativeCase() {
+// ForgeInstallations.INSTANCE.installations = null;
+// InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID).put(
+// ForgeInstallations.PREF_FORGE_INSTALLATIONS,
+// ALTERNATIVE_FORGE_INSTALLATIONS);
+// ForgeRuntime[] runtimes = ForgeInstallations.INSTANCE.getInstallations();
+// assertNotNull(ForgeInstallations.INSTANCE.installations);
+// assertEquals(3, runtimes.length);
+// }
+
+
+
+
+}