JBoss Tools SVN: r43119 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-08-21 05:09:07 -0400 (Tue, 21 Aug 2012)
New Revision: 43119
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java
Log:
modificiation to ensure wizards test order
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java 2012-08-21 00:18:06 UTC (rev 43118)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java 2012-08-21 09:09:07 UTC (rev 43119)
@@ -47,7 +47,19 @@
}
@Test
- public void testQualifier() {
+ public void testComponentsWizards() {
+ testQualifier();
+ testScope();
+ testIBinding();
+ testStereotype();
+ testDecorator();
+ testInterceptor();
+ testBeansXml();
+ testBean();
+ testAnnLiteral();
+ }
+
+ private void testQualifier() {
wizardExt.qualifier(getPackageName(), "Q1", false, false).finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
@@ -73,8 +85,7 @@
assertTrue(code.startsWith("/**"));
}
- @Test
- public void testScope() {
+ private void testScope() {
wizardExt.scope(getPackageName(), "Scope1", true, false, true, false).finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
@@ -116,8 +127,7 @@
assertTrue(code.startsWith("/**"));
}
- @Test
- public void testIBinding() {
+ private void testIBinding() {
CDIWizardBase w = wizardExt.binding(getPackageName(), "B1", null, true, false);
assertEquals(2, w.getTargets().size());
w.finish();
@@ -172,8 +182,7 @@
assertTrue(code.contains("@B2"));
}
- @Test
- public void testStereotype() {
+ private void testStereotype() {
CDIWizardBase w = wizardExt.stereotype(getPackageName(), "S1", null, null, false, false, false, false,
false);
assertEquals(9, w.getScopes().size());
@@ -229,8 +238,7 @@
assertFalse(code.startsWith("/**"));
}
- @Test
- public void testDecorator() {
+ private void testDecorator() {
bot.sleep(Timing.time1S());
CDIWizardBase w = wizardExt.decorator(getPackageName(), "", "java.lang.Comparable", null, true, true, false, false);
w.finish();
@@ -265,8 +273,7 @@
assertTrue(code.startsWith("/**"));
}
- @Test
- public void testInterceptor() {
+ private void testInterceptor() {
CDIWizardBase w = wizardExt.interceptor(getPackageName(), "I1", "B2", null, null, false);
w.finish();
util.waitForNonIgnoredJobs();
@@ -297,8 +304,7 @@
assertTrue(code.contains("extends Date"));
}
- @Test
- public void testBeansXml() {
+ private void testBeansXml() {
CDIWizardBase w = new NewCDIFileWizard(CDIWizardType.BEANS_XML).run();
w.setSourceFolder(getProjectName() + "/WebContent/WEB-INF");
assertFalse(w.canFinish());
@@ -310,8 +316,7 @@
w.cancel();
}
- @Test
- public void testBean() {
+ private void testBean() {
CDIWizardBase w = wizardExt.bean(getPackageName(), "Bean1", true, true, false, false, false, false, null, null, null, null);
w.finish();
util.waitForNonIgnoredJobs();
@@ -355,8 +360,7 @@
assertTrue(code.startsWith("/**"));
}
- @Test
- public void testAnnLiteral() {
+ private void testAnnLiteral() {
CDIWizardBase w = wizardExt.annLiteral(getPackageName(), "AnnL1", true, false, true, false, getPackageName() + ".Q1");
w.finish();
util.waitForNonIgnoredJobs();
12 years, 4 months
JBoss Tools SVN: r43118 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-20 20:18:06 -0400 (Mon, 20 Aug 2012)
New Revision: 43118
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/TypeDeclaration.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java 2012-08-20 20:15:07 UTC (rev 43117)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java 2012-08-21 00:18:06 UTC (rev 43118)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.java;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -33,7 +34,7 @@
public class ParametedType implements IParametedType {
protected ParametedTypeFactory typeFactory = null;
protected IType type;
- protected String arrayPrefix = ""; //$NON-NLS-1$
+ protected int arrayIndex = 0;
protected String signature;
protected List<ParametedType> parameterTypes = new ArrayList<ParametedType>();
protected boolean primitive;
@@ -103,10 +104,24 @@
return type;
}
+ public int getArrayIndex() {
+ return arrayIndex;
+ }
+
public String getArrayPrefix() {
- return arrayPrefix;
+ return toArrayPrefix(arrayIndex);
}
+ static String[] PREFIXES = new String[4];
+ static {
+ PREFIXES[0] = ""; //$NON-NLS-1$
+ for (int i = 1; i < PREFIXES.length; i++) PREFIXES[i] = PREFIXES[i - 1] + Signature.C_ARRAY;
+ }
+
+ private static String toArrayPrefix(int arrayIndex) {
+ return arrayIndex < PREFIXES.length ? PREFIXES[arrayIndex] : PREFIXES[3] + toArrayPrefix(arrayIndex - 3);
+ }
+
public String getSignature() {
return signature;
}
@@ -117,11 +132,9 @@
public void setSignature(String signature) {
this.signature = signature;
- arrayPrefix = ""; //$NON-NLS-1$
+ arrayIndex = 0;
if(signature != null) {
- for (int i = 0; i < signature.length(); i++) {
- if(signature.charAt(i) == Signature.C_ARRAY) arrayPrefix += Signature.C_ARRAY; else break;
- }
+ for (; arrayIndex < signature.length() && (signature.charAt(arrayIndex) == Signature.C_ARRAY); arrayIndex++) {}
}
}
@@ -154,7 +167,7 @@
return false;
}
}
- if(!arrayPrefix.equals(other.arrayPrefix)) {
+ if(arrayIndex != other.arrayIndex) {
return false;
}
@@ -170,14 +183,14 @@
boolean objectArray = false;
if(sc != null) {
sc = resolveParameters(sc);
- } else if(!"java.lang.Object".equals(type.getFullyQualifiedName())) {
+ } else if(!"java.lang.Object".equals(type.getFullyQualifiedName())) { //$NON-NLS-1$
sc = ParametedTypeFactory.OBJECT;
- } else if("java.lang.Object".equals(type.getFullyQualifiedName()) && arrayPrefix.length() > 0) {
+ } else if("java.lang.Object".equals(type.getFullyQualifiedName()) && arrayIndex > 0) { //$NON-NLS-1$
objectArray = true;
sc = ParametedTypeFactory.OBJECT;
}
- if(!objectArray && arrayPrefix.length() > 0) {
- sc = arrayPrefix + sc;
+ if(!objectArray && arrayIndex > 0) {
+ sc = getArrayPrefix() + sc;
}
superType = getFactory().getParametedType(type, this, sc);
@@ -196,7 +209,7 @@
String[] is = type.getSuperInterfaceTypeSignatures();
if(is != null) for (int i = 0; i < is.length; i++) {
String p = resolveParameters(is[i]);
- if(arrayPrefix.length() > 0) p = arrayPrefix + p;
+ if(arrayIndex > 0) p = getArrayPrefix() + p;
ParametedType t = getFactory().getParametedType(type, this, p);
if(t != null) {
if(provider != null) {
@@ -304,7 +317,7 @@
return parametersBySignature.get(signature);
}
- public Set<IParametedType> getAllTypes() {
+ public Collection<IParametedType> getAllTypes() {
if(allInheritedTypes == null) {
allInheritedTypes = buildAllTypes(new HashSet<String>(), this, new HashSet<IParametedType>());
}
@@ -328,7 +341,7 @@
}
public String toString() {
- return signature + ":" + super.toString();
+ return signature + ":" + super.toString(); //$NON-NLS-1$
}
public boolean isAssignableTo(ParametedType other, boolean checkInheritance) {
@@ -337,7 +350,7 @@
boolean isAssignableTo(ParametedType other, boolean checkInheritance, Map<String,IType> resolvedVars) {
if(equals(other)) return true;
- if("*".equals(other.getSignature())) {
+ if("*".equals(other.getSignature())) { //$NON-NLS-1$
return true;
}
if(this.type == null) {
@@ -413,7 +426,7 @@
public String getSimpleName() {
if(getSignature()!=null) {
if(isPrimitive()) {
- int array = arrayPrefix.length();
+ int array = arrayIndex;
StringBuilder result = new StringBuilder(primitives.get(Signature.getSignatureSimpleName(getSignature().substring(array))));
if(array > 0) {
for (int i = 0; i < array; i++) {
@@ -425,6 +438,6 @@
return Signature.getSignatureSimpleName(getSignature());
}
}
- return "";
+ return ""; //$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java 2012-08-20 20:15:07 UTC (rev 43117)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java 2012-08-21 00:18:06 UTC (rev 43118)
@@ -95,7 +95,7 @@
result.setFactory(this);
result.setSignature(typeSignature);
- typeSignature = typeSignature.substring(result.getArrayPrefix().length());
+ typeSignature = typeSignature.substring(result.getArrayIndex());
char c = typeSignature.length() == 0 ? '\0' : typeSignature.charAt(0);
if(primitives.containsKey(c) && typeSignature.length() == 1) {
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/TypeDeclaration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/TypeDeclaration.java 2012-08-20 20:15:07 UTC (rev 43117)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/TypeDeclaration.java 2012-08-21 00:18:06 UTC (rev 43118)
@@ -25,7 +25,7 @@
public TypeDeclaration(ParametedType type, IResource resource, int startPosition, int length) {
this.setFactory(type.getFactory());
this.type = type.getType();
- arrayPrefix = type.arrayPrefix;
+ arrayIndex = type.arrayIndex;
this.resource = resource;
this.length = length;
this.startPosition = startPosition;
12 years, 4 months
JBoss Tools SVN: r43117 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-08-20 16:15:07 -0400 (Mon, 20 Aug 2012)
New Revision: 43117
Modified:
trunk/build/parent/pom.xml
Log:
https://issues.jboss.org/browse/JBIDE-12438 default profile is not activated by default on mac os
added target platform repository to osx profile
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-08-20 15:32:51 UTC (rev 43116)
+++ trunk/build/parent/pom.xml 2012-08-20 20:15:07 UTC (rev 43117)
@@ -616,6 +616,20 @@
<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
<platformSystemProperties> -d32 -Dosgi.arch=x86 -XstartOnFirstThread </platformSystemProperties>
</properties>
+ <!-- This is required to have it working by default under mac osx for swtbot tests -->
+ <repositories>
+ <repository>
+ <id>jbosstools-target-site</id>
+ <url>${jbosstools-target-site}</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
</profile>
<profile>
@@ -785,8 +799,6 @@
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
- <!-- Single repo containing contents of unified.target, but without using
- the target file -->
<repository>
<id>jbosstools-target-site</id>
<url>${jbosstools-target-site}</url>
12 years, 4 months
JBoss Tools SVN: r43116 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-08-20 11:32:51 -0400 (Mon, 20 Aug 2012)
New Revision: 43116
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
Log:
Fix error made by previous commit.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2012-08-20 14:44:20 UTC (rev 43115)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2012-08-20 15:32:51 UTC (rev 43116)
@@ -23,7 +23,8 @@
org.jboss.tools.ui.bot.ext.types,
org.jboss.tools.ui.bot.ext.view,
org.jboss.tools.ui.bot.ext.widgets,
- org.jboss.tools.ui.bot.ext.wizards
+ org.jboss.tools.ui.bot.ext.wizards,
+ org.jboss.tools.ui.bot.ext.zest
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
@@ -41,6 +42,8 @@
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.draw2d;bundle-version="3.6.1",
+ org.eclipse.zest.core;bundle-version="1.2.0",
+ org.eclipse.zest.layouts;bundle-version="1.1.0",
org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.0.0",
org.eclipse.gef;bundle-version="3.6.1",
org.eclipse.ui,
12 years, 4 months
JBoss Tools SVN: r43115 - in trunk/forge/tests/org.jboss.tools.forge.ui.bot.test: resources/properties and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2012-08-20 10:44:20 -0400 (Mon, 20 Aug 2012)
New Revision: 43115
Modified:
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/src/org/jboss/tools/forge/ui/bot/test/suite/ForgeTest.java
Log:
* @Require server added
Modified: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-20 14:43:52 UTC (rev 43114)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-20 14:44:20 UTC (rev 43115)
@@ -14,7 +14,7 @@
<properties>
<jbosstools.test.jboss-as.home>${requirementsDirectory}/jboss-as-7.1.1.Final</jbosstools.test.jboss-as.home>
<additionalSystemProperties></additionalSystemProperties>
- <systemProperties>${additionalSystemProperties} -Dtest.configurations.dir=resources/properties -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}</systemProperties>
+ <systemProperties>${additionalSystemProperties} -DJAVA_HOME=${JAVA_HOME} -Dtest.configurations.dir=resources/properties -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}</systemProperties>
</properties>
<profiles>
Modified: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties 2012-08-20 14:43:52 UTC (rev 43114)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties 2012-08-20 14:44:20 UTC (rev 43115)
@@ -3,9 +3,10 @@
# <java version>,<jre/jdk home>
# JAVA=1.6,/usr/java/jdk1.6.0_25/jre
# JAVA=1.6,${JAVA_HOME}
+JAVA=1.x,${JAVA_HOME}
#EAP|JBOSS_AS|EPP|SOA,<server version>,<jre version to run with>|default,<server home>
# note : when server is type of SOA, version is version of SOA (not the bundled EAP)
-SERVER=AS,7.0,default,${jbosstools.test.jboss-as.home}
+SERVER=AS,7.1,1.x,${jbosstools.test.jboss-as.home}
#<seam version>,<seam runtime home>
#SEAM=2.2,/opt/jbdevstudio4.1.1.GA/jboss-eap/seam
#<esb versoin>,<esb runtime home>
Modified: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/src/org/jboss/tools/forge/ui/bot/test/suite/ForgeTest.java
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/src/org/jboss/tools/forge/ui/bot/test/suite/ForgeTest.java 2012-08-20 14:43:52 UTC (rev 43114)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/src/org/jboss/tools/forge/ui/bot/test/suite/ForgeTest.java 2012-08-20 14:44:20 UTC (rev 43115)
@@ -1,7 +1,6 @@
package org.jboss.tools.forge.ui.bot.test.suite;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
-
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
@@ -10,16 +9,21 @@
import org.jboss.tools.forge.ui.bot.test.util.ConsoleUtils;
import org.jboss.tools.forge.ui.bot.test.util.ViewUtils;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
/**
*
* @author psrna
*
*/
+@Require(server = @Server(type = ServerType.ALL, state = ServerState.Present))
public class ForgeTest extends SWTTestExt {
protected static final String PROJECT_NAME = "testproject";
@@ -164,6 +168,7 @@
}
public static void startForge(){
+ log.info("Trying to start forge...");
if(!isForgeViewActive())
openForgeView();
@@ -175,7 +180,7 @@
//not working with juno ^^^
//workaround:
ViewUtils.getToolbarButton("Start the default Forge runtime").click();
-
+
util.waitForNonIgnoredJobs();
}
12 years, 4 months
JBoss Tools SVN: r43113 - branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: psuchy
Date: 2012-08-20 10:04:34 -0400 (Mon, 20 Aug 2012)
New Revision: 43113
Modified:
branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java
Log:
Modified: branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java
===================================================================
--- branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java 2012-08-20 13:53:22 UTC (rev 43112)
+++ branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java 2012-08-20 14:04:34 UTC (rev 43113)
@@ -14,8 +14,8 @@
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
- //DetectJBoss7.class,
- //OperateJBoss7.class,
+ DetectJBoss7.class,
+ OperateJBoss7.class,
DetectSeam22.class,
CheckSeam22.class,
DetectSeam23.class,
12 years, 4 months
JBoss Tools SVN: r43112 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-08-20 09:53:22 -0400 (Mon, 20 Aug 2012)
New Revision: 43112
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/HibernateJptPlugin.java
Log:
https://issues.jboss.org/browse/JBIDE-9535
Update logic of getting default schema/catalog
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 2012-08-20 13:38:35 UTC (rev 43111)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2012-08-20 13:53:22 UTC (rev 43112)
@@ -83,41 +83,75 @@
return null;
}
+ /*
+ * The sequence is(from biggest priority to lowest):
+ * 1) Configuration.getProperty() (if cc.hasConfiguration())
+ * 2) ConsoleConfiguration.getPreference().getProperty()-uses hibernate.properties
+ * 3) JpaProject user overrides
+ * 4) persistence.xml
+ * 5) logic from superclass
+ */
@Override
public String getDefaultSchema() {
+ String schema = null;
ConsoleConfiguration cc = getDefaultConsoleConfiguration();
if (cc != null){
+ if (cc.hasConfiguration()){//was not build yet
+ Configuration configuration = cc.getConfiguration();
+ if (configuration.getProperties().containsKey(Environment.DEFAULT_SCHEMA)){
+ schema = configuration.getProperty(Environment.DEFAULT_SCHEMA);
+ }
+ }
Properties properties = cc.getPreferences().getProperties();
if (properties != null && properties.containsKey(Environment.DEFAULT_SCHEMA)){
- return properties.getProperty(Environment.DEFAULT_SCHEMA);
+ schema = properties.getProperty(Environment.DEFAULT_SCHEMA);
}
}
- String schema = null;
- BasicHibernateProperties prop = getBasicHibernateProperties();
- if (getUserOverrideDefaultSchema() != null){
- schema = getUserOverrideDefaultSchema();
- } else if (prop != null && prop.getSchemaDefault() != null){
- schema = prop.getSchemaDefault();
+ if (schema == null){
+ BasicHibernateProperties prop = getBasicHibernateProperties();
+ if (getUserOverrideDefaultSchema() != null){
+ schema = getUserOverrideDefaultSchema();
+ } else if (prop != null && prop.getSchemaDefault() != null){
+ schema = prop.getSchemaDefault();
+ }
}
return schema != null ? schema : super.getDefaultSchema();
}
+ /*
+ * The sequence is(from biggest priority to lowest):
+ * 1) Configuration.getProperty() (if cc.hasConfiguration())
+ * 2) ConsoleConfiguration.getPreference().getProperty()-uses hibernate.properties
+ * 3) JpaProject user overrides
+ * 4) persistence.xml
+ * 5) logic from superclass
+ */
@Override
public String getDefaultCatalog() {
String catalog = null;
BasicHibernateProperties prop = getBasicHibernateProperties();
ConsoleConfiguration cc = getDefaultConsoleConfiguration();
if (cc != null){
+ if (cc.hasConfiguration()){//was not build yet
+ Configuration configuration = cc.getConfiguration();
+ if (configuration.getProperties().containsKey(Environment.DEFAULT_CATALOG)){
+ catalog = configuration.getProperty(Environment.DEFAULT_CATALOG);
+ }
+
+ }
Properties properties = cc.getPreferences().getProperties();
if (properties != null && properties.containsKey(Environment.DEFAULT_CATALOG)){
- return properties.getProperty(Environment.DEFAULT_CATALOG);
+ catalog = properties.getProperty(Environment.DEFAULT_CATALOG);
}
- } else if (getUserOverrideDefaultCatalog() != null){
- catalog = getUserOverrideDefaultCatalog();
- } else if (prop != null && prop.getCatalogDefault() != null){
- catalog = prop.getCatalogDefault();
}
+ if (catalog == null){
+ if (getUserOverrideDefaultCatalog() != null){
+ catalog = getUserOverrideDefaultCatalog();
+ } else if (prop != null && prop.getCatalogDefault() != null){
+ catalog = prop.getCatalogDefault();
+ }
+ }
return catalog != null ? catalog : super.getDefaultCatalog();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java 2012-08-20 13:38:35 UTC (rev 43111)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java 2012-08-20 13:53:22 UTC (rev 43112)
@@ -122,8 +122,7 @@
@Override
public void configurationBuilt(ConsoleConfiguration ccfg) {
- if (ccfg.getConfiguration() == null
- || ccfg.getConfiguration().getNamingStrategy() == null){
+ if (ccfg.getConfiguration() == null){
return;
}
revalidateProjects(ccfg);
12 years, 4 months
JBoss Tools SVN: r43111 - in trunk/tests/plugins/org.jboss.tools.ui.bot.ext: src/org/jboss/tools/ui/bot/ext and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-08-20 09:38:35 -0400 (Mon, 20 Aug 2012)
New Revision: 43111
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
Log:
Add possibility to screen cast to all SWTBot tests from test run
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2012-08-20 13:19:55 UTC (rev 43110)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2012-08-20 13:38:35 UTC (rev 43111)
@@ -23,8 +23,7 @@
org.jboss.tools.ui.bot.ext.types,
org.jboss.tools.ui.bot.ext.view,
org.jboss.tools.ui.bot.ext.widgets,
- org.jboss.tools.ui.bot.ext.wizards,
- org.jboss.tools.ui.bot.ext.zest
+ org.jboss.tools.ui.bot.ext.wizards
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
@@ -42,8 +41,6 @@
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.draw2d;bundle-version="3.6.1",
- org.eclipse.zest.core;bundle-version="1.2.0",
- org.eclipse.zest.layouts;bundle-version="1.1.0",
org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.0.0",
org.eclipse.gef;bundle-version="3.6.1",
org.eclipse.ui,
@@ -52,7 +49,8 @@
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.swtbot.forms.finder
+ org.eclipse.swtbot.forms.finder,
+ org.jboss.tools.tests;bundle-version="3.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.gef,
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2012-08-20 13:19:55 UTC (rev 43110)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2012-08-20 13:38:35 UTC (rev 43111)
@@ -1,5 +1,8 @@
package org.jboss.tools.ui.bot.ext;
+import java.awt.AWTException;
+import java.io.File;
+import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
@@ -13,6 +16,7 @@
import org.apache.log4j.Logger;
import org.eclipse.swtbot.swt.finder.junit.ScreenshotCaptureListener;
+import org.jboss.tools.test.util.ScreenRecorderExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.TestConfiguration;
import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
@@ -43,6 +47,7 @@
*/
public class RequirementAwareSuite extends Suite {
private static boolean runManageBlockingWindow = true;
+ private static ScreenRecorderExt screenRecorderExt = null;
// we have one global instance of cleanup listener
final static DoAfterAllTestsRunListener cleanUp = new DoAfterAllTestsRunListener();
@@ -137,7 +142,7 @@
public List<RequirementBase> getRequirements() {
return Collections.unmodifiableList(this.requirements);
}
-
+
@Override
protected List<FrameworkMethod> computeTestMethods() {
List<FrameworkMethod> testMethods = new ArrayList<FrameworkMethod>();
@@ -175,6 +180,9 @@
try {
super.run(notifier);
} finally {
+ if (System.getProperty("swt.bot.test.record.screencast","false").equalsIgnoreCase("true")){
+ RequirementAwareSuite.stopScreenRecorder();
+ }
notifier.removeListener(failureSpy);
}
}
@@ -186,6 +194,9 @@
@Override
protected Statement withBeforeClasses(Statement statement) {
+ if (System.getProperty("swt.bot.test.record.screencast","false").equalsIgnoreCase("true")){
+ RequirementAwareSuite.startScreenRecorder(getTestClass().getJavaClass().getSimpleName());
+ }
if (RequirementAwareSuite.runManageBlockingWindow){
SWTJBTExt.manageBlockingWidows(false, false);
RequirementAwareSuite.runManageBlockingWindow = false;
@@ -195,6 +206,7 @@
}
log.info("Fullfilling requirements before test "
+ getTestClass().getJavaClass());
+
try {
for (RequirementBase r : requirements) {
r.fulfill();
@@ -450,5 +462,62 @@
ExcludeCategory annotation = klass.getAnnotation(ExcludeCategory.class);
return annotation == null ? null : annotation.value();
}
-
+ /**
+ * Starts Screen Recorder
+ */
+ private static void startScreenRecorder(String className) {
+ if (screenRecorderExt == null) {
+ try {
+ screenRecorderExt = new ScreenRecorderExt();
+ } catch (IOException ioe) {
+ throw new RuntimeException("Unable to initialize Screen Recorder.", ioe);
+ } catch (AWTException awte) {
+ throw new RuntimeException("Unable to initialize Screen Recorder.", awte);
+ }
+ }
+ if (screenRecorderExt != null) {
+ if (screenRecorderExt.isState(ScreenRecorderExt.STATE_DONE)) {
+ try {
+ File screenCastDir = new File ("screencasts");
+ if (!screenCastDir.exists()){
+ screenCastDir.mkdir();
+ }
+ final String fileName = "screencasts" + File.separator + className;
+ log.info("Starting Screen Recorder. Saving Screen Cast to file: " + fileName);
+ screenRecorderExt.start(fileName);
+ } catch (IOException ioe) {
+ throw new RuntimeException("Unable to start Screen Recorder.", ioe);
+ }
+ } else {
+ throw new RuntimeException(
+ "Unable to start Screen Recorder.\nScreen Recorder is not in state DONE.");
+ }
+ } else {
+ log.error("Screen Recorder was not properly initilized");
+ }
+ }
+ /**
+ * Stops Screen Recorder
+ */
+ private static void stopScreenRecorder(){
+ if (screenRecorderExt != null){
+ if (screenRecorderExt.isState(ScreenRecorderExt.STATE_RECORDING)){
+ try {
+ screenRecorderExt.stop();
+ log.info("Screen Recorder stopped.");
+ } catch (IOException ioe) {
+ throw
+ new RuntimeException("Unable to stop Screen Recorder." , ioe);
+ }
+ }
+ else{
+ throw
+ new RuntimeException("Unable to stop Screen Recorder.\nScreen Recorder is no in state RECORDING.");
+ }
+ }
+ else {
+ throw
+ new RuntimeException("Unable to stop Screen Recorder.\nScreen Recorder was not properly initilized");
+ }
+ }
}
12 years, 4 months
JBoss Tools SVN: r43110 - in trunk/tests/plugins/org.jboss.tools.tests: META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-08-20 09:19:55 -0400 (Mon, 20 Aug 2012)
New Revision: 43110
Added:
trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
trunk/tests/plugins/org.jboss.tools.tests/resources/
trunk/tests/plugins/org.jboss.tools.tests/resources/lib/
trunk/tests/plugins/org.jboss.tools.tests/resources/lib/ScreenRecorder.jar
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
Modified:
trunk/tests/plugins/org.jboss.tools.tests/.classpath
trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.tests/about.html
trunk/tests/plugins/org.jboss.tools.tests/build.properties
Log:
Add screencast recording util.
Modified: trunk/tests/plugins/org.jboss.tools.tests/.classpath
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/.classpath 2012-08-20 13:10:24 UTC (rev 43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/.classpath 2012-08-20 13:19:55 UTC (rev 43110)
@@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="resources/lib/ScreenRecorder.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2012-08-20 13:10:24 UTC (rev 43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2012-08-20 13:19:55 UTC (rev 43110)
@@ -15,7 +15,8 @@
org.jboss.tools.test.util,
org.jboss.tools.test.util.xpl,
org.jboss.tools.tests
-Bundle-ClassPath: .
+Bundle-ClassPath: .,
+ resources/lib/ScreenRecorder.jar
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Activator: org.jboss.tools.tests.TestsPlugin
Modified: trunk/tests/plugins/org.jboss.tools.tests/about.html
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/about.html 2012-08-20 13:10:24 UTC (rev 43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/about.html 2012-08-20 13:19:55 UTC (rev 43110)
@@ -30,5 +30,15 @@
and such source code may be obtained at
<A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+<H3>Third party</H3>
+<P>
+The Content includes Monte Media Library. Use of the Monte Media Library is free for all uses (non-commercial,
+commercial and educational) under the terms of <A href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 (CC BY 3.0)</A>.
+<BR>
+<BR>
+Author of Monte Media library is Werner Randelshofer, Immensee, Switzerland.
+<BR>
+<A href="www.randelshofer.ch">www.randelshofer.ch</A>
+</P>
</BODY>
</HTML>
\ No newline at end of file
Modified: trunk/tests/plugins/org.jboss.tools.tests/build.properties
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/build.properties 2012-08-20 13:10:24 UTC (rev 43109)
+++ trunk/tests/plugins/org.jboss.tools.tests/build.properties 2012-08-20 13:19:55 UTC (rev 43110)
@@ -10,7 +10,9 @@
plugin.properties,\
about.html,\
.project,\
- .classpath
+ .classpath,\
+ monte-library-license.html,\
+ resources/
bin.includes = .,\
META-INF/,\
testProject1/,\
@@ -18,4 +20,6 @@
plugin.xml,\
plugin_customization.ini,\
plugin.properties,\
- about.html
+ about.html,\
+ monte-library-license.html,\
+ resources/
Added: trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html 2012-08-20 13:19:55 UTC (rev 43110)
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Pure Java Screen Recorder Demo | License</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<style type="text/css">
+<!--
+* {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ line-height: 140%;
+ font-weight: normal;
+ font-size: 12px;
+ background-color: #FFFFFF;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+.header {
+ padding-bottom: 20px;
+}
+.header h1 {
+ font-size: 16px;
+ font-weight: bold;
+}
+.header .byline {
+ font-weight: bold;
+}
+.article {
+}
+.article ul {
+ padding-bottom: 10px;
+}
+.toc ul {
+ padding-bottom: 10px;
+}
+.article p {
+ padding-bottom: 12px;
+}
+body {
+ width: 512px;
+ padding-top: 10px;
+ padding-right: 10px;
+ padding-bottom: 20px;
+ padding-left: 10px;
+}
+.article h1 {
+ font-size: 16px;
+ font-weight: bold;
+ padding-top: 10px;
+}
+.article h2 {
+ font-weight: bold;
+ padding-top: 10px;
+}
+-->
+</style>
+</head>
+
+<body>
+<div class="header" >
+ <h1>Pure Java Screen Recorder Demo</h1>
+ <p class="byline">License</p>
+</div>
+<div class="toc" >
+ <h1>Table of Contents</h1>
+ <ul>
+ <li><a href="#disclaimer">Disclaimer</a></li>
+ <li><a href="#Fee2">License Fee</a></li>
+ <li><a href="#Fee">License Terms</a></li>
+ <li><a href="#Copyright">Copyright</a></li>
+ </ul>
+</div>
+<div class="article" >
+ <h1><a name="disclaimer" id="disclaimer"></a>Disclaimer</h1>
+ <p>Use of the demo is entirely at your own risk. I will not be
+ liable for any data
+ loss, hardware damage or whatever this program might cause. </p>
+ <h1 class="semiparagraph"><a name="Fee" id="Fee2"></a>License Fee</h1>
+ <p>Use of the demo iis free for all uses, including personal use, educational use, and commercial use.</p>
+ <h1></h1>
+ <h1><a name="Terms" id="Terms"></a>License Terms</h1>
+ <p>You can license the demo under the terms of the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.</p>
+ <h2> You are free:</h2>
+ <ul>
+ <li>to Share — to copy, distribute and transmit the work</li>
+ <li> to Remix — to adapt the work</li>
+ </ul>
+ <h2> Under the following conditions:</h2>
+ <ul>
+ <li> Attribution. You must keep an attribution to the author, Werner Randelshofer, in the source files (but not in any way that suggests that they endorse you or your use of the work).</li>
+ </ul>
+ <p> For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to <a href="http://creativecommons.org/licenses/by/3.0/">this web page</a>.</p>
+ <p>Any of the above conditions can be waived if you get permission from the copyright holder.</p>
+ <p>Nothing in this license impairs or restricts the author's moral rights.</p>
+ <h1><a name="Copyright" id="Copyright"></a>Copyright</h1>
+ <h5 class="semiparagraph">Pure Java Screen Recorder Demo © 2008-2011</h5>
+ <p> Werner Randelshofer, Hausmatt 10, Immensee,
+ CH-6405, Switzerland<br />
+ <a href="http://www.randelshofer.ch/">http://www.randelshofer.ch/</a><br />
+ <a href="mailto:werner.randelshofer@bluewin.ch">werner.randelshofer(a)bluewin.ch<br />
+ </a>All Rights Reserved.</p>
+</div>
+</body>
+</html>
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/monte-library-license.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/plugins/org.jboss.tools.tests/resources/lib/ScreenRecorder.jar
===================================================================
(Binary files differ)
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/resources/lib/ScreenRecorder.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java 2012-08-20 13:19:55 UTC (rev 43110)
@@ -0,0 +1,152 @@
+package org.jboss.tools.test.util;
+
+import static org.monte.media.FormatKeys.EncodingKey;
+import static org.monte.media.FormatKeys.FrameRateKey;
+import static org.monte.media.FormatKeys.KeyFrameIntervalKey;
+import static org.monte.media.FormatKeys.MIME_QUICKTIME;
+import static org.monte.media.FormatKeys.MediaTypeKey;
+import static org.monte.media.FormatKeys.MimeTypeKey;
+import static org.monte.media.VideoFormatKeys.CompressorNameKey;
+import static org.monte.media.VideoFormatKeys.DepthKey;
+import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_ANIMATION;
+import static org.monte.media.VideoFormatKeys.QualityKey;
+
+import java.awt.AWTException;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.io.File;
+import java.io.IOException;
+
+import org.monte.screenrecorder.ScreenRecorder;
+import org.monte.media.Format;
+import org.monte.media.Registry;
+import org.monte.media.FormatKeys.MediaType;
+import org.monte.media.math.Rational;
+/**
+ * Extends ScreenRecorder class due to possibility to specify location
+ * of file with recorder screen cast
+ * @author Vlado Pakan
+ *
+ * ScreenRecorder class was created by Werner Randelshofer, Immensee, Switzerland.
+ * www.randelshofer.ch
+ *
+ * Use of the Monte Media Library is free for all uses (non-commercial, commercial and educational)
+ * under the terms of Creative Commons Attribution 3.0 (CC BY 3.0).
+ * http://creativecommons.org/licenses/by/3.0/
+ *
+ */
+public class ScreenRecorderExt extends ScreenRecorder{
+ private String useFileName = null;
+ public static final String STATE_DONE = "DONE";
+ public static final String STATE_RECORDING = "RECORDING";
+ public static final String STATE_FAILED = "FAILED";
+
+ /**
+ * Default constructor for .mov screen cast file
+ * @throws IOException
+ * @throws AWTException
+ */
+ public ScreenRecorderExt() throws IOException, AWTException {
+ this(GraphicsEnvironment
+ .getLocalGraphicsEnvironment()
+ .getDefaultScreenDevice()
+ .getDefaultConfiguration(),
+ new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_QUICKTIME),
+ new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey,
+ ENCODING_QUICKTIME_ANIMATION, CompressorNameKey,
+ ENCODING_QUICKTIME_ANIMATION, DepthKey, (int) 24,
+ FrameRateKey, Rational.valueOf(15), QualityKey, 1.0f,
+ KeyFrameIntervalKey, (int) (15 * 60)),
+ new Format(MediaTypeKey,
+ MediaType.VIDEO, EncodingKey, "black", FrameRateKey,
+ Rational.valueOf(30)),
+ null);
+ }
+ /**
+ * Creates ScreenRecorderExt instance with parametrs
+ * @param cfg
+ * @param fileFormat
+ * @param screenFormat
+ * @param mouseFormat
+ * @param audioFormat
+ * @throws IOException
+ * @throws AWTException
+ */
+ public ScreenRecorderExt(GraphicsConfiguration cfg, Format fileFormat,
+ Format screenFormat, Format mouseFormat, Format audioFormat)
+ throws IOException, AWTException {
+ super(cfg, fileFormat, screenFormat, mouseFormat, audioFormat);
+ }
+
+ /**
+ * Start screen cast recording to specified file name
+ * @param fileName
+ * @throws IOException
+ */
+ public void start(String fileName) throws IOException{
+ this.useFileName = fileName;
+ super.start();
+ }
+ /**
+ * Start screen cast recording to default file name
+ * @throws IOException
+ */
+ @Override
+ public void start() throws IOException{
+ this.useFileName = null;
+ super.start();
+ }
+ /**
+ * Create movie file for recorder screen cast. Screen cast will be stored
+ * to file specified within proceeding start() method invocation
+ *
+ */
+ @Override
+ protected File createMovieFile(Format fileFormat) throws IOException {
+ File fileToWriteMovie;
+ if (this.useFileName == null || this.useFileName.length() == 0){
+ fileToWriteMovie = super.createMovieFile(fileFormat);
+ }
+ else {
+ if (this.useFileName.indexOf('.') < 0){
+ this.useFileName += '.' + Registry.getInstance().getExtension(fileFormat);
+ }
+ fileToWriteMovie = new File(this.useFileName);
+ if (fileToWriteMovie.exists()){
+ fileToWriteMovie.delete();
+ }
+ }
+
+ return fileToWriteMovie;
+ }
+
+ /**
+ * Returns true if state of Screen Recorder is as specified by parameter state
+ * @param state
+ * @return
+ */
+ public boolean isState(String state) {
+ boolean result = false;
+
+ if (state.equals(ScreenRecorderExt.STATE_DONE) && getState().equals(State.DONE)){
+ result = true;
+ } else if (state.equals(ScreenRecorderExt.STATE_RECORDING) && getState().equals(State.RECORDING)){
+ result = true;
+ } else if (state.equals(ScreenRecorderExt.STATE_RECORDING) && getState().equals(State.RECORDING)){
+ result = true;
+ } else if (state.equals(ScreenRecorderExt.STATE_FAILED) && getState().equals(State.FAILED)){
+ result = true;
+ }
+
+ return result;
+ }
+ /**
+ * Overrides parent definition.
+ * Defined to not have access restriction warning
+ */
+ @Override
+ public void stop() throws IOException{
+ super.stop();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 4 months