JBoss Tools SVN: r3671 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-18 02:21:59 -0400 (Tue, 18 Sep 2007)
New Revision: 3671
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java
Log:
code formatting / organize imports
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java 2007-09-18 06:20:57 UTC (rev 3670)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java 2007-09-18 06:21:59 UTC (rev 3671)
@@ -8,28 +8,24 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView;
public class ViewUtilityMethods {
public static void activatePropertiesView(IPropertySheetPage propertyPage) {
- Object o = JBossServerView.getDefault().getExtensionFrame().getViewer().getSelectedElement();
- if( o instanceof XPathCategory ) {
- // show properties view
- String propsId = "org.eclipse.ui.views.PropertySheet";
- try {
- IWorkbench work = PlatformUI.getWorkbench();
- IWorkbenchWindow window = work.getActiveWorkbenchWindow();
- if( !isPropertiesOnTop()) {
- window.getActivePage().showView(propsId);
- if( propertyPage != null ) {
- propertyPage.selectionChanged(JBossServerView.getDefault().getViewSite().getPart(), JBossServerView.getDefault().getExtensionFrame().getViewer().getSelection());
- }
+ // show properties view
+ String propsId = "org.eclipse.ui.views.PropertySheet";
+ try {
+ IWorkbench work = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = work.getActiveWorkbenchWindow();
+ if( !isPropertiesOnTop()) {
+ window.getActivePage().showView(propsId);
+ if( propertyPage != null ) {
+ propertyPage.selectionChanged(JBossServerView.getDefault().getViewSite().getPart(), JBossServerView.getDefault().getExtensionFrame().getViewer().getSelection());
}
- } catch( PartInitException pie ) {
}
+ } catch( PartInitException pie ) {
}
}
17 years, 3 months
JBoss Tools SVN: r3670 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-18 02:20:57 -0400 (Tue, 18 Sep 2007)
New Revision: 3670
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
Log:
Model classes for JMX added
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-09-18 06:20:57 UTC (rev 3670)
@@ -0,0 +1,296 @@
+package org.jboss.ide.eclipse.as.core.extensions.jmx;
+
+import java.io.IOException;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.naming.InitialContext;
+
+import org.eclipse.wst.server.core.IServer;
+
+public class JMXModel {
+ protected HashMap<String, JMXModelRoot> root;
+
+ public JMXModel() {
+ root = new HashMap<String, JMXModelRoot>();
+ }
+
+ public JMXModelRoot getModel(IServer server) {
+ if (root.get(server.getId()) == null) {
+ JMXModelRoot serverRoot = new JMXModelRoot(server);
+ root.put(server.getId(), serverRoot);
+ }
+ return root.get(server.getId());
+ }
+
+ public void clearModel(IServer server) {
+ root.remove(server.getId());
+ }
+
+
+ public static class JMXModelRoot {
+ protected IServer server;
+ protected JMXDomain[] domains = null;
+ protected JMXException exception = null;
+
+ public JMXModelRoot(IServer server) {
+ this.server = server;
+ }
+
+ public JMXDomain[] getDomains() {
+ return domains;
+ }
+
+ public JMXException getException() {
+ return exception;
+ }
+
+ public void loadDomains() {
+ exception = null;
+ JMXRunnable run = new JMXRunnable() {
+ public void run(MBeanServerConnection connection) {
+ try {
+ String[] domainNames = connection.getDomains();
+ JMXDomain[] domains = new JMXDomain[domainNames.length];
+ for (int i = 0; i < domainNames.length; i++) {
+ domains[i] = new JMXDomain(server, domainNames[i]);
+ }
+ JMXModelRoot.this.domains = domains;
+ } catch (IOException ioe) {
+ exception = new JMXException(ioe);
+ }
+ }
+ };
+ JMXSafeRunner.run(server, run);
+ }
+ }
+
+ public static class JMXDomain {
+ protected String name;
+ protected IServer server;
+ protected JMXBean[] mbeans = null;
+ protected JMXException exception = null;
+
+ public JMXDomain(IServer server, String name) {
+ this.server = server;
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public JMXException getException() {
+ return exception;
+ }
+
+ public JMXBean[] getBeans() {
+ return mbeans;
+ }
+
+ public void resetChildren() {
+ mbeans = null;
+ exception = null;
+ }
+
+ public void loadBeans() {
+ exception = null;
+ JMXRunnable run = new JMXRunnable() {
+ public void run(MBeanServerConnection connection) {
+ try {
+ Set<?> s = connection.queryMBeans(new ObjectName(name
+ + ":*"), null);
+ Iterator<?> i = s.iterator();
+ JMXBean[] beans = new JMXBean[s.size()];
+ int count = 0;
+ while (i.hasNext()) {
+ ObjectInstance tmp = (ObjectInstance) i.next();
+ beans[count++] = new JMXBean(server, tmp);
+ }
+ mbeans = beans;
+ } catch (MalformedObjectNameException mone) {
+ exception = new JMXException(mone);
+ } catch (IOException ioe) {
+ exception = new JMXException(ioe);
+ }
+ }
+ };
+ JMXSafeRunner.run(server, run);
+ }
+ }
+
+ public static class JMXBean {
+ protected String domain;
+ protected String name;
+ protected String clazz;
+ protected IServer server;
+ protected MBeanInfo info;
+ protected JMXException exception;
+
+ public JMXBean(IServer server, ObjectInstance instance) {
+ this.server = server;
+ this.domain = instance.getObjectName().getDomain();
+ this.clazz = instance.getClassName();
+ this.name = instance.getObjectName().getCanonicalName();
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getClazz() {
+ return clazz;
+ }
+
+ public IServer getServer() {
+ return server;
+ }
+
+ public void resetChildren() {
+ info = null;
+ exception = null;
+ }
+
+ public WrappedMBeanOperationInfo[] getOperations() {
+ if (info == null)
+ return null;
+ MBeanOperationInfo[] ops = info.getOperations();
+ WrappedMBeanOperationInfo[] wrappedOps = new WrappedMBeanOperationInfo[ops.length];
+ for (int i = 0; i < ops.length; i++) {
+ wrappedOps[i] = new WrappedMBeanOperationInfo(server, this,
+ ops[i]);
+ }
+ return wrappedOps;
+ }
+
+ public MBeanAttributeInfo[] getAttributes() {
+ return info == null ? null : info.getAttributes();
+ }
+
+ public JMXException getException() {
+ return this.exception;
+ }
+
+ public void loadInfo() {
+ exception = null;
+ JMXRunnable run = new JMXRunnable() {
+ public void run(MBeanServerConnection connection) {
+ Exception tmp = null;
+ try {
+ info = connection.getMBeanInfo(new ObjectName(name));
+ } catch (InstanceNotFoundException e) {
+ tmp = e;
+ } catch (IntrospectionException e) {
+ tmp = e;
+ } catch (MalformedObjectNameException e) {
+ tmp = e;
+ } catch (ReflectionException e) {
+ tmp = e;
+ } catch (NullPointerException e) {
+ tmp = e;
+ } catch (IOException e) {
+ tmp = e;
+ } catch( UndeclaredThrowableException e) {
+ tmp = e;
+ }
+ if (tmp != null) {
+ exception = new JMXException(tmp);
+ }
+ }
+ };
+ JMXSafeRunner.run(server, run);
+ }
+
+ }
+
+ public static class WrappedMBeanOperationInfo {
+ protected IServer server;
+ protected JMXBean bean;
+ protected MBeanOperationInfo info;
+
+ public WrappedMBeanOperationInfo(IServer server, JMXBean bean,
+ MBeanOperationInfo info) {
+ this.server = server;
+ this.bean = bean;
+ this.info = info;
+ }
+ public MBeanOperationInfo getInfo() {
+ return info;
+ }
+ public JMXBean getBean() {
+ return bean;
+ }
+ }
+
+ public static class JMXException extends Exception {
+ private static final long serialVersionUID = 1L;
+ private Exception exception;
+
+ public JMXException(Exception e) {
+ this.exception = e;
+ }
+
+ public Exception getException() {
+ return this.exception;
+ }
+ }
+
+ protected interface JMXRunnable {
+ public void run(MBeanServerConnection connection);
+ }
+
+ public static class JMXSafeRunner {
+ public static void run(IServer s, JMXRunnable r) {
+ ClassLoader currentLoader = Thread.currentThread()
+ .getContextClassLoader();
+ ClassLoader newLoader = JMXClassLoaderRepository.getDefault()
+ .getClassLoader(s);
+ Thread.currentThread().setContextClassLoader(newLoader);
+ InitialContext ic = null;
+ try {
+ JMXUtil.setCredentials(s);
+ Properties p = JMXUtil.getDefaultProperties(s);
+ ic = new InitialContext(p);
+ Object obj = ic.lookup("jmx/invoker/RMIAdaptor");
+ ic.close();
+ if (obj instanceof MBeanServerConnection) {
+ MBeanServerConnection connection = (MBeanServerConnection) obj;
+ r.run(connection);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ Thread.currentThread().setContextClassLoader(currentLoader);
+ }
+ }
+
+ public static class JMXAttributesWrapper {
+ protected JMXBean bean;
+
+ public JMXAttributesWrapper(JMXBean bean) {
+ this.bean = bean;
+ }
+
+ public JMXBean getBean() {
+ return bean;
+ }
+ }
+
+}
17 years, 3 months
JBoss Tools SVN: r3669 - in trunk/seam/plugins/org.jboss.tools.seam.core: templates/ejb and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 21:41:18 -0400 (Mon, 17 Sep 2007)
New Revision: 3669
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
Log:
http://jira.jboss.com/jira/browse/JBIDE-848
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-17 23:35:15 UTC (rev 3668)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-18 01:41:18 UTC (rev 3669)
@@ -516,7 +516,7 @@
try {
ejb.refreshLocal(IResource.DEPTH_INFINITE, monitor);
ear.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- EclipseResourceUtil.addNatureToProject(ejb, ISeamProject.NATURE_ID);
+ // EclipseResourceUtil.addNatureToProject(ejb, ISeamProject.NATURE_ID);
} catch(CoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2007-09-17 23:35:15 UTC (rev 3668)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2007-09-18 01:41:18 UTC (rev 3669)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@</name>
+ <name>@projectName@-ejb</name>
<comment></comment>
<projects>
</projects>
@@ -21,7 +21,7 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
+ <name>org.jboss.tools.seam.core.seambuilder</name>
<arguments>
</arguments>
</buildCommand>
@@ -32,5 +32,6 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.jboss.tools.seam.core.seamnature</nature>
</natures>
</projectDescription>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2007-09-17 23:35:15 UTC (rev 3668)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2007-09-18 01:41:18 UTC (rev 3669)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>lamp-test</name>
+ <name>@projectName@-test</name>
<comment></comment>
<projects>
</projects>
17 years, 3 months
JBoss Tools SVN: r3668 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 19:35:15 -0400 (Mon, 17 Sep 2007)
New Revision: 3668
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
fix JUnit tests errors:
testSeamProjectNewWizardInstanceIsCreate
Failure
Cannot create seam facet wizard page
junit.framework.AssertionFailedError: Cannot create seam facet wizard page
at org.jboss.tools.seam.ui.test.wizard.SeamProjectNewWizardTest.testSeamProjectNewWizardInstanceIsCreated(SeamProjectNewWizardTest.java:49)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:354)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:206)
at org.eclipse.test.UITestApplication$3.run(UITestApplication.java:195)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3296)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2974)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:138)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:60)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:210)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-09-17 23:16:09 UTC (rev 3667)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-09-17 23:35:15 UTC (rev 3668)
@@ -89,7 +89,9 @@
IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
.createComboWithButton(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
- "Seam Runtime", getRuntimeNames(), SeamRuntimeManager.getInstance().getDefaultRuntime().getName(), true, new NewSeamRuntimeAction(), (IValidator)null);
+ "Seam Runtime", getRuntimeNames(),
+ SeamRuntimeManager.getInstance().getDefaultRuntime()==null?"":SeamRuntimeManager.getInstance().getDefaultRuntime().getName(),
+ true, new NewSeamRuntimeAction(), (IValidator)null);
// IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
// .createBrowseFolderEditor(
17 years, 3 months
JBoss Tools SVN: r3667 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 19:16:09 -0400 (Mon, 17 Sep 2007)
New Revision: 3667
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
fix JUnit tests errors
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-17 23:15:52 UTC (rev 3666)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-17 23:16:09 UTC (rev 3667)
@@ -21,6 +21,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -46,6 +47,7 @@
import org.jboss.tools.seam.ui.views.actions.ScopePresentationActionProvider;
import org.jboss.tools.seam.ui.views.actions.SeamViewLayoutActionGroup.SeamContributionItem;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
/**
@@ -66,12 +68,11 @@
RedHat4WebPerspectiveFactory.PERSPECTIVE_ID,
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
TestProjectProvider provider=null;
- try {
- provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null, "TestComponentView", true);
- } catch (Exception e1) {
- JUnitUtils.fail("Cannot create Project Provider", e1);
- }
- project = provider.getProject();
+ project = (IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("TestComponentView");
+
+ if(project==null) {
+ project = ResourcesUtils.importProject(Platform.getBundle("org.jboss.tools.seam.ui.test"), "/projects/TestComponentView", new NullProgressMonitor());
+ }
componentsFile = project.getFile("WebContent/WEB-INF/components.xml");
assertTrue("Cannot find components.xml in test project", componentsFile != null && componentsFile.exists());
}
@@ -79,8 +80,6 @@
public void testAddComponentInXmlFile(){
SeamCorePlugin.getSeamProject(project, true);
- refreshProject(project);
-
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
@@ -578,14 +577,6 @@
System.out.println("Refresh project "+count);
try {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-// waitForJobs();
-// try {
-// waitForJob();
-// } catch (InterruptedException e) {
-// JUnitUtils.fail(e.getMessage(),e);
-// }
-// project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- //waitForJobs();
try {
waitForJob();
} catch (InterruptedException e) {
17 years, 3 months
JBoss Tools SVN: r3666 - in trunk/tests/tests/org.jboss.tools.test: src/org/jboss/tools/test/util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 19:15:52 -0400 (Mon, 17 Sep 2007)
New Revision: 3666
Added:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
Modified:
trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
Log:
fix JUnit tests errors
Modified: trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF 2007-09-17 22:53:10 UTC (rev 3665)
+++ trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF 2007-09-17 23:15:52 UTC (rev 3666)
@@ -7,7 +7,8 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
- org.junit
+ org.junit,
+ org.eclipse.ui.ide
Provide-Package: org.jboss.ide.tests.util
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.test.util,
Added: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java (rev 0)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2007-09-17 23:15:52 UTC (rev 3666)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.test.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ResourcesUtils {
+
+ public static IProject importProject(
+ Bundle bundle, String templLocation,
+ IProgressMonitor monitor)
+ throws
+ IOException, CoreException,
+ InvocationTargetException, InterruptedException {
+
+ String tplPrjLcStr;
+ tplPrjLcStr = FileLocator.resolve(bundle.getEntry(templLocation))
+ .getFile();
+ IProject importedPrj = createEclipseProject(bundle,tplPrjLcStr,monitor);
+ ImportOperation op = new ImportOperation(importedPrj.getFullPath(),
+ new File(tplPrjLcStr),
+ FileSystemStructureProvider.INSTANCE,
+ new IOverwriteQuery() {
+ public String queryOverwrite(String pathString) {
+ return IOverwriteQuery.ALL;
+ }},
+ Arrays.asList(new File(tplPrjLcStr).listFiles()));
+
+ op.setCreateContainerStructure(false);
+ op.setContext(Display.getCurrent().getActiveShell());
+ op.run(monitor);
+ Job j = new Job("+++++++++++test"){/* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ System.out.println("++++++++++Running a decorator.job");
+ return Status.OK_STATUS;
+ }};
+ j.setUser(true);
+ j.setPriority(Job.DECORATE);
+ j.schedule();
+ return importedPrj;
+ }
+
+ public static IProject createEclipseProject(String projectName,
+ IProgressMonitor monitor) throws CoreException {
+
+ IProject newProjectHandle = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(projectName);
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProjectDescription description = workspace
+ .newProjectDescription(projectName);
+ newProjectHandle.create(description, new NullProgressMonitor());
+ newProjectHandle.open(monitor);
+ return newProjectHandle;
+ }
+
+ public static IProject createEclipseProject(Bundle bundle,
+ String templateLocation, IProgressMonitor monitor)
+ throws CoreException, IOException {
+
+ IPath tplPrjDescr = new Path(templateLocation)
+ .append(IProjectDescription.DESCRIPTION_FILE_NAME);
+ IProjectDescription descr = ResourcesPlugin.getWorkspace()
+ .loadProjectDescription(tplPrjDescr);
+ descr.setLocation(null);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ descr.getName());
+ project.create(descr, monitor);
+ project.open(IResource.BACKGROUND_REFRESH, monitor);
+
+ return project;
+ }
+}
Property changes on: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2007-09-17 22:53:10 UTC (rev 3665)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2007-09-17 23:15:52 UTC (rev 3666)
@@ -197,4 +197,5 @@
// jbwsNS+"libs"
// });
}
+
}
17 years, 3 months
JBoss Tools SVN: r3665 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 18:53:10 -0400 (Mon, 17 Sep 2007)
New Revision: 3665
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
Log:
fix JUnit tests errors:
testGetRuntimes Failure Seam runtime 'Seam 1.2.0' is not created
junit.framework.AssertionFailedError: Seam runtime 'Seam 1.2.0' is not created
at org.jboss.tools.seam.core.test.project.facet.SeamRuntimeManagerTest.testGetRuntimes(SeamRuntimeManagerTest.java:52)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:354)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:206)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:533)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:155)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
at org.eclipse.core.launcher.Main.main(Main.java:30)
testGetRuntimesSeamVersion Failure Error in obtaining seam runtimes lis for Seam 1.2
junit.framework.AssertionFailedError: Error in obtaining seam runtimes lis for Seam 1.2
at org.jboss.tools.seam.core.test.project.facet.SeamRuntimeManagerTest.testGetRuntimesSeamVersion(SeamRuntimeManagerTest.java:62)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:354)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:206)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:533)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:155)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
at org.eclipse.core.launcher.Main.main(Main.java:30)
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java 2007-09-17 21:00:59 UTC (rev 3664)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java 2007-09-17 22:53:10 UTC (rev 3665)
@@ -49,7 +49,7 @@
*/
public void testGetRuntimes() throws IOException {
SeamRuntime[] rtms = manager.getRuntimes();
- assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms.length!=1);
+ assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms.length==1);
assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms[0].getName().equals("Seam 1.2.0"));
}
@@ -59,7 +59,7 @@
public void testGetRuntimesSeamVersion() {
SeamRuntimeManager manager = SeamRuntimeManager.getInstance();
SeamRuntime[] rtms = manager.getRuntimes(SeamVersion.SEAM_1_2);
- assertTrue("Error in obtaining seam runtimes lis for Seam 1.2", rtms.length!=1);
+ assertTrue("Error in obtaining seam runtimes lis for Seam 1.2", rtms.length==1);
}
/**
17 years, 3 months
JBoss Tools SVN: r3664 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 17:00:59 -0400 (Mon, 17 Sep 2007)
New Revision: 3664
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
Log:
fix JUnit tests errors
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-09-17 19:29:22 UTC (rev 3663)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-09-17 21:00:59 UTC (rev 3664)
@@ -88,11 +88,10 @@
* @param runtime
*/
public void addRuntime(SeamRuntime runtime) {
- runtimes.put(runtime.getName(),runtime);
if(getDefaultRuntime()!=null && runtime.isDefault()) {
getDefaultRuntime().setDefault(false);
}
-
+ runtimes.put(runtime.getName(),runtime);
save();
}
17 years, 3 months
JBoss Tools SVN: r3663 - trunk/seam/tests/org.jboss.tools.seam.core.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 15:29:22 -0400 (Mon, 17 Sep 2007)
New Revision: 3663
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/build.properties
Log:
Fix JUnit Tests error
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/build.properties
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/build.properties 2007-09-17 16:17:15 UTC (rev 3662)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/build.properties 2007-09-17 19:29:22 UTC (rev 3663)
@@ -1,12 +1,17 @@
bin.includes = META-INF/,\
seam-core-tests.jar,\
projects/,\
- info.xml
+ info.xml,\
+ seam/,\
+ about.html,\
+ ant.properties
src.includes = META-INF/,\
ant.properties,\
build.properties,\
info.xml,\
src/,\
- projects/
+ projects/,\
+ seam/,\
+ about.html
source.seam-core-tests.jar = src/
jars.compile.order = seam-core-tests.jar
17 years, 3 months
JBoss Tools SVN: r3662 - in trunk/documentation/qa/emma: reports and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 12:17:15 -0400 (Mon, 17 Sep 2007)
New Revision: 3662
Added:
trunk/documentation/qa/emma/reports/
trunk/documentation/qa/emma/reports/smoke-20070913-coverage.zip
Log:
coverage report for smoke 20070913
Added: trunk/documentation/qa/emma/reports/smoke-20070913-coverage.zip
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/emma/reports/smoke-20070913-coverage.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months