JBoss Tools SVN: r35048 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-09-26 11:44:45 -0400 (Mon, 26 Sep 2011)
New Revision: 35048
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java
Log:
Problems view open only if it is not opened already
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java 2011-09-26 15:42:17 UTC (rev 35047)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java 2011-09-26 15:44:45 UTC (rev 35048)
@@ -101,7 +101,12 @@
*/
public static SWTBotTreeItem getErrorsNode (SWTBotExt bot){
SWTBotTreeItem errorsNode = null;
- SWTBot problemsBot = SWTEclipseExt.showView(bot,ViewType.PROBLEMS);
+ SWTBot problemsBot = null;
+ if (new SWTEclipseExt().isViewOpened("Problems")) {
+ problemsBot = bot.viewByTitle("Problems").bot();
+ }else {
+ problemsBot = SWTEclipseExt.showView(bot,ViewType.PROBLEMS);
+ }
bot.sleep(Timing.time3S());
try{
SWTBotTreeItem[] filteredTreeItems = ProblemsView.getProblemsTreeItemsContainingText(bot,problemsBot.tree(),null,
@@ -122,7 +127,12 @@
*/
public static SWTBotTreeItem getWarningsNode (SWTBotExt bot){
SWTBotTreeItem warningsNode = null;
- SWTBot problemsBot = SWTEclipseExt.showView(bot,ViewType.PROBLEMS);
+ SWTBot problemsBot = null;
+ if (new SWTEclipseExt().isViewOpened("Problems")) {
+ problemsBot = bot.viewByTitle("Problems").bot();
+ }else {
+ problemsBot = SWTEclipseExt.showView(bot,ViewType.PROBLEMS);
+ }
bot.sleep(Timing.time3S());
try{
SWTBotTreeItem[] filteredTreeItems = ProblemsView.getProblemsTreeItemsContainingText(bot,problemsBot.tree(),null,
14 years, 3 months
JBoss Tools SVN: r35047 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: src/org/jboss/tools/cdi/bot/test/quickfix and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-09-26 11:42:17 -0400 (Mon, 26 Sep 2011)
New Revision: 35047
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean3.java.cdi
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean2.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
Log:
Refactoring, documentation and completion of CDI Quick Fix test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean2.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean2.java.cdi 2011-09-26 15:28:29 UTC (rev 35046)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean2.java.cdi 2011-09-26 15:42:17 UTC (rev 35047)
@@ -1,6 +1,7 @@
package org.cdi.test;
import javax.decorator.Decorator;
import javax.decorator.Delegate;
+import javax.enterprise.inject.Produces;
import javax.enterprise.inject.Specializes;
import javax.inject.Inject;
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean3.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean3.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/TestBean3.java.cdi 2011-09-26 15:42:17 UTC (rev 35047)
@@ -0,0 +1,16 @@
+package org.cdi.test;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+
+public class TestBean extends AnyBean{
+
+ @Inject String str;
+
+ @Produces
+ public String getMessage() {
+ return "hello world";
+ }
+
+}
+
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-09-26 15:28:29 UTC (rev 35046)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-09-26 15:42:17 UTC (rev 35047)
@@ -1,6 +1,5 @@
package org.jboss.tools.cdi.bot.test.quickfix;
-import java.util.logging.Logger;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -21,7 +20,7 @@
import org.junit.runners.Suite.SuiteClasses;
/*
- * Test operates on quick fixes of CDI components
+ * Test operates on quick fixes of CDI components validation
*
* @author Jaroslav Jankovic
*/
@@ -31,123 +30,60 @@
@SuiteClasses({ CDIAllBotTests.class })
public class CDIQuickFixTest extends SWTTestExt {
- private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class.getName());
private static final String PROJECT_NAME = "CDIProject";
private static final String PACKAGE_NAME = "org.cdi.test";
private static SWTBotTreeItem[] problemsTrees;
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
- private enum ANNOTATIONS {TARGET, RETENTION, NAMED, TYPED, DISPOSES, OBSERVES, INTERCEPTOR,
+ private enum PROBLEM_TYPE {WARNINGS, ERRORS}
+ private enum ANNOTATIONS {SERIALIZABLE, TARGET, RETENTION, NAMED, TYPED, DISPOSES, OBSERVES, INTERCEPTOR,
SPECIALIZES, DECORATOR, NONBINDING}
private enum CDICOMPONENT {STEREOSCOPE, QUALIFIER, SCOPE, BEAN, ANNOTATION, INTERBINDING, INTERCEPTOR}
private SWTBotEclipseEditor ed;
+
+ /*
+ * init method "setup()" shows a project explorer view as default,
+ * disable folding (due to easier source code editing) and add
+ * cdi extension
+ */
@BeforeClass
public static void setup() {
eclipse.showView(ViewType.PROJECT_EXPLORER);
CDIUtil.disableFolding(bot, util);
CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer,PROJECT_NAME);
}
-
+
+ /*
+ * check problems (warnings and errors in Problems View)
+ */
@After
public void waitForJobs() {
+ checkProjectAllProblems();
util.waitForNonIgnoredJobs();
}
@Test
public void testSerializableQF() {
- createComponent(CDICOMPONENT.BEAN, "B1");
- assertTrue(("B1.java").equals(ed.getTitle()));
- String code = ed.toTextEditor().getText();
- LOGGER.fine(code);
- assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
- assertTrue(code.contains("public class B1 {"));
-
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
- .getResourceAsStream("/resources/cdi/B1.java.cdi"), false);
- assertContains("@SessionScoped", ed.toTextEditor().getText());
- problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
- "Managed bean B1 which", "/" + PROJECT_NAME, "B1.java",
- "CDI Problem");
- assertTrue(problemsTrees.length == 1);
-
- CDIUtil.resolveQuickFix(problemsTrees[0], bot, util);
- SWTBotEclipseEditor eclEditor = ed.toTextEditor();
- assertTrue(eclEditor.getText().contains("import java.io.Serializable;"));
- problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
- "Managed bean B1 which", "/" + PROJECT_NAME, "B1.java",
- "CDI Problem");
- assertTrue(problemsTrees.length == 0);
+ String className = "B1";
+ createComponent(CDICOMPONENT.BEAN, className);
+
+ //
+ checkSerializableAnnotation(CDICOMPONENT.BEAN, className);
}
@Test
public void testMultipleBeansQF() {
- createComponent(CDICOMPONENT.BEAN, "Animal");
- assertTrue(("Animal.java").equals(ed.getTitle()));
- String code = ed.toTextEditor().getText();
- assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
- assertTrue(code.contains("public class Animal {"));
-
- createComponent(CDICOMPONENT.BEAN, "Dog");
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
- .getResourceAsStream("/resources/cdi/Dog.java.cdi"), false);
- assertTrue(("Dog.java").equals(ed.getTitle()));
- code = ed.toTextEditor().getText();
- LOGGER.fine(code);
- assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
- assertTrue(code.contains("public class Dog extends Animal {"));
-
- createComponent(CDICOMPONENT.QUALIFIER, "Q1");
- assertTrue(("Q1.java").equals(ed.getTitle()));
- code = ed.toTextEditor().getText();
- LOGGER.fine(code);
-
- createComponent(CDICOMPONENT.BEAN, "BrokenFarm");
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
- .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
- false);
- assertTrue(("BrokenFarm.java").equals(ed.getTitle()));
- code = ed.toTextEditor().getText();
- LOGGER.fine(code);
- assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
- assertTrue(code.contains("public class BrokenFarm {"));
- assertTrue(code.contains("@Inject private Animal animal;"));
-
- problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
- "Multiple beans are eligible", "/" + PROJECT_NAME,
- "BrokenFarm.java", "CDI Problem");
- assertTrue(problemsTrees.length == 1);
-
- CDIUtil.openQuickFix(problemsTrees[0], bot);
- String qualifBean = null;
- if (bot.table(0).cell(0, 0).contains("Animal")) {
- qualifBean = "Animal";
- } else {
- qualifBean = "Dog";
- }
- bot.activeShell().bot().button("Finish").click();
- bot.sleep(Timing.time1S());
- util.waitForNonIgnoredJobs();
- assertFalse(bot.button("Add >").isEnabled());
- assertFalse(bot.button("Finish").isEnabled());
- bot.table(0).click(bot.table(0).indexOf("Q1 - " + PACKAGE_NAME), 0);
- assertTrue(bot.button("Add >").isEnabled());
- assertFalse(bot.button("Finish").isEnabled());
- bot.clickButton("Add >");
- assertTrue(bot.button("Finish").isEnabled());
- bot.clickButton("Finish");
-
- bot.sleep(Timing.time1S());
- util.waitForNonIgnoredJobs();
- code = ed.toTextEditor().getText();
- assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
- code = bot.editorByTitle(qualifBean + ".java").toTextEditor().getText();
- assertTrue(code.contains("@Q1"));
- problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
- "Multiple beans are eligible", "/" + PROJECT_NAME,
- "BrokenFarm.java", "CDI Problem");
- assertTrue(problemsTrees.length == 0);
+ String className = "BrokenFarm";
+ createComponent(CDICOMPONENT.BEAN, className);
+
+ //
+ checkMultipleBeans(CDICOMPONENT.BEAN, className);
}
+ /*
+ * CDI Quick Fix test operates over validation
+ * concerning about Stereoscope component
+ */
@Test
public void testStereoscopeQF() {
String className = "S1";
@@ -166,6 +102,10 @@
checkTypedAnnotation(CDICOMPONENT.STEREOSCOPE, className);
}
+ /*
+ * CDI Quick Fix test operates over validation
+ * concerning about Qualifier component
+ */
@Test
public void testQualifiersQF() {
String className = "Q2";
@@ -182,6 +122,10 @@
}
+ /*
+ * CDI Quick Fix test operates over validation
+ * concerning about Scope component
+ */
@Test
public void testScopeQF() {
String className = "Scope1";
@@ -194,6 +138,10 @@
checkTargetAnnotation(CDICOMPONENT.SCOPE, className);
}
+ /*
+ * CDI Quick Fix test operates over validation
+ * concerning about general Bean component
+ */
@Test
public void testBeanQF() {
String className = "MyBean";
@@ -215,6 +163,10 @@
checkSessionBean(CDICOMPONENT.BEAN, className);
}
+ /*
+ * CDI Quick Fix test operates over validation
+ * concerning about Interceptors/Interceptor Binding/Decorator component
+ */
@Test
public void testInterDecorQF() {
String className = "InterDecor";
@@ -236,9 +188,13 @@
checkSpecializeAnnotation(CDICOMPONENT.BEAN, "TestBean");
// 6.QF - https://issues.jboss.org/browse/JBIDE-7641
- checkNonBindingAnnotation(CDICOMPONENT.INTERCEPTOR, "Interceptor");
+ checkNonBindingAnnotation(CDICOMPONENT.INTERBINDING, "Interceptor");
}
+
+ /*
+ * method edits default Target form because of "one space inconsistency"
+ */
private void prepareCdiComponent(CDICOMPONENT component, String name) {
createComponent(component, name);
switch (component) {
@@ -280,6 +236,35 @@
ed = bot.activeEditor().toTextEditor();
}
+
+ /*
+ ****************************************************************
+ *
+ * "prepare" like methods which prepare structure of project
+ * before testing itself
+ *
+ ****************************************************************
+ */
+
+ private void prepareSerializableAnnotation() {
+ CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/B1.java.cdi"), false);
+ }
+
+ private void prepareMultipleBeans(String className) {
+ createComponent(CDICOMPONENT.BEAN, "Animal");
+ createComponent(CDICOMPONENT.BEAN, "Dog");
+ CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/Dog.java.cdi"), false);
+ createComponent(CDICOMPONENT.QUALIFIER, "Q1");
+ bot.editorByTitle(className + ".java").show();
+ ed = bot.activeEditor().toTextEditor();
+ CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
+ false);
+
+ }
+
private void prepareNamedAnnotation(CDICOMPONENT comp,
String className, boolean add) {
if (comp == CDICOMPONENT.BEAN) {
@@ -362,6 +347,28 @@
CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/TestBean.java.cdi"), false);
}
+
+
+ /*
+ ****************************************************************
+ *
+ * "check" like methods which are the most general method to test
+ * CDI components with various annotations, replacements and so on
+ *
+ ****************************************************************
+ */
+
+
+ private void checkSerializableAnnotation(CDICOMPONENT comp, String className) {
+ prepareSerializableAnnotation();
+ checkQuickFix(ANNOTATIONS.SERIALIZABLE, comp, className, "Serializable");
+ cleanWarnings(className);
+ }
+
+ private void checkMultipleBeans(CDICOMPONENT comp, String className) {
+ prepareMultipleBeans(className);
+ checkQuickFix(ANNOTATIONS.NAMED, comp, className, "MultipleBeans");
+ }
private void checkTargetAnnotation(CDICOMPONENT comp, String className) {
checkTargetAnnotWithAddon(comp, className, "@Target({TYPE, FIELD})");
@@ -421,6 +428,10 @@
"import java.lang.annotation.Retention;", "");
}
checkQuickFix(ANNOTATIONS.RETENTION, comp, className, replacement);
+ if (replacement.equals("@Retention(CLASS)")) {
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.RetentionPolicy.CLASS;","");
+ }
}
private void checkNamedAnnotation(CDICOMPONENT comp, String className) {
@@ -564,6 +575,8 @@
private void checkObserveAnnotation(CDICOMPONENT comp, String className) {
checkObserveAnnotWithAddon(comp, className, "@Decorator");
checkObserveAnnotWithAddon(comp, className, "@Interceptor");
+ CDIUtil.replaceInEditor(ed, bot, "@Interceptor", "");
+ CDIUtil.replaceInEditor(ed, bot, "import javax.interceptor.Interceptor;", "");
}
private void checkObserveAnnotWithAddon(CDICOMPONENT comp, String className,
@@ -585,6 +598,8 @@
prepareComponentsForSpecializeAnnotation(className);
checkSpecializeAnnotWithAddon(comp, className, "@Interceptor");
checkSpecializeAnnotWithAddon(comp, className, "@Decorator");
+ CDIUtil.copyResourceToClass(ed,
+ CDIQuickFixTest.class.getResourceAsStream("/resources/cdi/TestBean3.java.cdi"), false);
}
private void checkSpecializeAnnotWithAddon(CDICOMPONENT comp, String className,
@@ -599,17 +614,20 @@
private void checkNonBindingAnnotation(CDICOMPONENT comp, String className) {
checkNonBindingAnnotationWithAddon(comp, className, "Annotation");
checkNonBindingAnnotationWithAddon(comp, className, "Array");
+
}
private void checkNonBindingAnnotationWithAddon(CDICOMPONENT comp, String className,
String replacement) {
- if (comp == CDICOMPONENT.INTERCEPTOR) {
+ if (comp == CDICOMPONENT.INTERBINDING) {
boolean interceptorCreated = projectExplorer.isFilePresent(PROJECT_NAME,
"Java Resources", "src", PACKAGE_NAME, className + ".java");
if (!interceptorCreated) {
CDIUtil.binding(PACKAGE_NAME, className, null, false, false).finish();
+ ed = bot.activeEditor().toTextEditor();
}
}
+
if (replacement.equals("Annotation")) {
boolean annotationCreated = projectExplorer.isFilePresent(PROJECT_NAME,
"Java Resources", "src", PACKAGE_NAME, "AAnnotation.java");
@@ -625,13 +643,24 @@
checkQuickFix(ANNOTATIONS.NONBINDING, comp, className, replacement);
}
+ /*
+ ****************************************************************
+ *
+ * checkQuickFix is the most important method in this class. It
+ * gets validation error prior to component type, annotation and
+ * class name, then it resolve validation error through quick fix
+ * wizard and finally check if validation errors was fixed through
+ * this wizard
+ *
+ ****************************************************************
+ */
+
private void checkQuickFix(ANNOTATIONS annonType, CDICOMPONENT comp,
String className, String replacement) {
- String componentClass = className + ".java";
- problemsTrees = getProblems(annonType, comp, componentClass);
+ problemsTrees = getProblems(annonType, comp, className + ".java");
assertTrue(problemsTrees.length != 0);
resolveQuickFix(annonType, comp, replacement);
- problemsTrees = getProblems(annonType, comp, componentClass);
+ problemsTrees = getProblems(annonType, comp, className + ".java");
assertTrue(problemsTrees.length == 0);
}
@@ -641,6 +670,7 @@
switch (annonType) {
case NAMED:
case SPECIALIZES:
+ case SERIALIZABLE:
warningType = ((comp == CDICOMPONENT.BEAN)?true:false);
break;
case TYPED:
@@ -653,12 +683,20 @@
}
String problemsContains = null;
if (warningType) {
- if (annonType == ANNOTATIONS.SPECIALIZES) {
+ switch (annonType) {
+ case SPECIALIZES:
problemsContains = "@Specializes";
- }
- if (annonType == ANNOTATIONS.NONBINDING) {
+ break;
+ case NONBINDING:
problemsContains = "@Nonbinding";
+ break;
+ case SERIALIZABLE:
+ problemsContains = "declares a passivating scope SessionScoped";
+ break;
}
+ if (className.equals("BrokenFarm.java")) {
+ problemsContains = "Multiple beans are eligible";
+ }
problemsTree = ProblemsView.getFilteredWarningsTreeItems(bot, problemsContains, "/"
+ PROJECT_NAME, className, "CDI Problem");
} else {
@@ -680,8 +718,12 @@
}
private void resolveQuickFix(ANNOTATIONS annonType, CDICOMPONENT comp, String replacement) {
- int index = indexDetermine(annonType, comp, replacement);
- resolve(annonType, replacement, index);
+ if (replacement.equals("MultipleBeans")) {
+ resolveMultipleBeans();
+ }else {
+ int index = indexDetermine(annonType, comp, replacement);
+ resolve(annonType, replacement, index);
+ }
}
private int indexDetermine(ANNOTATIONS annonType, CDICOMPONENT comp, String replacement) {
@@ -711,14 +753,70 @@
bot.clickButton("Finish");
bot.sleep(Timing.time1S());
util.waitForNonIgnoredJobs();
- clearImports(annonType, replacement);
}
+
+ private void resolveMultipleBeans() {
+ CDIUtil.openQuickFix(problemsTrees[0], bot);
+ String qualifBean = null;
+ if (bot.table(0).cell(0, 0).contains("Animal")) {
+ qualifBean = "Animal";
+ } else {
+ qualifBean = "Dog";
+ }
+ bot.activeShell().bot().button("Finish").click();
+ bot.sleep(Timing.time1S());
+ util.waitForNonIgnoredJobs();
+ assertFalse(bot.button("Add >").isEnabled());
+ assertFalse(bot.button("Finish").isEnabled());
+ bot.table(0).click(bot.table(0).indexOf("Q1 - " + PACKAGE_NAME), 0);
+ assertTrue(bot.button("Add >").isEnabled());
+ assertFalse(bot.button("Finish").isEnabled());
+ bot.clickButton("Add >");
+ assertTrue(bot.button("Finish").isEnabled());
+ bot.clickButton("Finish");
+
+ bot.sleep(Timing.time1S());
+ util.waitForNonIgnoredJobs();
+ String code = ed.toTextEditor().getText();
+ assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
+ code = bot.editorByTitle(qualifBean + ".java").toTextEditor().getText();
+ assertTrue(code.contains("@Q1"));
+ }
- private void clearImports(ANNOTATIONS annonType, String replacement) {
- if (annonType == ANNOTATIONS.RETENTION && replacement.equals("@Retention(CLASS)")) {
- CDIUtil.replaceInEditor(ed, bot,
- "import static java.lang.annotation.RetentionPolicy.CLASS;","");
+ /*
+ * method gets all the problems by all classes in the project.
+ * Type of problems (warning, error) is chosen by proper value in parameter
+ */
+
+ private void checkProjectAllProblems() {
+ problemsTrees = getAllProblems(PROBLEM_TYPE.WARNINGS);
+ assertTrue(problemsTrees.length == 0);
+ problemsTrees = getAllProblems(PROBLEM_TYPE.ERRORS);
+ assertTrue(problemsTrees.length == 0);
+ }
+
+ private SWTBotTreeItem[] getAllProblems(PROBLEM_TYPE problemType) {
+ SWTBotTreeItem[] problemsTree = null;
+ if (problemType == PROBLEM_TYPE.WARNINGS) {
+ problemsTree = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
+ + PROJECT_NAME, null, null);
+ }else if (problemType == PROBLEM_TYPE.ERRORS) {
+ problemsTree = ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
+ + PROJECT_NAME, null, null);
}
+ return problemsTree;
}
-
+
+ private void cleanWarnings(String className) {
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
+ + PROJECT_NAME, className + ".java", null);
+ assertTrue(problemsTrees.length != 0);
+ CDIUtil.openQuickFix(problemsTrees[0], bot);
+ bot.clickButton("Finish");
+ bot.sleep(Timing.time1S());
+ bot.activeEditor().save();
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
+ + PROJECT_NAME, className, "CDI Problem");
+ assertTrue(problemsTrees.length == 0);
+ }
}
14 years, 3 months
JBoss Tools SVN: r35046 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-09-26 11:28:29 -0400 (Mon, 26 Sep 2011)
New Revision: 35046
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java
Log:
- Added equals and hashCode methods to VpeCustomStringStorage
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java 2011-09-26 14:39:13 UTC (rev 35045)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java 2011-09-26 15:28:29 UTC (rev 35046)
@@ -31,14 +31,17 @@
this.name = resourceName;
}
+ @Override
public InputStream getContents() throws CoreException {
return new ByteArrayInputStream(this.jarFileContent.getBytes());
}
+ @Override
public IPath getFullPath() {
return null;
}
+ @Override
public String getName() {
return this.name;
}
@@ -50,12 +53,52 @@
return this.jarFileContent;
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public Object getAdapter(Class adapter) {
return null;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + (jarFileContent == null ? 0 : jarFileContent.hashCode());
+ result = prime * result + (name == null ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ VpeCustomStringStorage other = (VpeCustomStringStorage) obj;
+ if (jarFileContent == null) {
+ if (other.jarFileContent != null) {
+ return false;
+ }
+ } else if (!jarFileContent.equals(other.jarFileContent)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
}
14 years, 3 months
JBoss Tools SVN: r35045 - in trunk/as: plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-26 10:39:13 -0400 (Mon, 26 Sep 2011)
New Revision: 35045
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IDomain.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Domain.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/DomainResponseUnmarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ListCartridgesResponseUnmarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/utils/StreamUtils.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgeTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/CartridgeAsserts.java
Log:
[JBIDE-9773] correcting ApplicationLogReader implementation and adding new tests
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -17,26 +17,28 @@
*/
public interface IApplication {
- public abstract String getUUID() throws OpenshiftException;
+ public String getName();
+
+ public String getUUID() throws OpenshiftException;
- public abstract ICartridge getCartridge();
+ public ICartridge getCartridge();
- public abstract String getEmbedded() throws OpenshiftException;
+ public String getEmbedded() throws OpenshiftException;
- public abstract Date getCreationTime() throws OpenshiftException;
+ public Date getCreationTime() throws OpenshiftException;
- public abstract void destroy() throws OpenshiftException;
+ public void destroy() throws OpenshiftException;
- public abstract void start() throws OpenshiftException;
+ public void start() throws OpenshiftException;
- public abstract void restart() throws OpenshiftException;
+ public void restart() throws OpenshiftException;
- public abstract void stop() throws OpenshiftException;
+ public void stop() throws OpenshiftException;
- public abstract ApplicationLogReader getLog() throws OpenshiftException;
+ public ApplicationLogReader getLog() throws OpenshiftException;
- public abstract String getGitUri() throws OpenshiftException;
+ public String getGitUri() throws OpenshiftException;
- public abstract String getApplicationUrl() throws OpenshiftException;
+ public String getApplicationUrl() throws OpenshiftException;
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -12,26 +12,27 @@
import java.util.Collection;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IDomain;
/**
* @author André Dietisheim
*/
public interface IUser {
- public abstract String getRhlogin();
+ public String getRhlogin();
- public abstract String getPassword();
+ public String getPassword();
- public abstract Domain getDomain() throws OpenshiftException;
+ public IDomain getDomain() throws OpenshiftException;
- public abstract ISSHPublicKey getSshKey() throws OpenshiftException;
+ public ISSHPublicKey getSshKey() throws OpenshiftException;
- public abstract Collection<Cartridge> getCartridges() throws OpenshiftException;
+ public Collection<ICartridge> getCartridges() throws OpenshiftException;
- public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException;
+ public IApplication createApplication(String name, ICartridge cartridge) throws OpenshiftException;
- public abstract Collection<Application> getApplications() throws OpenshiftException;
+ public Collection<IApplication> getApplications() throws OpenshiftException;
+ public IApplication getApplicationByName(String name) throws OpenshiftException;
+
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -108,7 +108,7 @@
@Override
public String getGitUri() throws OpenshiftException {
- Domain domain = user.getDomain();
+ IDomain domain = user.getDomain();
if (domain == null) {
return null;
}
@@ -118,7 +118,7 @@
@Override
public String getApplicationUrl() throws OpenshiftException {
- Domain domain = user.getDomain();
+ IDomain domain = user.getDomain();
if (domain == null) {
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Domain.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Domain.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Domain.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -16,7 +16,7 @@
/**
* @author André Dietisheim
*/
-public class Domain {
+public class Domain implements IDomain {
private String namespace;
private String rhcDomain;
@@ -32,10 +32,12 @@
this.user = user;
}
+ @Override
public String getNamespace() throws OpenshiftException {
return namespace;
}
+ @Override
public String getRhcDomain() throws OpenshiftException {
user.loadLazyValues();
return rhcDomain;
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IDomain.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IDomain.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IDomain.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -0,0 +1,11 @@
+package org.jboss.ide.eclipse.as.openshift.core.internal;
+
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+
+public interface IDomain {
+
+ public abstract String getNamespace() throws OpenshiftException;
+
+ public abstract String getRhcDomain() throws OpenshiftException;
+
+}
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IDomain.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -12,7 +12,6 @@
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
@@ -23,7 +22,7 @@
*/
public interface IOpenshiftService {
- public List<Cartridge> getCartridges(User user) throws OpenshiftException;
+ public List<ICartridge> getCartridges(User user) throws OpenshiftException;
public Application createApplication(String name, ICartridge cartridge, User user) throws OpenshiftException;
@@ -37,9 +36,9 @@
public String getStatus(String name, ICartridge cartridge, User user) throws OpenshiftException;
- public Domain changeDomain(String name, ISSHPublicKey sshKey, User user) throws OpenshiftException;
+ public IDomain changeDomain(String name, ISSHPublicKey sshKey, User user) throws OpenshiftException;
- public Domain createDomain(String name, ISSHPublicKey sshKey, User user) throws OpenshiftException;
+ public IDomain createDomain(String name, ISSHPublicKey sshKey, User user) throws OpenshiftException;
public UserInfo getUserInfo(User user) throws OpenshiftException;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -14,7 +14,6 @@
import java.net.URL;
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
@@ -75,7 +74,7 @@
}
@Override
- public List<Cartridge> getCartridges(User user) throws OpenshiftException {
+ public List<ICartridge> getCartridges(User user) throws OpenshiftException {
ListCartridgesRequest listCartridgesRequest = new ListCartridgesRequest(user.getRhlogin(), true);
String url = listCartridgesRequest.getUrlString(BASE_URL);
try {
@@ -85,7 +84,7 @@
.createString();
String listCatridgesReponse = createHttpClient(url).post(request);
listCatridgesReponse = JsonSanitizer.sanitize(listCatridgesReponse);
- OpenshiftResponse<List<Cartridge>> response =
+ OpenshiftResponse<List<ICartridge>> response =
new ListCartridgesResponseUnmarshaller().unmarshall(listCatridgesReponse);
return response.getOpenshiftObject();
} catch (MalformedURLException e) {
@@ -96,16 +95,16 @@
}
@Override
- public Domain createDomain(String name, ISSHPublicKey sshKey, User user) throws OpenshiftException {
+ public IDomain createDomain(String name, ISSHPublicKey sshKey, User user) throws OpenshiftException {
return requestDomainAction(new CreateDomainRequest(name, sshKey, user.getRhlogin(), true), user);
}
@Override
- public Domain changeDomain(String newName, ISSHPublicKey sshKey, User user) throws OpenshiftException {
+ public IDomain changeDomain(String newName, ISSHPublicKey sshKey, User user) throws OpenshiftException {
return requestDomainAction(new ChangeDomainRequest(newName, sshKey, user.getRhlogin(), true), user);
}
- protected Domain requestDomainAction(AbstractDomainRequest request, User user) throws OpenshiftException {
+ protected IDomain requestDomainAction(AbstractDomainRequest request, User user) throws OpenshiftException {
String url = request.getUrlString(BASE_URL);
try {
String requestString =
@@ -115,7 +114,7 @@
.createString();
String responseString = createHttpClient(url).post(requestString);
responseString = JsonSanitizer.sanitize(responseString);
- OpenshiftResponse<Domain> response =
+ OpenshiftResponse<IDomain> response =
new DomainResponseUnmarshaller(request.getName(), user).unmarshall(responseString);
return response.getOpenshiftObject();
} catch (MalformedURLException e) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -15,8 +15,8 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
@@ -32,8 +32,8 @@
private ISSHPublicKey sshKey;
private Domain domain;
private UserInfo userInfo;
- private List<Cartridge> cartridges;
- private List<Application> applications = new ArrayList<Application>();
+ private List<ICartridge> cartridges;
+ private List<IApplication> applications = new ArrayList<IApplication>();
private IOpenshiftService service;
@@ -53,7 +53,7 @@
}
@Override
- public Domain getDomain() throws OpenshiftException {
+ public IDomain getDomain() throws OpenshiftException {
loadLazyValues();
return domain;
}
@@ -80,7 +80,7 @@
}
@Override
- public List<Cartridge> getCartridges() throws OpenshiftException {
+ public List<ICartridge> getCartridges() throws OpenshiftException {
if (cartridges == null) {
this.cartridges = service.getCartridges(this);
}
@@ -88,26 +88,27 @@
}
@Override
- public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ public IApplication createApplication(String name, ICartridge cartridge) throws OpenshiftException {
Application application = service.createApplication(name, cartridge, this);
add(application);
return application;
}
-
+
@Override
- public Collection<Application> getApplications() throws OpenshiftException {
+ public Collection<IApplication> getApplications() throws OpenshiftException {
loadLazyValues();
return Collections.unmodifiableList(applications);
}
+ @Override
public IApplication getApplicationByName(String name) throws OpenshiftException {
loadLazyValues();
return getApplicationByName(name, applications);
}
- private Application getApplicationByName(String name, Collection<Application> applications) {
- Application matchingApplication = null;
- for (Application application : applications) {
+ private IApplication getApplicationByName(String name, Collection<IApplication> applications) {
+ IApplication matchingApplication = null;
+ for (IApplication application : applications) {
if (name.equals(application.getName())) {
matchingApplication = application;
}
@@ -123,6 +124,10 @@
applications.remove(application);
}
+ public void setSshPublicKey(ISSHPublicKey key) {
+ this.sshKey = key;
+ }
+
/**
* Loads the lazy values from the server if needed. Updates itself all
* referenced objects (applications, domain).
@@ -166,9 +171,9 @@
private void update(List<ApplicationInfo> applicationInfos) {
for (ApplicationInfo applicationInfo : applicationInfos) {
- Application application = getApplicationByName(applicationInfo.getName(), applications);
+ IApplication application = getApplicationByName(applicationInfo.getName(), applications);
if (application != null) {
- application.update(applicationInfo);
+ ((Application) application).update(applicationInfo);
} else {
applications.add(createApplication(applicationInfo));
}
@@ -184,7 +189,8 @@
, this, service);
}
- public void setSshPublicKey(ISSHPublicKey key) {
- this.sshKey = key;
+ protected IOpenshiftService getService() {
+ return service;
}
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/DomainResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/DomainResponseUnmarshaller.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/DomainResponseUnmarshaller.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -12,12 +12,13 @@
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
/**
* @author André Dietisheim
*/
-public class DomainResponseUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<Domain> {
+public class DomainResponseUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<IDomain> {
private String domainName;
private User user;
@@ -28,7 +29,7 @@
}
@Override
- protected Domain createOpenshiftObject(ModelNode node) {
+ protected IDomain createOpenshiftObject(ModelNode node) {
return new Domain(domainName, user);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ListCartridgesResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ListCartridgesResponseUnmarshaller.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ListCartridgesResponseUnmarshaller.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -15,6 +15,7 @@
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftJsonConstants;
/**
@@ -24,11 +25,11 @@
*
* @author André Dietisheim
*/
-public class ListCartridgesResponseUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<List<Cartridge>> {
+public class ListCartridgesResponseUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<List<ICartridge>> {
@Override
- protected List<Cartridge> createOpenshiftObject(ModelNode responseNode) {
- List<Cartridge> cartridges = new ArrayList<Cartridge>();
+ protected List<ICartridge> createOpenshiftObject(ModelNode responseNode) {
+ List<ICartridge> cartridges = new ArrayList<ICartridge>();
ModelNode dataNode = responseNode.get(IOpenshiftJsonConstants.PROPERTY_DATA);
if (dataNode == null) {
return cartridges;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/utils/StreamUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/utils/StreamUtils.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/utils/StreamUtils.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -6,6 +6,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.io.Reader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
@@ -37,27 +38,27 @@
}
public static String readToString(InputStream inputStream) throws IOException {
- try {
- BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
- StringWriter writer = new StringWriter();
- String line = null;
- while ((line = reader.readLine()) != null) {
- writer.write(line);
- }
- return writer.toString();
- } finally {
- if (inputStream != null) {
- inputStream.close();
- }
+ return readToString(new InputStreamReader(inputStream));
+ }
+
+ public static String readToString(Reader reader) throws IOException {
+ BufferedReader bufferedReader = new BufferedReader(reader);
+ StringWriter writer = new StringWriter();
+ String line = null;
+ while ((line = bufferedReader.readLine()) != null) {
+ writer.write(line);
}
+ return writer.toString();
}
/**
* Writes the given string to the given output stream. The stream is closed
* after writing all data.
*
- * @param data the data to write
- * @param outputStream the stream to write to
+ * @param data
+ * the data to write
+ * @param outputStream
+ * the stream to write to
* @throws IOException
*/
public static void writeTo(byte[] data, OutputStream outputStream) throws IOException {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -10,18 +10,24 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.test.internal.core;
-import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.jboss.ide.eclipse.as.openshift.core.ApplicationLogReader;
+import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+import org.jboss.ide.eclipse.as.openshift.core.internal.utils.StreamUtils;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -29,10 +35,11 @@
*/
public class ApplicationLogReaderIntegrationTest {
+ private static final long TIMEOUT = 6 * 1024;
+
private IOpenshiftService service;
+ private TestUser user;
- private User user;
-
@Before
public void setUp() {
this.service = new OpenshiftService();
@@ -45,6 +52,7 @@
*
* @throws Exception
*/
+ @Ignore
@Test
public void getStatusReturnsTheWholeLogIfNoNewLogEntryOnServer() throws Exception {
String applicationName = ApplicationUtils.createRandomApplicationName();
@@ -62,6 +70,7 @@
* Asserts the service implementation: getStatus returns the new entries
* (and a tailing-header) if new log entries are available
*/
+ @Ignore
@Test
public void getStatusReturnsNewEntriesIfNewLogEntriesOnServer() throws Exception {
String applicationName = ApplicationUtils.createRandomApplicationName();
@@ -76,4 +85,79 @@
}
}
+ @Test
+ public void logReaderReturnsNewEntriesAfterApplicationRestart() throws Exception {
+ IApplication application = null;
+ ExecutorService executor = null;
+ long startTime = System.currentTimeMillis();
+ try {
+ application = user.createTestApplication();
+ ApplicationLogReader logReader = application.getLog();
+ String log = StreamUtils.readToString(logReader);
+ System.err.println(log);
+ LogReaderRunnable logReaderRunnable = new LogReaderRunnable(logReader);
+ executor = Executors.newSingleThreadExecutor();
+ executor.submit(logReaderRunnable);
+ boolean logAvailable = waitForLog(startTime, System.currentTimeMillis() + TIMEOUT, logReaderRunnable);
+ assertTrue(logReaderRunnable.isRunning());
+ assertFalse(logAvailable);
+ application.restart();
+ logAvailable = waitForLog(startTime, System.currentTimeMillis() + TIMEOUT, logReaderRunnable);
+ assertTrue(logAvailable);
+ assertTrue(logReaderRunnable.isRunning());
+ } finally {
+ if (executor != null) {
+ executor.shutdownNow();
+ }
+ if (application != null) {
+ user.silentlyDestroyApplication(application);
+ }
+ }
+ }
+
+ protected boolean waitForLog(long startTime, long timeout, LogReaderRunnable logReaderRunnable)
+ throws InterruptedException {
+ while (logReaderRunnable.isEmpty()
+ && System.currentTimeMillis() <= timeout) {
+ Thread.sleep(1 * 1024);
+ }
+ return logReaderRunnable.isEmpty();
+ }
+
+ private static class LogReaderRunnable implements Runnable {
+
+ private ApplicationLogReader logReader;
+ private StringBuilder builder;
+ private boolean running;
+
+ public LogReaderRunnable(ApplicationLogReader logReader) {
+ this.logReader = logReader;
+ this.builder = new StringBuilder();
+ }
+
+ @Override
+ public void run() {
+ this.running = true;
+ try {
+ for (int data = -1; (data = logReader.read()) != -1;) {
+ builder.append((char) data);
+ }
+ } catch (Exception e) {
+ this.running = false;
+ }
+ }
+
+ public boolean isRunning() {
+ return running;
+ }
+
+ public String getLog() {
+ return builder.toString();
+ }
+
+ public boolean isEmpty() {
+ return builder.length() == 0;
+ }
+ }
+
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgeTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgeTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -15,7 +15,7 @@
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.OpenshiftResponse;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.JsonSanitizer;
@@ -31,9 +31,9 @@
@Test
public void canUnmarshallApplicationResponse() throws OpenshiftException {
String response = JsonSanitizer.sanitize(CartridgeResponseFake.RESPONSE);
- OpenshiftResponse<List<Cartridge>> openshiftResponse =
+ OpenshiftResponse<List<ICartridge>> openshiftResponse =
new ListCartridgesResponseUnmarshaller().unmarshall(response);
- List<Cartridge> cartridges = openshiftResponse.getOpenshiftObject();
+ List<ICartridge> cartridges = openshiftResponse.getOpenshiftObject();
assertNotNull(cartridges);
assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_JBOSSAS70, cartridges);
assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_PERL5, cartridges);
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -15,7 +15,7 @@
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
@@ -41,7 +41,7 @@
@Ignore
@Test
public void canRequestListCartridges() throws Exception {
- List<Cartridge> cartridges = openshiftService.getCartridges(user);
+ List<ICartridge> cartridges = openshiftService.getCartridges(user);
assertNotNull(cartridges);
assertTrue(cartridges.size() > 0);
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -14,7 +14,7 @@
import static org.junit.Assert.assertNotNull;
import org.jboss.ide.eclipse.as.openshift.core.SSHKeyPair;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestSSHKey;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
@@ -37,7 +37,7 @@
String domainName = createRandomString();
SSHKeyPair sshKey = TestSSHKey.create();
- Domain domain = openshiftService.createDomain(domainName, sshKey, user);
+ IDomain domain = openshiftService.createDomain(domainName, sshKey, user);
assertNotNull(domain);
assertEquals(domainName, domain.getNamespace());
@@ -48,7 +48,7 @@
String domainName = createRandomString();
SSHKeyPair sshKey = TestSSHKey.create();
- Domain domain = openshiftService.changeDomain(domainName, sshKey, user);
+ IDomain domain = openshiftService.changeDomain(domainName, sshKey, user);
assertNotNull(domain);
assertEquals(domainName, domain.getNamespace());
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -19,7 +19,7 @@
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.SSHKeyPair;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ChangeDomainRequest;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.CreateDomainRequest;
@@ -63,10 +63,10 @@
responseString = JsonSanitizer.sanitize(responseString);
User user = new User(RHLOGIN, PASSWORD, new NoopOpenshiftServiceFake());
- OpenshiftResponse<Domain> response = new DomainResponseUnmarshaller(domainName, user).unmarshall(responseString);
+ OpenshiftResponse<IDomain> response = new DomainResponseUnmarshaller(domainName, user).unmarshall(responseString);
assertNotNull(response);
- Domain domain = response.getOpenshiftObject();
+ IDomain domain = response.getOpenshiftObject();
assertEquals(domainName, domain.getNamespace());
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -16,7 +16,7 @@
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
@@ -38,7 +38,7 @@
@Test
public void canListCartridges() throws Exception {
- List<Cartridge> cartridges = openshiftService.getCartridges(user);
+ List<ICartridge> cartridges = openshiftService.getCartridges(user);
assertNotNull(cartridges);
assertTrue(cartridges.size() > 0);
assertThatContainsCartridge("jbossas-7.0", cartridges);
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -16,7 +16,7 @@
import java.net.URLEncoder;
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ListCartridgesRequest;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftEnvelopeFactory;
@@ -75,12 +75,12 @@
+ "\"exit_code\":0}";
cartridgeListResponse = JsonSanitizer.sanitize(cartridgeListResponse);
- OpenshiftResponse<List<Cartridge>> response =
+ OpenshiftResponse<List<ICartridge>> response =
new ListCartridgesResponseUnmarshaller().unmarshall(cartridgeListResponse);
assertEquals("", response.getMessages());
assertEquals(false, response.isDebug());
- List<Cartridge> cartridges = response.getOpenshiftObject();
+ List<ICartridge> cartridges = response.getOpenshiftObject();
assertEquals(5, cartridges.size());
assertThatContainsCartridge("perl-5.10", cartridges);
assertThatContainsCartridge("jbossas-7.0", cartridges);
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -24,11 +24,11 @@
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
@@ -68,7 +68,7 @@
@Test
public void canGetDomain() throws OpenshiftException {
- Domain domain = user.getDomain();
+ IDomain domain = user.getDomain();
assertNotNull(domain);
assertEquals(UserInfoResponseFake.RHC_DOMAIN, domain.getRhcDomain());
assertEquals(UserInfoResponseFake.NAMESPACE, domain.getNamespace());
@@ -79,8 +79,8 @@
OpenshiftService cartridgeListService = new NoopOpenshiftServiceFake() {
@Override
- public List<Cartridge> getCartridges(User user) throws OpenshiftException {
- ArrayList<Cartridge> cartridges = new ArrayList<Cartridge>();
+ public List<ICartridge> getCartridges(User user) throws OpenshiftException {
+ ArrayList<ICartridge> cartridges = new ArrayList<ICartridge>();
cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_JBOSSAS70));
cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_PERL5));
cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_PHP53));
@@ -90,7 +90,7 @@
}
};
User user = new User(UserInfoResponseFake.RHLOGIN, UserInfoResponseFake.PASSWORD, cartridgeListService);
- Collection<Cartridge> cartridges = user.getCartridges();
+ Collection<ICartridge> cartridges = user.getCartridges();
assertNotNull(cartridges);
assertEquals(5, cartridges.size());
assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_JBOSSAS70, cartridges);
@@ -103,7 +103,7 @@
@Test
public void canGetApplications() throws OpenshiftException {
/** response is UserInfoResponseFake */
- Collection<Application> applications = user.getApplications();
+ Collection<IApplication> applications = user.getApplications();
assertNotNull(applications);
assertEquals(2, applications.size());
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -12,13 +12,12 @@
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
-import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
@@ -34,7 +33,7 @@
}
@Override
- public List<Cartridge> getCartridges(User user) throws OpenshiftException {
+ public List<ICartridge> getCartridges(User user) throws OpenshiftException {
throw new UnsupportedOperationException();
}
@@ -69,12 +68,12 @@
}
@Override
- public Domain changeDomain(String domainName, ISSHPublicKey sshKey, User user) throws OpenshiftException {
+ public IDomain changeDomain(String domainName, ISSHPublicKey sshKey, User user) throws OpenshiftException {
throw new UnsupportedOperationException();
}
@Override
- public Domain createDomain(String name, ISSHPublicKey keyPair, User user) throws OpenshiftException {
+ public IDomain createDomain(String name, ISSHPublicKey keyPair, User user) throws OpenshiftException {
throw new UnsupportedOperationException();
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -10,7 +10,11 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IApplication;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
/**
* @author André Dietisheim
@@ -27,4 +31,16 @@
public TestUser(String password) {
super(RHLOGIN, password);
}
+
+ public IApplication createTestApplication() throws OpenshiftException {
+ return createApplication(ApplicationUtils.createRandomApplicationName(), Cartridge.JBOSSAS_7);
+ }
+
+ public void silentlyDestroyApplication(IApplication application) {
+ try {
+ getService().destroyApplication(application.getName(), application.getCartridge(), this);
+ } catch (OpenshiftException e) {
+ e.printStackTrace();
+ }
+ }
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/CartridgeAsserts.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/CartridgeAsserts.java 2011-09-26 14:33:51 UTC (rev 35044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/CartridgeAsserts.java 2011-09-26 14:39:13 UTC (rev 35045)
@@ -15,7 +15,6 @@
import java.text.MessageFormat;
import java.util.Collection;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
/**
@@ -23,7 +22,7 @@
*/
public class CartridgeAsserts {
- public static void assertThatContainsCartridge(String cartridgeName, Collection<Cartridge> cartridges) {
+ public static void assertThatContainsCartridge(String cartridgeName, Collection<ICartridge> cartridges) {
boolean found = false;
for (ICartridge cartridge : cartridges) {
if (cartridgeName.equals(cartridge.getName())) {
@@ -35,6 +34,4 @@
fail(MessageFormat.format("Could not find cartridge with name \"{0}\"", cartridgeName));
}
}
-
-
}
14 years, 3 months
JBoss Tools SVN: r35044 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-09-26 10:33:51 -0400 (Mon, 26 Sep 2011)
New Revision: 35044
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java
Log:
JBIDE-9588
Poor performance of XHTML template validation
XHTML Syntax Validator is moved to org.apache.xerces.parsers.SAXParser()
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java 2011-09-26 14:17:45 UTC (rev 35043)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java 2011-09-26 14:33:51 UTC (rev 35044)
@@ -17,10 +17,6 @@
import java.util.List;
import java.util.Stack;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -81,14 +77,7 @@
"http://apache.org/xml/features/continue-after-fatal-error"
};
- private void setSAXParserFeatures(SAXParser saxParser, String[] features, boolean set) {
- XMLReader reader;
- try {
- reader = saxParser.getXMLReader();
- } catch (SAXException e) {
- JSFModelPlugin.getDefault().logError(e);
- return;
- }
+ private void setSAXParserFeatures(XMLReader reader, String[] features, boolean set) {
for (String feature : features) {
try {
reader.setFeature(feature, set);
@@ -98,10 +87,8 @@
}
}
- private void setSAXParserProperty(SAXParser saxParser, String property, Object value) {
- XMLReader reader;
+ private void setSAXParserProperty(XMLReader reader, String property, Object value) {
try {
- reader = saxParser.getXMLReader();
reader.setProperty(property, value);
} catch (SAXException e) {
JSFModelPlugin.getDefault().logError(e);
@@ -147,33 +134,30 @@
NestedValidatorContext context, ValidationResult result) {
displaySubtask(JSFValidationMessage.XHTML_VALIDATION, uri);
XMLValidationInfo report = new XMLValidationInfo(uri);
- SAXParserFactory factory = SAXParserFactory.newInstance();
XHTMLElementHandler handler = new XHTMLElementHandler(
(resource instanceof IFile ? getDocument((IFile)resource) : null),
report);
- SAXParser saxParser = null;
+ XMLReader xmlReader = new org.apache.xerces.parsers.SAXParser();
+
try {
- saxParser = factory.newSAXParser();
- setSAXParserFeatures(saxParser, SAX_PARSER_FEATURES_TO_DISABLE, false);
- setSAXParserFeatures(saxParser, SAX_PARSER_FEATURES_TO_ENABLE, true);
- setSAXParserProperty(saxParser, "http://xml.org/sax/properties/lexical-handler", handler);
+ setSAXParserFeatures(xmlReader, SAX_PARSER_FEATURES_TO_DISABLE, false);
+ setSAXParserFeatures(xmlReader, SAX_PARSER_FEATURES_TO_ENABLE, true);
+ setSAXParserProperty(xmlReader, "http://xml.org/sax/properties/lexical-handler", handler);
+ xmlReader.setContentHandler(handler);
+ xmlReader.setDTDHandler(handler);
+ xmlReader.setErrorHandler(handler);
+
isXHTMLDoctype = false;
- if (inputstream != null) {
- saxParser.parse(inputstream, handler);
- } else {
- saxParser.parse(uri, handler);
- }
- } catch (ParserConfigurationException e) {
+
+ xmlReader.parse(uri);
+ } catch (IOException e) {
JSFModelPlugin.getDefault().logError(e);
report.addError(e.getLocalizedMessage(), 0, 0, uri);
} catch (SAXException e) {
JSFModelPlugin.getDefault().logError(e);
report.addError(e.getLocalizedMessage(), 0, 0, uri);
- } catch (IOException e) {
- JSFModelPlugin.getDefault().logError(e);
- report.addError(e.getLocalizedMessage(), 0, 0, uri);
- }
-
+ }
+
List<ElementLocation> locations = handler.getNonPairedOpenElements();
if (!locations.isEmpty()) {
for (ElementLocation location : locations) {
14 years, 3 months
JBoss Tools SVN: r35043 - in trunk/central/plugins/org.jboss.tools.central: icons and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-26 10:17:45 -0400 (Mon, 26 Sep 2011)
New Revision: 35043
Added:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/TextSearchControl.java
Removed:
trunk/central/plugins/org.jboss.tools.central/icons/Thumbs.db
trunk/central/plugins/org.jboss.tools.central/icons/arrow-left-orange-9x8.gif
trunk/central/plugins/org.jboss.tools.central/icons/jive-icon-accept-16x16.gif
trunk/central/plugins/org.jboss.tools.central/icons/jive-icon-working-16x16.gif
Modified:
trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/FavoriteAtEclipseMarketplaceHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/NewProjectExamplesWizardHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossNewsHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsHomeHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshDiscoveryHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossNewsHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTutorialsHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTwitterHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/NewsToolTip.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/OverviewToolTip.java
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/META-INF/MANIFEST.MF 2011-09-26 14:17:45 UTC (rev 35043)
@@ -22,7 +22,9 @@
org.eclipse.mylyn.discovery.ui;bundle-version="3.6.0",
org.eclipse.mylyn.discovery.core;bundle-version="3.6.0",
org.eclipse.mylyn.commons.ui;bundle-version="3.6.1",
- org.eclipse.equinox.p2.ui.sdk;bundle-version="1.0.200"
+ org.eclipse.equinox.p2.ui.sdk;bundle-version="1.0.200",
+ org.eclipse.equinox.p2.core;bundle-version="2.1.0",
+ org.eclipse.equinox.p2.engine;bundle-version="2.1.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Localization: plugin
Deleted: trunk/central/plugins/org.jboss.tools.central/icons/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/central/plugins/org.jboss.tools.central/icons/arrow-left-orange-9x8.gif
===================================================================
(Binary files differ)
Deleted: trunk/central/plugins/org.jboss.tools.central/icons/jive-icon-accept-16x16.gif
===================================================================
(Binary files differ)
Deleted: trunk/central/plugins/org.jboss.tools.central/icons/jive-icon-working-16x16.gif
===================================================================
(Binary files differ)
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -13,15 +13,11 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
@@ -55,9 +51,9 @@
import org.jboss.tools.central.model.Tutorial;
import org.jboss.tools.central.model.TutorialCategory;
import org.jboss.tools.project.examples.model.Project;
-import org.jboss.tools.runtime.core.model.DownloadRuntime;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import org.osgi.service.prefs.BackingStoreException;
@@ -96,7 +92,11 @@
public static final String SHOW_JBOSS_CENTRAL_ON_STARTUP = "showJBossCentralOnStartup";
public static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
+
+ public static final String PROFILE_ID = "profileId";
+ public static final String PROFILE_TIMESTAMP = "profileTimestamp";
+
public static final String JBDS_PRODUCT_PLUGIN_ID = "com.jboss.jbds.product";
public static final String NEW_PROJECT_EXAMPLES_WIZARD_ID = "org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard";
@@ -112,7 +112,15 @@
public static final String TUTORIALS_EXTENSION_ID = "org.jboss.tools.central.tutorials";
+ public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
+
+ public static final String SEARCH_THE_COMMUNITY = "Search the Community";
+
+ public static final String SEARCH_COMMUNITY_PORTAL = "Search Community Portal";
+
public Map<String, TutorialCategory> tutorialCategories;
+
+ private BundleContext bundleContext;
public static final int MAX_FEEDS = 100;
@@ -131,6 +139,7 @@
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+ this.bundleContext = context;
plugin = this;
}
@@ -140,6 +149,7 @@
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
+ bundleContext = null;
tutorialCategories = null;
super.stop(context);
}
@@ -402,5 +412,20 @@
environment.put("org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
return environment;
}
+
+ public Object getService(String name) {
+ if (bundleContext == null)
+ return null;
+ ServiceReference<?> reference = bundleContext.getServiceReference(name);
+ if (reference == null)
+ return null;
+ Object result = bundleContext.getService(reference);
+ bundleContext.ungetService(reference);
+ return result;
+ }
+ public BundleContext getBundleContext() {
+ return bundleContext;
+ }
+
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -10,6 +10,10 @@
************************************************************************************/
package org.jboss.tools.central;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;
@@ -23,6 +27,27 @@
@Override
public void earlyStartup() {
boolean showJBossCentral = JBossCentralActivator.getDefault().showJBossCentralOnStartup();
+ IProvisioningAgent agent = (IProvisioningAgent) JBossCentralActivator.getDefault().getService(IProvisioningAgent.SERVICE_NAME);
+ IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
+ if (profileRegistry == null) {
+ showJBossCentral = true;
+ } else {
+ IProfile profile = profileRegistry
+ .getProfile(IProfileRegistry.SELF);
+ String profileId = profile.getProfileId();
+ IEclipsePreferences prefs = JBossCentralActivator.getDefault().getPreferences();
+ String savedId = prefs.get(JBossCentralActivator.PROFILE_ID, null);
+ if (savedId == null || !savedId.equals(profileId)) {
+ prefs.put(JBossCentralActivator.PROFILE_ID, profileId);
+ showJBossCentral = true;
+ }
+ long timestamp = profile.getTimestamp();
+ long savedTimestamp = prefs.getLong(JBossCentralActivator.PROFILE_TIMESTAMP, -1);
+ if (timestamp != savedTimestamp) {
+ prefs.putLong(JBossCentralActivator.PROFILE_TIMESTAMP, timestamp);
+ showJBossCentral = true;
+ }
+ }
if (!showJBossCentral) {
return;
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/FavoriteAtEclipseMarketplaceHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/FavoriteAtEclipseMarketplaceHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/FavoriteAtEclipseMarketplaceHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,5 +1,21 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class FavoriteAtEclipseMarketplaceHandler extends OpenWithBrowserHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/NewProjectExamplesWizardHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/NewProjectExamplesWizardHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/NewProjectExamplesWizardHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,5 +1,17 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -18,6 +30,11 @@
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.jboss.tools.central.JBossCentralActivator;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class NewProjectExamplesWizardHandler extends AbstractHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossNewsHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossNewsHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossNewsHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
import org.jboss.tools.central.JBossCentralActivator;
@@ -2,2 +13,7 @@
+/**
+ *
+ * @author snjeza
+ *
+ */
public class OpenJBossNewsHandler extends OpenWithBrowserHandler {
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsHomeHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsHomeHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsHomeHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,5 +1,21 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class OpenJBossToolsHomeHandler extends OpenWithBrowserHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,5 +1,21 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class OpenJBossToolsTwitterHandler extends OpenWithBrowserHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshDiscoveryHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshDiscoveryHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshDiscoveryHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
import org.eclipse.core.commands.AbstractHandler;
@@ -6,6 +17,11 @@
import org.eclipse.core.runtime.jobs.Job;
import org.jboss.tools.central.jobs.RefreshDiscoveryJob;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class RefreshDiscoveryHandler extends AbstractHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossNewsHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossNewsHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossNewsHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
import org.eclipse.core.commands.AbstractHandler;
@@ -6,6 +17,11 @@
import org.eclipse.core.runtime.jobs.Job;
import org.jboss.tools.central.jobs.RefreshNewsJob;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class RefreshJBossNewsHandler extends AbstractHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTutorialsHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTutorialsHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTutorialsHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
import org.eclipse.core.commands.AbstractHandler;
@@ -7,6 +18,11 @@
import org.jboss.tools.central.JBossCentralActivator;
import org.jboss.tools.central.jobs.RefreshTutorialsJob;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class RefreshJBossTutorialsHandler extends AbstractHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTwitterHandler.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTwitterHandler.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/RefreshJBossTwitterHandler.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.actions;
import org.eclipse.core.commands.AbstractHandler;
@@ -4,6 +15,11 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class RefreshJBossTwitterHandler extends AbstractHandler {
@Override
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.editors;
import java.io.IOException;
@@ -2,3 +13,2 @@
-import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
@@ -12,12 +22,16 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.central.JBossCentralActivator;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class AbstractJBossCentralPage extends FormPage {
public static final String ID_PREFIX = "org.jboss.tools.central.editors.";
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.central.editors;
import org.eclipse.jface.window.ToolTip;
@@ -9,14 +19,17 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class DescriptionToolTip extends ToolTip {
- private Control control;
private String description;
public DescriptionToolTip(Control control, String description) {
super(control);
- this.control = control;
this.description = description;
setHideOnMouseDown(true);
setPopupDelay(400);
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.editors;
import java.util.ArrayList;
@@ -6,6 +17,7 @@
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang.StringEscapeUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
@@ -83,6 +95,11 @@
import org.jboss.tools.project.examples.model.Project;
import org.osgi.framework.Bundle;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class GettingStartedPage extends AbstractJBossCentralPage {
private static final String CLASS_ATTRIBUTE = "class";
@@ -134,8 +151,8 @@
toolkit.paintBordersFor(body);
Composite left = createComposite(toolkit, body);
+ createProjectsSection(toolkit, left);
createTutorialsSection(toolkit, left);
- createProjectsSection(toolkit, left);
createDocumentationSection(toolkit, left);
toolkit.paintBordersFor(left);
@@ -280,7 +297,7 @@
}
private void createTutorialsSection(FormToolkit toolkit, Composite parent) {
- tutorialsSection = createSection(toolkit, parent, "Project Examples", ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
+ tutorialsSection = createSection(toolkit, parent, "Project Examples", ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE);
GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
//gd.widthHint = 350;
//gd.heightHint = 100;
@@ -370,7 +387,7 @@
}
public void createProjectsSection(FormToolkit toolkit, Composite parent) {
- projectsSection = createSection(toolkit, parent, "Create Projects", ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE);
+ projectsSection = createSection(toolkit, parent, "Create Projects", ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
projectsSection.setText("Create Projects");
projectsSection.setLayout(new GridLayout());
GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
@@ -633,9 +650,10 @@
private void showException(PageBook pageBook, FormText exceptionText, Exception e) {
JBossCentralActivator.log(e);
+ String message = StringEscapeUtils.escapeXml(e.getMessage());
String text = JBossCentralActivator.FORM_START_TAG +
"<img href=\"image\"/> " +
- e.getMessage() +
+ message +
JBossCentralActivator.FORM_END_TAG;
exceptionText.setText(text, true, false);
Image image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -10,10 +10,19 @@
************************************************************************************/
package org.jboss.tools.central.editors;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
@@ -21,14 +30,19 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.menus.CommandContributionItem;
import org.jboss.tools.central.JBossCentralActivator;
+import org.jboss.tools.central.actions.OpenJBossNewsHandler;
+import org.jboss.tools.central.editors.xpl.TextSearchControl;
import org.jboss.tools.central.jobs.RefreshNewsJob;
/**
@@ -38,6 +52,8 @@
*/
public class JBossCentralEditor extends SharedHeaderFormEditor {
+ private static final String UTF_8_ENCODING = "UTF-8";
+
private static final String JBOSS_TOOLS_CENTRAL = "JBoss Tools Central";
public static final String ID = "org.jboss.tools.central.editors.JBossCentralEditor";
@@ -144,18 +160,11 @@
getToolkit().decorateFormHeading(form.getForm());
Composite headerComposite = getToolkit().createComposite(form.getForm().getHead(), SWT.NONE);
- headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
headerComposite.setLayout(new GridLayout(2, false));
headerComposite.setBackground(null);
Button showOnStartup = getToolkit().createButton(headerComposite, "Show on Startup", SWT.CHECK);
-
-// Text searchControl = getToolkit().createText(headerComposite, "", SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL);
-// searchControl.setMessage("Search");
-// GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
-// gd.widthHint = 150;
-// searchControl.setLayoutData(gd);
-
showOnStartup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
showOnStartup.setBackground(null);
showOnStartup.setSelection(JBossCentralActivator.getDefault().showJBossCentralOnStartup());
@@ -170,7 +179,134 @@
}
});
+
+ Composite searchComposite = getToolkit().createComposite(headerComposite);
+ GridData gd = new GridData(SWT.END, SWT.FILL, true, true);
+ gd.widthHint = 200;
+ searchComposite.setLayoutData(gd);
+ searchComposite.setBackground(null);
+ searchComposite.setLayout(new GridLayout(2, false));
+ ImageHyperlink menuLink = getToolkit().createImageHyperlink(searchComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ menuLink.setLayoutData(gd);
+ menuLink.setBackground(null);
+ menuLink.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_DOWN));
+ menuLink.setToolTipText("Search Menu");
+ final TextSearchControl searchControl = new TextSearchControl(searchComposite, false);
+ gd = new GridData(SWT.END, SWT.FILL, true, true);
+ gd.widthHint = 200;
+ searchControl.setLayoutData(gd);
+ searchControl.setBackground(null);
+ getToolkit().adapt(searchControl);
+ searchControl.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ if (e.detail == SWT.CANCEL) {
+ searchControl.getTextControl().setText("");
+ searchControl.setInitialMessage(searchControl.getInitialMessage());
+ } else {
+ try {
+ StringBuffer url = new StringBuffer();
+ String initialMessage = searchControl.getInitialMessage();
+ if (JBossCentralActivator.SEARCH_COMMUNITY_PORTAL.equals(initialMessage)) {
+ url.append("https://access.redhat.com/knowledge/searchResults?col=avalon_portal&topSe...");
+ url.append(URLEncoder.encode(searchControl.getText(), UTF_8_ENCODING));
+ } else {
+ url.append("http://community.jboss.org/search.jspa?searchArea=");
+ url.append(URLEncoder.encode(initialMessage, UTF_8_ENCODING));
+ url.append("&as_sitesearch=jboss.org&q=");
+ url.append(URLEncoder.encode(searchControl.getText(), UTF_8_ENCODING));
+ }
+ final String location = url.toString();
+ AbstractHandler handler = new OpenJBossNewsHandler() {
+
+ @Override
+ public String getLocation() {
+ return location;
+ }
+
+ };
+ handler.execute(new ExecutionEvent());
+ } catch (UnsupportedEncodingException e1) {
+ JBossCentralActivator.log(e1);
+ } catch (ExecutionException e1) {
+ JBossCentralActivator.log(e1);
+ }
+ }
+ }
+ });
+
+ final Menu menu = new Menu(menuLink);
+ final MenuItem searchCommunity = new MenuItem(menu, SWT.CHECK);
+ searchCommunity.setText(JBossCentralActivator.SEARCH_THE_COMMUNITY);
+ final MenuItem searchProjectPages = new MenuItem(menu, SWT.CHECK);
+ searchProjectPages.setText(JBossCentralActivator.SEARCH_PROJECT_PAGES);
+ final MenuItem searchCommunityPortal = new MenuItem(menu, SWT.CHECK);
+ searchCommunityPortal.setText(JBossCentralActivator.SEARCH_COMMUNITY_PORTAL);
+
+ String initialMessage = searchControl.getInitialMessage();
+ if (JBossCentralActivator.SEARCH_COMMUNITY_PORTAL.equals(initialMessage)) {
+ searchCommunityPortal.setSelection(true);
+ } else if (JBossCentralActivator.SEARCH_PROJECT_PAGES.equals(initialMessage)) {
+ searchProjectPages.setSelection(true);
+ } else {
+ searchCommunity.setSelection(true);
+ }
+ searchCommunity.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ searchCommunity.setSelection(true);
+ searchProjectPages.setSelection(false);
+ searchCommunityPortal.setSelection(false);
+ searchControl.setInitialMessage(JBossCentralActivator.SEARCH_THE_COMMUNITY);
+ }
+
+ });
+ searchProjectPages.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ searchProjectPages.setSelection(true);
+ searchCommunity.setSelection(false);
+ searchCommunityPortal.setSelection(false);
+ searchControl.setInitialMessage(JBossCentralActivator.SEARCH_PROJECT_PAGES);
+ }
+
+ });
+
+ searchCommunityPortal.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ searchProjectPages.setSelection(false);
+ searchCommunity.setSelection(false);
+ searchCommunityPortal.setSelection(true);
+ searchControl.setInitialMessage(JBossCentralActivator.SEARCH_COMMUNITY_PORTAL);
+ }
+
+ });
+
+ menuLink.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ menu.setVisible(false);
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ menu.setVisible(true);
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+
form.getForm().setHeadClient(headerComposite);
IToolBarManager toolbar = form.getToolBarManager();
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/NewsToolTip.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/NewsToolTip.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/NewsToolTip.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,14 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.editors;
import org.eclipse.jface.window.ToolTip;
@@ -23,6 +34,11 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.widgets.FormText;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class NewsToolTip extends ToolTip {
private String toolText;
@@ -90,7 +106,7 @@
"h1, h2, h3, h4, h5, h6 { font-size: 14px;font-weight:bold;font-family: Arial, Helvetica, sans-serif; }" +
"</style>" +
"</head>" +
- "<body" +
+ "<body>" +
toolText +
"</body>" +
"</html>";
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/RefreshIndicator.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,6 +1,16 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.central.editors;
-import java.awt.image.ImageProducer;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -18,6 +28,12 @@
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.central.JBossCentralActivator;
import org.osgi.framework.Bundle;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
public class RefreshIndicator extends Canvas {
protected Image[] images;
protected Image image;
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.central.editors;
import java.lang.reflect.InvocationTargetException;
@@ -2,6 +12,4 @@
import java.util.Dictionary;
-import java.util.Hashtable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
@@ -43,9 +51,12 @@
import org.jboss.tools.central.JBossCentralActivator;
import org.jboss.tools.central.editors.xpl.DiscoveryViewer;
import org.jboss.tools.central.jobs.RefreshDiscoveryJob;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Version;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class SoftwarePage extends AbstractJBossCentralPage implements IRunnableContext {
public static final String ID = ID_PREFIX + "SoftwarePage";
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementationO
+ *******************************************************************************/
package org.jboss.tools.central.editors.xpl;
import java.beans.PropertyChangeEvent;
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/OverviewToolTip.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/OverviewToolTip.java 2011-09-26 14:16:40 UTC (rev 35042)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/OverviewToolTip.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
package org.jboss.tools.central.editors.xpl;
import java.net.URL;
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/TextSearchControl.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/TextSearchControl.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/TextSearchControl.java 2011-09-26 14:17:45 UTC (rev 35043)
@@ -0,0 +1,563 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ * JBoss by Red Hat
+ *******************************************************************************/
+package org.jboss.tools.central.editors.xpl;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.jface.bindings.keys.ParseException;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.fieldassist.ContentProposal;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jface.fieldassist.TextContentAdapter;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.mylyn.internal.commons.ui.CommonsUiPlugin;
+import org.eclipse.mylyn.internal.provisional.commons.ui.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.WorkbenchMessages;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.central.JBossCentralActivator;
+
+/**
+ * @author Shawn Minto
+ * @author snjeza
+ */
+public class TextSearchControl extends Composite {
+
+ private static final int MAX_PROPOSAL_ITEMS = 50;
+
+ /**
+ * Image descriptor for enabled clear button.
+ */
+ private static final String CLEAR_ICON = "org.eclipse.ui.internal.dialogs.CLEAR_ICON"; //$NON-NLS-1$
+
+ /**
+ * Image descriptor for enabled clear button.
+ */
+ private static final String FIND_ICON = "org.eclipse.ui.internal.dialogs.FIND_ICON"; //$NON-NLS-1$
+
+ private static final String SEARCH_SECTION = "searchSection";
+
+ private static final String SEARCH_KEY = "searchKey";
+
+ /* SWT STYLE BIT AVAILABLE ON 3.5 AND HIGHER */
+ public static final int ICON_SEARCH = 1 << 9;
+
+ /* SWT STYLE BIT AVAILABLE ON 3.5 AND HIGHER */
+ public static final int ICON_CANCEL = 1 << 8;
+
+ private static final String INITIAL_MESSAGE = "initialMessage";
+
+ /**
+ * Get image descriptors for the clear button.
+ */
+ static {
+ ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PlatformUI.PLUGIN_ID,
+ "$nl$/icons/full/etool16/clear_co.gif"); //$NON-NLS-1$
+ if (descriptor != null) {
+ JFaceResources.getImageRegistry().put(CLEAR_ICON, descriptor);
+ }
+
+ descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(CommonsUiPlugin.ID_PLUGIN,
+ "$nl$/icons/etool16/find.png"); //$NON-NLS-1$
+ if (descriptor != null) {
+ JFaceResources.getImageRegistry().put(FIND_ICON, descriptor);
+ }
+ }
+
+ private Text textControl;
+
+ private Control clearControl;
+
+ private Control findControl;
+
+ private final Set<SelectionListener> selectionListeners = new HashSet<SelectionListener>();
+
+ private static Boolean useNativeSearchField;
+
+ private String initialMessage;
+
+ private String[] proposals;
+
+ @SuppressWarnings("restriction")
+ public TextSearchControl(Composite parent, boolean automaticFind) {
+ super(parent, getCompositeStyle(automaticFind, parent));
+
+ int textStyle = SWT.SINGLE;
+ int numColumns = 1;
+ if (useNativeSearchField(automaticFind, parent)) {
+ if (automaticFind) {
+ textStyle |= SWT.SEARCH | ICON_CANCEL;
+ } else {
+ textStyle |= SWT.SEARCH | ICON_SEARCH | ICON_CANCEL;
+ }
+ } else {
+ super.setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+ super.setFont(parent.getFont());
+ numColumns = 2;
+ if (!automaticFind) {
+ numColumns += 1;
+ }
+ }
+ GridLayoutFactory.swtDefaults()
+ .margins(0, 0)
+ .extendedMargins(0, 0, 0, 0)
+ .spacing(0, 1)
+ .numColumns(numColumns)
+ .applyTo(this);
+
+
+ textControl = new Text(this, textStyle);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+
+ textControl.setLayoutData(gridData);
+
+ KeyStroke stroke;
+ String proposalKey = null;
+ try {
+ stroke = KeyStroke.getInstance("M1+SPACE"); //$NON-NLS-1$
+ proposalKey = stroke.format();
+ } catch (ParseException e1) {
+ JBossCentralActivator.log(e1);
+ }
+ stroke = null;
+ final ControlDecoration dec = new ControlDecoration(textControl, SWT.TOP
+ | SWT.LEFT);
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ FieldDecoration fd = registry.getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+ dec.setImage(fd.getImage());
+ String description;
+ if (proposalKey == null) {
+ description = fd.getDescription();
+ } else {
+ description = fd.getDescription() + "(" + proposalKey + ")";
+ }
+ dec.setDescriptionText(description);
+
+ dec.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage());
+
+ dec.setShowOnlyOnFocus(true);
+ dec.setShowHover(true);
+
+ ContentProposalAdapter adapter = new ContentProposalAdapter(textControl,
+ new TextContentAdapter(),
+ new SearchContentProposalProvider(),
+ null,
+ null);
+ adapter.setPropagateKeys(true);
+ adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
+
+ if (useNativeSearchField == null || !useNativeSearchField) {
+ findControl = createLabelButtonControl(this,
+ JFaceResources.getImageRegistry().getDescriptor(FIND_ICON),
+ Messages.TextControl_AccessibleListenerFindButton, Messages.TextControl_FindToolTip, ICON_SEARCH);
+ Point size = findControl.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ GridData data = (GridData) textControl.getLayoutData();
+ data.heightHint = size.y;
+ clearControl = createLabelButtonControl(this,
+ JFaceResources.getImageRegistry().getDescriptor(CLEAR_ICON),
+ WorkbenchMessages.FilteredTree_ClearToolTip,//FilteredTree_AccessibleListenerClearButton,
+ WorkbenchMessages.FilteredTree_ClearToolTip, ICON_CANCEL);
+ addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ updateButtonVisibilityAndEnablement();
+
+ }
+ });
+ updateButtonVisibilityAndEnablement();
+ }
+
+ IDialogSettings section = getSearchSettings();
+ proposals = section.getArray(SEARCH_KEY);
+ if (proposals == null) {
+ proposals = new String[0];
+ section.put(SEARCH_KEY, proposals);
+ }
+ String message = section.get(INITIAL_MESSAGE);
+ if (message == null || message.isEmpty()) {
+ message = JBossCentralActivator.SEARCH_THE_COMMUNITY;
+ }
+ setInitialMessage(message);
+
+ registerListeners();
+ }
+
+
+ private void registerListeners() {
+ addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ if (textControl != null && !textControl.isDisposed()) {
+ addSearchSettings();
+ }
+
+ }
+ });
+ textControl.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ if (textControl != null && !textControl.isDisposed()) {
+ // addSearchSettings();
+ if (textControl.getText().isEmpty()) {
+ setInitialMessage(initialMessage);
+ }
+ updateButtonVisibilityAndEnablement();
+ }
+ }
+
+ });
+ }
+
+ private static int getCompositeStyle(boolean automaticFind, Composite parent) {
+ if (useNativeSearchField(automaticFind, parent)) {
+ return SWT.NONE;
+ }
+ return SWT.BORDER;
+ }
+
+ private static boolean useNativeSearchField(boolean automaticFind, Composite parent) {
+ if (parent != null) {
+ if (useNativeSearchField == null) {
+ useNativeSearchField = Boolean.FALSE;
+ Text testText = null;
+ try {
+ int style = SWT.SEARCH | ICON_CANCEL;
+ if (automaticFind) {
+ style |= ICON_SEARCH;
+ }
+ testText = new Text(parent, style);
+ useNativeSearchField = new Boolean((testText.getStyle() & ICON_CANCEL) != 0
+ && (!automaticFind || (testText.getStyle() & ICON_SEARCH) != 0));
+ } finally {
+ if (testText != null) {
+ testText.dispose();
+ }
+ }
+
+ }
+ } else {
+ useNativeSearchField = Boolean.FALSE;
+ }
+ return useNativeSearchField.booleanValue();
+ }
+
+ private Control createLabelButtonControl(Composite parent,
+ ImageDescriptor activeImageDescriptor, final String accessibilityText, String toolTipText, final int detail) {
+
+ final Image nativeImage = parent.getDisplay().getSystemImage(detail);
+
+ final Image activeImage = nativeImage != null ? nativeImage : activeImageDescriptor.createImage();
+ final Image inactiveImage = new Image(parent.getDisplay(), activeImage, SWT.IMAGE_GRAY);
+ final Image pressedImage = inactiveImage;
+
+ final Label labelButton = new Label(parent, SWT.NONE);
+ labelButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+ labelButton.setImage(inactiveImage);
+ labelButton.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+ labelButton.setToolTipText(toolTipText);
+ labelButton.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ if (nativeImage == null && activeImage != null && !activeImage.isDisposed()) {
+ activeImage.dispose();
+ }
+ if (inactiveImage != null && !inactiveImage.isDisposed()) {
+ inactiveImage.dispose();
+ }
+ if (pressedImage != null && !pressedImage.isDisposed()) {
+ pressedImage.dispose();
+ }
+ }
+ });
+ labelButton.addMouseListener(new MouseAdapter() {
+ private MouseMoveListener fMoveListener;
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ labelButton.setImage(pressedImage);
+ fMoveListener = new MouseMoveListener() {
+ private boolean fMouseInButton = true;
+
+ public void mouseMove(MouseEvent e) {
+ boolean mouseInButton = isMouseInButton(e);
+ if (mouseInButton != fMouseInButton) {
+ fMouseInButton = mouseInButton;
+ labelButton.setImage(mouseInButton ? pressedImage : inactiveImage);
+ }
+ }
+ };
+ labelButton.addMouseMoveListener(fMoveListener);
+ }
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ if (fMoveListener != null) {
+ labelButton.removeMouseMoveListener(fMoveListener);
+ fMoveListener = null;
+ boolean mouseInButton = isMouseInButton(e);
+ labelButton.setImage(mouseInButton ? activeImage : inactiveImage);
+ if (mouseInButton) {
+ if (textControl != null && textControl.isEnabled() && textControl.getText().length() > 0) {
+ notifySelectionChanged(detail);
+ }
+ }
+ }
+ }
+
+ private boolean isMouseInButton(MouseEvent e) {
+ Point buttonSize = labelButton.getSize();
+ return 0 <= e.x && e.x < buttonSize.x && 0 <= e.y && e.y < buttonSize.y;
+ }
+ });
+
+ labelButton.addMouseTrackListener(new MouseTrackListener() {
+ public void mouseEnter(MouseEvent e) {
+ if (labelButton.getImage() != activeImage) {
+ labelButton.setImage(activeImage);
+ }
+ }
+
+ public void mouseExit(MouseEvent e) {
+ if (labelButton.getImage() != inactiveImage) {
+ labelButton.setImage(inactiveImage);
+ }
+ }
+
+ public void mouseHover(MouseEvent e) {
+ }
+ });
+
+ labelButton.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = accessibilityText;
+ }
+ });
+ labelButton.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
+ @Override
+ public void getRole(AccessibleControlEvent e) {
+ e.detail = ACC.ROLE_PUSHBUTTON;
+ }
+ });
+ return labelButton;
+ }
+
+ @Override
+ public void addTraverseListener(TraverseListener listener) {
+ textControl.addTraverseListener(listener);
+ }
+
+ @Override
+ public void removeTraverseListener(TraverseListener listener) {
+ textControl.removeTraverseListener(listener);
+ }
+
+ public void addSelectionListener(SelectionListener listener) {
+ textControl.addSelectionListener(listener);
+ selectionListeners.add(listener);
+ }
+
+ public void removeSelectionListener(SelectionListener listener) {
+ textControl.removeSelectionListener(listener);
+ selectionListeners.remove(listener);
+ }
+
+ public void addModifyListener(ModifyListener listener) {
+ textControl.addModifyListener(listener);
+ }
+
+ public void removeModifyListener(ModifyListener listener) {
+ textControl.removeModifyListener(listener);
+ }
+
+ private void notifySelectionChanged(int detail) {
+ if (useNativeSearchField != null && useNativeSearchField) {
+ // notification should happen via the widgets selection listener
+ return;
+ }
+ Event event = new Event();
+ event.detail = detail;
+ event.widget = textControl;
+ event.display = textControl.getDisplay();
+
+ SelectionEvent e = new SelectionEvent(event);
+ for (Object element : selectionListeners) {
+ ((SelectionListener) element).widgetDefaultSelected(e);
+ }
+ }
+
+ private void updateButtonVisibilityAndEnablement() {
+ if (textControl != null && !textControl.isDisposed()) {
+ boolean hasText = textControl.getText().length() > 0;
+
+ //setFindButtonVisibility(!(hasText && automaticFind));
+ setFindButtonVisibility(hasText);
+ setClearButtonVisibility(hasText);
+ }
+ }
+
+ private void setFindButtonVisibility(boolean visible) {
+ if (findControl != null && !findControl.isDisposed()) {
+ findControl.setVisible(visible);
+ if (findControl.getLayoutData() instanceof GridData) {
+ ((GridData) findControl.getLayoutData()).exclude = !visible;
+ findControl.getParent().layout();
+ }
+ }
+ }
+
+ private void setClearButtonVisibility(boolean visible) {
+ if (clearControl != null && !clearControl.isDisposed()) {
+ clearControl.setVisible(visible);
+ if (clearControl.getLayoutData() instanceof GridData) {
+ ((GridData) clearControl.getLayoutData()).exclude = !visible;
+ clearControl.getParent().layout();
+ }
+ }
+ }
+
+ public Text getTextControl() {
+ return textControl;
+ }
+
+ public String getText() {
+ if (textControl != null && !textControl.isDisposed()) {
+ return textControl.getText();
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public void setText(String text) {
+ if (textControl != null && !textControl.isDisposed()) {
+ textControl.setText(text);
+ }
+ }
+
+ @Override
+ public void setBackground(Color color) {
+ if (useNativeSearchField != null && useNativeSearchField) {
+ super.setBackground(color);
+ }
+ }
+
+ public String getInitialMessage() {
+ return initialMessage;
+ }
+
+ public void setInitialMessage(String initialMessage) {
+ this.initialMessage = initialMessage;
+ if (textControl != null && !textControl.isDisposed()
+ && textControl.getText().isEmpty()) {
+ textControl.setMessage(initialMessage);
+ IDialogSettings section = getSearchSettings();
+ section.put(INITIAL_MESSAGE, initialMessage);
+ }
+ }
+
+ private IDialogSettings getSearchSettings() {
+ IDialogSettings settings = JBossCentralActivator.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(SEARCH_SECTION);
+ if (section == null) {
+ section = settings.addNewSection(SEARCH_SECTION);
+ }
+ return section;
+ }
+
+ private void addSearchSettings() {
+ String text = textControl.getText().trim();
+ if (!text.isEmpty()) {
+ boolean found = false;
+ for (String proposal:proposals) {
+ if (text.equals(proposal)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ int length = proposals.length;
+ if (length > MAX_PROPOSAL_ITEMS) {
+ length = MAX_PROPOSAL_ITEMS;
+ }
+ String[] newProposals = new String[length + 1];
+ System.arraycopy(proposals, 0, newProposals, 1, length);
+ newProposals[0] = text;
+ proposals = newProposals;
+ IDialogSettings section = getSearchSettings();
+ section.put(SEARCH_KEY, proposals);
+ }
+ }
+ }
+
+ private class SearchContentProposalProvider implements IContentProposalProvider {
+
+ @Override
+ public IContentProposal[] getProposals(String contents, int position) {
+ if (contents != null) {
+ if (position > 0) {
+ contents = contents.substring(0, position);
+ }
+ contents = contents.trim();
+ }
+ List<IContentProposal> contentProposals = new ArrayList<IContentProposal>();
+ for (String proposal:proposals) {
+ if (proposal != null && proposal.startsWith(contents)) {
+ contentProposals.add(new ContentProposal(proposal));
+ }
+ }
+ return contentProposals.toArray(new IContentProposal[0]);
+ }
+
+ }
+
+}
14 years, 3 months
JBoss Tools SVN: r35042 - in workspace/snjeza/org.jboss.tools.central.update: features and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-26 10:16:40 -0400 (Mon, 26 Sep 2011)
New Revision: 35042
Added:
workspace/snjeza/org.jboss.tools.central.update/features/org.jboss.tools.central.feature_1.0.0.201109261417.jar
workspace/snjeza/org.jboss.tools.central.update/plugins/org.jboss.tools.central_1.0.0.201109261417.jar
Removed:
workspace/snjeza/org.jboss.tools.central.update/features/org.jboss.tools.central.feature_1.0.0.201109192238.jar
workspace/snjeza/org.jboss.tools.central.update/plugins/org.jboss.tools.central_1.0.0.201109192238.jar
Modified:
workspace/snjeza/org.jboss.tools.central.update/artifacts.jar
workspace/snjeza/org.jboss.tools.central.update/content.jar
workspace/snjeza/org.jboss.tools.central.update/site.xml
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: workspace/snjeza/org.jboss.tools.central.update/artifacts.jar
===================================================================
(Binary files differ)
Modified: workspace/snjeza/org.jboss.tools.central.update/content.jar
===================================================================
(Binary files differ)
Deleted: workspace/snjeza/org.jboss.tools.central.update/features/org.jboss.tools.central.feature_1.0.0.201109192238.jar
===================================================================
(Binary files differ)
Added: workspace/snjeza/org.jboss.tools.central.update/features/org.jboss.tools.central.feature_1.0.0.201109261417.jar
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/org.jboss.tools.central.update/features/org.jboss.tools.central.feature_1.0.0.201109261417.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: workspace/snjeza/org.jboss.tools.central.update/plugins/org.jboss.tools.central_1.0.0.201109192238.jar
===================================================================
(Binary files differ)
Added: workspace/snjeza/org.jboss.tools.central.update/plugins/org.jboss.tools.central_1.0.0.201109261417.jar
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/org.jboss.tools.central.update/plugins/org.jboss.tools.central_1.0.0.201109261417.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: workspace/snjeza/org.jboss.tools.central.update/site.xml
===================================================================
--- workspace/snjeza/org.jboss.tools.central.update/site.xml 2011-09-26 14:15:55 UTC (rev 35041)
+++ workspace/snjeza/org.jboss.tools.central.update/site.xml 2011-09-26 14:16:40 UTC (rev 35042)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
- <feature url="features/org.jboss.tools.central.feature_1.0.0.201109192238.jar" id="org.jboss.tools.central.feature" version="1.0.0.201109192238">
+ <feature url="features/org.jboss.tools.central.feature_1.0.0.201109261417.jar" id="org.jboss.tools.central.feature" version="1.0.0.201109261417">
<category name="org.jboss.tools.central"/>
</feature>
<category-def name="org.jboss.tools.central" label="JBoss Central"/>
14 years, 3 months
JBoss Tools SVN: r35041 - in trunk/central: features and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-26 10:15:55 -0400 (Mon, 26 Sep 2011)
New Revision: 35041
Added:
trunk/central/features/pom.xml
trunk/central/plugins/pom.xml
trunk/central/pom.xml
trunk/central/site/pom.xml
trunk/central/site/site.xml
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Added: trunk/central/features/pom.xml
===================================================================
--- trunk/central/features/pom.xml (rev 0)
+++ trunk/central/features/pom.xml 2011-09-26 14:15:55 UTC (rev 35041)
@@ -0,0 +1,19 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>central</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.central</groupId>
+ <artifactId>features</artifactId>
+
+ <name>central.features</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.jboss.tools.central.feature</module>
+ </modules>
+</project>
+
Added: trunk/central/plugins/pom.xml
===================================================================
--- trunk/central/plugins/pom.xml (rev 0)
+++ trunk/central/plugins/pom.xml 2011-09-26 14:15:55 UTC (rev 35041)
@@ -0,0 +1,19 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>central</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.central</groupId>
+ <artifactId>plugins</artifactId>
+
+ <name>central.plugins</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.jboss.tools.central</module>
+ </modules>
+</project>
+
Added: trunk/central/pom.xml
===================================================================
--- trunk/central/pom.xml (rev 0)
+++ trunk/central/pom.xml 2011-09-26 14:15:55 UTC (rev 35041)
@@ -0,0 +1,23 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.2-SNAPSHOT</version>
+ <relativePath>../build/parent/pom.xml</relativePath>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>central</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>centrall.all</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>features</module>
+ <module>plugins</module>
+ <!-- <module>tests</module> -->
+ <module>site</module>
+ </modules>
+</project>
+
Added: trunk/central/site/pom.xml
===================================================================
--- trunk/central/site/pom.xml (rev 0)
+++ trunk/central/site/pom.xml 2011-09-26 14:15:55 UTC (rev 35041)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>central</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.central</groupId>
+ <artifactId>central.site</artifactId>
+ <name>central.site</name>
+
+ <packaging>eclipse-update-site</packaging>
+</project>
\ No newline at end of file
Added: trunk/central/site/site.xml
===================================================================
--- trunk/central/site/site.xml (rev 0)
+++ trunk/central/site/site.xml 2011-09-26 14:15:55 UTC (rev 35041)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>To install these features, point Eclipse at this site.</description>
+ <!-- JBoss Tools Central Nightly Build Update Site -->
+ <category-def label="JBoss Tools Central Nightly Build Update Site" name="JBoss Tools Central Nightly Build Update Site">
+ <description>JBoss Tools Central Nightly Build Update Site: contains all features in this build.</description>
+ </category-def>
+ <feature url="features/org.jboss.tools.central.feature_0.0.0.jar" id="org.jboss.tools.central.feature" version="0.0.0">
+ <category name="JBoss Tools Central Nightly Build Update Site"/>
+ </feature>
+
+</site>
14 years, 3 months
JBoss Tools SVN: r35040 - in trunk/as: plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-26 08:27:42 -0400 (Mon, 26 Sep 2011)
New Revision: 35040
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/OpenshiftIntegrationTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
Log:
[JBIDE-9773] correcting ApplicationLogReader implementation and adding new tests
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -30,6 +30,8 @@
public abstract Collection<Cartridge> getCartridges() throws OpenshiftException;
+ public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException;
+
public abstract Collection<Application> getApplications() throws OpenshiftException;
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -135,6 +135,14 @@
this.uuid = applicationInfo.getUuid();
}
+ protected IOpenshiftService getService() {
+ return service;
+ }
+
+ protected User getUser() {
+ return user;
+ }
+
@Override
public int hashCode() {
final int prime = 31;
@@ -159,5 +167,4 @@
return false;
return true;
}
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -129,7 +129,6 @@
public Application createApplication(String name, ICartridge cartridge, User user) throws OpenshiftException {
Application application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE,
user.getRhlogin(), true), user);
- user.add(application);
return application;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -88,6 +88,13 @@
}
@Override
+ public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ Application application = service.createApplication(name, cartridge, this);
+ add(application);
+ return application;
+ }
+
+ @Override
public Collection<Application> getApplications() throws OpenshiftException {
loadLazyValues();
return Collections.unmodifiableList(applications);
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -10,9 +10,8 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.test.internal.core;
-import static org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationAsserts.assertGitUri;
import static org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationAsserts.assertAppliactionUrl;
-
+import static org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationAsserts.assertGitUri;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -24,8 +23,9 @@
import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -35,29 +35,24 @@
private IOpenshiftService service;
- private static final String RHLOGIN = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
private User user;
private User invalidUser;
- @Ignore
@Before
public void setUp() {
this.service = new OpenshiftService();
- this.user = new User(RHLOGIN, PASSWORD);
- this.invalidUser = new User(RHLOGIN, "bogusPassword");
+ this.user = new TestUser();
+ this.invalidUser = new TestUser("bogusPassword");
}
- @Ignore
@Test(expected = InvalidCredentialsOpenshiftException.class)
public void createApplicationWithInvalidCredentialsThrowsException() throws Exception {
- service.createApplication(createRandomApplicationName(), ICartridge.JBOSSAS_7, invalidUser);
+ service.createApplication(ApplicationUtils.createRandomApplicationName(), ICartridge.JBOSSAS_7, invalidUser);
}
- @Ignore
@Test
public void canCreateApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
ICartridge cartridge = ICartridge.JBOSSAS_7;
Application application = service.createApplication(applicationName, cartridge, user);
@@ -65,59 +60,54 @@
assertEquals(applicationName, application.getName());
assertEquals(cartridge, application.getCartridge());
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canDestroyApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.destroyApplication(applicationName, ICartridge.JBOSSAS_7, user);
}
- @Ignore
@Test(expected = OpenshiftException.class)
public void createDuplicateApplicationThrowsException() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canStopApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canStartStoppedApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.startApplication(applicationName, ICartridge.JBOSSAS_7, user);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canStartStartedApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
/**
* freshly created apps are started
@@ -129,14 +119,13 @@
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.startApplication(applicationName, ICartridge.JBOSSAS_7, user);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canStopStoppedApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
/**
* freshly created apps are started
@@ -149,14 +138,13 @@
service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canRestartApplication() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
/**
* freshly created apps are started
@@ -168,72 +156,45 @@
service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
service.restartApplication(applicationName, ICartridge.JBOSSAS_7, user);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
public void canGetStatus() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
Application application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
assertNotNull(applicationStatus);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
- @Ignore
@Test
- public void getStatusReturnsTheWholeLog() throws Exception {
- String applicationName = createRandomApplicationName();
- try {
- Application application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
- String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
- String applicationStatus2 = service.getStatus(application.getName(), application.getCartridge(), user);
- assertEquals(applicationStatus, applicationStatus2);
- } finally {
- silentlyDestroyAS7Application(applicationName, service);
- }
- }
-
- @Test
public void returnsValidGitUri() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
String gitUri = application.getGitUri();
assertNotNull(gitUri);
assertGitUri(applicationName, gitUri);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
@Test
public void returnsValidApplicationUrl() throws Exception {
- String applicationName = createRandomApplicationName();
+ String applicationName = ApplicationUtils.createRandomApplicationName();
try {
IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
String applicationUrl = application.getApplicationUrl();
assertNotNull(applicationUrl);
assertAppliactionUrl(applicationName, applicationUrl);
} finally {
- silentlyDestroyAS7Application(applicationName, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
}
}
-
- private String createRandomApplicationName() {
- return String.valueOf(System.currentTimeMillis());
- }
-
- private void silentlyDestroyAS7Application(String name, IOpenshiftService service) {
- try {
- service.destroyApplication(name, ICartridge.JBOSSAS_7, user);
- } catch (OpenshiftException e) {
- e.printStackTrace();
- }
- }
}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.test.internal.core;
+
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationLogReaderIntegrationTest {
+
+ private IOpenshiftService service;
+
+ private User user;
+
+ @Before
+ public void setUp() {
+ this.service = new OpenshiftService();
+ this.user = new TestUser();
+ }
+
+ /**
+ * Asserts the service implementation: getStatus returns the same log if no
+ * new log entry is available
+ *
+ * @throws Exception
+ */
+ @Test
+ public void getStatusReturnsTheWholeLogIfNoNewLogEntryOnServer() throws Exception {
+ String applicationName = ApplicationUtils.createRandomApplicationName();
+ try {
+ Application application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+ String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
+ String applicationStatus2 = service.getStatus(application.getName(), application.getCartridge(), user);
+ assertEquals(applicationStatus, applicationStatus2);
+ } finally {
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+ }
+ }
+
+ /**
+ * Asserts the service implementation: getStatus returns the new entries
+ * (and a tailing-header) if new log entries are available
+ */
+ @Test
+ public void getStatusReturnsNewEntriesIfNewLogEntriesOnServer() throws Exception {
+ String applicationName = ApplicationUtils.createRandomApplicationName();
+ try {
+ Application application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+ String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
+ application.restart();
+ String applicationStatus2 = service.getStatus(application.getName(), application.getCartridge(), user);
+ assertFalse(applicationStatus.equals(applicationStatus2));
+ } finally {
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+ }
+ }
+
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -189,7 +189,11 @@
, ApplicationResponseFake.APPLICATION_CREATIONTIME
, user
, userInfoService);
- // we need to add it manually since we dont use the service
+ /**
+ * we have to add it manually since we dont create the application with the user class
+ *
+ * @see User#createApplication
+ */
user.add(application);
return application;
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -18,6 +18,7 @@
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -29,15 +30,12 @@
private OpenshiftService openshiftService;
- private static final String RHLOGIN = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
-
private User user;
@Before
public void setUp() {
this.openshiftService = new OpenshiftService();
- this.user = new User(RHLOGIN, PASSWORD);
+ this.user = new TestUser();
}
@Ignore
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -16,21 +16,20 @@
import org.jboss.ide.eclipse.as.openshift.core.SSHKeyPair;
import org.jboss.ide.eclipse.as.openshift.core.internal.Domain;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.User;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestSSHKey;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
import org.junit.Test;
public class DomainIntegrationTest {
private OpenshiftService openshiftService;
+ private TestUser user;
- private static final String RHLOGIN = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
-
@Before
public void setUp() {
this.openshiftService = new OpenshiftService();
+ this.user = new TestUser();
}
@Test
@@ -38,7 +37,6 @@
String domainName = createRandomString();
SSHKeyPair sshKey = TestSSHKey.create();
- User user = new User(RHLOGIN, PASSWORD);
Domain domain = openshiftService.createDomain(domainName, sshKey, user);
assertNotNull(domain);
@@ -50,7 +48,6 @@
String domainName = createRandomString();
SSHKeyPair sshKey = TestSSHKey.create();
- User user = new User(RHLOGIN, PASSWORD);
Domain domain = openshiftService.changeDomain(domainName, sshKey, user);
assertNotNull(domain);
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -18,7 +18,7 @@
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
import org.junit.Test;
@@ -28,18 +28,17 @@
public class ListCartridgesIntegrationTest {
private OpenshiftService openshiftService;
+ private TestUser user;
- private static final String USERNAME = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
-
@Before
public void setUp() {
this.openshiftService = new OpenshiftService();
+ this.user = new TestUser();
}
@Test
public void canListCartridges() throws Exception {
- List<Cartridge> cartridges = openshiftService.getCartridges(new User(USERNAME, PASSWORD));
+ List<Cartridge> cartridges = openshiftService.getCartridges(user);
assertNotNull(cartridges);
assertTrue(cartridges.size() > 0);
assertThatContainsCartridge("jbossas-7.0", cartridges);
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/OpenshiftIntegrationTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/OpenshiftIntegrationTestSuite.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/OpenshiftIntegrationTestSuite.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -20,7 +20,8 @@
CartridgesIntegrationTest.class,
DomainIntegrationTest.class,
ListCartridgesIntegrationTest.class,
- UserInfoIntegrationTest.class
+ UserInfoIntegrationTest.class,
+ ApplicationLogReaderIntegrationTest.class
})
/**
* @author André Dietisheim
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java 2011-09-26 10:05:13 UTC (rev 35039)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -21,8 +21,8 @@
import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.User;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
+import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationInfoAsserts;
import org.junit.Before;
import org.junit.Test;
@@ -33,26 +33,24 @@
public class UserInfoIntegrationTest {
private OpenshiftService openshiftService;
+ private TestUser user;
- private static final String RHLOGIN = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
-
@Before
public void setUp() {
this.openshiftService = new OpenshiftService();
+ this.user = new TestUser();
}
@Test
public void canGetUserInfo() throws Exception {
- UserInfo userInfo = openshiftService.getUserInfo(new User(RHLOGIN, PASSWORD));
+ UserInfo userInfo = openshiftService.getUserInfo(user);
assertNotNull(userInfo);
- assertEquals(RHLOGIN, userInfo.getRhLogin());
+ assertEquals(user.getRhlogin(), userInfo.getRhLogin());
}
@Test
public void userInfoContainsOneMoreApplicationAfterCreatingNewApplication() throws Exception {
- User user = new User(RHLOGIN, PASSWORD);
UserInfo userInfo = openshiftService.getUserInfo(user);
assertNotNull(userInfo);
@@ -74,7 +72,6 @@
@Test
public void canUseReturnedSSHKeyToChangeDomain() throws Exception {
- User user = new User(RHLOGIN, PASSWORD);
UserInfo userInfo = openshiftService.getUserInfo(user);
assertNotNull(userInfo);
@@ -88,7 +85,7 @@
private void silentlyDestroyAS7Application(String name, IOpenshiftService service) {
try {
- service.destroyApplication(name, ICartridge.JBOSSAS_7, new User(RHLOGIN, PASSWORD));
+ service.destroyApplication(name, ICartridge.JBOSSAS_7, user);
} catch (OpenshiftException e) {
e.printStackTrace();
}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes;
+
+import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+
+/**
+ * @author André Dietisheim
+ */
+public class TestUser extends User {
+
+ private static final String RHLOGIN = "toolsjboss(a)gmail.com";
+ private static final String PASSWORD = "1q2w3e";
+
+ public TestUser() {
+ super(RHLOGIN, PASSWORD);
+ }
+
+ public TestUser(String password) {
+ super(RHLOGIN, password);
+ }
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java 2011-09-26 12:27:42 UTC (rev 35040)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.test.internal.core.utils;
+
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
+import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.internal.User;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationUtils {
+
+ public static String createRandomApplicationName() {
+ return String.valueOf(System.currentTimeMillis());
+ }
+
+ public static Application createApplication(User user, IOpenshiftService service) throws OpenshiftException {
+ return service.createApplication(createRandomApplicationName(), Cartridge.JBOSSAS_7, user);
+ }
+
+ public static void silentlyDestroyAS7Application(String name, User user, IOpenshiftService service) {
+ try {
+ service.destroyApplication(name, ICartridge.JBOSSAS_7, user);
+ } catch (OpenshiftException e) {
+ e.printStackTrace();
+ }
+ }
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 3 months
JBoss Tools SVN: r35039 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-26 06:05:13 -0400 (Mon, 26 Sep 2011)
New Revision: 35039
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java
Log:
[JBIDE-9762] cleaned package structure, accessible API
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java 2011-09-26 10:04:04 UTC (rev 35038)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/User.java 2011-09-26 10:05:13 UTC (rev 35039)
@@ -35,17 +35,17 @@
private List<Cartridge> cartridges;
private List<Application> applications = new ArrayList<Application>();
- private OpenshiftService service;
+ private IOpenshiftService service;
public User(String rhlogin, String password) {
this(rhlogin, password, (ISSHPublicKey) null, new OpenshiftService());
}
- public User(String rhlogin, String password, OpenshiftService service) {
+ public User(String rhlogin, String password, IOpenshiftService service) {
this(rhlogin, password, (ISSHPublicKey) null, service);
}
- public User(String rhlogin, String password, ISSHPublicKey sshKey, OpenshiftService service) {
+ public User(String rhlogin, String password, ISSHPublicKey sshKey, IOpenshiftService service) {
this.rhlogin = rhlogin;
this.password = password;
this.sshKey = sshKey;
14 years, 3 months