JBoss Tools SVN: r41032 - in trunk/openshift: plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-05-15 16:22:31 -0400 (Tue, 15 May 2012)
New Revision: 41032
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgeStrategy.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategyAdapter.java
trunk/openshift/tests/org.jboss.tools.openshift.express.test/src/org/jboss/tools/openshift/express/test/EmbedCartridgeStrategyTest.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategy.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgesOperation.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IEmbedCartridgesWizardPageModel.java
trunk/openshift/tests/org.jboss.tools.openshift.express.test/META-INF/MANIFEST.MF
Log:
[JBIDE-10852] implemented generic strategy to handle all the different dependency aspects (simple if/else approach was getting very messy). Implemented unit-test for embed cartridge strategy
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2012-05-15 20:22:31 UTC (rev 41032)
@@ -54,7 +54,8 @@
org.jboss.tools.common.ui.preferencevalue,
org.jboss.tools.common.ui.ssh
Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.jboss.tools.openshift.express.internal.core.behaviour;x-friends:="org.jboss.tools.openshift.express.test",
+Export-Package: org.jboss.tools.openshift.express.internal.core;x-friends:="org.jboss.tools.openshift.express.test",
+ org.jboss.tools.openshift.express.internal.core.behaviour;x-friends:="org.jboss.tools.openshift.express.test",
org.jboss.tools.openshift.express.internal.ui;x-friends:="org.jboss.tools.openshift.express.test",
org.jboss.tools.openshift.express.internal.ui.behaviour;x-friends:="org.jboss.tools.openshift.express.test",
org.jboss.tools.openshift.express.internal.ui.console;x-friends:="org.jboss.tools.openshift.express.test",
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgeStrategy.java (from rev 40985, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategy.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgeStrategy.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgeStrategy.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.tools.openshift.express.internal.core;
+
+import java.net.SocketTimeoutException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.openshift.client.IApplication;
+import com.openshift.client.ICartridge;
+import com.openshift.client.IEmbeddableCartridge;
+import com.openshift.client.OpenShiftException;
+
+/**
+ * A UI strategy that is able to add and remove embedded cartridges while
+ * fullfilling requirements and resolving conflicts (ex. mutual exclusivity
+ * etc.)
+ * <p>
+ * TODO: replaced this manual code by a generic dependency-tree analysis
+ * mechanism as soon as OpenShift completed design of cartridge metamodel
+ *
+ * @author Andre Dietisheim
+ */
+public class EmbedCartridgeStrategy {
+
+ private static final EmbeddableCartridgeRelations[] dependencies =
+ new EmbeddableCartridgeRelations[] {
+ new EmbeddableCartridgeRelations(IEmbeddableCartridge.JENKINS_14,
+ null, null, ICartridge.JENKINS_14),
+ new EmbeddableCartridgeRelations(IEmbeddableCartridge.PHPMYADMIN_34,
+ null, IEmbeddableCartridge.MYSQL_51, null),
+ new EmbeddableCartridgeRelations(IEmbeddableCartridge.ROCKMONGO_11,
+ null, IEmbeddableCartridge.MONGODB_20, null),
+ new EmbeddableCartridgeRelations(IEmbeddableCartridge._10GEN_MMS_AGENT_01,
+ null, IEmbeddableCartridge.MONGODB_20, null),
+ new EmbeddableCartridgeRelations(IEmbeddableCartridge.POSTGRESQL_84,
+ IEmbeddableCartridge.MYSQL_51, null, null),
+ new EmbeddableCartridgeRelations(IEmbeddableCartridge.MYSQL_51,
+ IEmbeddableCartridge.POSTGRESQL_84, null, null),
+ };
+
+ private Map<IEmbeddableCartridge, EmbeddableCartridgeRelations> dependenciesByCartridge;
+ private HashMap<IEmbeddableCartridge, Set<IEmbeddableCartridge>> dependantsByCartridge;
+
+ private IApplication application;
+
+ public EmbedCartridgeStrategy(IApplication application) {
+ this.application = application;
+ initDependencyMaps(dependencies);
+ }
+
+ private void initDependencyMaps(EmbeddableCartridgeRelations... dependencies) {
+ this.dependenciesByCartridge = new HashMap<IEmbeddableCartridge, EmbeddableCartridgeRelations>();
+
+ this.dependantsByCartridge = new HashMap<IEmbeddableCartridge, Set<IEmbeddableCartridge>>();
+ for (EmbeddableCartridgeRelations dependency : dependencies) {
+ dependenciesByCartridge.put(dependency.getSubject(), dependency);
+ Set<IEmbeddableCartridge> dependants = getDependants(dependency);
+ dependants.add(dependency.getSubject());
+ }
+ }
+
+ private Set<IEmbeddableCartridge> getDependants(EmbeddableCartridgeRelations relation) {
+ Set<IEmbeddableCartridge> dependants = dependantsByCartridge.get(relation.getRequired());
+ if (dependants == null) {
+ dependantsByCartridge.put(
+ relation.getRequired(),
+ dependants = new HashSet<IEmbeddableCartridge>());
+ }
+ return dependants;
+ }
+
+ public EmbeddableCartridgeDiff add(IEmbeddableCartridge cartridge, Set<IEmbeddableCartridge> currentCartridges)
+ throws OpenShiftException, SocketTimeoutException {
+ EmbeddableCartridgeDiff cartridgeDiff = new EmbeddableCartridgeDiff(cartridge);
+ add(cartridge, currentCartridges, cartridgeDiff);
+ return cartridgeDiff;
+ }
+
+ private void add(IEmbeddableCartridge cartridge, Set<IEmbeddableCartridge> currentCartridges,
+ EmbeddableCartridgeDiff diff)
+ throws OpenShiftException, SocketTimeoutException {
+ EmbeddableCartridgeRelations relation = dependenciesByCartridge.get(cartridge);
+ if (relation == null) {
+ return;
+ }
+ removeConflicting(currentCartridges, diff, relation);
+ addRequired(currentCartridges, diff, relation.getRequired());
+ addRequiredApplication(diff, relation);
+ }
+
+ private void addRequired(Set<IEmbeddableCartridge> currentCartridges, EmbeddableCartridgeDiff diff,
+ IEmbeddableCartridge requiredCartridge) throws OpenShiftException,
+ SocketTimeoutException {
+ if (requiredCartridge != null
+ && !currentCartridges.contains(requiredCartridge)) {
+ // recurse
+ add(requiredCartridge, currentCartridges, diff);
+ diff.addAddition(requiredCartridge);
+ }
+ }
+
+ private void addRequiredApplication(EmbeddableCartridgeDiff diff,
+ EmbeddableCartridgeRelations relation) throws OpenShiftException {
+ if (relation.getRequiredApplication() != null
+ && !application.getDomain().hasApplicationByCartridge(relation.getRequiredApplication())) {
+ diff.addApplicationAddition(relation.getRequiredApplication());
+ }
+ }
+
+ private void removeConflicting(Set<IEmbeddableCartridge> currentCartridges, EmbeddableCartridgeDiff cartridgeDiff,
+ EmbeddableCartridgeRelations relation) throws OpenShiftException, SocketTimeoutException {
+ IEmbeddableCartridge conflictingCartridge = relation.getConflicting();
+ if (conflictingCartridge != null) {
+ remove(conflictingCartridge, currentCartridges, cartridgeDiff);
+ if (currentCartridges.contains(conflictingCartridge)) {
+ cartridgeDiff.addRemoval(conflictingCartridge);
+ }
+ }
+ }
+
+ public EmbeddableCartridgeDiff remove(IEmbeddableCartridge cartridge, Set<IEmbeddableCartridge> currentCartridges)
+ throws OpenShiftException, SocketTimeoutException {
+ EmbeddableCartridgeDiff cartridgeDiff = new EmbeddableCartridgeDiff(cartridge);
+ remove(cartridge, currentCartridges, cartridgeDiff);
+ return cartridgeDiff;
+ }
+
+ private void remove(IEmbeddableCartridge cartridge, Set<IEmbeddableCartridge> currentCartridges,
+ EmbeddableCartridgeDiff cartridgeDiff)
+ throws OpenShiftException, SocketTimeoutException {
+ Set<IEmbeddableCartridge> dependantCartridges = dependantsByCartridge.get(cartridge);
+ if (dependantCartridges == null) {
+ return;
+ }
+ for (IEmbeddableCartridge dependantCartridge : dependantCartridges) {
+ if (currentCartridges.contains(dependantCartridge)) {
+ remove(dependantCartridge, currentCartridges, cartridgeDiff);
+ cartridgeDiff.addRemoval(dependantCartridge);
+ }
+ }
+ }
+
+ private static class EmbeddableCartridgeRelations {
+
+ private IEmbeddableCartridge conflicting;
+ private IEmbeddableCartridge required;
+ private IEmbeddableCartridge subject;
+ private ICartridge requiredApplication;
+
+ protected EmbeddableCartridgeRelations(IEmbeddableCartridge cartridge,
+ IEmbeddableCartridge conflicting, IEmbeddableCartridge required, ICartridge requiredApplication) {
+ this.subject = cartridge;
+ this.conflicting = conflicting;
+ this.required = required;
+ this.requiredApplication = requiredApplication;
+ }
+
+ protected IEmbeddableCartridge getSubject() {
+ return subject;
+ }
+
+ protected IEmbeddableCartridge getConflicting() {
+ return conflicting;
+ }
+
+ protected IEmbeddableCartridge getRequired() {
+ return required;
+ }
+
+ protected ICartridge getRequiredApplication() {
+ return requiredApplication;
+ }
+
+ }
+
+ public static class EmbeddableCartridgeDiff {
+
+ private List<IEmbeddableCartridge> removals;
+ private List<IEmbeddableCartridge> additions;
+ private List<ICartridge> applicationAdditions;
+ private IEmbeddableCartridge cartridge;
+
+ protected EmbeddableCartridgeDiff(IEmbeddableCartridge cartridge) {
+ this.cartridge = cartridge;
+ this.removals = new ArrayList<IEmbeddableCartridge>();
+ this.additions = new ArrayList<IEmbeddableCartridge>();
+ this.applicationAdditions = new ArrayList<ICartridge>();
+ }
+
+ public IEmbeddableCartridge getCartridge() {
+ return cartridge;
+ }
+
+ public List<IEmbeddableCartridge> getAdditions() {
+ return additions;
+ }
+
+ public boolean hasAdditions() {
+ return getAdditions().size() > 0;
+ }
+
+ protected void addAddition(IEmbeddableCartridge cartridge) {
+ additions.add(cartridge);
+ }
+
+ public List<IEmbeddableCartridge> getRemovals() {
+ return removals;
+ }
+
+ public boolean hasRemovals() {
+ return getRemovals().size() > 0;
+ }
+
+ protected void addRemoval(IEmbeddableCartridge cartridge) {
+ removals.add(cartridge);
+ }
+
+ protected void addApplicationAddition(ICartridge applicationType) {
+ applicationAdditions.add(applicationType);
+ }
+
+ public List<ICartridge> getApplicationAdditions() {
+ return applicationAdditions;
+ }
+
+ public boolean hasApplicationAdditions() {
+ return getApplicationAdditions().size() > 0;
+ }
+
+ public boolean hasChanges() {
+ return hasApplicationAdditions()
+ || hasRemovals()
+ || hasAdditions();
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgeStrategy.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgesOperation.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgesOperation.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/EmbedCartridgesOperation.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -16,9 +16,6 @@
import java.util.Comparator;
import java.util.List;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.list.ListDiff;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
import org.eclipse.core.runtime.IProgressMonitor;
import com.openshift.client.IApplication;
@@ -43,26 +40,23 @@
* Embeds and removes cartridges from the given application so that it
* matches the given list of enabled cartridges.
*
- * @param enabledCartridges
+ * @param selectedCartridges
* @param monitor
* @return
* @throws SocketTimeoutException
* @throws OpenShiftException
*/
- public List<IEmbeddedCartridge> execute(final List<IEmbeddableCartridge> enabledCartridges,
+ public List<IEmbeddedCartridge> execute(final List<IEmbeddableCartridge> selectedCartridges,
final IProgressMonitor monitor)
throws SocketTimeoutException, OpenShiftException {
- if (enabledCartridges == null) {
+ if (selectedCartridges == null) {
return Collections.emptyList();
}
List<IEmbeddableCartridge> cartridgesToAdd = new ArrayList<IEmbeddableCartridge>();
List<IEmbeddableCartridge> cartridgesToRemove = new ArrayList<IEmbeddableCartridge>();
- computeAdditionsAndRemovals(
- cartridgesToAdd,
- cartridgesToRemove,
- enabledCartridges,
- application.getEmbeddedCartridges());
+ computeRemovals(selectedCartridges, application.getEmbeddedCartridges(), cartridgesToRemove);
+ computeAdditions(selectedCartridges, application.getEmbeddedCartridges(), cartridgesToAdd);
removeEmbeddedCartridges(cartridgesToRemove, application);
final List<IEmbeddedCartridge> addedCartridges = addEmbeddedCartridges(cartridgesToAdd, application);
@@ -70,7 +64,7 @@
}
private void removeEmbeddedCartridges(List<IEmbeddableCartridge> cartridgesToRemove, final IApplication application)
- throws OpenShiftException,SocketTimeoutException {
+ throws OpenShiftException, SocketTimeoutException {
if (cartridgesToRemove.isEmpty()) {
return;
}
@@ -93,20 +87,24 @@
return application.addEmbeddableCartridges(cartridgesToAdd);
}
- private void computeAdditionsAndRemovals(List<IEmbeddableCartridge> addedCartridges,
- List<IEmbeddableCartridge> removedCartridges, List<IEmbeddableCartridge> selectedCartridges,
- List<IEmbeddedCartridge> embeddedCartidges)
- throws OpenShiftException, SocketTimeoutException {
- ListDiff listDiff = Diffs.computeListDiff(embeddedCartidges, selectedCartridges);
- for (ListDiffEntry entry : listDiff.getDifferences()) {
- if (entry.isAddition()) {
- addedCartridges.add((IEmbeddableCartridge) entry.getElement());
- } else {
- removedCartridges.add((IEmbeddableCartridge) entry.getElement());
+ private void computeAdditions(List<IEmbeddableCartridge> selectedCartridges,
+ List<IEmbeddedCartridge> embeddedCartridges, List<IEmbeddableCartridge> addedCartridges) {
+ for (IEmbeddableCartridge cartridge : selectedCartridges){
+ if (!embeddedCartridges.contains(cartridge)){
+ addedCartridges.add(cartridge);
}
}
}
+ private void computeRemovals(List<IEmbeddableCartridge> selectedCartridges,
+ List<IEmbeddedCartridge> embeddedCartridges, List<IEmbeddableCartridge> removedCartridges) {
+ for (IEmbeddableCartridge cartridge : embeddedCartridges){
+ if (!selectedCartridges.contains(cartridge)){
+ removedCartridges.add(cartridge);
+ }
+ }
+ }
+
private static class CartridgeAddRemovePriorityComparator implements Comparator<IEmbeddableCartridge> {
@Override
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -31,6 +31,19 @@
|| value.length() == 0;
}
+ public static <T> String toString(List<T> elements) {
+ return toString(elements, new ToStringConverter<T>() {
+
+ @Override
+ public String toString(T object) {
+ if (object == null) {
+ return null;
+ }
+ return String.valueOf(object);
+ }
+ });
+ }
+
public static <T> String toString(List<T> elements, ToStringConverter<T> converter) {
StringBuilder builder = new StringBuilder();
for(int i = 0; i < elements.size(); i++) {
@@ -42,7 +55,7 @@
}
return builder.toString();
}
-
+
public static interface ToStringConverter<T> {
public String toString(T object);
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -16,7 +16,6 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateListStrategy;
-import org.eclipse.core.databinding.UpdateSetStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.core.databinding.observable.list.IObservableList;
@@ -334,14 +333,12 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 2).hint(400, 250)
.applyTo(tableContainer);
this.viewer = createTable(tableContainer);
- viewer.addCheckStateListener(new EmbedCartridgeStrategy(pageModel, this));
+ viewer.addCheckStateListener(new EmbedCartridgeStrategyAdapter(pageModel, this));
dbc.bindSet(
ViewerProperties.checkedElements(IEmbeddableCartridge.class).observe(viewer),
BeanProperties.set(
ApplicationConfigurationWizardPageModel.PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES)
- .observe(pageModel),
- new UpdateSetStrategy(UpdateSetStrategy.POLICY_NEVER),
- null);
+ .observe(pageModel));
this.checkAllButton = new Button(newAppEmbeddableCartridgesGroup, SWT.PUSH);
checkAllButton.setText("&Select All");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -337,7 +337,7 @@
if (application != null) {
setApplicationName(application.getName());
setSelectedCartridge(application.getCartridge());
- setSelectedEmbeddableCartridges(new HashSet<IEmbeddableCartridge>(application.getEmbeddedCartridges()));
+ setSelectedEmbeddableCartridges(application.getEmbeddedCartridges());
setSelectedGearProfile(application.getGearProfile());
setScale(application.getApplicationScale());
wizardModel.setApplication(application);
@@ -397,6 +397,10 @@
return wizardModel.getSelectedEmbeddableCartridges();
}
+ protected void setSelectedEmbeddableCartridges(List<? extends IEmbeddableCartridge> cartridges) {
+ setSelectedEmbeddableCartridges(cartridges);
+ }
+
public void setSelectedEmbeddableCartridges(Set<IEmbeddableCartridge> selectedEmbeddableCartridges) {
firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES,
wizardModel.getSelectedEmbeddableCartridges(),
@@ -407,11 +411,6 @@
return getSelectedEmbeddableCartridges().contains(cartridge);
}
- @Override
- public boolean hasApplicationOfType(ICartridge cartridge) throws SocketTimeoutException, OpenShiftException {
- return getUser().hasApplicationOfType(cartridge);
- }
-
public boolean hasApplication(String applicationName) throws SocketTimeoutException, OpenShiftException {
return getUser().hasApplication(applicationName);
}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategy.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategy.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategy.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.tools.openshift.express.internal.ui.wizard;
-
-import java.net.SocketTimeoutException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
-
-import com.openshift.client.IApplication;
-import com.openshift.client.ICartridge;
-import com.openshift.client.IEmbeddableCartridge;
-import com.openshift.client.OpenShiftException;
-
-/**
- * A UI strategy that is able to add and remove embedded cartridges while
- * fullfilling requirements and resolving conflicts (ex. mutual exclusivity
- * etc.)
- * <p>
- * TODO: replaced this manual code by a generic dependency-tree analysis
- * mechanism as soon as OpenShift completed design of cartridge metamodel
- *
- * @author Andre Dietisheim
- */
-public class EmbedCartridgeStrategy implements ICheckStateListener {
-
- private IEmbedCartridgesWizardPageModel pageModel;
- private IWizardPage wizardPage;
-
- public EmbedCartridgeStrategy(IEmbedCartridgesWizardPageModel pageModel, IWizardPage wizardPage) {
- this.wizardPage = wizardPage;
- this.pageModel = pageModel;
- }
-
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- try {
- IEmbeddableCartridge cartridge = (IEmbeddableCartridge) event.getElement();
- if (event.getChecked()) {
- addCartridge(cartridge);
- } else {
- removeCartridge(cartridge);
- }
- } catch (OpenShiftException e) {
- OpenShiftUIActivator.log("Could not process embeddable cartridges", e);
- } catch (SocketTimeoutException e) {
- OpenShiftUIActivator.log("Could not process embeddable cartridges", e);
- }
- }
-
- private void addCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException, SocketTimeoutException {
- if (IEmbeddableCartridge.PHPMYADMIN_34.equals(cartridge)) {
- addPhpMyAdmin();
- } else if (IEmbeddableCartridge.JENKINS_14.equals(cartridge)) {
- addJenkins(cartridge);
- } else if (IEmbeddableCartridge.MYSQL_51.equals(cartridge)) {
- addMySql();
- } else if (IEmbeddableCartridge.POSTGRESQL_84.equals(cartridge)) {
- addPostgreSql();
- } else if (IEmbeddableCartridge.ROCKMONGO_11.equals(cartridge)) {
- addRockMongo();
- } else if (IEmbeddableCartridge._10GEN_MMS_AGENT_01.equals(cartridge)) {
- add10gen();
- } else {
- pageModel.selectEmbeddedCartridges(cartridge);
- }
- }
-
- private void removeCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException, SocketTimeoutException {
- if (IEmbeddableCartridge.MYSQL_51.equals(cartridge)) {
- removeMySQL();
- } else if (IEmbeddableCartridge.MONGODB_20.equals(cartridge)) {
- removeMongoDb();
- } else {
- pageModel.unselectEmbeddedCartridges(cartridge);
- }
- }
-
- private void addJenkins(final IEmbeddableCartridge cartridge) throws OpenShiftException,
- SocketTimeoutException {
- if (pageModel.hasApplicationOfType(ICartridge.JENKINS_14)) {
- pageModel.getSelectedEmbeddableCartridges().add(cartridge);
- } else {
- final JenkinsApplicationDialog dialog = new JenkinsApplicationDialog(getShell());
- if (dialog.open() == Dialog.OK) {
- createJenkinsApplication(cartridge, dialog.getValue());
- } else {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.JENKINS_14);
- }
- }
- }
-
- private void createJenkinsApplication(final IEmbeddableCartridge cartridge, final String name) {
- try {
- WizardUtils.runInWizard(new Job(NLS.bind("Creating jenkins application \"{0}\"...", name)) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- IApplication jenkinsApplication = pageModel.createJenkinsApplication(name, monitor);
- pageModel.selectEmbeddedCartridges(cartridge);
- openLogDialog(jenkinsApplication);
- return Status.OK_STATUS;
- } catch (Exception e) {
- try {
- pageModel.selectEmbeddedCartridges(cartridge);
- } catch (Exception ex) {
- OpenShiftUIActivator.log(ex);
- }
- return OpenShiftUIActivator.createErrorStatus("Could not create jenkins application", e);
- }
- }
-
- }, getContainer());
- } catch (Exception e) {
- // ignore
- }
- }
-
- private void addPhpMyAdmin() throws OpenShiftException, SocketTimeoutException {
- if (!pageModel.isSelected(IEmbeddableCartridge.MYSQL_51)) {
- if (MessageDialog.openQuestion(getShell(), "Embed phpMyAdmin Cartridge",
- "To embed phpMyAdmin, you'd also have to embed MySQL. \n\nAlso embed MySQL?")) {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
- }
- } else {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
- }
- }
-
- private void addMySql()
- throws OpenShiftException, SocketTimeoutException {
- if (pageModel.isSelected(IEmbeddableCartridge.POSTGRESQL_84)) {
- if (MessageDialog
- .openQuestion(getShell(), "Remove PostgreSQL Cartridge",
- "MySQL and PostgreSQL are mutually exclusive. To embed MySQL, you have to remove PostgreSQL. \n\nRemove PostgreSQL?")) {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.POSTGRESQL_84);
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- }
- } else {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- }
- }
-
- private void addPostgreSql()
- throws OpenShiftException, SocketTimeoutException {
- if (pageModel.isSelected(IEmbeddableCartridge.MYSQL_51)) {
- if (MessageDialog
- .openQuestion(getShell(), "Remove MySQL Cartridge",
- "MySQL and PostgreSQL are mutually exclusive. To embed PostgreSQL, you have to remove MySQL.\n\nRemove MySQL?")) {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.POSTGRESQL_84);
- }
- } else {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.POSTGRESQL_84);
- }
- }
-
- private void removeMySQL() throws OpenShiftException, SocketTimeoutException {
- if (pageModel.isSelected(IEmbeddableCartridge.PHPMYADMIN_34)) {
- if (MessageDialog
- .openQuestion(getShell(), "Remove phpmyadmin cartridge",
- "If you remove the mysql cartridge, you'd also have to remove phpmyadmin.\n\nRemove phpMyAdmin and MySQL?")) {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- }
- } else {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- }
- }
-
- private void addRockMongo() throws OpenShiftException, SocketTimeoutException {
- if (!pageModel.isSelected(IEmbeddableCartridge.MONGODB_20)) {
- if (MessageDialog.openQuestion(getShell(), "Embed MongoDB Cartridge",
- "To embed RockMongo, you'd also have to embed MongoDB. \n\nAlso embed MongoDB?")) {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.ROCKMONGO_11);
- }
- } else {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
- }
- }
-
- private void removeMongoDb() throws OpenShiftException, SocketTimeoutException {
- boolean removeMongoDb = true;
- if (pageModel.isSelected(IEmbeddableCartridge.ROCKMONGO_11)) {
- if (MessageDialog.openQuestion(getShell(), "Remove MongoDB cartridge",
- "If you remove the MongoDB cartridge, you'd also have to remove RockMongo.")) {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.ROCKMONGO_11);
- } else {
- removeMongoDb = false;
- }
- }
-
- if (removeMongoDb // mongo to be removed?
- && pageModel.isSelected(IEmbeddableCartridge._10GEN_MMS_AGENT_01)) {
- if (MessageDialog.openQuestion(getShell(), "Remove MongoDB cartridge",
- "If you remove the MongoDB cartridge, you'd also have to remove 10gen MMS agent.")) {
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge._10GEN_MMS_AGENT_01);
- } else {
- removeMongoDb = false;
- }
- }
-
- if (removeMongoDb) { // mongo to be removed?
- pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
- }
- }
-
- private void add10gen() throws OpenShiftException, SocketTimeoutException {
- if (!pageModel.isSelected(IEmbeddableCartridge.MONGODB_20)) {
- if (MessageDialog.openQuestion(getShell(), "Embed 10gen Cartridge",
- "To embed 10gen cartridge, you'd also have to embed MongoDB. \n\nAlso embed MongoDB?")) {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge._10GEN_MMS_AGENT_01);
- }
- } else {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
- }
- }
-
- private Shell getShell() {
- return wizardPage.getControl().getShell();
- }
-
- private IWizardContainer getContainer() {
- return wizardPage.getWizard().getContainer();
- }
-
- private void openLogDialog(final IApplication application) {
- wizardPage.getControl().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- new CreationLogDialog(getShell(), application).open();
- }
- });
- }
-
- private static class JenkinsApplicationDialog extends InputDialog {
-
- public JenkinsApplicationDialog(Shell shell) {
- super(
- shell,
- "New Jenkins application",
- "To embed Jenkins into your application, you first have to create a separate Jenkins application. "
- + "Please provide a name for this new Jenkins application (lower-case letters and digits only):"
- , null, new JenkinsNameValidator());
- }
-
- private static class JenkinsNameValidator implements IInputValidator {
-
- @Override
- public String isValid(String input) {
- if (StringUtils.isEmpty(input)) {
- return "You have to provide a name for the jenkins application";
- }
-
- if (!StringUtils.isAlphaNumeric(input)) {
- return "The name may only contain lower-case letters and digits.";
- }
- return null;
- }
- }
- }
-}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategyAdapter.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategyAdapter.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategyAdapter.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.tools.openshift.express.internal.ui.wizard;
+
+import java.net.SocketTimeoutException;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.core.EmbedCartridgeStrategy;
+import org.jboss.tools.openshift.express.internal.core.EmbedCartridgeStrategy.EmbeddableCartridgeDiff;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils.ToStringConverter;
+
+import com.openshift.client.IApplication;
+import com.openshift.client.ICartridge;
+import com.openshift.client.IEmbeddableCartridge;
+import com.openshift.client.OpenShiftException;
+
+/**
+ * A UI strategy that is able to add and remove embedded cartridges while
+ * fullfilling requirements and resolving conflicts (ex. mutual exclusivity
+ * etc.)
+ * <p>
+ * TODO: replaced this manual code by a generic dependency-tree analysis
+ * mechanism as soon as OpenShift completed design of cartridge metamodel
+ *
+ * @author Andre Dietisheim
+ */
+public class EmbedCartridgeStrategyAdapter implements ICheckStateListener {
+
+ private IEmbedCartridgesWizardPageModel pageModel;
+ private IWizardPage wizardPage;
+
+ public EmbedCartridgeStrategyAdapter(IEmbedCartridgesWizardPageModel pageModel, IWizardPage wizardPage) {
+ this.wizardPage = wizardPage;
+ this.pageModel = pageModel;
+ }
+
+ @Override
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ try {
+ IEmbeddableCartridge cartridge = (IEmbeddableCartridge) event.getElement();
+ EmbeddableCartridgeDiff diff = null;
+ EmbedCartridgeStrategy embedCartridgeStrategy = new EmbedCartridgeStrategy(pageModel.getApplication());
+ diff = createEmbeddableCartridgeDiff(event.getChecked(), cartridge, embedCartridgeStrategy);
+
+ if (diff.hasChanges()) {
+ if (MessageDialog
+ .openQuestion(getShell(),
+ NLS.bind("{0} Cartridges", event.getChecked() ? "Add" : "Remove"),
+ createEmbeddingOperationMessage(event.getChecked(), diff))) {
+ createApplications(diff.getApplicationAdditions());
+ unselectEmbeddableCartridges(diff.getRemovals());
+ selectEmbeddableCartridges(diff.getAdditions());
+ } else {
+ if (event.getChecked()) {
+ pageModel.unselectEmbeddedCartridges(cartridge);
+ } else {
+ pageModel.selectEmbeddedCartridges(cartridge);
+ }
+ }
+ }
+
+ } catch (OpenShiftException e) {
+ OpenShiftUIActivator.log("Could not process embeddable cartridges", e);
+ } catch (SocketTimeoutException e) {
+ OpenShiftUIActivator.log("Could not process embeddable cartridges", e);
+ }
+ }
+
+ private EmbeddableCartridgeDiff createEmbeddableCartridgeDiff(
+ boolean add, IEmbeddableCartridge cartridge, EmbedCartridgeStrategy embedCartridgeStrategy)
+ throws OpenShiftException, SocketTimeoutException {
+ if (add) {
+ return embedCartridgeStrategy.add(cartridge, pageModel.getSelectedEmbeddableCartridges());
+ } else {
+ return embedCartridgeStrategy.remove(cartridge, pageModel.getSelectedEmbeddableCartridges());
+ }
+ }
+
+ private String createEmbeddingOperationMessage(boolean adding, EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(NLS.bind("If you want {0} {1}, you also have to:", adding ? "add" : "remove",
+ new EmbeddableCartridgeToStringConverter().toString(diff.getCartridge())));
+ if (diff.hasApplicationAdditions()) {
+ builder.append(NLS.bind("\n- Create {0}",
+ StringUtils.toString(diff.getApplicationAdditions(), new CartridgeToStringConverter())));
+ }
+ if (diff.hasRemovals()) {
+ builder.append(NLS.bind("\n- Remove {0}",
+ StringUtils.toString(diff.getRemovals(), new EmbeddableCartridgeToStringConverter())));
+ }
+ if (diff.hasAdditions()) {
+ builder.append(NLS.bind("\n- Add {0}",
+ StringUtils.toString(diff.getAdditions(), new EmbeddableCartridgeToStringConverter())));
+ }
+ builder.append("\n\nShall we proceed with these modifications?");
+ return builder.toString();
+ }
+
+ private void unselectEmbeddableCartridges(List<IEmbeddableCartridge> removals) throws SocketTimeoutException,
+ OpenShiftException {
+ for (IEmbeddableCartridge embeddableCartridge : removals) {
+ pageModel.unselectEmbeddedCartridges(embeddableCartridge);
+ }
+ }
+
+ private void selectEmbeddableCartridges(List<IEmbeddableCartridge> additions) throws SocketTimeoutException,
+ OpenShiftException {
+ for (IEmbeddableCartridge embeddableCartridge : additions) {
+ pageModel.selectEmbeddedCartridges(embeddableCartridge);
+ }
+ }
+
+ private void createApplications(List<ICartridge> applicationAdditions) {
+ for (ICartridge cartridge : applicationAdditions) {
+ if (!ICartridge.JENKINS_14.equals(cartridge)) {
+ throw new UnsupportedOperationException("only jenkins applications may currently be created.");
+ }
+ createJenkinsApplication(cartridge);
+ }
+ }
+
+ private void createJenkinsApplication(final ICartridge cartridge) {
+ final String name = openJenkinsApplicationDialog();
+ try {
+ WizardUtils.runInWizard(new Job(NLS.bind("Creating application \"{0}\"...", name)) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ IApplication application = pageModel.createJenkinsApplication(name, monitor);
+ openLogDialog(application);
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ try {
+ // TODO: unselect failed embeddable cartridge
+ // pageModel.unselectEmbeddedCartridges(cartridge);
+ } catch (Exception ex) {
+ OpenShiftUIActivator.log(ex);
+ }
+ return OpenShiftUIActivator.createErrorStatus("Could not create application {0}", e);
+ }
+ }
+
+ }, getContainer());
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ private String openJenkinsApplicationDialog() {
+ final JenkinsApplicationDialog dialog = new JenkinsApplicationDialog(getShell());
+ if (dialog.open() != Dialog.OK) {
+ return null;
+ }
+ return dialog.getValue();
+ }
+
+ private Shell getShell() {
+ return wizardPage.getControl().getShell();
+ }
+
+ private IWizardContainer getContainer() {
+ return wizardPage.getWizard().getContainer();
+ }
+
+ private void openLogDialog(final IApplication application) {
+ wizardPage.getControl().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ new CreationLogDialog(getShell(), application).open();
+ }
+ });
+ }
+
+ private static class JenkinsApplicationDialog extends InputDialog {
+
+ public JenkinsApplicationDialog(Shell shell) {
+ super(
+ shell,
+ "New Jenkins application",
+ "To embed Jenkins into your application, you first have to create a separate Jenkins application. "
+ + "Please provide a name for this new Jenkins application (lower-case letters and digits only):"
+ , null, new JenkinsNameValidator());
+ }
+
+ private static class JenkinsNameValidator implements IInputValidator {
+
+ @Override
+ public String isValid(String input) {
+ if (StringUtils.isEmpty(input)) {
+ return "You have to provide a name for the jenkins application";
+ }
+
+ if (!StringUtils.isAlphaNumeric(input)) {
+ return "The name may only contain lower-case letters and digits.";
+ }
+ return null;
+ }
+ }
+ }
+
+ private static class EmbeddableCartridgeToStringConverter implements ToStringConverter<IEmbeddableCartridge> {
+
+ @Override
+ public String toString(IEmbeddableCartridge cartridge) {
+ if (cartridge == null) {
+ return null;
+ }
+ return cartridge.getName();
+ }
+ }
+
+ private static class CartridgeToStringConverter implements ToStringConverter<ICartridge> {
+
+ @Override
+ public String toString(ICartridge cartridge) {
+ if (cartridge == null) {
+ return null;
+ }
+ return cartridge.getName();
+ }
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeStrategyAdapter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -19,7 +19,6 @@
import java.util.concurrent.TimeUnit;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateSetStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -71,7 +70,7 @@
Group embedGroup = new Group(parent, SWT.NONE);
embedGroup.setText("Embeddable Cartridges");
GridDataFactory.fillDefaults()
- .hint(200, 200).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(embedGroup);
+ .hint(200, 300).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(embedGroup);
GridLayoutFactory.fillDefaults()
.numColumns(3).margins(6, 6).applyTo(embedGroup);
@@ -79,15 +78,12 @@
this.viewer = createTable(tableContainer);
GridDataFactory.fillDefaults()
.span(3, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
-// viewer.addCheckStateListener(new EmbedCartridgeStrategy(viewer, pageModel, this));
dbc.bindSet(
ViewerProperties.checkedElements(IEmbeddableCartridge.class).observe(viewer),
BeanProperties.set(
EmbedCartridgeWizardPageModel.PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES)
- .observe(pageModel),
- new UpdateSetStrategy(UpdateSetStrategy.POLICY_NEVER),
- null);
- viewer.addCheckStateListener(new EmbedCartridgeStrategy(pageModel, this));
+ .observe(pageModel));;
+ viewer.addCheckStateListener(new EmbedCartridgeStrategyAdapter(pageModel, this));
// hiding buttons for now: https://issues.jboss.org/browse/JBIDE-10399
// Button checkAllButton = new Button(embedGroup, SWT.PUSH);
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -12,7 +12,6 @@
import java.net.SocketTimeoutException;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -54,7 +53,7 @@
|| application.getEmbeddedCartridges() == null) {
return;
}
- selectedCartridges.addAll(application.getEmbeddedCartridges());
+ setSelectedEmbeddableCartridges(application.getEmbeddedCartridges());
}
public List<IEmbeddableCartridge> loadEmbeddableCartridges() throws OpenShiftException, SocketTimeoutException {
@@ -80,14 +79,16 @@
return selectedCartridges;
}
- public void setSelectedEmbeddableCartridges(Set<IEmbeddableCartridge> cartridges) throws SocketTimeoutException, OpenShiftException {
- setSelectedEmbeddableCartridges(cartridges);
+ protected void setSelectedEmbeddableCartridges(List<? extends IEmbeddableCartridge> cartridges) throws SocketTimeoutException, OpenShiftException {
+ setSelectedEmbeddableCartridges(new HashSet<IEmbeddableCartridge>(cartridges));
}
-
- protected void setSelectedEmbeddedCartridges(Collection<IEmbeddedCartridge> cartridges) throws SocketTimeoutException, OpenShiftException {
- Set<IEmbeddableCartridge> oldValue = getSelectedEmbeddableCartridges();
- selectedCartridges.clear();
- selectedCartridges.addAll(cartridges);
+
+ public void setSelectedEmbeddableCartridges(Set<IEmbeddableCartridge> cartridges) throws SocketTimeoutException, OpenShiftException {
+ Set<IEmbeddableCartridge> oldValue = new HashSet<IEmbeddableCartridge>(getSelectedEmbeddableCartridges());
+ if (cartridges != selectedCartridges) {
+ selectedCartridges.clear();
+ selectedCartridges.addAll(cartridges);
+ }
firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES, oldValue, selectedCartridges);
}
@@ -99,6 +100,7 @@
return wizardModel.getUser().hasApplicationOfType(cartridge);
}
+ @Override
public IApplication getApplication() {
return wizardModel.getApplication();
}
@@ -106,23 +108,21 @@
@Override
public void selectEmbeddedCartridges(IEmbeddableCartridge cartridge)
throws OpenShiftException,SocketTimeoutException {
- Set<IEmbeddableCartridge> oldValue = new HashSet<IEmbeddableCartridge>(getSelectedEmbeddableCartridges());
getSelectedEmbeddableCartridges().add(cartridge);
- firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES, oldValue, getSelectedEmbeddableCartridges());
+ firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES, null, getSelectedEmbeddableCartridges());
}
@Override
public void unselectEmbeddedCartridges(IEmbeddableCartridge cartridge)
throws OpenShiftException,SocketTimeoutException {
- Set<IEmbeddableCartridge> oldValue = new HashSet<IEmbeddableCartridge>(getSelectedEmbeddableCartridges());
getSelectedEmbeddableCartridges().remove(cartridge);
- firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES, oldValue, getSelectedEmbeddableCartridges());
+ firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES, null, getSelectedEmbeddableCartridges());
}
public Set<IEmbeddableCartridge> refreshSelectedEmbeddedCartridges()
throws OpenShiftException, SocketTimeoutException {
getApplication().refresh();
- setSelectedEmbeddedCartridges(getApplication().getEmbeddedCartridges());
+ setSelectedEmbeddableCartridges(getApplication().getEmbeddedCartridges());
return getSelectedEmbeddableCartridges();
}
@@ -138,12 +138,7 @@
return new EmbedCartridgesOperation(getApplication())
.execute(new ArrayList<IEmbeddableCartridge>(selectedCartridges), null);
}
-
- @Override
- public boolean hasApplicationOfType(ICartridge cartridge) throws SocketTimeoutException, OpenShiftException {
- return wizardModel.getUser().hasApplicationOfType(cartridge);
- }
-
+
public IApplication createJenkinsApplication(String name, IProgressMonitor monitor) throws OpenShiftException {
IApplication application =
new CreateApplicationOperation(wizardModel.getUser()).execute(
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IEmbedCartridgesWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IEmbedCartridgesWizardPageModel.java 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IEmbedCartridgesWizardPageModel.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -16,7 +16,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import com.openshift.client.IApplication;
-import com.openshift.client.ICartridge;
import com.openshift.client.IEmbeddableCartridge;
import com.openshift.client.OpenShiftException;
@@ -37,8 +36,8 @@
public boolean isSelected(IEmbeddableCartridge cartridge) throws OpenShiftException, SocketTimeoutException;
- public boolean hasApplicationOfType(ICartridge cartridge) throws SocketTimeoutException, OpenShiftException;
-
+ public IApplication getApplication();
+
public IApplication createJenkinsApplication(String name, IProgressMonitor monitor) throws OpenShiftException;
}
\ No newline at end of file
Modified: trunk/openshift/tests/org.jboss.tools.openshift.express.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.express.test/META-INF/MANIFEST.MF 2012-05-15 19:59:04 UTC (rev 41031)
+++ trunk/openshift/tests/org.jboss.tools.openshift.express.test/META-INF/MANIFEST.MF 2012-05-15 20:22:31 UTC (rev 41032)
@@ -5,8 +5,10 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Vendor: JBoss by Red Hat
Require-Bundle: org.jboss.tools.openshift.express.ui;bundle-version="2.3.0",
+ org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
org.eclipse.core.filesystem;bundle-version="1.3.100",
- org.junit;bundle-version="[4.8.2,5.0.0)"
+ org.junit;bundle-version="[4.8.2,5.0.0)",
+ com.jcraft.jsch;bundle-version="[0.1.44,1.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/openshift/tests/org.jboss.tools.openshift.express.test/src/org/jboss/tools/openshift/express/test/EmbedCartridgeStrategyTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.express.test/src/org/jboss/tools/openshift/express/test/EmbedCartridgeStrategyTest.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.express.test/src/org/jboss/tools/openshift/express/test/EmbedCartridgeStrategyTest.java 2012-05-15 20:22:31 UTC (rev 41032)
@@ -0,0 +1,630 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tools.openshift.express.test;
+
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.net.SocketTimeoutException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.tools.openshift.express.internal.core.EmbedCartridgeStrategy;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.jcraft.jsch.Session;
+import com.openshift.client.ApplicationScale;
+import com.openshift.client.IApplication;
+import com.openshift.client.IApplicationGear;
+import com.openshift.client.IApplicationPortForwarding;
+import com.openshift.client.ICartridge;
+import com.openshift.client.IDomain;
+import com.openshift.client.IEmbeddableCartridge;
+import com.openshift.client.IEmbeddedCartridge;
+import com.openshift.client.IGearProfile;
+import com.openshift.client.IUser;
+import com.openshift.client.OpenShiftException;
+import com.openshift.client.OpenShiftSSHOperationException;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class EmbedCartridgeStrategyTest {
+
+ private EmbedCartridgeStrategy embedStrategy;
+ private DomainFake domainFake;
+
+ @Before
+ public void setUp() throws SocketTimeoutException, OpenShiftException {
+ this.domainFake = new DomainFake();
+ IApplication applicationFake = domainFake.createApplication("adietish", ICartridge.JBOSSAS_7);
+ this.embedStrategy = new EmbedCartridgeStrategy(applicationFake);
+ }
+
+ @Test
+ public void shouldNotAddMySql() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = new HashSet<IEmbeddableCartridge>();
+ currentCartridges.add(IEmbeddableCartridge.MYSQL_51);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.MYSQL_51, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.MYSQL_51, diff.getCartridge());
+ assertFalse(diff.hasAdditions());
+ assertFalse(diff.hasRemovals());
+ assertFalse(diff.hasApplicationAdditions());
+ }
+
+ @Test
+ public void shouldAddMySql() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = Collections.<IEmbeddableCartridge>emptySet();
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.MYSQL_51, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.MYSQL_51, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 0);
+ }
+
+ @Test
+ public void shouldAddPhpMyAdminAndMySql() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = Collections.<IEmbeddableCartridge>emptySet();
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.PHPMYADMIN_34, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.PHPMYADMIN_34, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 1);
+ assertEquals(IEmbeddableCartridge.MYSQL_51, diff.getAdditions().get(0));
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 0);
+ }
+
+ @Test
+ public void shouldRemovePhpMyAdmin() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = new HashSet<IEmbeddableCartridge>();
+ currentCartridges.add(IEmbeddableCartridge.MYSQL_51);
+ currentCartridges.add(IEmbeddableCartridge.PHPMYADMIN_34);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.remove(IEmbeddableCartridge.PHPMYADMIN_34, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.PHPMYADMIN_34, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 0);
+ }
+
+ @Test
+ public void shouldRemovePhpMyAdminAndMySql() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = new HashSet<IEmbeddableCartridge>();
+ currentCartridges.add(IEmbeddableCartridge.MYSQL_51);
+ currentCartridges.add(IEmbeddableCartridge.PHPMYADMIN_34);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.remove(IEmbeddableCartridge.MYSQL_51, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.MYSQL_51, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 1);
+ assertTrue(diff.getRemovals().contains(IEmbeddableCartridge.PHPMYADMIN_34));
+ }
+
+ @Test
+ public void shouldRemovePostgresAndAddMySql() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = new HashSet<IEmbeddableCartridge>();
+ currentCartridges.add(IEmbeddableCartridge.POSTGRESQL_84);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.MYSQL_51, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.MYSQL_51, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 1);
+ assertEquals(IEmbeddableCartridge.POSTGRESQL_84, diff.getRemovals().get(0));
+ }
+
+ @Test
+ public void shouldRemovePostgresAndAddPhpMyAdminAndMySql() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = new HashSet<IEmbeddableCartridge>();
+ currentCartridges.add(IEmbeddableCartridge.POSTGRESQL_84);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.PHPMYADMIN_34, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.PHPMYADMIN_34, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 1);
+ assertEquals(IEmbeddableCartridge.MYSQL_51, diff.getAdditions().get(0));
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 1);
+ assertEquals(IEmbeddableCartridge.POSTGRESQL_84, diff.getRemovals().get(0));
+ }
+
+ @Test
+ public void shouldAddRockmongoAndMongoDb() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = Collections.<IEmbeddableCartridge>emptySet();
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.ROCKMONGO_11, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.ROCKMONGO_11, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 1);
+ assertEquals(IEmbeddableCartridge.MONGODB_20, diff.getAdditions().get(0));
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 0);
+ }
+
+ @Test
+ public void shouldRemoveRockmongoAnd10genAndMongoDb() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = new HashSet<IEmbeddableCartridge>();
+ currentCartridges.add(IEmbeddableCartridge.MONGODB_20);
+ currentCartridges.add(IEmbeddableCartridge.ROCKMONGO_11);
+ currentCartridges.add(IEmbeddableCartridge._10GEN_MMS_AGENT_01);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.remove(IEmbeddableCartridge.MONGODB_20, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.MONGODB_20, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 2);
+ assertTrue(diff.getRemovals().contains(IEmbeddableCartridge.ROCKMONGO_11));
+ assertTrue(diff.getRemovals().contains(IEmbeddableCartridge._10GEN_MMS_AGENT_01));
+ }
+
+ @Test
+ public void shouldNotAddJenkinsApplication() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = Collections.<IEmbeddableCartridge>emptySet();
+ domainFake.createApplication("adietish", ICartridge.JENKINS_14);
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.JENKINS_14, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.JENKINS_14, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 0);
+ assertNotNull(diff.getApplicationAdditions());
+ assertTrue(diff.getApplicationAdditions().size() == 0);
+ }
+
+ @Test
+ public void shouldAddJenkinsApplication() throws SocketTimeoutException, OpenShiftException{
+ // given
+ Set<IEmbeddableCartridge> currentCartridges = Collections.<IEmbeddableCartridge>emptySet();
+
+ // when
+ EmbedCartridgeStrategy.EmbeddableCartridgeDiff diff = embedStrategy.add(IEmbeddableCartridge.JENKINS_14, currentCartridges);
+
+ // then
+ assertEquals(IEmbeddableCartridge.JENKINS_14, diff.getCartridge());
+ assertNotNull(diff.getAdditions());
+ assertTrue(diff.getAdditions().size() == 0);
+ assertNotNull(diff.getRemovals());
+ assertTrue(diff.getRemovals().size() == 0);
+ assertNotNull(diff.getApplicationAdditions());
+ assertTrue(diff.getApplicationAdditions().size() == 1);
+ assertTrue(diff.getApplicationAdditions().contains(ICartridge.JENKINS_14));
+ }
+
+ private static final class ApplicationFake implements IApplication {
+
+ private ICartridge cartridge;
+ private IDomain domain;
+
+ public ApplicationFake(ICartridge cartridge, IDomain domain) {
+ this.cartridge = cartridge;
+ this.domain = domain;
+ }
+
+ @Override
+ public String getCreationLog() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasCreationLog() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getName() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getUUID() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getGitUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getApplicationUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ApplicationScale getApplicationScale() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IGearProfile getGearProfile() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getHealthCheckUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ICartridge getCartridge() {
+ return cartridge;
+ }
+
+ @Override
+ public IEmbeddedCartridge addEmbeddableCartridge(IEmbeddableCartridge cartridge)
+ throws OpenShiftException,SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IEmbeddedCartridge> addEmbeddableCartridges(List<IEmbeddableCartridge> cartridge)
+ throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IEmbeddedCartridge> getEmbeddedCartridges() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasEmbeddedCartridge(IEmbeddableCartridge cartridge)
+ throws OpenShiftException,SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasEmbeddedCartridge(String cartridgeName) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IEmbeddedCartridge getEmbeddedCartridge(String cartridgeName)
+ throws OpenShiftException,SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IEmbeddedCartridge getEmbeddedCartridge(IEmbeddableCartridge cartridge)
+ throws OpenShiftException,SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void removeEmbeddedCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException,
+ SocketTimeoutException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public List<IApplicationGear> getGears() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Date getCreationTime() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void destroy() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void start() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void restart() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void stop() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void stop(boolean force) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean waitForAccessible(long timeout) throws OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IDomain getDomain() {
+ return domain;
+ }
+
+ @Override
+ public void exposePort() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void concealPort() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void showPort() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void scaleDown() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void scaleUp() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void addAlias(String string) throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<String> getAliases() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasAlias(String name) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void removeAlias(String alias) throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void refresh() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasSSHSession() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isPortFowardingStarted() throws OpenShiftSSHOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IApplicationPortForwarding> getForwardablePorts() throws OpenShiftSSHOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IApplicationPortForwarding> startPortForwarding() throws OpenShiftSSHOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IApplicationPortForwarding> stopPortForwarding() throws OpenShiftSSHOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IApplicationPortForwarding> refreshForwardablePorts() throws OpenShiftSSHOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<String> getEnvironmentProperties() throws OpenShiftSSHOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSSHSession(Session session) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session getSSHSession() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ private static final class DomainFake implements IDomain {
+
+ private List<IApplication> applications;
+
+ public DomainFake() {
+ this.applications = new ArrayList<IApplication>();
+ }
+
+ @Override
+ public String getCreationLog() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasCreationLog() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void refresh() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getId() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getSuffix() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void rename(String id) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IUser getUser() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void destroy() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void destroy(boolean force) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean waitForAccessible(long timeout) throws OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IApplication createApplication(String name, ICartridge cartridge, ApplicationScale scale,
+ IGearProfile gearProfile) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IApplication createApplication(String name, ICartridge cartridge, ApplicationScale scale)
+ throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IApplication createApplication(String name, ICartridge cartridge, IGearProfile gearProfile)
+ throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IApplication createApplication(String name, ICartridge cartridge) {
+ IApplication application = new ApplicationFake(cartridge, this);
+ applications.add(application);
+ return application;
+ }
+
+ @Override
+ public List<IApplication> getApplications() throws OpenShiftException, SocketTimeoutException {
+ return applications;
+ }
+
+ @Override
+ public List<String> getAvailableCartridgeNames() throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IApplication getApplicationByName(String name) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasApplicationByName(String name) throws OpenShiftException, SocketTimeoutException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<IApplication> getApplicationsByCartridge(ICartridge cartridge) throws OpenShiftException {
+ List<IApplication> matchingApplications = new ArrayList<IApplication>();
+ for (IApplication application : applications) {
+ if (cartridge.equals(application.getCartridge())) {
+ matchingApplications.add(application);
+ break;
+ }
+ }
+ return matchingApplications;
+ }
+
+ @Override
+ public boolean hasApplicationByCartridge(ICartridge cartridge) throws OpenShiftException {
+ return getApplicationsByCartridge(cartridge).size() > 0;
+ }
+
+ @Override
+ public List<IGearProfile> getAvailableGearProfiles() throws SocketTimeoutException, OpenShiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+}
Property changes on: trunk/openshift/tests/org.jboss.tools.openshift.express.test/src/org/jboss/tools/openshift/express/test/EmbedCartridgeStrategyTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 8 months
JBoss Tools SVN: r41030 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-05-15 13:46:57 -0400 (Tue, 15 May 2012)
New Revision: 41030
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties
Log:
https://issues.jboss.org/browse/JBIDE-11511 HTML5 jQuery Mobile Template
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties 2012-05-15 14:37:31 UTC (rev 41029)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties 2012-05-15 17:46:57 UTC (rev 41030)
@@ -1,3 +1,3 @@
Templates.html.jQueryMobile = HTML5 jQuery Mobile Page
Templates.html.jQueryMobile.desc = HTML5 jQuery Mobile Template
-Templates.html.jQueryMobile.content = <!DOCTYPE html> \n<html><head> \n <title>jQuery Mobile Template</title> \n <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \n <meta name="viewport" \n content="width=device-width, initial-scale=1, user-scalable=0" /> \n \n <link rel="stylesheet" \n href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> \n \n <script type="text/javascript" \n src="http://code.jquery.com/jquery-1.7.2.min.js"></script> \n <script type="text/javascript" \n src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> \n <script type="text/javascript"> \n $$(document).on("pageinit", function(event){ \n alert("Ready To Go"); \n }); \n </script> \n</head> \n \n<body> \n <div data-role="page" id="page1"> \n <div data-role="header"> \n <h1>jQuery Mobile</h1> \n </div> \n \n <div data-role="content"> \n <ul id="listOfItems" data-role="listview" data-inset="true" \n data-filter="true"> \n!
<li><a href="">One</a></li> \n <li><a href="">Two</a></li> \n <li><a href="">Three</a></li> \n </ul> \n </div> \n \n <div data-role="footer"> \n <h4>www.jboss.org/developer</h4> \n </div> \n \n </div> \n</body> \n</html> \n
\ No newline at end of file
+Templates.html.jQueryMobile.content = <!DOCTYPE html> \n<html> \n<head> \n <title>jQuery Mobile Template</title> \n <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \n <meta name="viewport" \n content="width=device-width, initial-scale=1" /> \n <link rel="stylesheet" \n href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> \n <script type="text/javascript" \n src="http://code.jquery.com/jquery-1.7.1.min.js"></script> \n <script type="text/javascript" \n src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> \n <script type="text/javascript"> \n $$(document).on("pageinit", "#page1", function(event){ \n alert("Ready To Go"); \n }); \n </script> \n</head> \n<body> \n <div data-role="page" id="page1"> \n <div data-role="header"> \n <h1>jQuery Mobile</h1> \n </div> \n <div data-role="content"> \n <ul id="listOfItems" data-role="listview" data-inset="true" \n data-filter="true"> \n <li><a href="!
">One</a></li> \n <li><a href="">Two</a></li> \n <li><a href="">Three</a></li> \n </ul> \n </div> \n <div data-role="footer"> \n <h4>www.jboss.org/developer</h4> \n </div> \n </div> \n</body> \n</html>
\ No newline at end of file
12 years, 8 months
JBoss Tools SVN: r41029 - trunk/central/tests/org.jboss.tools.central.test.ui.bot.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-05-15 10:37:31 -0400 (Tue, 15 May 2012)
New Revision: 41029
Removed:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/requirements.properties
Modified:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml
Log:
JBIDE-11714 Central
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml 2012-05-15 13:52:06 UTC (rev 41028)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml 2012-05-15 14:37:31 UTC (rev 41029)
@@ -14,7 +14,7 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
<additionalSystemProperties></additionalSystemProperties>
- <jbosstools.test.jbossas.home>${requirement.build.root}/jboss-as-7.1.1.Final</jbosstools.test.jbossas.home>
+ <jbosstools.test.jbossas.home>${project.build.directory}/requirements/jboss-as-7.1.1.Final</jbosstools.test.jbossas.home>
<!-- for debugging ucomment and comment next line <systemProperties>-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y -Djbosstools.test.jbossas.home=${jbosstools.test.jbossas.home} -Dswtbot.test.properties.file=${swtbot.properties}</systemProperties> -->
<systemProperties>${additionalSystemProperties} -Djbosstools.test.jbossas.home=${jbosstools.test.jbossas.home} -Dswtbot.test.properties.file=${swtbot.properties}</systemProperties>
</properties>
@@ -31,6 +31,31 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-dist</artifactId>
+ <version>7.1.1.Final</version>
+ <type>zip</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/requirements</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
Deleted: trunk/central/tests/org.jboss.tools.central.test.ui.bot/requirements.properties
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/requirements.properties 2012-05-15 13:52:06 UTC (rev 41028)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/requirements.properties 2012-05-15 14:37:31 UTC (rev 41029)
@@ -1 +0,0 @@
-requirements=jbossas-7.1.1.Final
\ No newline at end of file
12 years, 8 months
JBoss Tools SVN: r41028 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-05-15 09:52:06 -0400 (Tue, 15 May 2012)
New Revision: 41028
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
Log:
JBIDE-11684 : make the archetypes compatible with EAP ER6
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-05-15 13:51:30 UTC (rev 41027)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-05-15 13:52:06 UTC (rev 41028)
@@ -11,7 +11,7 @@
<shortDescription>Java EE Web Project</shortDescription>
<priority>1</priority>
<description>
-This is your project! It's a sample, deployable Maven 3 project to help you get your foot in the door developing with Java EE 6 on JBoss AS 7.
+This is your project! It's a sample, deployable Maven 3 project to help you get your foot in the door developing with Java EE 6 on JBoss AS 7.1.
This project is setup to allow you to create a compliant Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1, JPA 2.0 and Bean Validation 1.0.
It includes a persistence unit and some sample persistence and transaction code to help you get your feet wet with database access in enterprise Java.
</description>
@@ -19,9 +19,9 @@
<url/>
<fixes>
<fix type="wtpruntime">
- <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1 or EAP 6 </property>
- <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss AS 7.1 or EAP 6 </property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.711</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
@@ -48,7 +48,7 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.spec.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp-archetype</archetypeArtifactId>
- <archetypeVersion>7.0.2.CR2b</archetypeVersion>
+ <archetypeVersion>7.1.1-Beta1-JBT</archetypeVersion>
<archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
@@ -105,7 +105,8 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.spec.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp-ear-archetype</archetypeArtifactId>
- <archetypeVersion>7.0.2.CR2</archetypeVersion>
+ <archetypeVersion>7.1.1-Beta1-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
-->
@@ -160,7 +161,8 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.aerogear.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-html5-mobile-archetype</archetypeArtifactId>
- <archetypeVersion>1.0.0.M3b</archetypeVersion>
+ <archetypeVersion>1.0.0.M3-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
-->
@@ -214,23 +216,24 @@
<mavenArchetype>
<archetypeGroupId>org.richfaces.archetypes</archetypeGroupId>
<archetypeArtifactId>richfaces-archetype-kitchensink</archetypeArtifactId>
- <archetypeVersion>4.2.0.Final-2</archetypeVersion>
+ <archetypeVersion>4.2.2.Final-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/snapshots/</archetypeRepository>
- <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
-->
<groupId>org.jboss.tools.example</groupId>
<artifactId>richfaces-webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.example.richfaces</javaPackage>
- <!--
<properties>
- <property name="richfaces-enterprise-version" value="4.2.0.Final" />
+ <property name="richfaces-enterprise-version" value="4.2.1.Final" /> <!-- RF is broken in WFK / WFK repo not available-->
+ <property name="richfaces-version" value="4.2.1.Final" />
</properties>
- -->
</mavenArchetype>
- <essentialEnterpriseDependencies>org.richfaces:richfaces-bom:pom:4.2.0.Final-redhat-1::,</essentialEnterpriseDependencies>
+ <!--
+ <essentialEnterpriseDependencies>org.richfaces:richfaces-bom:pom:4.2.1.Final-redhat-1::,</essentialEnterpriseDependencies>
+ -->
<tags>wizard</tags>
<icon path="icons/rf_logo.png" />
<welcome type="editor" url="/${project[0]}/README.md"/>
@@ -247,8 +250,8 @@
<url/>
<fixes>
<fix type="wtpruntime">
- <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1 or EAP 6 </property>
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss AS 7.1 or EAP 6 </property>
<property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
</fix>
<fix type="plugin">
@@ -275,9 +278,12 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.spring.archetypes</archetypeGroupId>
<archetypeArtifactId>spring-mvc-webapp</archetypeArtifactId>
- <archetypeVersion>1.0.0.CR3</archetypeVersion>
+ <archetypeVersion>1.0.0-CR4-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <!--
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
- <groupId>org.jboss.tools.example</groupId>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
<artifactId>springmvc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.example.springmvc</javaPackage>
@@ -337,7 +343,7 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.errai.archetypes</archetypeGroupId>
<archetypeArtifactId>kitchensink-quickstart</archetypeArtifactId>
- <archetypeVersion>2.0-Beta3-jbt</archetypeVersion>
+ <archetypeVersion>2.0.0.Final-JBT</archetypeVersion>
<archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>https://repository.jboss.org/nexus/content/groups/public/</archetypeRepository>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-05-15 13:51:30 UTC (rev 41027)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-05-15 13:52:06 UTC (rev 41028)
@@ -11,7 +11,7 @@
<shortDescription>Java EE Web Project</shortDescription>
<priority>1</priority>
<description>
-This is your project! It's a sample, deployable Maven 3 project to help you get your foot in the door developing with Java EE 6 on JBoss AS 7.
+This is your project! It's a sample, deployable Maven 3 project to help you get your foot in the door developing with Java EE 6 on JBoss AS 7.1.
This project is setup to allow you to create a compliant Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1, JPA 2.0 and Bean Validation 1.0.
It includes a persistence unit and some sample persistence and transaction code to help you get your feet wet with database access in enterprise Java.
</description>
@@ -19,9 +19,9 @@
<url/>
<fixes>
<fix type="wtpruntime">
- <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1 or EAP 6 </property>
- <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss AS 7.1 or EAP 6 </property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.711</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
@@ -48,7 +48,7 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.spec.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp-archetype</archetypeArtifactId>
- <archetypeVersion>7.0.2.CR2b</archetypeVersion>
+ <archetypeVersion>7.1.1-Beta1-JBT</archetypeVersion>
<archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
@@ -105,7 +105,8 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.spec.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp-ear-archetype</archetypeArtifactId>
- <archetypeVersion>7.0.2.CR2</archetypeVersion>
+ <archetypeVersion>7.1.1-Beta1-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
-->
@@ -160,7 +161,8 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.aerogear.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-html5-mobile-archetype</archetypeArtifactId>
- <archetypeVersion>1.0.0.M3b</archetypeVersion>
+ <archetypeVersion>1.0.0.M3-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
-->
@@ -214,23 +216,24 @@
<mavenArchetype>
<archetypeGroupId>org.richfaces.archetypes</archetypeGroupId>
<archetypeArtifactId>richfaces-archetype-kitchensink</archetypeArtifactId>
- <archetypeVersion>4.2.0.Final-2</archetypeVersion>
+ <archetypeVersion>4.2.2.Final-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/snapshots/</archetypeRepository>
- <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
-->
<groupId>org.jboss.tools.example</groupId>
<artifactId>richfaces-webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.example.richfaces</javaPackage>
- <!--
<properties>
- <property name="richfaces-enterprise-version" value="4.2.0.Final" />
+ <property name="richfaces-enterprise-version" value="4.2.1.Final" /> <!-- RF is broken in WFK / WFK repo not available-->
+ <property name="richfaces-version" value="4.2.1.Final" />
</properties>
- -->
</mavenArchetype>
- <essentialEnterpriseDependencies>org.richfaces:richfaces-bom:pom:4.2.0.Final-redhat-1::,</essentialEnterpriseDependencies>
+ <!--
+ <essentialEnterpriseDependencies>org.richfaces:richfaces-bom:pom:4.2.1.Final-redhat-1::,</essentialEnterpriseDependencies>
+ -->
<tags>wizard</tags>
<icon path="icons/rf_logo.png" />
<welcome type="editor" url="/${project[0]}/README.md"/>
@@ -247,8 +250,8 @@
<url/>
<fixes>
<fix type="wtpruntime">
- <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1 or EAP 6 </property>
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss AS 7.1 or EAP 6 </property>
<property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
</fix>
<fix type="plugin">
@@ -275,9 +278,12 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.spring.archetypes</archetypeGroupId>
<archetypeArtifactId>spring-mvc-webapp</archetypeArtifactId>
- <archetypeVersion>1.0.0.CR3</archetypeVersion>
+ <archetypeVersion>1.0.0-CR4-JBT</archetypeVersion>
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <!--
<archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
- <groupId>org.jboss.tools.example</groupId>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
<artifactId>springmvc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.example.springmvc</javaPackage>
@@ -337,7 +343,7 @@
<mavenArchetype>
<archetypeGroupId>org.jboss.errai.archetypes</archetypeGroupId>
<archetypeArtifactId>kitchensink-quickstart</archetypeArtifactId>
- <archetypeVersion>2.0-Beta3-jbt</archetypeVersion>
+ <archetypeVersion>2.0.0.Final-JBT</archetypeVersion>
<archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
<!--
<archetypeRepository>https://repository.jboss.org/nexus/content/groups/public/</archetypeRepository>
12 years, 8 months
JBoss Tools SVN: r41027 - workspace/fred/repositories/snapshot/org/jboss/spring/archetypes/spring-mvc-webapp/1.0.0-CR4-JBT.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-05-15 09:51:30 -0400 (Tue, 15 May 2012)
New Revision: 41027
Modified:
workspace/fred/repositories/snapshot/org/jboss/spring/archetypes/spring-mvc-webapp/1.0.0-CR4-JBT/spring-mvc-webapp-1.0.0-CR4-JBT.jar
Log:
make springmvc deployable on openshift
Modified: workspace/fred/repositories/snapshot/org/jboss/spring/archetypes/spring-mvc-webapp/1.0.0-CR4-JBT/spring-mvc-webapp-1.0.0-CR4-JBT.jar
===================================================================
(Binary files differ)
12 years, 8 months
JBoss Tools SVN: r41026 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-15 09:40:29 -0400 (Tue, 15 May 2012)
New Revision: 41026
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java
Log:
JBIDE-11125 - Runtime download should be able to work in background
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java 2012-05-15 13:40:25 UTC (rev 41025)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java 2012-05-15 13:40:29 UTC (rev 41026)
@@ -21,6 +21,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IStartup;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.core.model.RuntimeDefinition;
@@ -54,7 +55,7 @@
if (exists) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- Shell shell = Display.getCurrent().getActiveShell();
+ Shell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
for (RuntimePath runtimePath:RuntimeUIActivator.getDefault().getRuntimePaths()) {
if (runtimePath.isScanOnEveryStartup() || firstStart) {
12 years, 8 months
JBoss Tools SVN: r41025 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-15 09:40:25 -0400 (Tue, 15 May 2012)
New Revision: 41025
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java
Log:
JBIDE-11125 - Runtime download should be able to work in background
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java 2012-05-15 12:33:40 UTC (rev 41024)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java 2012-05-15 13:40:25 UTC (rev 41025)
@@ -515,7 +515,7 @@
private Shell getActiveShell() {
Display display = Display.getDefault();
if (display != null) {
- return display.getActiveShell();
+ return PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
}
return null;
}
12 years, 8 months
JBoss Tools SVN: r41024 - in trunk/ws: plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-05-15 08:33:40 -0400 (Tue, 15 May 2012)
New Revision: 41024
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java
Log:
Fixing imports, renaming block variables, improving test
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java 2012-05-15 12:25:08 UTC (rev 41023)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java 2012-05-15 12:33:40 UTC (rev 41024)
@@ -31,6 +31,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaCore;
@@ -99,7 +100,7 @@
*/
private JaxrsMetamodelDelta processEntireProject(IProject project, int deltaKind, IProgressMonitor progressMonitor)
throws CoreException {
-
+ // start with a fresh new metamodel
final JaxrsMetamodel metamodel = JaxrsMetamodel.create(JavaCore.create(project));
final JaxrsMetamodelDelta metamodelDelta = new JaxrsMetamodelDelta(metamodel, deltaKind);
try {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java 2012-05-15 12:25:08 UTC (rev 41023)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java 2012-05-15 12:33:40 UTC (rev 41024)
@@ -229,23 +229,23 @@
}
}
// unindex the given element, whatever its kind
- for (Iterator<Entry<String, Set<JaxrsBaseElement>>> iterator = elementsIndex.entrySet().iterator(); iterator
+ for (Iterator<Entry<String, Set<JaxrsBaseElement>>> indexIterator = elementsIndex.entrySet().iterator(); indexIterator
.hasNext();) {
- final Entry<String, Set<JaxrsBaseElement>> entry = iterator.next();
- final Set<JaxrsBaseElement> elements = entry.getValue();
+ final Entry<String, Set<JaxrsBaseElement>> indexEntry = indexIterator.next();
+ final Set<JaxrsBaseElement> indexEntryElements = indexEntry.getValue();
// because the elements.remove(jaxrsElement); does not work here
// (hashcode has changed between the time the jaxrsElement was added
// and now !)
- for (Iterator<JaxrsBaseElement> elementIterator = elements.iterator(); elementIterator.hasNext();) {
- JaxrsBaseElement element = elementIterator.next();
+ for (Iterator<JaxrsBaseElement> indexEntryElementsIterator = indexEntryElements.iterator(); indexEntryElementsIterator.hasNext();) {
+ JaxrsBaseElement element = indexEntryElementsIterator.next();
if (element.equals(jaxrsElement)) {
Logger.trace(" Removing {} from index", element);
- elementIterator.remove();
+ indexEntryElementsIterator.remove();
}
}
- if (elements.isEmpty()) {
- iterator.remove();
+ if (indexEntryElements.isEmpty()) {
+ indexIterator.remove();
}
}
}
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java 2012-05-15 12:25:08 UTC (rev 41023)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java 2012-05-15 12:33:40 UTC (rev 41024)
@@ -11,7 +11,6 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder;
import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertFalse;
@@ -25,7 +24,6 @@
import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
import org.jboss.tools.ws.jaxrs.core.WorkbenchTasks;
import org.jboss.tools.ws.jaxrs.core.WorkbenchUtils;
-import org.jboss.tools.ws.jaxrs.core.configuration.ProjectBuilderUtils;
import org.jboss.tools.ws.jaxrs.core.configuration.ProjectNatureUtils;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsMetamodel;
@@ -58,9 +56,15 @@
JaxrsMetamodel.create(javaProject);
}
assertThat(JaxrsMetamodelLocator.get(javaProject), notNullValue());
- // operation
WorkbenchTasks.buildProject(project, IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
+ JaxrsMetamodelLocator.get(javaProject);
WorkbenchTasks.buildProject(project, IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ JaxrsMetamodelLocator.get(javaProject);
+ // operation: rebuilt the project, including the jaxrs metamodel
+ WorkbenchTasks.buildProject(project, IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ JaxrsMetamodelLocator.get(javaProject);
+ WorkbenchTasks.buildProject(project, IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ JaxrsMetamodelLocator.get(javaProject);
// verification
final IJaxrsMetamodel metamodel = JaxrsMetamodelLocator.get(javaProject);
assertThat(metamodel, notNullValue());
12 years, 8 months
JBoss Tools SVN: r41023 - in trunk/maven: tests/org.jboss.tools.maven.configurators.tests/META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-05-15 08:25:08 -0400 (Tue, 15 May 2012)
New Revision: 41023
Added:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/cdi/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/cdi/deltaspike/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/cdi/deltaspike/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/CDIConfiguratorTest.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF
Log:
JBIDE-11741 : enable CDI support on maven projects having a DeltaSpike dependency
Modified: trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java 2012-05-15 11:47:40 UTC (rev 41022)
+++ trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java 2012-05-15 12:25:08 UTC (rev 41023)
@@ -182,8 +182,11 @@
}
private boolean isKnownCdiExtension(Artifact artifact) {
- return artifact.getGroupId().startsWith("org.jboss.seam.")
- && artifact.getVersion().startsWith("3.");
+ return (artifact.getGroupId().startsWith("org.jboss.seam.")
+ && artifact.getVersion().startsWith("3."))
+ || artifact.getGroupId().startsWith("org.apache.deltaspike.");
+
+
}
}
Modified: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF 2012-05-15 11:47:40 UTC (rev 41022)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF 2012-05-15 12:25:08 UTC (rev 41023)
@@ -17,6 +17,7 @@
org.jboss.tools.maven.jaxrs,
org.jboss.tools.maven.jbosspackaging,
org.jboss.tools.maven.jpa,
+ org.jboss.tools.maven.cdi,
org.jboss.tools.maven.ui,
org.eclipse.wst.server.core,
org.jboss.tools.common,
@@ -31,7 +32,8 @@
org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.2.0)",
org.eclipse.jpt.jpa.core;bundle-version="3.0.1",
org.eclipse.jpt.common.core,
- org.eclipse.jpt.common.utility
+ org.eclipse.jpt.common.utility,
+ org.jboss.tools.cdi.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/cdi/deltaspike/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/cdi/deltaspike/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/cdi/deltaspike/pom.xml 2012-05-15 12:25:08 UTC (rev 41023)
@@ -0,0 +1,14 @@
+<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>
+ <groupId>foo.bar</groupId>
+ <artifactId>deltaspike</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.deltaspike.core</groupId>
+ <artifactId>deltaspike-core-api</artifactId>
+ <version>0.2-incubating</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/CDIConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/CDIConfiguratorTest.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/CDIConfiguratorTest.java 2012-05-15 12:25:08 UTC (rev 41023)
@@ -0,0 +1,48 @@
+/*************************************************************************************
+ * Copyright (c) 2012 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.maven.configurators.tests;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.junit.Test;
+
+@SuppressWarnings("restriction")
+public class CDIConfiguratorTest extends AbstractMavenConfiguratorTest {
+
+ protected static final IProjectFacet MAVEN_FACET = ProjectFacetsManager.getProjectFacet("jboss.m2");
+ protected static final IProjectFacet CDI_FACET = ProjectFacetsManager.getProjectFacet("jst.cdi"); //$NON-NLS-1$
+ protected static final IProjectFacetVersion DEFAULT_CDI_VERSION = CDI_FACET.getVersion("1.0"); //$NON-NLS-1$
+
+ @Test
+ public void testJBIDE11741_deltaSpikeDependency() throws Exception {
+ String projectLocation = "projects/cdi/deltaspike";
+ IProject cdiProject = importProject(projectLocation+"/pom.xml");
+ waitForJobsToComplete();
+ assertNoErrors(cdiProject);
+ assertIsCDIProject(cdiProject, DEFAULT_CDI_VERSION);
+ }
+
+ private void assertIsCDIProject(IProject project, IProjectFacetVersion expectedCdiVersion) throws Exception {
+ assertNoErrors(project);
+ assertTrue("CDI nature is missing", project.hasNature(CDICoreNature.NATURE_ID));
+
+ IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+ if (facetedProject != null) {
+ IProjectFacetVersion cdiVersion = facetedProject.getInstalledVersion(CDI_FACET);
+ assertEquals("Unexpected CDI Version", expectedCdiVersion, cdiVersion);
+ assertTrue("Maven Facet is missing", facetedProject.hasProjectFacet(MAVEN_FACET));
+ }
+ }
+}
12 years, 8 months