JBoss Tools SVN: r37833 - trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-01-13 11:30:26 -0500 (Fri, 13 Jan 2012)
New Revision: 37833
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
Log:
[JBIDE-10624] cleaning test case
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2012-01-13 16:07:19 UTC (rev 37832)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2012-01-13 16:30:26 UTC (rev 37833)
@@ -24,11 +24,11 @@
protected final TestUtils testUtils = new TestUtils();
+ private TestProject testProject;
private TestRepository testRepository;
+ private TestRepository testRepositoryClone;
+ private TestProject testProject2;
private TestRepository testRepository2;
- private TestProject testProject;
- private TestProject testProject2;
- private TestRepository clonedTestRepository;
@Before
public void setUp() throws Exception {
@@ -47,8 +47,8 @@
testRepository2.setUserAndEmail(GIT_USER, GIT_EMAIL);
testRepository2.connect(testProject2.getProject());
- this.clonedTestRepository = cloneRepository(testRepository);
- clonedTestRepository.addRemoteTo(REPO2_REMOTE_NAME, testRepository2.getRepository());
+ this.testRepositoryClone = cloneRepository(testRepository);
+ testRepositoryClone.addRemoteTo(REPO2_REMOTE_NAME, testRepository2.getRepository());
}
private TestRepository cloneRepository(TestRepository repository) throws URISyntaxException,
@@ -62,7 +62,7 @@
@After
public void tearDown() throws Exception {
testRepository.dispose();
- clonedTestRepository.dispose();
+ testRepositoryClone.dispose();
testRepository2.dispose();
Activator.getDefault().getRepositoryCache().clear();
@@ -93,10 +93,10 @@
String fileName = "b.txt";
String fileContent = "adietish(a)redhat.com";
- File file = clonedTestRepository.createFile(fileName, fileContent);
- clonedTestRepository.addAndCommit(file, "adding a file");
+ File file = testRepositoryClone.createFile(fileName, fileContent);
+ testRepositoryClone.addAndCommit(file, "adding a file");
- EGitUtils.push(clonedTestRepository.getRepository(), null);
+ EGitUtils.push(testRepositoryClone.getRepository(), null);
// does origin contain file added to clone?
testUtils.assertRepositoryContainsFilesWithContent(
@@ -110,10 +110,10 @@
String fileName = "c.txt";
String fileContent = "adietish(a)redhat.com";
- File file = clonedTestRepository.createFile(fileName, fileContent);
- clonedTestRepository.addAndCommit(file, "adding a file");
+ File file = testRepositoryClone.createFile(fileName, fileContent);
+ testRepositoryClone.addAndCommit(file, "adding a file");
- EGitUtils.push(REPO2_REMOTE_NAME, clonedTestRepository.getRepository(), null);
+ EGitUtils.push(REPO2_REMOTE_NAME, testRepositoryClone.getRepository(), null);
// does origin contain file added to clone?
testUtils.assertRepositoryContainsFilesWithContent(
@@ -133,14 +133,14 @@
fileContent);
testRepository2.add(fileInRepo2);
- File fileInClone = clonedTestRepository.createFile(fileName, fileContent);
- clonedTestRepository.addAndCommit(fileInClone, "adding a file");
+ File fileInClone = testRepositoryClone.createFile(fileName, fileContent);
+ testRepositoryClone.addAndCommit(fileInClone, "adding a file");
- EGitUtils.push(REPO2_REMOTE_NAME, clonedTestRepository.getRepository(), null);
+ EGitUtils.push(REPO2_REMOTE_NAME, testRepositoryClone.getRepository(), null);
// does origin contain file added to clone?
testUtils.assertRepositoryContainsFilesWithContent(
- clonedTestRepository.getRepository(),
+ testRepositoryClone.getRepository(),
fileName,
fileContent);
}
12 years, 12 months
JBoss Tools SVN: r37832 - trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-13 11:07:19 -0500 (Fri, 13 Jan 2012)
New Revision: 37832
Modified:
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java
Log:
JBIDE-10366 Add tests for JBoss Central
Modified: trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java 2012-01-13 16:04:51 UTC (rev 37831)
+++ trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java 2012-01-13 16:07:19 UTC (rev 37832)
@@ -21,9 +21,11 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.WorkbenchWindow;
import org.jboss.tools.central.JBossCentralActivator;
import org.jboss.tools.central.ShowJBossCentral;
import org.jboss.tools.central.editors.JBossCentralEditor;
@@ -46,17 +48,19 @@
public class CentralTest {
private static JBossCentralEditor editor;
+ private static final String ORG_ECLIPSE_UI_INTERNAL_INTROVIEW = "org.eclipse.ui.internal.introview";
+
@BeforeClass
public static void init() throws Exception {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- editor = JBossCentralActivator.getJBossCentralEditor();
- }
- });
-
+ final WorkbenchWindow window = (WorkbenchWindow) PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow();
+ final IWorkbenchPage page = window.getActivePage();
+ IViewPart welcomeView = page.findView(ORG_ECLIPSE_UI_INTERNAL_INTROVIEW);
+ if (welcomeView != null) {
+ page.hideView(welcomeView);
+ }
+ editor = JBossCentralActivator.getJBossCentralEditor();
}
@AfterClass
@@ -66,70 +70,89 @@
@Test
public void testEditorOpen() throws Exception {
- assertTrue("The JBoss Central editor isn't open",editor != null);
+ assertTrue("The JBoss Central editor isn't open", editor != null);
}
-
+
@Test
public void testTutorials() throws Exception {
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
- Map<String, TutorialCategory> categories = RefreshTutorialsJob.INSTANCE.getTutorialCategories();
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
+ Map<String, TutorialCategory> categories = RefreshTutorialsJob.INSTANCE
+ .getTutorialCategories();
assertTrue("No one tutorial is found", categories.size() > 0);
}
-
+
@Test
public void testNews() throws Exception {
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
List<FeedsEntry> news = RefreshNewsJob.INSTANCE.getEntries();
assertTrue("No one news is found", news.size() > 0);
}
-
+
@Test
public void testBlogs() throws Exception {
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
List<FeedsEntry> blogs = RefreshBlogsJob.INSTANCE.getEntries();
assertTrue("No one blog is found", blogs.size() > 0);
}
-
+
@Test
public void testCachingBlogs() throws Exception {
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
- assertTrue("Blog entries aren't cached", RefreshBlogsJob.INSTANCE.getCacheFile().exists());
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
+ assertTrue("Blog entries aren't cached", RefreshBlogsJob.INSTANCE
+ .getCacheFile().exists());
}
-
+
@Test
public void testCachingNews() throws Exception {
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
- assertTrue("News entries aren't cached", RefreshNewsJob.INSTANCE.getCacheFile().exists());
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
+ assertTrue("News entries aren't cached", RefreshNewsJob.INSTANCE
+ .getCacheFile().exists());
}
+
@Test
public void testShowOnStartup() throws Exception {
EditorTestHelper.closeAllEditors();
- assertTrue("The Show On Startup property isn't set by default", JBossCentralActivator.getDefault().showJBossCentralOnStartup());
+ assertTrue("The Show On Startup property isn't set by default",
+ JBossCentralActivator.getDefault().showJBossCentralOnStartup());
new ShowJBossCentral().earlyStartup();
JobUtils.delay(1000);
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
-
- assertTrue("The JBoss Central editor isn't open by default", hasOpenEditor());
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
+
+ assertTrue("The JBoss Central editor isn't open by default",
+ hasOpenEditor());
IEclipsePreferences prefs = JBossCentralActivator.getDefault()
.getPreferences();
prefs.putBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP,
false);
- assertFalse("The Show On Startup property isn't changed", JBossCentralActivator.getDefault().showJBossCentralOnStartup());
+ assertFalse("The Show On Startup property isn't changed",
+ JBossCentralActivator.getDefault().showJBossCentralOnStartup());
EditorTestHelper.closeAllEditors();
new ShowJBossCentral().earlyStartup();
- Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY,
+ new NullProgressMonitor());
JobUtils.delay(1000);
- assertFalse("The JBoss Central editor is open when the Show On Startup property is unchecked", hasOpenEditor());
- prefs.putBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP,
+ assertFalse(
+ "The JBoss Central editor is open when the Show On Startup property is unchecked",
+ hasOpenEditor());
+ prefs.putBoolean(
+ JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP,
JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
}
private boolean hasOpenEditor() {
- IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows();
- for (int i= 0; i < windows.length; i++) {
- IWorkbenchPage[] pages= windows[i].getPages();
- for (int j= 0; j < pages.length; j++) {
- IEditorReference[] editorReferences= pages[j].getEditorReferences();
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench()
+ .getWorkbenchWindows();
+ for (int i = 0; i < windows.length; i++) {
+ IWorkbenchPage[] pages = windows[i].getPages();
+ for (int j = 0; j < pages.length; j++) {
+ IEditorReference[] editorReferences = pages[j]
+ .getEditorReferences();
if (editorReferences.length > 0) {
return true;
}
12 years, 12 months
JBoss Tools SVN: r37831 - trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-13 11:04:51 -0500 (Fri, 13 Jan 2012)
New Revision: 37831
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web apps
- creating of MacOS-like menus is fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-01-13 15:58:20 UTC (rev 37830)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-01-13 16:04:51 UTC (rev 37831)
@@ -146,6 +146,12 @@
Menu appMenuBar = skin.getMenuBar();
if (appMenuBar != null) {
+ //delete all existing items, if any (necessary for systems like MacOS
+ // that have system (non-shell) menu bar), to do not create duplicate items while changing skins
+ for (MenuItem item : appMenuBar.getItems()) {
+ item.dispose();
+ }
+
createMenusForMenuBar(appMenuBar);
}
12 years, 12 months
JBoss Tools SVN: r37830 - trunk/central/plugins/org.jboss.tools.central/icons.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-01-13 10:58:20 -0500 (Fri, 13 Jan 2012)
New Revision: 37830
Modified:
trunk/central/plugins/org.jboss.tools.central/icons/html5.png
trunk/central/plugins/org.jboss.tools.central/icons/rf_logo.png
Log:
JBIDE-10627 Update the new Web and EAR project wizards icons in JBoss Central
Modified: trunk/central/plugins/org.jboss.tools.central/icons/html5.png
===================================================================
(Binary files differ)
Modified: trunk/central/plugins/org.jboss.tools.central/icons/rf_logo.png
===================================================================
(Binary files differ)
12 years, 12 months
JBoss Tools SVN: r37829 - trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-13 10:52:55 -0500 (Fri, 13 Jan 2012)
New Revision: 37829
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java
Log:
https://issues.jboss.org/browse/JBIDE-10431 : browsersim should be sexy
- iPhone3 skin: replaces all image-buttons by image-composites (on MacOS buttons cannot have 0px border, but composites can)
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java 2012-01-13 15:34:54 UTC (rev 37828)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java 2012-01-13 15:52:55 UTC (rev 37829)
@@ -15,15 +15,14 @@
import org.eclipse.swt.browser.BrowserFunction;
import org.eclipse.swt.browser.LocationEvent;
import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Region;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@@ -106,13 +105,13 @@
private Text locationText;
private ProgressBar progressBar;
private int orientation;
- private ButtonImageDecorator backButtonDecorator;
- private ButtonImageDecorator forwardButtonDecorator;
- private ButtonImageDecorator refreshButtonDecorator;
- private ButtonImageDecorator stopButtonDecorator;
+ private CompositeImageDecorator backCompositeDecorator;
+ private CompositeImageDecorator forwardCompositeDecorator;
+ private CompositeImageDecorator refreshCompositeDecorator;
+ private CompositeImageDecorator stopCompositeDecorator;
private Image shellImage;
private Region shellRegion;
- private ButtonImageDecorator showAddressBarButtonDecorator;
+ private CompositeImageDecorator showAddressBarCompositeDecorator;
private boolean addressBarVisible = true;
private int currentOrientationIndex;
private CompositeImageDecorator addressBarDecorator;
@@ -139,25 +138,29 @@
Image stopImage = imageList.getImage("iphone_skin/stop.png");
Image stopSelectedImage = imageList.getImage("iphone_skin/stop-selected.png");
- Button backButton = new Button(shell, SWT.FLAT);
- backButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- controlHandler.goBack();
+ Composite backComposite = new Composite(shell, SWT.NONE);
+ backComposite.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 1) {
+ controlHandler.goBack();
+ }
};
});
- backButtonDecorator = new ButtonImageDecorator(backButton);
- backButtonDecorator.setImages(backImage, backSelectedImage);
- backButtonDecorator.setLocations(BACK_LOCATION[VERTICAL], BACK_LOCATION[HORIZONTAL]);
+ backCompositeDecorator = new CompositeImageDecorator(backComposite);
+ backCompositeDecorator.setImages(backImage, backSelectedImage);
+ backCompositeDecorator.setLocations(BACK_LOCATION[VERTICAL], BACK_LOCATION[HORIZONTAL]);
- Button forwardButton = new Button(shell, SWT.FLAT);
- forwardButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- controlHandler.goForward();
+ Composite forwardComposite = new Composite(shell, SWT.NONE);
+ forwardComposite.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 1) {
+ controlHandler.goForward();
+ }
}
});
- forwardButtonDecorator = new ButtonImageDecorator(forwardButton);
- forwardButtonDecorator.setImages(forwardImage, forwardSelectedImage);
- forwardButtonDecorator.setLocations(FORWARD_LOCATION[VERTICAL], FORWARD_LOCATION[HORIZONTAL]);
+ forwardCompositeDecorator = new CompositeImageDecorator(forwardComposite);
+ forwardCompositeDecorator.setImages(forwardImage, forwardSelectedImage);
+ forwardCompositeDecorator.setLocations(FORWARD_LOCATION[VERTICAL], FORWARD_LOCATION[HORIZONTAL]);
Composite addressBar = new Composite(shell, SWT.NONE);
addressBarDecorator = new CompositeImageDecorator(addressBar);
@@ -172,43 +175,49 @@
progressBar.setVisible(false);
- Button refreshButton = new Button(addressBar, SWT.FLAT);
- refreshButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- controlHandler.refresh();
+ Composite refreshComposite = new Composite(addressBar, SWT.NONE);
+ refreshComposite.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 1) {
+ controlHandler.refresh();
+ }
}
});
- refreshButtonDecorator = new ButtonImageDecorator(refreshButton);
- refreshButtonDecorator.setImages(refreshImage, refreshSelectedImage);
- refreshButtonDecorator.setLocations(REFRESH_LOCATION[VERTICAL], REFRESH_LOCATION[HORIZONTAL]);
+ refreshCompositeDecorator = new CompositeImageDecorator(refreshComposite);
+ refreshCompositeDecorator.setImages(refreshImage, refreshSelectedImage);
+ refreshCompositeDecorator.setLocations(REFRESH_LOCATION[VERTICAL], REFRESH_LOCATION[HORIZONTAL]);
- Button stopButton = new Button(addressBar, SWT.FLAT);
- stopButtonDecorator = new ButtonImageDecorator(stopButton);
- stopButtonDecorator.setImages(stopImage, stopSelectedImage);
- stopButtonDecorator.setLocations(STOP_LOCATION[VERTICAL], STOP_LOCATION[HORIZONTAL]);
- stopButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- controlHandler.stop();
+ Composite stopComposite = new Composite(addressBar, SWT.NONE);
+ stopCompositeDecorator = new CompositeImageDecorator(stopComposite);
+ stopCompositeDecorator.setImages(stopImage, stopSelectedImage);
+ stopCompositeDecorator.setLocations(STOP_LOCATION[VERTICAL], STOP_LOCATION[HORIZONTAL]);
+ stopComposite.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 1) {
+ controlHandler.stop();
+ }
}
});
- Button showAddressBarButton = new Button(shell, SWT.FLAT);
- showAddressBarButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setAddressBarVisible(!addressBarVisible);
+ Composite showAddressBarComposite = new Composite(shell, SWT.NONE);
+ showAddressBarComposite.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 1) {
+ setAddressBarVisible(!addressBarVisible);
+ }
}
});
- showAddressBarButtonDecorator = new ButtonImageDecorator(showAddressBarButton);
+ showAddressBarCompositeDecorator = new CompositeImageDecorator(showAddressBarComposite);
Image showAddressBarVerticalImage = imageList.getImage(SHOW_ADDRESS_BAR_IMAGE[VERTICAL]);
Image showAddressBarHorizontalImage = imageList.getImage(SHOW_ADDRESS_BAR_IMAGE[HORIZONTAL]);
- showAddressBarButtonDecorator.setImages(showAddressBarVerticalImage, showAddressBarVerticalImage, showAddressBarHorizontalImage, showAddressBarHorizontalImage);
- showAddressBarButtonDecorator.setLocations(SHOW_ADDRESS_BAR_LOCATION[VERTICAL], SHOW_ADDRESS_BAR_LOCATION[HORIZONTAL]);
+ showAddressBarCompositeDecorator.setImages(showAddressBarVerticalImage, showAddressBarVerticalImage, showAddressBarHorizontalImage, showAddressBarHorizontalImage);
+ showAddressBarCompositeDecorator.setLocations(SHOW_ADDRESS_BAR_LOCATION[VERTICAL], SHOW_ADDRESS_BAR_LOCATION[HORIZONTAL]);
Listener l = new Listener() {
Point origin;
public void handleEvent(Event e) {
- if ((e.stateMask & SWT.BUTTON1) != 0 || e.button == 1) { // left mouse button
+ if ((e.stateMask & SWT.BUTTON1) != 0 || e.button == 1) { // left mouse Composite
switch (e.type) {
case SWT.MouseDown:
origin = new Point(e.x, e.y);
@@ -301,11 +310,11 @@
private void setWidgetsBounds(int orientationIndex) {
boolean vertical = orientationIndex == VERTICAL;
addressBarDecorator.setVertical(vertical);
- backButtonDecorator.setVertical(vertical);
- forwardButtonDecorator.setVertical(vertical);
- refreshButtonDecorator.setVertical(vertical);
- stopButtonDecorator.setVertical(vertical);
- showAddressBarButtonDecorator.setVertical(vertical);
+ backCompositeDecorator.setVertical(vertical);
+ forwardCompositeDecorator.setVertical(vertical);
+ refreshCompositeDecorator.setVertical(vertical);
+ stopCompositeDecorator.setVertical(vertical);
+ showAddressBarCompositeDecorator.setVertical(vertical);
locationText.setBounds(URL_RECTANGLE[orientationIndex]);
progressBar.setBounds(PROGRESS_BAR_RECTANGLE[orientationIndex]);
12 years, 12 months
JBoss Tools SVN: r37828 - trunk/central/features/org.jboss.tools.central.test.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-13 10:34:54 -0500 (Fri, 13 Jan 2012)
New Revision: 37828
Modified:
trunk/central/features/org.jboss.tools.central.test.feature/pom.xml
Log:
Modified: trunk/central/features/org.jboss.tools.central.test.feature/pom.xml
===================================================================
--- trunk/central/features/org.jboss.tools.central.test.feature/pom.xml 2012-01-13 15:29:55 UTC (rev 37827)
+++ trunk/central/features/org.jboss.tools.central.test.feature/pom.xml 2012-01-13 15:34:54 UTC (rev 37828)
@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.jboss.tools.examples</groupId>
+ <groupId>org.jboss.tools.central</groupId>
<artifactId>features</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
12 years, 12 months
JBoss Tools SVN: r37827 - in trunk/central: features and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-13 10:29:55 -0500 (Fri, 13 Jan 2012)
New Revision: 37827
Modified:
trunk/central/features/pom.xml
trunk/central/pom.xml
trunk/central/tests/pom.xml
Log:
JBIDE-10366 Add tests for JBoss Central
Modified: trunk/central/features/pom.xml
===================================================================
--- trunk/central/features/pom.xml 2012-01-13 15:28:32 UTC (rev 37826)
+++ trunk/central/features/pom.xml 2012-01-13 15:29:55 UTC (rev 37827)
@@ -16,6 +16,7 @@
<module>org.jboss.tools.central.feature</module>
<module>org.jboss.tools.central.discovery.feature</module>
<module>org.jboss.tools.community.central.feature</module>
+ <module>org.jboss.tools.central.test.feature</module>
</modules>
</project>
Modified: trunk/central/pom.xml
===================================================================
--- trunk/central/pom.xml 2012-01-13 15:28:32 UTC (rev 37826)
+++ trunk/central/pom.xml 2012-01-13 15:29:55 UTC (rev 37827)
@@ -21,7 +21,7 @@
<modules>
<module>features</module>
<module>plugins</module>
- <!-- <module>tests</module> -->
+ <module>tests</module>
<module>site</module>
</modules>
</project>
Modified: trunk/central/tests/pom.xml
===================================================================
--- trunk/central/tests/pom.xml 2012-01-13 15:28:32 UTC (rev 37826)
+++ trunk/central/tests/pom.xml 2012-01-13 15:29:55 UTC (rev 37827)
@@ -12,7 +12,7 @@
<name>central.tests</name>
<packaging>pom</packaging>
<modules>
- <!-- TODO: add test modules here -->
+ <module>org.jboss.tools.central.test</module>
</modules>
</project>
12 years, 12 months
JBoss Tools SVN: r37826 - in trunk/central: tests/org.jboss.tools.central.test and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-13 10:28:32 -0500 (Fri, 13 Jan 2012)
New Revision: 37826
Added:
trunk/central/features/org.jboss.tools.central.test.feature/.project
trunk/central/features/org.jboss.tools.central.test.feature/build.properties
trunk/central/features/org.jboss.tools.central.test.feature/feature.properties
trunk/central/features/org.jboss.tools.central.test.feature/feature.xml
trunk/central/features/org.jboss.tools.central.test.feature/pom.xml
trunk/central/tests/org.jboss.tools.central.test/.classpath
trunk/central/tests/org.jboss.tools.central.test/.project
trunk/central/tests/org.jboss.tools.central.test/.settings/
trunk/central/tests/org.jboss.tools.central.test/.settings/org.eclipse.jdt.core.prefs
trunk/central/tests/org.jboss.tools.central.test/META-INF/
trunk/central/tests/org.jboss.tools.central.test/META-INF/MANIFEST.MF
trunk/central/tests/org.jboss.tools.central.test/build.properties
trunk/central/tests/org.jboss.tools.central.test/plugin.properties
trunk/central/tests/org.jboss.tools.central.test/pom.xml
trunk/central/tests/org.jboss.tools.central.test/src/
trunk/central/tests/org.jboss.tools.central.test/src/org/
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/Activator.java
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java
trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/JBossCentralAllTests.java
Log:
JBIDE-10366 Add tests for JBoss Central
Added: trunk/central/features/org.jboss.tools.central.test.feature/.project
===================================================================
--- trunk/central/features/org.jboss.tools.central.test.feature/.project (rev 0)
+++ trunk/central/features/org.jboss.tools.central.test.feature/.project 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.central.test.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/central/features/org.jboss.tools.central.test.feature/build.properties
===================================================================
--- trunk/central/features/org.jboss.tools.central.test.feature/build.properties (rev 0)
+++ trunk/central/features/org.jboss.tools.central.test.feature/build.properties 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,2 @@
+bin.includes = feature.xml,\
+ feature.properties
Added: trunk/central/features/org.jboss.tools.central.test.feature/feature.properties
===================================================================
--- trunk/central/features/org.jboss.tools.central.test.feature/feature.properties (rev 0)
+++ trunk/central/features/org.jboss.tools.central.test.feature/feature.properties 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,54 @@
+###############################################################################
+# Copyright (c) 2008-2011 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Tools - Tests - JBoss Central
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=JBoss Tools - Tests - JBoss Central
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 Red Hat, Inc. and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/central/features/org.jboss.tools.central.test.feature/feature.xml
===================================================================
--- trunk/central/features/org.jboss.tools.central.test.feature/feature.xml (rev 0)
+++ trunk/central/features/org.jboss.tools.central.test.feature/feature.xml 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.central.test.feature"
+ label="JBoss Tools - Tests - JBoss Central"
+ version="1.0.0.qualifier"
+ provider-name="JBoss by Red Hat">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin id="org.jboss.tools.central.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+
+</feature>
Added: trunk/central/features/org.jboss.tools.central.test.feature/pom.xml
===================================================================
--- trunk/central/features/org.jboss.tools.central.test.feature/pom.xml (rev 0)
+++ trunk/central/features/org.jboss.tools.central.test.feature/pom.xml 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.examples</groupId>
+ <artifactId>features</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.central.features</groupId>
+ <artifactId>org.jboss.tools.central.test.feature</artifactId>
+
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Added: trunk/central/tests/org.jboss.tools.central.test/.classpath
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/.classpath (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/.classpath 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/central/tests/org.jboss.tools.central.test/.project
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/.project (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/.project 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.central.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/central/tests/org.jboss.tools.central.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/.settings/org.eclipse.jdt.core.prefs 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,8 @@
+#Thu Jan 12 22:51:52 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/central/tests/org.jboss.tools.central.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/META-INF/MANIFEST.MF 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.central.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.central.test.Activator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.central;bundle-version="1.0.0",
+ org.jboss.tools.community.central;bundle-version="1.0.0",
+ org.jboss.tools.tests;bundle-version="3.2.0",
+ org.junit4;bundle-version="4.8.1",
+ org.jboss.tools.project.examples;bundle-version="1.2.1",
+ org.jboss.tools.project.examples.cheatsheet;bundle-version="1.2.1",
+ org.jboss.tools.community.project.examples;bundle-version="1.2.1",
+ org.jboss.tools.maven.project.examples;bundle-version="1.3.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Localization: plugin
+Bundle-Vendor: %BundleVendor
Added: trunk/central/tests/org.jboss.tools.central.test/build.properties
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/build.properties (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/build.properties 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
Added: trunk/central/tests/org.jboss.tools.central.test/plugin.properties
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/plugin.properties (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/plugin.properties 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.project.examples
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Central Tests
\ No newline at end of file
Added: trunk/central/tests/org.jboss.tools.central.test/pom.xml
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/pom.xml (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/pom.xml 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.central</groupId>
+ <artifactId>tests</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.central.tests</groupId>
+ <artifactId>org.jboss.tools.central.test</artifactId>
+
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <testSuite>org.jboss.tools.central.test</testSuite>
+ <testClass>org.jboss.tools.central.test.JBossCentralAllTests</testClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/Activator.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/Activator.java (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/Activator.java 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,50 @@
+package org.jboss.tools.central.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.central.test"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/CentralTest.java 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,141 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.central.JBossCentralActivator;
+import org.jboss.tools.central.ShowJBossCentral;
+import org.jboss.tools.central.editors.JBossCentralEditor;
+import org.jboss.tools.central.jobs.RefreshBlogsJob;
+import org.jboss.tools.central.jobs.RefreshNewsJob;
+import org.jboss.tools.central.jobs.RefreshTutorialsJob;
+import org.jboss.tools.central.model.FeedsEntry;
+import org.jboss.tools.central.model.TutorialCategory;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class CentralTest {
+
+ private static JBossCentralEditor editor;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ editor = JBossCentralActivator.getJBossCentralEditor();
+ }
+ });
+
+ }
+
+ @AfterClass
+ public static void close() throws Exception {
+ EditorTestHelper.closeAllEditors();
+ }
+
+ @Test
+ public void testEditorOpen() throws Exception {
+ assertTrue("The JBoss Central editor isn't open",editor != null);
+ }
+
+ @Test
+ public void testTutorials() throws Exception {
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ Map<String, TutorialCategory> categories = RefreshTutorialsJob.INSTANCE.getTutorialCategories();
+ assertTrue("No one tutorial is found", categories.size() > 0);
+ }
+
+ @Test
+ public void testNews() throws Exception {
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ List<FeedsEntry> news = RefreshNewsJob.INSTANCE.getEntries();
+ assertTrue("No one news is found", news.size() > 0);
+ }
+
+ @Test
+ public void testBlogs() throws Exception {
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ List<FeedsEntry> blogs = RefreshBlogsJob.INSTANCE.getEntries();
+ assertTrue("No one blog is found", blogs.size() > 0);
+ }
+
+ @Test
+ public void testCachingBlogs() throws Exception {
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ assertTrue("Blog entries aren't cached", RefreshBlogsJob.INSTANCE.getCacheFile().exists());
+ }
+
+ @Test
+ public void testCachingNews() throws Exception {
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ assertTrue("News entries aren't cached", RefreshNewsJob.INSTANCE.getCacheFile().exists());
+ }
+ @Test
+ public void testShowOnStartup() throws Exception {
+ EditorTestHelper.closeAllEditors();
+ assertTrue("The Show On Startup property isn't set by default", JBossCentralActivator.getDefault().showJBossCentralOnStartup());
+ new ShowJBossCentral().earlyStartup();
+ JobUtils.delay(1000);
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+
+ assertTrue("The JBoss Central editor isn't open by default", hasOpenEditor());
+ IEclipsePreferences prefs = JBossCentralActivator.getDefault()
+ .getPreferences();
+ prefs.putBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP,
+ false);
+ assertFalse("The Show On Startup property isn't changed", JBossCentralActivator.getDefault().showJBossCentralOnStartup());
+ EditorTestHelper.closeAllEditors();
+ new ShowJBossCentral().earlyStartup();
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ JobUtils.delay(1000);
+ assertFalse("The JBoss Central editor is open when the Show On Startup property is unchecked", hasOpenEditor());
+ prefs.putBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP,
+ JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
+ }
+
+ private boolean hasOpenEditor() {
+ IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows();
+ for (int i= 0; i < windows.length; i++) {
+ IWorkbenchPage[] pages= windows[i].getPages();
+ for (int j= 0; j < pages.length; j++) {
+ IEditorReference[] editorReferences= pages[j].getEditorReferences();
+ if (editorReferences.length > 0) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
Added: trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/JBossCentralAllTests.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/JBossCentralAllTests.java (rev 0)
+++ trunk/central/tests/org.jboss.tools.central.test/src/org/jboss/tools/central/test/JBossCentralAllTests.java 2012-01-13 15:28:32 UTC (rev 37826)
@@ -0,0 +1,24 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+
+(a)Suite.SuiteClasses({
+ CentralTest.class,
+})
+
+(a)RunWith(Suite.class)
+public class JBossCentralAllTests {
+
+}
\ No newline at end of file
12 years, 12 months
JBoss Tools SVN: r37825 - trunk/central/features.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-13 10:26:43 -0500 (Fri, 13 Jan 2012)
New Revision: 37825
Added:
trunk/central/features/org.jboss.tools.central.test.feature/
Log:
JBIDE-10366 Add tests for JBoss Central
12 years, 12 months
JBoss Tools SVN: r37824 - trunk/central/tests.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-13 10:25:43 -0500 (Fri, 13 Jan 2012)
New Revision: 37824
Added:
trunk/central/tests/org.jboss.tools.central.test/
Log:
JBIDE-10366 Add tests for JBoss Central
12 years, 12 months