JBoss Tools SVN: r32282 - branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:05:27 -0400 (Wed, 22 Jun 2011)
New Revision: 32282
Modified:
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-9216
JPA: Null text range in GenericGenerator validation process
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java 2011-06-22 12:04:52 UTC (rev 32281)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java 2011-06-22 12:05:27 UTC (rev 32282)
@@ -55,10 +55,12 @@
private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private DeclarationAnnotationElementAdapter<String> strategyDeclarationAdapter;
private AnnotationElementAdapter<String> strategyAdapter;
private String strategy;
+ private TextRange strategyTextRange;
final Vector<NestableParameterAnnotation> parameters = new Vector<NestableParameterAnnotation>();
final ParametersAnnotationContainer parametersContainer = new ParametersAnnotationContainer();
@@ -78,13 +80,17 @@
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.strategy = this.buildStrategy(astRoot);
+ this.strategyTextRange = this.buildStrategyTextRange(astRoot);
AnnotationContainerTools.initialize(this.parametersContainer, astRoot);
}
public void synchronizeWith(CompilationUnit astRoot) {
this.syncName(this.buildName(astRoot));
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.syncStrategy(this.buildStrategy(astRoot));
+ this.strategyTextRange = this.buildStrategyTextRange(astRoot);
AnnotationContainerTools.synchronize(this.parametersContainer, astRoot);
}
@@ -127,10 +133,18 @@
}
public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.nameTextRange;
+ }
+
+ private TextRange buildNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
public TextRange getStrategyTextRange(CompilationUnit astRoot) {
+ return this.strategyTextRange;
+ }
+
+ private TextRange buildStrategyTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.strategyDeclarationAdapter, astRoot);
}
14 years, 9 months
JBoss Tools SVN: r32281 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:04:52 -0400 (Wed, 22 Jun 2011)
New Revision: 32281
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
Log:
https://issues.jboss.org/browse/JBIDE-9218
JPA: Null text range in HibernateQuery validation process
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java 2011-06-22 12:04:36 UTC (rev 32280)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java 2011-06-22 12:04:52 UTC (rev 32281)
@@ -53,6 +53,7 @@
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
private final AnnotationElementAdapter<String> queryAdapter;
@@ -147,6 +148,7 @@
@Override
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.query = this.buildQuery(astRoot);
this.flushMode = this.buildFlushMode(astRoot);
this.cacheMode = this.buildCacheMode(astRoot);
@@ -164,6 +166,7 @@
@Override
public void synchronizeWith(CompilationUnit astRoot) {
this.syncName(this.buildName(astRoot));
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.syncQuery(this.buildQuery(astRoot));
this.syncFlushMode(this.buildFlushMode(astRoot));
this.syncCacheMode(this.buildCacheMode(astRoot));
@@ -215,6 +218,10 @@
@Override
public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.nameTextRange;
+ }
+
+ private TextRange buildNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java 2011-06-22 12:04:36 UTC (rev 32280)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java 2011-06-22 12:04:52 UTC (rev 32281)
@@ -51,6 +51,7 @@
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
private final AnnotationElementAdapter<String> queryAdapter;
@@ -121,6 +122,7 @@
@Override
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.query = this.buildQuery(astRoot);
this.flushMode = this.buildFlushMode(astRoot);
this.cacheMode = this.buildCacheMode(astRoot);
@@ -135,6 +137,7 @@
@Override
public void synchronizeWith(CompilationUnit astRoot) {
this.syncName(this.buildName(astRoot));
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.syncQuery(this.buildQuery(astRoot));
this.syncFlushMode(this.buildFlushMode(astRoot));
this.syncCacheMode(this.buildCacheMode(astRoot));
@@ -178,12 +181,16 @@
private String buildName(CompilationUnit astRoot) {
return this.nameAdapter.getValue(astRoot);
}
-
+
@Override
public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.nameTextRange;
+ }
+
+ private TextRange buildNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
-
+
// ***** query
@Override
public String getQuery() {
14 years, 9 months
JBoss Tools SVN: r32280 - branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:04:36 -0400 (Wed, 22 Jun 2011)
New Revision: 32280
Modified:
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
Log:
https://issues.jboss.org/browse/JBIDE-9218
JPA: Null text range in HibernateQuery validation process
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java 2011-06-22 12:03:47 UTC (rev 32279)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java 2011-06-22 12:04:36 UTC (rev 32280)
@@ -53,6 +53,7 @@
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
private final AnnotationElementAdapter<String> queryAdapter;
@@ -147,6 +148,7 @@
@Override
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.query = this.buildQuery(astRoot);
this.flushMode = this.buildFlushMode(astRoot);
this.cacheMode = this.buildCacheMode(astRoot);
@@ -164,6 +166,7 @@
@Override
public void synchronizeWith(CompilationUnit astRoot) {
this.syncName(this.buildName(astRoot));
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.syncQuery(this.buildQuery(astRoot));
this.syncFlushMode(this.buildFlushMode(astRoot));
this.syncCacheMode(this.buildCacheMode(astRoot));
@@ -215,6 +218,10 @@
@Override
public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.nameTextRange;
+ }
+
+ private TextRange buildNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java 2011-06-22 12:03:47 UTC (rev 32279)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java 2011-06-22 12:04:36 UTC (rev 32280)
@@ -51,6 +51,7 @@
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
private final AnnotationElementAdapter<String> queryAdapter;
@@ -121,6 +122,7 @@
@Override
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.query = this.buildQuery(astRoot);
this.flushMode = this.buildFlushMode(astRoot);
this.cacheMode = this.buildCacheMode(astRoot);
@@ -135,6 +137,7 @@
@Override
public void synchronizeWith(CompilationUnit astRoot) {
this.syncName(this.buildName(astRoot));
+ this.nameTextRange = this.buildNameTextRange(astRoot);
this.syncQuery(this.buildQuery(astRoot));
this.syncFlushMode(this.buildFlushMode(astRoot));
this.syncCacheMode(this.buildCacheMode(astRoot));
@@ -178,12 +181,16 @@
private String buildName(CompilationUnit astRoot) {
return this.nameAdapter.getValue(astRoot);
}
-
+
@Override
public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.nameTextRange;
+ }
+
+ private TextRange buildNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
-
+
// ***** query
@Override
public String getQuery() {
14 years, 9 months
JBoss Tools SVN: r32279 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:03:47 -0400 (Wed, 22 Jun 2011)
New Revision: 32279
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-9222
JPA: GenericGenerator composite doesn't update when switch between classes
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java 2011-06-22 12:03:24 UTC (rev 32278)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java 2011-06-22 12:03:47 UTC (rev 32279)
@@ -63,6 +63,7 @@
super.doPopulate();
this.genericGeneratorExpansionStateHolder .setValue(Boolean.valueOf(getSubject() != null
&& getSubject().genericGeneratorsSize() > 0));
+ this.generatorHolder.setValue(getSubject() != null && getSubject().genericGeneratorsSize() > 0 ? getSubject().genericGenerators().next() : null);
}
@Override
14 years, 9 months
JBoss Tools SVN: r32278 - branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 08:03:24 -0400 (Wed, 22 Jun 2011)
New Revision: 32278
Modified:
branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-9222
JPA: GenericGenerator composite doesn't update when switch between classes
Modified: branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java
===================================================================
--- branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java 2011-06-22 09:54:31 UTC (rev 32277)
+++ branches/jbosstools-3.3.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java 2011-06-22 12:03:24 UTC (rev 32278)
@@ -63,6 +63,7 @@
super.doPopulate();
this.genericGeneratorExpansionStateHolder .setValue(Boolean.valueOf(getSubject() != null
&& getSubject().genericGeneratorsSize() > 0));
+ this.generatorHolder.setValue(getSubject() != null && getSubject().genericGeneratorsSize() > 0 ? getSubject().genericGenerators().next() : null);
}
@Override
14 years, 9 months
JBoss Tools SVN: r32277 - in branches/jbosstools-3.3.0.M2/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7 and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-22 05:54:31 -0400 (Wed, 22 Jun 2011)
New Revision: 32277
Modified:
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
/JBIDE-9210 to branch (last minute addition, woohoo)
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -130,6 +130,7 @@
*/
public JBoss7ServerState getServerState(String host, int port) throws Exception;
+ @Deprecated
public JBoss7ServerState getServerState(String host) throws Exception;
/**
@@ -140,6 +141,7 @@
*/
public void stop(String host, int port) throws Exception;
+ @Deprecated
public void stop(String host) throws Exception;
public void dispose();
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -15,6 +15,7 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
@@ -48,6 +49,13 @@
return server;
}
+ private int getManagementPort() {
+ JBoss7Server server = (JBoss7Server)getServer().loadAdapter(JBoss7Server.class, new NullProgressMonitor());
+ if( server != null )
+ return server.getManagementPort();
+ return 9999;
+ }
+
public boolean isComplete() throws PollingException, RequiresInfoException {
IJBoss7ManagerService service = null;
try {
@@ -68,7 +76,7 @@
try {
JBoss7ServerState serverState = null;
do {
- serverState = service.getServerState(getServer().getHost());
+ serverState = service.getServerState(getServer().getHost(), getManagementPort());
} while (serverState == JBoss7ServerState.STARTING);
return serverState == JBoss7ServerState.RUNNING;
} catch (Exception e) {
@@ -80,7 +88,7 @@
try {
JBoss7ServerState serverState = null;
do {
- serverState = service.getServerState(getServer().getHost());
+ serverState = service.getServerState(getServer().getHost(), getManagementPort());
} while (serverState == JBoss7ServerState.RUNNING);
return false;
} catch (JBoss7ManangerConnectException e) {
@@ -100,7 +108,7 @@
IJBoss7ManagerService service = null;
try {
service = JBoss7ManagerUtil.getService(getServer());
- JBoss7ServerState serverState = service.getServerState(getServer().getHost());
+ JBoss7ServerState serverState = service.getServerState(getServer().getHost(), getManagementPort());
return serverState == JBoss7ServerState.RUNNING
|| serverState == JBoss7ServerState.RESTART_REQUIRED;
} catch (Exception e) {
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -47,6 +47,7 @@
return checkedGetService().getServerState(host, port);
}
+ @Deprecated
public JBoss7ServerState getServerState(String host) throws Exception {
return checkedGetService().getServerState(host);
}
@@ -55,6 +56,7 @@
checkedGetService().stop(host, port);
}
+ @Deprecated
public void stop(String host) throws Exception {
checkedGetService().stop(host);
}
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -33,6 +33,11 @@
return false;
}
+ public int getManagementPort() {
+ return findPort(AS7_MANAGEMENT_PORT, AS7_MANAGEMENT_PORT_DETECT, AS7_MANAGEMENT_PORT_DETECT_XPATH,
+ AS7_MANAGEMENT_PORT_DEFAULT_XPATH, AS7_MANAGEMENT_PORT_DEFAULT_PORT);
+ }
+
@Override
public String getDeployLocationType() {
return getAttribute(DEPLOY_DIRECTORY_TYPE, DEPLOY_SERVER);
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -20,6 +20,7 @@
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.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugEvent;
@@ -68,6 +69,10 @@
return delegateClassMap;
}
+ private JBoss7Server getJBoss7Server() {
+ return (JBoss7Server)getServer().loadAdapter(JBoss7Server.class, new NullProgressMonitor());
+ }
+
public boolean shouldSuspendScanner() {
return false;
}
@@ -143,9 +148,9 @@
return service;
}
- private boolean isServerRunning(String host) throws Exception {
+ private boolean isServerRunning(String host, int port) throws Exception {
try {
- return getService().getServerState(host) == JBoss7ServerState.RUNNING;
+ return getService().getServerState(host, port) == JBoss7ServerState.RUNNING;
} catch (JBoss7ManangerConnectException e) {
return false;
}
@@ -165,9 +170,9 @@
} else {
serverStopping();
// TODO: for now only local, implement for remote afterwards
- if (isServerRunning(getServer().getHost())) {
+ if (isServerRunning(getServer().getHost(), getJBoss7Server().getManagementPort())) {
// The service and Poller will make sure the server is down
- getService().stop(getServer().getHost());
+ getService().stop(getServer().getHost(), getJBoss7Server().getManagementPort());
return;
} else {
if( serverProcess != null && !serverProcess.isTerminated()) {
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -87,15 +87,23 @@
public static final String SERVER_USERNAME = "org.jboss.ide.eclipse.as.core.server.userName"; //$NON-NLS-1$
public static final String SERVER_PASSWORD = "org.jboss.ide.eclipse.as.core.server.password"; //$NON-NLS-1$
public static final String JNDI_PORT = "org.jboss.ide.eclipse.as.core.server.jndiPort"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DETECT = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JNDI"; //$NON-NLS-1$
+ public static final int JNDI_DEFAULT_PORT = 1099;
+
public static final String WEB_PORT = "org.jboss.ide.eclipse.as.core.server.webPort"; //$NON-NLS-1$
- public static final String JNDI_PORT_DETECT = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect"; //$NON-NLS-1$
public static final String WEB_PORT_DETECT= "org.jboss.ide.eclipse.as.core.server.webPortAutoDetect"; //$NON-NLS-1$
- public static final String JNDI_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath"; //$NON-NLS-1$
public static final String WEB_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.webPortAutoDetect.XPath"; //$NON-NLS-1$
- public static final String JNDI_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JNDI"; //$NON-NLS-1$
public static final String WEB_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JBoss Web"; //$NON-NLS-1$
- public static final int JNDI_DEFAULT_PORT = 1099;
- public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
+ public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
+
+ public static final String AS7_MANAGEMENT_PORT = "org.jboss.ide.eclipse.as.core.server.as7.managementPort"; //$NON-NLS-1$
+ public static final String AS7_MANAGEMENT_PORT_DETECT= "org.jboss.ide.eclipse.as.core.server.as7.managementPortAutoDetect"; //$NON-NLS-1$
+ public static final String AS7_MANAGEMENT_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.as7.managementPortAutoDetect.XPath"; //$NON-NLS-1$
+ public static final String AS7_MANAGEMENT_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JBoss Management"; //$NON-NLS-1$
+ public static final int AS7_MANAGEMENT_PORT_DEFAULT_PORT = 9999;
+
public static final String IGNORE_LAUNCH_COMMANDS = "org.jboss.ide.eclipse.as.core.server.IGNORE_LAUNCH_COMMANDS"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_NAME = "name"; //$NON-NLS-1$
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties 2011-06-22 09:54:31 UTC (rev 32277)
@@ -1,3 +1,6 @@
JBoss_Web=//*[@name="standard-sockets"]/*[@name="http"]
JBoss_Web_FILE=standalone/configuration/standalone.xml
-JBoss_Web_ATTRIBUTE=port
\ No newline at end of file
+JBoss_Web_ATTRIBUTE=port
+JBoss_Management=//*[local-name()="management-interfaces"]/*[local-name()="native-interface"]
+JBoss_Management_ATTRIBUTE=port
+JBoss_Management_FILE=standalone/configuration/standalone.xml
\ No newline at end of file
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -52,17 +52,19 @@
return manager.getDeploymentState(deploymentName);
}
+ @Deprecated
+ public JBoss7ServerState getServerState(String host) throws Exception {
+ return getServerState(host, AS7Manager.MGMT_PORT);
+ }
+
public JBoss7ServerState getServerState(String host, int port) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.getServerState();
}
- public JBoss7ServerState getServerState(String host) throws Exception {
- return new AS7Manager(host).getServerState();
- }
-
+ @Deprecated
public void stop(String host) throws Exception {
- new AS7Manager(host).stopServer();
+ stop(host, AS7Manager.MGMT_PORT);
}
public void stop(String host, int port) throws Exception {
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -198,11 +198,13 @@
public static String EditorJNDIPort;
public static String EditorWebPort;
public static String EditorJMXRMIPort;
+ public static String EditorAS7ManagementPort;
public static String EditorAutomaticallyDetectPort;
public static String EditorPortInvalid;
public static String EditorChangeJNDICommandName;
public static String EditorChangeWebCommandName;
public static String EditorChangeJMXRMICommandName;
+ public static String EditorChangeAS7ManagementCommandName;
public static String EditorChangeUsernameCommandName;
public static String EditorChangePasswordCommandName;
public static String EditorCPD_Value;
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-06-22 09:54:31 UTC (rev 32277)
@@ -168,14 +168,16 @@
EditorChangeStopPollerCommandName=Change Shutdown Poller
EditorServerPorts=Server Ports
EditorServerPortsDescription=The ports entered here are which ports the tools\nwill poll the server on. Changing these fields\nwill not change the ports the server itself listens on.
-EditorJNDIPort=JNDI Port
-EditorWebPort=Web Port
-EditorJMXRMIPort=JMX RMI Port
+EditorJNDIPort=JNDI
+EditorWebPort=Web
+EditorJMXRMIPort=JMX RMI
+EditorAS7ManagementPort=Management
EditorAutomaticallyDetectPort=Automatically detect
EditorPortInvalid=One or more ports have an invalid value. This may adversely affect the tooling's ability to interact with the server.
EditorChangeJNDICommandName=Change JNDI Port Details
EditorChangeWebCommandName=Change Web Port Details
EditorChangeJMXRMICommandName=Change JMX RMI Port Details
+EditorChangeAS7ManagementCommandName=Change AS7 Management Port Details
EditorChangeUsernameCommandName=Change Username
EditorChangePasswordCommandName=Change Password
EditorCPD_Value=Current Value
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-06-22 09:54:31 UTC (rev 32277)
@@ -50,6 +50,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBoss6Server;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.dialogs.ChangePortDialog;
@@ -141,7 +142,18 @@
}
}
+ public static class JBoss7ManagementPortEditorExtension extends PortEditorExtension {
+ public JBoss7ManagementPortEditorExtension() {
+ super(Messages.EditorAS7ManagementPort,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT_DETECT_XPATH,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT_DETECT,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_XPATH,
+ Messages.EditorChangeAS7ManagementCommandName);
+ }
+ }
+
public static abstract class PortEditorExtension implements IPortEditorExtension {
protected Button detect;
protected Text text;
Modified: branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-06-22 09:06:44 UTC (rev 32276)
+++ branches/jbosstools-3.3.0.M2/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-06-22 09:54:31 UTC (rev 32277)
@@ -281,6 +281,10 @@
class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JBoss6JMXRMIPortEditorExtension"
serverIds="org.jboss.ide.eclipse.as.60">
</section>
+ <section
+ class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JBoss7ManagementPortEditorExtension"
+ serverIds="org.jboss.ide.eclipse.as.70">
+ </section>
</extension>
14 years, 9 months
JBoss Tools SVN: r32276 - in trunk/documentation/whatsnew/hibernate: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-06-22 05:06:44 -0400 (Wed, 22 Jun 2011)
New Revision: 32276
Added:
trunk/documentation/whatsnew/hibernate/images/database_icon_decorator.jpg
trunk/documentation/whatsnew/hibernate/images/import_hibernate_jar.jpg
trunk/documentation/whatsnew/hibernate/images/import_hibernate_jar2.jpg
trunk/documentation/whatsnew/hibernate/images/strategy_completion_proposals.png
Modified:
trunk/documentation/whatsnew/hibernate/hibernate-news-3.5.0.M1.html
Log:
https://issues.jboss.org/browse/JBIDE-9160
Updated documantation
Modified: trunk/documentation/whatsnew/hibernate/hibernate-news-3.5.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/hibernate/hibernate-news-3.5.0.M1.html 2011-06-22 08:37:54 UTC (rev 32275)
+++ trunk/documentation/whatsnew/hibernate/hibernate-news-3.5.0.M1.html 2011-06-22 09:06:44 UTC (rev 32276)
@@ -37,16 +37,33 @@
</tr>
<tr>
- <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Validate @TypeDef</b></td>
+ <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Validate @Type</b></td>
<td valign="top">
- <p>Added validation of org.hibernate.annotation.TypeDef annotation (typeClass attribute).</p>
+ <p>Added validation of org.hibernate.annotation.Type annotation. The type attribute should contain either a name of the class
+ which implements UserType interface either a type name which is defined by @TypeDef annotation.</p>
- <p><small><a href="https://jira.jboss.org/browse/JBIDE-8239">Related jira</a></p>
+ <p><small><a href="https://jira.jboss.org/browse/JBIDE-8238">Related jira</a></p>
</td>
</tr>
+
+ <tr>
+ <td colspan="2">
+ </td>
+ </tr>
<tr>
+ <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Completion Proposals</b></td>
+ <td valign="top">
+ <p>Built-in strategies added to @GenericGenerator strategy attribute completion proposals.</p>
+ <p><img src="images/strategy_completion_proposals.png"/></p>
+
+ <p><small><a href="https://jira.jboss.org/browse/JBIDE-8470">Related jira</a></p>
+
+ </td>
+ </tr>
+
+ <tr>
<td colspan="2">
<hr/>
<h3>Hibernate libraries</h3>
Added: trunk/documentation/whatsnew/hibernate/images/database_icon_decorator.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/hibernate/images/database_icon_decorator.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/hibernate/images/import_hibernate_jar.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/hibernate/images/import_hibernate_jar.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/hibernate/images/import_hibernate_jar2.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/hibernate/images/import_hibernate_jar2.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/hibernate/images/strategy_completion_proposals.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/hibernate/images/strategy_completion_proposals.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 9 months
JBoss Tools SVN: r32275 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7 and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-22 04:37:54 -0400 (Wed, 22 Jun 2011)
New Revision: 32275
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-9210 - no more hard coding management port
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBoss7ManagerService.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -130,6 +130,7 @@
*/
public JBoss7ServerState getServerState(String host, int port) throws Exception;
+ @Deprecated
public JBoss7ServerState getServerState(String host) throws Exception;
/**
@@ -140,6 +141,7 @@
*/
public void stop(String host, int port) throws Exception;
+ @Deprecated
public void stop(String host) throws Exception;
public void dispose();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -15,6 +15,7 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
@@ -48,6 +49,13 @@
return server;
}
+ private int getManagementPort() {
+ JBoss7Server server = (JBoss7Server)getServer().loadAdapter(JBoss7Server.class, new NullProgressMonitor());
+ if( server != null )
+ return server.getManagementPort();
+ return 9999;
+ }
+
public boolean isComplete() throws PollingException, RequiresInfoException {
IJBoss7ManagerService service = null;
try {
@@ -68,7 +76,7 @@
try {
JBoss7ServerState serverState = null;
do {
- serverState = service.getServerState(getServer().getHost());
+ serverState = service.getServerState(getServer().getHost(), getManagementPort());
} while (serverState == JBoss7ServerState.STARTING);
return serverState == JBoss7ServerState.RUNNING;
} catch (Exception e) {
@@ -80,7 +88,7 @@
try {
JBoss7ServerState serverState = null;
do {
- serverState = service.getServerState(getServer().getHost());
+ serverState = service.getServerState(getServer().getHost(), getManagementPort());
} while (serverState == JBoss7ServerState.RUNNING);
return false;
} catch (JBoss7ManangerConnectException e) {
@@ -100,7 +108,7 @@
IJBoss7ManagerService service = null;
try {
service = JBoss7ManagerUtil.getService(getServer());
- JBoss7ServerState serverState = service.getServerState(getServer().getHost());
+ JBoss7ServerState serverState = service.getServerState(getServer().getHost(), getManagementPort());
return serverState == JBoss7ServerState.RUNNING
|| serverState == JBoss7ServerState.RESTART_REQUIRED;
} catch (Exception e) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServiceProxy.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -47,6 +47,7 @@
return checkedGetService().getServerState(host, port);
}
+ @Deprecated
public JBoss7ServerState getServerState(String host) throws Exception {
return checkedGetService().getServerState(host);
}
@@ -55,6 +56,7 @@
checkedGetService().stop(host, port);
}
+ @Deprecated
public void stop(String host) throws Exception {
checkedGetService().stop(host);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -33,6 +33,11 @@
return false;
}
+ public int getManagementPort() {
+ return findPort(AS7_MANAGEMENT_PORT, AS7_MANAGEMENT_PORT_DETECT, AS7_MANAGEMENT_PORT_DETECT_XPATH,
+ AS7_MANAGEMENT_PORT_DEFAULT_XPATH, AS7_MANAGEMENT_PORT_DEFAULT_PORT);
+ }
+
@Override
public String getDeployLocationType() {
return getAttribute(DEPLOY_DIRECTORY_TYPE, DEPLOY_SERVER);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -20,6 +20,7 @@
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.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugEvent;
@@ -65,6 +66,10 @@
return delegateClassMap;
}
+ private JBoss7Server getJBoss7Server() {
+ return (JBoss7Server)getServer().loadAdapter(JBoss7Server.class, new NullProgressMonitor());
+ }
+
public boolean shouldSuspendScanner() {
return false;
}
@@ -139,9 +144,9 @@
return service;
}
- private boolean isServerRunning(String host) throws Exception {
+ private boolean isServerRunning(String host, int port) throws Exception {
try {
- return getService().getServerState(host) == JBoss7ServerState.RUNNING;
+ return getService().getServerState(host, port) == JBoss7ServerState.RUNNING;
} catch (JBoss7ManangerConnectException e) {
return false;
}
@@ -161,9 +166,9 @@
} else {
serverStopping();
// TODO: for now only local, implement for remote afterwards
- if (isServerRunning(getServer().getHost())) {
+ if (isServerRunning(getServer().getHost(), getJBoss7Server().getManagementPort())) {
// The service and Poller will make sure the server is down
- getService().stop(getServer().getHost());
+ getService().stop(getServer().getHost(), getJBoss7Server().getManagementPort());
return;
} else {
if( serverProcess != null && !serverProcess.isTerminated()) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -87,15 +87,23 @@
public static final String SERVER_USERNAME = "org.jboss.ide.eclipse.as.core.server.userName"; //$NON-NLS-1$
public static final String SERVER_PASSWORD = "org.jboss.ide.eclipse.as.core.server.password"; //$NON-NLS-1$
public static final String JNDI_PORT = "org.jboss.ide.eclipse.as.core.server.jndiPort"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DETECT = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JNDI"; //$NON-NLS-1$
+ public static final int JNDI_DEFAULT_PORT = 1099;
+
public static final String WEB_PORT = "org.jboss.ide.eclipse.as.core.server.webPort"; //$NON-NLS-1$
- public static final String JNDI_PORT_DETECT = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect"; //$NON-NLS-1$
public static final String WEB_PORT_DETECT= "org.jboss.ide.eclipse.as.core.server.webPortAutoDetect"; //$NON-NLS-1$
- public static final String JNDI_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath"; //$NON-NLS-1$
public static final String WEB_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.webPortAutoDetect.XPath"; //$NON-NLS-1$
- public static final String JNDI_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JNDI"; //$NON-NLS-1$
public static final String WEB_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JBoss Web"; //$NON-NLS-1$
- public static final int JNDI_DEFAULT_PORT = 1099;
- public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
+ public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
+
+ public static final String AS7_MANAGEMENT_PORT = "org.jboss.ide.eclipse.as.core.server.as7.managementPort"; //$NON-NLS-1$
+ public static final String AS7_MANAGEMENT_PORT_DETECT= "org.jboss.ide.eclipse.as.core.server.as7.managementPortAutoDetect"; //$NON-NLS-1$
+ public static final String AS7_MANAGEMENT_PORT_DETECT_XPATH = "org.jboss.ide.eclipse.as.core.server.as7.managementPortAutoDetect.XPath"; //$NON-NLS-1$
+ public static final String AS7_MANAGEMENT_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR + "JBoss Management"; //$NON-NLS-1$
+ public static final int AS7_MANAGEMENT_PORT_DEFAULT_PORT = 9999;
+
public static final String IGNORE_LAUNCH_COMMANDS = "org.jboss.ide.eclipse.as.core.server.IGNORE_LAUNCH_COMMANDS"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_NAME = "name"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties 2011-06-22 08:37:54 UTC (rev 32275)
@@ -1,3 +1,6 @@
JBoss_Web=//*[@name="standard-sockets"]/*[@name="http"]
JBoss_Web_FILE=standalone/configuration/standalone.xml
-JBoss_Web_ATTRIBUTE=port
\ No newline at end of file
+JBoss_Web_ATTRIBUTE=port
+JBoss_Management=//*[local-name()="management-interfaces"]/*[local-name()="native-interface"]
+JBoss_Management_ATTRIBUTE=port
+JBoss_Management_FILE=standalone/configuration/standalone.xml
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7ManagerService.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -52,17 +52,19 @@
return manager.getDeploymentState(deploymentName);
}
+ @Deprecated
+ public JBoss7ServerState getServerState(String host) throws Exception {
+ return getServerState(host, AS7Manager.MGMT_PORT);
+ }
+
public JBoss7ServerState getServerState(String host, int port) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.getServerState();
}
- public JBoss7ServerState getServerState(String host) throws Exception {
- return new AS7Manager(host).getServerState();
- }
-
+ @Deprecated
public void stop(String host) throws Exception {
- new AS7Manager(host).stopServer();
+ stop(host, AS7Manager.MGMT_PORT);
}
public void stop(String host, int port) throws Exception {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -198,11 +198,13 @@
public static String EditorJNDIPort;
public static String EditorWebPort;
public static String EditorJMXRMIPort;
+ public static String EditorAS7ManagementPort;
public static String EditorAutomaticallyDetectPort;
public static String EditorPortInvalid;
public static String EditorChangeJNDICommandName;
public static String EditorChangeWebCommandName;
public static String EditorChangeJMXRMICommandName;
+ public static String EditorChangeAS7ManagementCommandName;
public static String EditorChangeUsernameCommandName;
public static String EditorChangePasswordCommandName;
public static String EditorCPD_Value;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-06-22 08:37:54 UTC (rev 32275)
@@ -168,14 +168,16 @@
EditorChangeStopPollerCommandName=Change Shutdown Poller
EditorServerPorts=Server Ports
EditorServerPortsDescription=The ports entered here are which ports the tools\nwill poll the server on. Changing these fields\nwill not change the ports the server itself listens on.
-EditorJNDIPort=JNDI Port
-EditorWebPort=Web Port
-EditorJMXRMIPort=JMX RMI Port
+EditorJNDIPort=JNDI
+EditorWebPort=Web
+EditorJMXRMIPort=JMX RMI
+EditorAS7ManagementPort=Management
EditorAutomaticallyDetectPort=Automatically detect
EditorPortInvalid=One or more ports have an invalid value. This may adversely affect the tooling's ability to interact with the server.
EditorChangeJNDICommandName=Change JNDI Port Details
EditorChangeWebCommandName=Change Web Port Details
EditorChangeJMXRMICommandName=Change JMX RMI Port Details
+EditorChangeAS7ManagementCommandName=Change AS7 Management Port Details
EditorChangeUsernameCommandName=Change Username
EditorChangePasswordCommandName=Change Password
EditorCPD_Value=Current Value
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-06-22 08:37:54 UTC (rev 32275)
@@ -50,6 +50,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBoss6Server;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.dialogs.ChangePortDialog;
@@ -141,7 +142,18 @@
}
}
+ public static class JBoss7ManagementPortEditorExtension extends PortEditorExtension {
+ public JBoss7ManagementPortEditorExtension() {
+ super(Messages.EditorAS7ManagementPort,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT_DETECT_XPATH,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT_DETECT,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT,
+ IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_XPATH,
+ Messages.EditorChangeAS7ManagementCommandName);
+ }
+ }
+
public static abstract class PortEditorExtension implements IPortEditorExtension {
protected Button detect;
protected Text text;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-06-22 06:11:07 UTC (rev 32274)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-06-22 08:37:54 UTC (rev 32275)
@@ -281,6 +281,10 @@
class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JBoss6JMXRMIPortEditorExtension"
serverIds="org.jboss.ide.eclipse.as.60">
</section>
+ <section
+ class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JBoss7ManagementPortEditorExtension"
+ serverIds="org.jboss.ide.eclipse.as.70">
+ </section>
</extension>
14 years, 9 months
JBoss Tools SVN: r32274 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-22 02:11:07 -0400 (Wed, 22 Jun 2011)
New Revision: 32274
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
Log:
compile error in my workspace, removed @Override
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-06-22 06:08:34 UTC (rev 32273)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-06-22 06:11:07 UTC (rev 32274)
@@ -66,7 +66,6 @@
// override me
}
- @Override
public void launch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
preLaunch(configuration, mode, launch, monitor);
14 years, 9 months
JBoss Tools SVN: r32273 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-22 02:08:34 -0400 (Wed, 22 Jun 2011)
New Revision: 32273
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/projectcreation/NewTargetedWebProjectTest.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
JBIDE-8718 test case
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/projectcreation/NewTargetedWebProjectTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/projectcreation/NewTargetedWebProjectTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/projectcreation/NewTargetedWebProjectTest.java 2011-06-22 06:08:34 UTC (rev 32273)
@@ -0,0 +1,95 @@
+package org.jboss.ide.eclipse.as.test.projectcreation;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.JavaEEFacetConstants;
+import org.jboss.ide.eclipse.as.test.util.wtp.OperationTestCase;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectCreationUtil;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+import org.jboss.tools.test.util.JobUtils;
+
+public class NewTargetedWebProjectTest extends TestCase {
+ final String MODULE_NAME = "newModulev2111";
+ final String CONTENT_DIR = "contentDirS";
+ private IServer server;
+ private IProject p;
+
+ // Test Commented Until Passing
+
+// public void testTargetedWebProjectErrorsJboss6() throws Exception {
+// server = ServerRuntimeUtils.create60Server();
+// p = createProject("org.jboss.ide.eclipse.as.runtime.60");
+// int markerSev = p.findMaxProblemSeverity(null, true, IResource.DEPTH_INFINITE);
+// assertTrue(markerSev != IMarker.SEVERITY_ERROR);
+// }
+
+ public void testTargetedWebProjectErrorsJboss7() throws Exception {
+ server = ServerRuntimeUtils.create70Server();
+ p = createProject("org.jboss.ide.eclipse.as.runtime.70");
+ int markerSev = p.findMaxProblemSeverity(null, true, IResource.DEPTH_INFINITE);
+ assertTrue(markerSev != IMarker.SEVERITY_ERROR);
+ }
+
+ protected IProject createProject(String rtId) throws Exception {
+ IDataModel dm = ProjectCreationUtil.getWebDataModel(MODULE_NAME, null, null, null, null, JavaEEFacetConstants.WEB_24, false);
+ OperationTestCase.runAndVerify(dm);
+ p = ResourcesPlugin.getWorkspace().getRoot().getProject(MODULE_NAME);
+ assertTrue(p.exists());
+ assertNotNull(p);
+ assertTrue(p.exists());
+ setProjectRuntime(rtId);
+ IFile f = p.getFolder("src").getFile("Tiger.java");
+ f.create(getClassContents(), true, new NullProgressMonitor());
+ JobUtils.waitForIdle(2000);
+ return p;
+ }
+ protected void setProjectRuntime(String type) throws Exception {
+ IFacetedProject fp = ProjectFacetsManager.create(p);
+ IRuntime rt = fp.getPrimaryRuntime();
+ assertNull(rt);
+ Set<IRuntime> all = RuntimeManager.getRuntimes();
+ assertEquals(all.size(), 2);
+ Iterator<IRuntime> i = all.iterator();
+ IRuntime r1 = i.next();
+ if(!r1.getName().equals(type))
+ r1 = i.next();
+ Set<IRuntime> possible = new TreeSet<IRuntime>();
+ possible.add(r1);
+ fp.setTargetedRuntimes(possible, new NullProgressMonitor());
+ fp.setPrimaryRuntime(r1, new NullProgressMonitor());
+
+ assertNotNull(fp.getPrimaryRuntime());
+ }
+ protected InputStream getClassContents() {
+ String contents = "public class Tiger {\n}";
+ return new ByteArrayInputStream(contents.getBytes());
+ }
+ public void tearDown() throws Exception {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ ASTest.clearStateLocation();
+ }
+}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2011-06-22 05:14:14 UTC (rev 32272)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2011-06-22 06:08:34 UTC (rev 32273)
@@ -159,9 +159,14 @@
return createServer(IJBossToolingConstants.AS_51, IJBossToolingConstants.SERVER_AS_51, ASTest.JBOSS_AS_51_HOME, DEFAULT_CONFIG);
}
-// public static IServer create60Server() throws CoreException {
-// }
-
+ public static IServer create60Server() throws CoreException {
+ return createServer(IJBossToolingConstants.AS_60, IJBossToolingConstants.SERVER_AS_60, ASTest.JBOSS_AS_60_HOME, DEFAULT_CONFIG);
+ }
+
+ public static IServer create70Server() throws CoreException {
+ return createServer(IJBossToolingConstants.AS_70, IJBossToolingConstants.SERVER_AS_70, ASTest.JBOSS_AS_70_HOME, DEFAULT_CONFIG);
+ }
+
public static IServer createServer(String runtimeID, String serverID,
String location, String configuration) throws CoreException {
IRuntime runtime = RuntimeUtils.createRuntime(runtimeID, location, configuration);
@@ -199,14 +204,14 @@
public static void deleteAllRuntimes() throws CoreException {
// FIXME It doesn't harm to be commented, but location is null should be fixed
-// IRuntime[] runtimes = ServerCore.getRuntimes();
-// for( int i = 0; i < runtimes.length; i++ ) {
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ for( int i = 0; i < runtimes.length; i++ ) {
// assertNotNull("runtime " + runtimes[i].getName() + " has a null location", runtimes[i].getLocation());
// if( mockedServers.isPrefixOf(runtimes[i].getLocation())) {
// FileUtil.completeDelete(runtimes[i].getLocation().toFile());
// }
-// runtimes[i].delete();
-// }
+ runtimes[i].delete();
+ }
}
14 years, 9 months