JBoss Tools SVN: r34767 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 09:44:33 -0400 (Thu, 15 Sep 2011)
New Revision: 34767
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml 2011-09-15 13:28:02 UTC (rev 34766)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml 2011-09-15 13:44:33 UTC (rev 34767)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.core</artifactId>
14 years, 7 months
JBoss Tools SVN: r34766 - in trunk/as: plugins/org.jboss.ide.eclipse.as.openshift.core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 09:28:02 -0400 (Thu, 15 Sep 2011)
New Revision: 34766
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml
trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml 2011-09-15 12:52:28 UTC (rev 34765)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml 2011-09-15 13:28:02 UTC (rev 34766)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.ui</artifactId>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml 2011-09-15 12:52:28 UTC (rev 34765)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml 2011-09-15 13:28:02 UTC (rev 34766)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.openshift.core</artifactId>
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-09-15 12:52:28 UTC (rev 34765)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-09-15 13:28:02 UTC (rev 34766)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.tests</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.internal.test</artifactId>
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml 2011-09-15 12:52:28 UTC (rev 34765)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml 2011-09-15 13:28:02 UTC (rev 34766)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.openshift.test</artifactId>
14 years, 7 months
JBoss Tools SVN: r34765 - in trunk/as: tests/org.jboss.ide.eclipse.as.egit.test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 08:52:28 -0400 (Thu, 15 Sep 2011)
New Revision: 34765
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml
trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml 2011-09-15 12:52:22 UTC (rev 34764)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/pom.xml 2011-09-15 12:52:28 UTC (rev 34765)
@@ -4,10 +4,9 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.ui</artifactId>
<packaging>eclipse-plugin</packaging>
- <version>0.0.1-SNAPSHOT</version>
</project>
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-09-15 12:52:22 UTC (rev 34764)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-09-15 12:52:28 UTC (rev 34765)
@@ -4,10 +4,9 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.tests</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.internal.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
- <version>0.0.1</version>
</project>
14 years, 7 months
JBoss Tools SVN: r34764 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 08:52:22 -0400 (Thu, 15 Sep 2011)
New Revision: 34764
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml 2011-09-15 12:51:07 UTC (rev 34763)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/pom.xml 2011-09-15 12:52:22 UTC (rev 34764)
@@ -4,10 +4,9 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.core</artifactId>
<packaging>eclipse-plugin</packaging>
- <version>0.0.1-SNAPSHOT</version>
</project>
14 years, 7 months
JBoss Tools SVN: r34763 - trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 08:51:07 -0400 (Thu, 15 Sep 2011)
New Revision: 34763
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml 2011-09-15 12:50:39 UTC (rev 34762)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/pom.xml 2011-09-15 12:51:07 UTC (rev 34763)
@@ -4,10 +4,9 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.openshift.test</artifactId>
<packaging>eclipse-plugin</packaging>
- <version>0.0.1</version>
</project>
14 years, 7 months
JBoss Tools SVN: r34762 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 08:50:39 -0400 (Thu, 15 Sep 2011)
New Revision: 34762
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml 2011-09-15 11:35:25 UTC (rev 34761)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/pom.xml 2011-09-15 12:50:39 UTC (rev 34762)
@@ -4,10 +4,9 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>plugins</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
<artifactId>org.jboss.ide.eclipse.as.openshift.core</artifactId>
<packaging>eclipse-plugin</packaging>
- <version>0.0.1</version>
</project>
14 years, 7 months
JBoss Tools SVN: r34761 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core: src/org/jboss/tools/hibernate/jpt/core/internal and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-09-15 07:35:25 -0400 (Thu, 15 Sep 2011)
New Revision: 34761
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/.api_filters
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
Log:
https://issues.jboss.org/browse/JBIDE-9701
process implied package-info like implied entities are processed
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/.api_filters
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/.api_filters (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/.api_filters 2011-09-15 11:35:25 UTC (rev 34761)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.jboss.tools.hibernate.jpt.core" version="2">
+ <resource path="src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java" type="org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject">
+ <filter id="576720909">
+ <message_arguments>
+ <message_argument value="AbstractJpaProject"/>
+ <message_argument value="HibernateJpaProject"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java" type="org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit">
+ <filter id="576720909">
+ <message_arguments>
+ <message_argument value="AbstractPersistenceUnit"/>
+ <message_argument value="HibernatePersistenceUnit"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2011-09-15 10:49:15 UTC (rev 34760)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2011-09-15 11:35:25 UTC (rev 34761)
@@ -15,8 +15,14 @@
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
+import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.internal.AbstractJpaProject;
+import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageInfoCompilationUnit;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.hibernate.cfg.Configuration;
@@ -77,7 +83,59 @@
}
return this.cachedNamingStrategyEnable;
}
+
+ protected Iterable<JpaFile> getJavaPackageInfoSourceJpaFiles() {
+ return this.getJpaFiles(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
+ }
+ /**
+ * Return the JPA project's resource compilation units.
+ */
+ protected Iterable<JavaResourcePackageInfoCompilationUnit> getInternalJavaResourcePackageInfoCompilationUnits() {
+ return new TransformationIterable<JpaFile, JavaResourcePackageInfoCompilationUnit>(this.getJavaPackageInfoSourceJpaFiles()) {
+ @Override
+ protected JavaResourcePackageInfoCompilationUnit transform(JpaFile jpaFile) {
+ return (JavaResourcePackageInfoCompilationUnit) jpaFile.getResourceModel();
+ }
+ };
+ }
+
+ protected Iterable<JavaResourcePackage> getInternalSourceJavaResourcePackages() {
+ return new TransformationIterable<JavaResourcePackageInfoCompilationUnit, JavaResourcePackage>(this.getInternalJavaResourcePackageInfoCompilationUnits()) {
+ @Override
+ protected JavaResourcePackage transform(final JavaResourcePackageInfoCompilationUnit compilationUnit) {
+ return compilationUnit.getPackage();
+ }
+ };
+ }
+
+ protected Iterable<JavaResourcePackage> getInternalAnnotatedSourceJavaResourcePacakges() {
+ return new FilteringIterable<JavaResourcePackage>(this.getInternalSourceJavaResourcePackages()) {
+ @Override
+ protected boolean accept(JavaResourcePackage jrpPackage) {
+ return /*jrpPackage.isPersistable() && jrpPackage.isAnnotated()*/true;
+ }
+ };
+ }
+
+ /**
+ * Return only those valid <em>mapped</em> (i.e. has any annotations) Java resource
+ * persistent packages that are directly part of the JPA project, ignoring
+ * those in JARs referenced in <code>persistence.xml</code>.
+ */
+ protected Iterable<JavaResourcePackage> getInternalMappedSourceJavaResourcePackages() {
+ return getInternalAnnotatedSourceJavaResourcePacakges();
+ }
+
+ public Iterable<String> getMappedJavaSourcePackagesNames() {
+ return new TransformationIterable<JavaResourcePackage, String>(this.getInternalMappedSourceJavaResourcePackages()) {
+ @Override
+ protected String transform(JavaResourcePackage jrpPackage) {
+ return jrpPackage.getName();
+ }
+ };
+ }
+
@Override
protected void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2011-09-15 10:49:15 UTC (rev 34760)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2011-09-15 11:35:25 UTC (rev 34761)
@@ -29,6 +29,7 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
+import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
@@ -42,6 +43,7 @@
import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
@@ -76,6 +78,11 @@
XmlPersistenceUnit persistenceUnit) {
super(parent, persistenceUnit);
}
+
+ @Override
+ public HibernateJpaProject getJpaProject() {
+ return (HibernateJpaProject)super.getJpaProject();
+ }
@Override
protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
@@ -225,7 +232,42 @@
CollectionTools.addAll(generatorList, ((HibernateGeneratorContainer)generatorContainer).genericGenerators());
}
}
+
+ /**
+ * Return the names of all the Java classes and packages in the JPA project that are
+ * mapped (i.e. have the appropriate annotation etc.) but not specified
+ * in the persistence unit.
+ */
+ @SuppressWarnings("unchecked")
+ protected Iterable<String> getImpliedClassNames_() {
+ return new CompositeIterable<String>(super.getImpliedClassNames_(),
+ new FilteringIterable<String>(this.getJpaProject().getMappedJavaSourcePackagesNames()) {
+ @Override
+ protected boolean accept(String mappedPackageName) {
+ return !HibernatePersistenceUnit.this.specifiesPackageInfo(mappedPackageName);
+ }
+ }
+ );
+ }
+
+ /**
+ * Ignore implied class refs and jar files.
+ */
+ public boolean specifiesPackageInfo(String typeName) {
+ for (ClassRef classRef : this.getSpecifiedClassRefs()) {
+ if (classRef.isFor(typeName)) {
+ return true;
+ }
+ }
+ /*for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
+ if (mappingFileRef.getPersistentType(typeName) != null) {
+ return true;
+ }
+ }*/
+ return false;
+ }
+
// ********** Validation ***********************************************
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
@@ -273,213 +315,6 @@
}
}
-//
-// // ********** specified package-info refs **********
-//
-// public ListIterator<PackageInfoRef> specifiedPackageInfoRefs() {
-// return this.getSpecifiedPackageInfoRefs().iterator();
-// }
-//
-// protected ListIterable<PackageInfoRef> getSpecifiedPackageInfoRefs() {
-// return new LiveCloneListIterable<PackageInfoRef>(this.specifiedPackageInfoRefs);
-// }
-//
-// public int specifiedPackageInfoRefsSize() {
-// return this.specifiedPackageInfoRefs.size();
-// }
-//
-// public PackageInfoRef addSpecifiedPackageInfoRef(String packageName) {
-// return this.addSpecifiedPackageInfoRef(this.specifiedPackageInfoRefs.size(), packageName);
-// }
-//
-// public PackageInfoRef addSpecifiedPackageInfoRef(int index, String packageName) {
-// XmlPackageInfoRef xmlPackageInfoRef = this.buildXmlPackageInfoRef(packageName);
-// PackageInfoRef classRef = this.addSpecifiedPackageInfoRef_(index, xmlPackageInfoRef);
-// this.xmlPersistenceUnit.getClasses().add(index, xmlPackageInfoRef);
-// return classRef;
-// }
-//
-// protected XmlPackageInfoRef buildXmlPackageInfoRef(String packageName) {
-// XmlPackageInfoRef ref = PersistenceFactory.eINSTANCE.createXmlPackageInfoRef();
-// ref.setJavaClass(packageName);
-// return ref;
-// }
-//
-// protected PackageInfoRef buildPackageInfoRef(XmlPackageInfoRef xmlPackageInfoRef) {
-// return this.getContextNodeFactory().buildPackageInfoRef(this, xmlPackageInfoRef);
-// }
-//
-// public void removeSpecifiedPackageInfoRef(PackageInfoRef classRef) {
-// this.removeSpecifiedPackageInfoRef(this.specifiedPackageInfoRefs.indexOf(classRef));
-// }
-//
-// public void removeSpecifiedPackageInfoRef(int index) {
-// this.removeSpecifiedPackageInfoRef_(index);
-// this.xmlPersistenceUnit.getClasses().remove(index);
-// }
-//
-// /**
-// * dispose the class ref
-// */
-// protected void removeSpecifiedPackageInfoRef_(int index) {
-// this.removeItemFromList(index, this.specifiedPackageInfoRefs, SPECIFIED_CLASS_REFS_LIST).dispose();
-// }
-//
-// protected void initializeSpecifiedPackageInfoRefs() {
-// for (XmlPackageInfoRef xmlJavaPackageInfoRef : this.getXmlPackageInfoRefs()) {
-// this.specifiedPackageInfoRefs.add(this.buildPackageInfoRef(xmlJavaPackageInfoRef));
-// }
-// }
-//
-// protected void syncSpecifiedPackageInfoRefs() {
-// ContextContainerTools.synchronizeWithResourceModel(this.specifiedPackageInfoRefContainerAdapter);
-// }
-//
-// protected Iterable<XmlPackageInfoRef> getXmlPackageInfoRefs() {
-// // clone to reduce chance of concurrency problems
-// return new LiveCloneIterable<XmlPackageInfoRef>(this.xmlPersistenceUnit.getClasses());
-// }
-//
-// protected void moveSpecifiedPackageInfoRef_(int index, PackageInfoRef classRef) {
-// this.moveItemInList(index, classRef, this.specifiedPackageInfoRefs, SPECIFIED_CLASS_REFS_LIST);
-// }
-//
-// protected PackageInfoRef addSpecifiedPackageInfoRef_(int index, XmlPackageInfoRef xmlPackageInfoRef) {
-// PackageInfoRef classRef = this.buildPackageInfoRef(xmlPackageInfoRef);
-// this.addItemToList(index, classRef, this.specifiedPackageInfoRefs, SPECIFIED_CLASS_REFS_LIST);
-// return classRef;
-// }
-//
-// protected void removeSpecifiedPackageInfoRef_(PackageInfoRef classRef) {
-// this.removeSpecifiedPackageInfoRef_(this.specifiedPackageInfoRefs.indexOf(classRef));
-// }
-//
-// /**
-// * specified class ref container adapter
-// */
-// protected class SpecifiedPackageInfoRefContainerAdapter
-// implements ContextContainerTools.Adapter<PackageInfoRef, XmlPackageInfoRef>
-// {
-// public Iterable<PackageInfoRef> getContextElements() {
-// return HibernatePersistenceUnit.this.getSpecifiedPackageInfoRefs();
-// }
-// public Iterable<XmlPackageInfoRef> getResourceElements() {
-// return HibernatePersistenceUnit.this.getXmlPackageInfoRefs();
-// }
-// public XmlPackageInfoRef getResourceElement(PackageInfoRef contextElement) {
-// return contextElement.getXmlPackageInfoRef();
-// }
-// public void moveContextElement(int index, PackageInfoRef element) {
-// HibernatePersistenceUnit.this.moveSpecifiedPackageInfoRef_(index, element);
-// }
-// public void addContextElement(int index, XmlPackageInfoRef resourceElement) {
-// HibernatePersistenceUnit.this.addSpecifiedPackageInfoRef_(index, resourceElement);
-// }
-// public void removeContextElement(PackageInfoRef element) {
-// HibernatePersistenceUnit.this.removeSpecifiedPackageInfoRef_(element);
-// }
-// }
-//
-// // ********** virtual package-info refs **********
-//
-// public Iterator<PackageInfoRef> impliedPackageInfoRefs() {
-// return this.getImpliedPackageInfoRefs().iterator();
-// }
-//
-// protected Iterable<PackageInfoRef> getImpliedPackageInfoRefs() {
-// return new LiveCloneIterable<PackageInfoRef>(this.impliedPackageInfoRefs);
-// }
-//
-// public int impliedPackageInfoRefsSize() {
-// return this.impliedPackageInfoRefs.size();
-// }
-//
-// protected PackageInfoRef addImpliedPackageInfoRef(String packageName) {
-// PackageInfoRef classRef = this.buildPackageInfoRef(packageName);
-// this.addItemToCollection(classRef, this.impliedPackageInfoRefs, IMPLIED_CLASS_REFS_COLLECTION);
-// return classRef;
-// }
-//
-// protected PackageInfoRef buildPackageInfoRef(String packageName) {
-// return this.getContextNodeFactory().buildPackageInfoRef(this, packageName);
-// }
-//
-// protected void removeImpliedPackageInfoRef(PackageInfoRef classRef) {
-// this.impliedPackageInfoRefs.remove(classRef);
-// classRef.dispose();
-// this.fireItemRemoved(IMPLIED_CLASS_REFS_COLLECTION, classRef);
-// }
-//
-// protected void updateImpliedPackageInfoRefs() {
-// ContextContainerTools.update(this.impliedPackageInfoRefContainerAdapter);
-// }
-//
-// protected Iterable<String> getImpliedClassNames() {
-// return this.excludesUnlistedClasses() ?
-// EmptyIterable.<String>instance() :
-// this.getImpliedClassNames_();
-// }
-//
-// /**
-// * Return the names of all the Java classes in the JPA project that are
-// * mapped (i.e. have the appropriate annotation etc.) but not specified
-// * in the persistence unit.
-// */
-// protected Iterable<String> getImpliedClassNames_() {
-// return new FilteringIterable<String>(this.getJpaProject().getMappedJavaSourceClassNames()) {
-// @Override
-// protected boolean accept(String mappedClassName) {
-// return ! HibernatePersistenceUnit.this.specifiesPersistentType(mappedClassName);
-// }
-// };
-// }
-//
-// /**
-// * Virtual class ref container adapter.
-// * <p>
-// * <strong>NB:</strong> The context class ref is matched with a resource
-// * class by name.
-// * <p>
-// * This is used during <strong>both</strong> <em>sync</em> and
-// * <em>update</em> because the list of implied class refs can be modified
-// * in either situation. In particular, we cannot simply rely on
-// * <em>update</em> because there are situations where a <em>sync</em> is
-// * triggered but a follow-up <em>update</em> is not. (Of course, any
-// * change discovered here will trigger an <em>update</em>.)
-// * <p>
-// * The most obvious example is when the JPA project is configured to
-// * discover annotated classes and a Java class is annotated for the first
-// * time (via code editing, not via the context model). This will trigger
-// * a <em>sync</em>; but, since the unannotated class is not yet in the
-// * context model and, as a result, the context model's state is untouched,
-// * an <em>update</em> will not be triggered.
-// * <p>
-// * Obviously, other context model changes can change this collection (e.g.
-// * setting whether the persistence unit excludes unlisted classes); o the
-// * collection must also be synchronized during <em>update</em>.
-// */
-// protected class ImpliedPackageInfoRefContainerAdapter
-// implements ContextContainerTools.Adapter<PackageInfoRef, String>
-// {
-// public Iterable<PackageInfoRef> getContextElements() {
-// return HibernatePersistenceUnit.this.getImpliedPackageInfoRef();
-// }
-// public Iterable<String> getResourceElements() {
-// return HibernatePersistenceUnit.this.getImpliedPackageInfoNames();
-// }
-// public String getResourceElement(PackageInfoRef contextElement) {
-// return contextElement.getPackageName();
-// }
-// public void moveContextElement(int index, PackageInfoRef element) {
-// // ignore moves - we don't care about the order of the implied package-info refs
-// }
-// public void addContextElement(int index, String resourceElement) {
-// // ignore the index - we don't care about the order of the implied package-info refs
-// HibernatePersistenceUnit.this.addImpliedPackageInfoRef(resourceElement);
-// }
-// public void removeContextElement(PackageInfoRef element) {
-// HibernatePersistenceUnit.this.removeImpliedPackageInfoRef(element);
-// }
-// }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java 2011-09-15 10:49:15 UTC (rev 34760)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java 2011-09-15 11:35:25 UTC (rev 34761)
@@ -15,7 +15,6 @@
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericClassRef;
@@ -30,6 +29,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
+
/**
* @author Dmitry Geraskov
*
14 years, 7 months
JBoss Tools SVN: r34760 - in trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core: fakes and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 06:49:15 -0400 (Thu, 15 Sep 2011)
New Revision: 34760
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoTest.java
Log:
[JBIDE-9510] implementing IOpenshiftService#getApplicationStatus and ApplicationStatusReader
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java 2011-09-15 10:48:51 UTC (rev 34759)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -18,7 +18,6 @@
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.Status;
import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.junit.Before;
import org.junit.Ignore;
@@ -35,6 +34,7 @@
private static final String USERNAME = "toolsjboss(a)gmail.com";
private static final String PASSWORD = "1q2w3e";
+ @Ignore
@Before
public void setUp() {
this.openshiftService = new OpenshiftService(USERNAME, PASSWORD);
@@ -167,8 +167,8 @@
String applicationName = createRandomApplicationName();
try {
Application application = openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
- Status status = openshiftService.getStatus(application);
- assertNotNull(status);
+ String applicationStatus = openshiftService.getStatus(application.getName(), application.getCartridge());
+ assertNotNull(applicationStatus);
} finally {
silentlyDestroyApplication(applicationName, openshiftService);
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java 2011-09-15 10:48:51 UTC (rev 34759)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -15,10 +15,10 @@
import java.net.URLEncoder;
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ApplicationRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationAction;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationRequest;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftJsonRequestFactory;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.ApplicationRequestJsonMarshaller;
import org.junit.Test;
/**
@@ -47,7 +47,7 @@
String createApplicationRequest = new ApplicationRequestJsonMarshaller().marshall(
new ApplicationRequest(
"test-application", Cartridge.JBOSSAS_7, ApplicationAction.CONFIGURE, USERNAME, true));
- String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, createApplicationRequest).create();
+ String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, createApplicationRequest).createString();
assertEquals(expectedRequestString, effectiveRequest);
}
@@ -69,8 +69,38 @@
String createApplicationRequest = new ApplicationRequestJsonMarshaller().marshall(
new ApplicationRequest(
"test-application", Cartridge.JBOSSAS_7, ApplicationAction.DECONFIGURE, USERNAME, true));
- String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, createApplicationRequest).create();
+ String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, createApplicationRequest).createString();
assertEquals(expectedRequestString, effectiveRequest);
}
+
+ @Test
+ public void canUnmarshallStatsResponse() {
+ String statusResponse =
+ "{\"messages\":\"\","
+ +"\"debug\":\"\","
+ +"\"data\":null,"
+ +"\"api\":\"1.1.1\","
+ +"\"api_c\":[\"placeholder\"],"
+ +"\"result\":\""
+ +"tailing /var/lib/libra/664e4d4dbce74c69ac321053149546df/1316010645406//jbossas-7.0/standalone/log/server.log\n"
+ +"------ Tail of 1316010645406 application server.log ------\n"
+ +"10:30:38,700 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-1) "
+ +"The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:"
+ +"/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:"
+ +"/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib\n"
+ +"10:30:38,792 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.1.7.1-8080\n"
+ +"10:30:38,836 INFO [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)\n"
+ +"10:30:38,892 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS]\n"
+ +"10:30:39,293 INFO [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /var/lib/libra/664e4d4dbce74c69ac321053149546df/1316010645406/jbossas-7.0/standalone/deployments\n"
+ +"10:30:39,314 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final \\\"Zap\\\" started in 2732ms - Started 82 of 107 services (22 services are passive or on-demand)\n"
+ +"10:30:39,339 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of \\\"ROOT.war\\\"\n"
+ +"10:30:39,424 INFO [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to ROOT.war\n"
+ +"10:30:39,700 INFO [org.jboss.web] (MSC service thread 1-2) registering web context: \n"
+ +"10:30:39,742 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed \\\"ROOT.war\\\"\n"
+ +"\","
+ +"\"broker\":\"1.1.1\","
+ +"\"broker_c\":[\"namespace\",\"rhlogin\",\"ssh\",\"app_uuid\",\"debug\",\"alter\",\"cartridge\",\"cart_type\",\"action\",\"app_name\",\"api\"],"
+ +"\"exit_code\":0}";
+ }
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java 2011-09-15 10:48:51 UTC (rev 34759)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainTest.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -21,10 +21,10 @@
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.SSHKey;
import org.jboss.ide.eclipse.as.openshift.core.User;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.DomainRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ChangeDomainRequest;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.CreateDomainRequest;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftJsonRequestFactory;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.DomainRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.DomainResponseUnmarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.JsonSanitizer;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.OpenshiftResponse;
@@ -51,7 +51,7 @@
new OpenshiftJsonRequestFactory(
PASSWORD,
new DomainRequestJsonMarshaller().marshall(request))
- .create();
+ .createString();
assertEquals(expectedRequestString, requestString);
}
@@ -64,7 +64,7 @@
OpenshiftResponse<Domain> response = new DomainResponseUnmarshaller(domainName).unmarshall(responseString);
assertNotNull(response);
- Domain domain = response.getData();
+ Domain domain = response.getOpenshiftObject();
assertEquals(domainName, domain.getName());
User user = domain.getUser();
assertNotNull(user);
@@ -83,7 +83,7 @@
new OpenshiftJsonRequestFactory(
PASSWORD,
new DomainRequestJsonMarshaller().marshall(request))
- .create();
+ .createString();
assertEquals(expectedRequestString, requestString);
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java 2011-09-15 10:48:51 UTC (rev 34759)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesTest.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -18,9 +18,9 @@
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ListCartridgesRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ListCartridgesRequest;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftJsonRequestFactory;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.ListCartridgesRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.JsonSanitizer;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.ListCartridgesResponseUnmarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.response.OpenshiftResponse;
@@ -42,7 +42,7 @@
String listCartridgeRequest = new ListCartridgesRequestJsonMarshaller().marshall(
new ListCartridgesRequest(USERNAME, true));
- String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, listCartridgeRequest).create();
+ String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, listCartridgeRequest).createString();
assertEquals(expectedRequestString, effectiveRequest);
}
@@ -80,7 +80,7 @@
assertEquals("", response.getMessages());
assertEquals(false, response.isDebug());
- List<Cartridge> cartridges = response.getData();
+ List<Cartridge> cartridges = response.getOpenshiftObject();
assertEquals(5, cartridges.size());
assertThatContainsCartridge("perl-5.10", cartridges);
assertThatContainsCartridge("jbossas-7.0", cartridges);
Added: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.test.internal.core;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
+import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserInfoIntegrationTest {
+
+ private IOpenshiftService openshiftService;
+
+ private static final String USERNAME = "toolsjboss(a)gmail.com";
+ private static final String PASSWORD = "1q2w3e";
+
+ @Before
+ public void setUp() {
+ this.openshiftService = new OpenshiftService(USERNAME, PASSWORD);
+ }
+
+ @Test
+ public void canGetUserInfo() throws Exception {
+ UserInfo userInfo = openshiftService.getUserInfo();
+ assertNotNull(userInfo);
+ }
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoTest.java 2011-09-15 10:48:51 UTC (rev 34759)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoTest.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -14,9 +14,9 @@
import java.net.URLEncoder;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.UserInfoRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftJsonRequestFactory;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.UserInfoRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.UserInfoRequestJsonMarshaller;
import org.junit.Test;
/**
@@ -37,7 +37,7 @@
+ "%7D";
String userInfoRequest = new UserInfoRequestJsonMarshaller().marshall(new UserInfoRequest(USERNAME, true));
- String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, userInfoRequest).create();
+ String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, userInfoRequest).createString();
assertEquals(expectedRequestString, effectiveRequest);
}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java 2011-09-15 10:49:15 UTC (rev 34760)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes;
+
+import java.util.List;
+
+import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.Domain;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.SSHKey;
+import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
+
+/**
+ * @author André Dietisheim
+ */
+public class NoopOpenshiftServiceFake implements IOpenshiftService {
+
+ @Override
+ public UserInfo getUserInfo() throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<Cartridge> getCartridges() throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application destroyApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application startApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application restartApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application stopApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getStatus(String applicationName, Cartridge cartridge) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Domain changeDomain(String domainName, SSHKey sshKey) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Domain createDomain(String name, SSHKey keyPair) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SSHKey createKey(String passPhrase, String privateKeyPath, String publicKeyPath) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SSHKey loadKey(String privateKeyPath, String publicKeyPath) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/NoopOpenshiftServiceFake.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r34759 - in trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core: internal and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 06:48:51 -0400 (Thu, 15 Sep 2011)
New Revision: 34759
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationStatusReader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/IOpenshiftRequestFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/ApplicationStatusUnmarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/UserInfoResponseUnmarshaller.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftObject.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/OpenshiftJsonRequestFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/OpenshiftResponse.java
Log:
[JBIDE-9510] implementing IOpenshiftService#getApplicationStatus and ApplicationStatusReader
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -11,7 +11,7 @@
package org.jboss.ide.eclipse.as.openshift.core;
-public class Application implements IOpenshiftObject {
+public class Application {
private String name;
private Cartridge cartridge;
@@ -47,7 +47,7 @@
service.stopApplication(name, cartridge);
}
- public Status getStatus() throws OpenshiftException {
- return service.getStatus(this);
+ public ApplicationStatusReader getStatus() throws OpenshiftException {
+ return new ApplicationStatusReader(this, service);
}
}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationStatusReader.java (from rev 34672, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationStatusReader.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationStatusReader.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationStatusReader extends Reader {
+
+ private IOpenshiftService service;
+ private Application application;
+ private StringReader serviceResponseReader;
+
+ public ApplicationStatusReader(Application application, IOpenshiftService service) {
+ this.application = application;
+ this.service = service;
+ }
+
+ protected String requestStatus() throws IOException {
+ try {
+ return service.getStatus(application.getName(), application.getCartridge());
+ } catch (OpenshiftException e) {
+ throw new IOException(e);
+ }
+ }
+
+ @Override
+ public int read(char[] cbuf, int off, int len) throws IOException {
+ int charactersRead = -1;
+ for (;;) {
+ charactersRead = getServiceResponseReader().read(cbuf, off, len);
+ if (charactersRead != -1) {
+ return charactersRead;
+ }
+ }
+ }
+
+ private Reader getServiceResponseReader() throws IOException {
+ if (serviceResponseReader == null) {
+ this.serviceResponseReader = new StringReader(requestStatus());
+ }
+ return serviceResponseReader;
+
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (serviceResponseReader != null) {
+ serviceResponseReader.close();
+ }
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationStatusReader.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -14,7 +14,7 @@
/**
* @author André Dietisheim
*/
-public class Cartridge implements IOpenshiftObject {
+public class Cartridge {
public static final Cartridge JBOSSAS_7 = new Cartridge("jbossas-7.0");
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -14,7 +14,7 @@
/**
* @author André Dietisheim
*/
-public class Domain implements IOpenshiftObject {
+public class Domain {
private User user;
private String name;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftObject.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftObject.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftObject.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.core;
-
-/**
- * @author André Dietisheim
- */
-public interface IOpenshiftObject {
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -31,7 +31,7 @@
public Application stopApplication(String name, Cartridge cartridge) throws OpenshiftException;
- public Status getStatus(Application application) throws OpenshiftException;
+ public String getStatus(String applicationName, Cartridge cartridge) throws OpenshiftException;
public Domain changeDomain(String domainName, SSHKey sshKey) throws OpenshiftException;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.core;
-
-/**
- * @author André Dietisheim
- */
-public class Status implements IOpenshiftObject {
-
- public Status() {
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -13,7 +13,7 @@
/**
* @author André Dietisheim
*/
-public class UserInfo implements IOpenshiftObject {
+public class UserInfo {
private String rhlogin;
private String uuId;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -15,6 +15,7 @@
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.ApplicationStatusReader;
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.Domain;
import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
@@ -23,7 +24,6 @@
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.SSHKey;
-import org.jboss.ide.eclipse.as.openshift.core.Status;
import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.HttpClientException;
import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UnauthorizedException;
@@ -67,12 +67,12 @@
String url = request.getUrlString(BASE_URL);
try {
String requestString = new UserInfoRequestJsonMarshaller().marshall(request);
- String openShiftRequestString = new OpenshiftJsonRequestFactory(password, requestString).create();
+ String openShiftRequestString = new OpenshiftJsonRequestFactory(password, requestString).createString();
String responseString = createHttpClient(url).post(openShiftRequestString);
responseString = JsonSanitizer.sanitize(responseString);
OpenshiftResponse<UserInfo> response =
new UserInfoResponseUnmarshaller().unmarshall(responseString);
- return response.getData();
+ return response.getOpenshiftObject();
} catch (MalformedURLException e) {
throw new OpenshiftEndpointException(
url, e, "Could not get user info for user \"{0}\" at \"{1}\"", username, url, e);
@@ -95,12 +95,12 @@
try {
String listCartridgesRequestString =
new ListCartridgesRequestJsonMarshaller().marshall(listCartridgesRequest);
- String request = new OpenshiftJsonRequestFactory(password, listCartridgesRequestString).create();
+ String request = new OpenshiftJsonRequestFactory(password, listCartridgesRequestString).createString();
String listCatridgesReponse = createHttpClient(url).post(request);
listCatridgesReponse = JsonSanitizer.sanitize(listCatridgesReponse);
OpenshiftResponse<List<Cartridge>> response =
new ListCartridgesResponseUnmarshaller().unmarshall(listCatridgesReponse);
- return response.getData();
+ return response.getOpenshiftObject();
} catch (MalformedURLException e) {
throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
} catch (HttpClientException e) {
@@ -135,12 +135,12 @@
new OpenshiftJsonRequestFactory(
password,
new DomainRequestJsonMarshaller().marshall(request))
- .create();
+ .createString();
String responseString = createHttpClient(url).post(requestString);
responseString = JsonSanitizer.sanitize(responseString);
OpenshiftResponse<Domain> response =
new DomainResponseUnmarshaller(request.getName()).unmarshall(responseString);
- return response.getData();
+ return response.getOpenshiftObject();
} catch (MalformedURLException e) {
throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
} catch (HttpClientException e) {
@@ -188,9 +188,9 @@
* ,"app_name","api"],"exit_code":0}
*/
@Override
- public Status getStatus(Application application) throws OpenshiftException {
- application = requestApplicationAction(
- new ApplicationRequest(application.getName(), application.getCartridge(),ApplicationAction.STATUS, username, true));
+ public String getStatus(String applicationName, Cartridge cartridge) throws OpenshiftException {
+ Application application = requestApplicationAction(
+ new ApplicationRequest(applicationName, cartridge, ApplicationAction.STATUS, username, true));
throw new UnsupportedOperationException();
}
@@ -199,14 +199,14 @@
try {
String applicationRequestString =
new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
- String request = new OpenshiftJsonRequestFactory(password, applicationRequestString).create();
+ String request = new OpenshiftJsonRequestFactory(password, applicationRequestString).createString();
String response = createHttpClient(url).post(request);
response = JsonSanitizer.sanitize(response);
OpenshiftResponse<Application> openshiftResponse =
new ApplicationResponseUnmarshaller(applicationRequest.getName(),
applicationRequest.getCartridge(), this).unmarshall(response);
- return openshiftResponse.getData();
+ return openshiftResponse.getOpenshiftObject();
} catch (MalformedURLException e) {
throw new OpenshiftException(
e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/IOpenshiftRequestFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/IOpenshiftRequestFactory.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/IOpenshiftRequestFactory.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core.internal.request;
+
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+
+/**
+ * @author André Dietisheim
+ */
+public interface IOpenshiftRequestFactory {
+
+ /**
+ * Creates an request String that may be sent to the openshift server
+ * @return
+ * @throws OpenshiftException
+ */
+ public String createString() throws OpenshiftException;
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/IOpenshiftRequestFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/OpenshiftJsonRequestFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/OpenshiftJsonRequestFactory.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/request/OpenshiftJsonRequestFactory.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -22,7 +22,7 @@
*
* @author André Dietisheim
*/
-public class OpenshiftJsonRequestFactory {
+public class OpenshiftJsonRequestFactory implements IOpenshiftRequestFactory {
private static final char EQ = '=';
private static final String PROPERTY_PASSWORD = "password";
@@ -38,7 +38,7 @@
this.payloads = payloads;
}
- public String create() throws OpenshiftException {
+ public String createString() throws OpenshiftException {
try {
StringBuilder builder = new StringBuilder();
appendPassword(builder);
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/ApplicationStatusUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/ApplicationStatusUnmarshaller.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/ApplicationStatusUnmarshaller.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core.internal.response;
+
+import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationStatusUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<Application> {
+
+ private String applicationName;
+ private Cartridge cartridge;
+ private IOpenshiftService service;
+
+ public ApplicationStatusUnmarshaller(String applicationName, IOpenshiftService service) {
+ this.applicationName = applicationName;
+ this.service = service;
+ }
+
+ @Override
+ protected Application createOpenshiftObject(ModelNode node) {
+ return new Application(applicationName, cartridge, service);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/ApplicationStatusUnmarshaller.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/OpenshiftResponse.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/OpenshiftResponse.java 2011-09-15 10:44:37 UTC (rev 34758)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/OpenshiftResponse.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -42,7 +42,7 @@
return result;
}
- public OPENSHIFTOBJECT getData() {
+ public OPENSHIFTOBJECT getOpenshiftObject() {
return openshiftObject;
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/UserInfoResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/UserInfoResponseUnmarshaller.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/UserInfoResponseUnmarshaller.java 2011-09-15 10:48:51 UTC (rev 34759)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core.internal.response;
+
+import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserInfoResponseUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<UserInfo> {
+
+ @Override
+ protected UserInfo createOpenshiftObject(ModelNode node) {
+ return new UserInfo("", "", "", "", "");
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/UserInfoResponseUnmarshaller.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r34758 - in trunk/as/tests/org.jboss.ide.eclipse.as.egit.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-15 06:44:37 -0400 (Thu, 15 Sep 2011)
New Revision: 34758
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
Log:
corrected plugin version to 0.0.1
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/META-INF/MANIFEST.MF 2011-09-15 10:44:28 UTC (rev 34757)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/META-INF/MANIFEST.MF 2011-09-15 10:44:37 UTC (rev 34758)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: EGit Tests
Bundle-SymbolicName: org.jboss.ide.eclipse.as.egit.test
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 0.0.1.qualifier
Bundle-Activator: org.jboss.ide.eclipse.as.egit.internal.test.EGitTestActivator
Bundle-Vendor: JBoss by Red Hat
Require-Bundle: org.jboss.ide.eclipse.as.egit.core;bundle-version="0.0.1",
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-09-15 10:44:28 UTC (rev 34757)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-09-15 10:44:37 UTC (rev 34758)
@@ -9,4 +9,5 @@
<groupId>org.jboss.tools.as.tests</groupId>
<artifactId>org.jboss.ide.eclipse.as.egit.internal.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
+ <version>0.0.1</version>
</project>
14 years, 7 months