<classpathentry kind="src" path="/org.eclipse.core.boot"/>
<classpathentry kind="src" path="/org.eclipse.core.runtime"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="C:/Documents and Settings/Ali Echihabi/My Documents/eclipse/eclipse-SDK-3_1.0-win32/eclipse/plugins/org.junit_3.8.1/junit.jar"/>
<classpathentry kind="src" path="/org.eclipse.core.resources"/>
<classpathentry kind="output" path="bin"/>
</classpath>
</view>
</extension>
<extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- nameFilter="*.php"
- id="net.sourceforge.phpeclipse.phpunit.actions.runTestsAction">
- <action
- label="Run PHPUnit Tests"
- class="net.sourceforge.phpeclipse.phpunit.actions.RunTestsAction"
- id="net.sourceforge.phpeclipse.phpunit.action1">
- </action>
- </objectContribution>
- </extension>
- <extension
point="org.eclipse.ui.preferencePages">
<page
name="PHPUnit Preference"
+++ /dev/null
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/*
- * Created on Jul 28, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class Messages {
-
- private static final String BUNDLE_NAME = "net.sourceforge.phpeclipse.phpunit.test"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE =
- ResourceBundle.getBundle(BUNDLE_NAME);
-
- /**
- *
- */
- private Messages() {
-
- // TODO Auto-generated constructor stub
- }
- /**
- * @param key
- * @return
- */
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
+ *
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
package net.sourceforge.phpeclipse.phpunit;
import java.net.MalformedURLException;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
+
public class PHPUnitImages {
protected static final String NAME_PREFIX =
* Available cached Images in the Java plugin image registry.
*/
- public static final String IMG_SELECT_TEST_SUITE = NAME_PREFIX + "tsuite.gif";
+ public static final String IMG_SELECT_TEST_SUITE =
+ NAME_PREFIX + "tsuite.gif";
public static final String IMG_RUN_TEST_SUITE = NAME_PREFIX + "start.gif";
public static final String IMG_TEST_ERROR = NAME_PREFIX + "testerr.gif";
public static final String IMG_TEST_FAILURE = NAME_PREFIX + "testfail.gif";
public static final String IMG_TEST_PASS = NAME_PREFIX + "testok.gif";
- public static final String IMG_TEST_SUITE_ERROR = NAME_PREFIX + "tsuiteerror.gif";
- public static final String IMG_TEST_SUITE_PASS = NAME_PREFIX + "tsuiteok.gif";
- public static final String IMG_TEST_SUITE_FAILURE = NAME_PREFIX + "tsuitefail.gif";
-
+ public static final String IMG_TEST_SUITE_ERROR =
+ NAME_PREFIX + "tsuiteerror.gif";
+ public static final String IMG_TEST_SUITE_PASS =
+ NAME_PREFIX + "tsuiteok.gif";
+ public static final String IMG_TEST_SUITE_FAILURE =
+ NAME_PREFIX + "tsuitefail.gif";
+
public static final String IMG_ERROR = NAME_PREFIX + "error.gif";
public static final String IMG_FAILURE = NAME_PREFIX + "failure.gif";
-
-
-
- public static final ImageDescriptor DESC_SELECT_TEST_SUITE = createManaged(IMG_SELECT_TEST_SUITE);
- public static final ImageDescriptor DESC_RUN_TEST_SUITE =createManaged(IMG_RUN_TEST_SUITE);
- public static final ImageDescriptor DESC_TEST_ERROR = createManaged(IMG_TEST_ERROR);
- public static final ImageDescriptor DESC_TEST_FAILURE = createManaged(IMG_TEST_FAILURE);
- public static final ImageDescriptor DESC_TEST_PASS = createManaged(IMG_TEST_PASS);
- public static final ImageDescriptor DESC_TEST_SUITE_ERROR = createManaged(IMG_TEST_SUITE_ERROR);
- public static final ImageDescriptor DESC_TEST_SUITE_PASS = createManaged(IMG_TEST_SUITE_PASS);
- public static final ImageDescriptor DESC_TEST_SUITE_FAILURE = createManaged(IMG_TEST_SUITE_FAILURE);
-
+
+ public static final ImageDescriptor DESC_SELECT_TEST_SUITE =
+ createManaged(IMG_SELECT_TEST_SUITE);
+ public static final ImageDescriptor DESC_RUN_TEST_SUITE =
+ createManaged(IMG_RUN_TEST_SUITE);
+ public static final ImageDescriptor DESC_TEST_ERROR =
+ createManaged(IMG_TEST_ERROR);
+ public static final ImageDescriptor DESC_TEST_FAILURE =
+ createManaged(IMG_TEST_FAILURE);
+ public static final ImageDescriptor DESC_TEST_PASS =
+ createManaged(IMG_TEST_PASS);
+ public static final ImageDescriptor DESC_TEST_SUITE_ERROR =
+ createManaged(IMG_TEST_SUITE_ERROR);
+ public static final ImageDescriptor DESC_TEST_SUITE_PASS =
+ createManaged(IMG_TEST_SUITE_PASS);
+ public static final ImageDescriptor DESC_TEST_SUITE_FAILURE =
+ createManaged(IMG_TEST_SUITE_FAILURE);
+
public static final ImageDescriptor DESC_ERROR = createManaged(IMG_ERROR);
- public static final ImageDescriptor DESC_FAILURE = createManaged(IMG_FAILURE);
+ public static final ImageDescriptor DESC_FAILURE =
+ createManaged(IMG_FAILURE);
/**
* Returns the image managed under the given key in this registry.
*
return IMAGE_REGISTRY;
}
- //---- Helper methods to access icons on the file system --------------------------------------
protected static ImageDescriptor createManaged(String name) {
try {
-/*
- * Created on Sep 4, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package net.sourceforge.phpeclipse.phpunit;
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
-import java.util.ResourceBundle;
+package net.sourceforge.phpeclipse.phpunit;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class PHPUnitPlugin extends AbstractUIPlugin {
+public class PHPUnitPlugin extends AbstractUIPlugin {
private static PHPUnitPlugin plugin;
- private ResourceBundle resourceBundle;
public static final String PLUGIN_ID= "net.sourceforge.phpeclipse.phpunit"; //$NON-NLS-1$
/**
super(descriptor);
- System.out.println("desc: " + descriptor.getInstallURL());
-
-
plugin= this;
-
-
- String pathSuffix= "icons/"; //$NON-NLS-1$
-
- System.out.println("" + Platform.getLocation());
-
- System.out.println("" + Platform.getPluginStateLocation(plugin));
-
- System.out.println("" + Platform.getLogFileLocation());
-
-
-
-
-
-
- }
-
- public String getPath() {
- return plugin.getDescriptor().getInstallURL().getFile();
+
}
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
+ *
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
package net.sourceforge.phpeclipse.phpunit;
import java.io.IOException;
import net.sourceforge.phpeclipse.phpunit.preferences.PHPUnitPreferencePage;
+import net.sourceforge.phpeclipse.phpunit.reporthandling.*;
import net.sourceforge.phpeclipse.phpunit.testpool.TestCase;
import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
import net.sourceforge.phpeclipse.phpunit.testpool.TestSuite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.part.ViewPart;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-/*
- * Created on May 22, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-/**
- * @author Ali Echihabi (ali_echihabi@ieee.org)
- *
- * Plugin for PHP unit Testing.
- * www.phpeclipse.de
- *
- * This the main view showing the progress and reports.
- *
- */
public class PHPUnitView extends ViewPart {
private ResultsInfoComposite resultsInfoComposite;
//private SettingsInfoComposite settingsInfoComposite; //TODO: move somewhere else, launcher, wizard or preferences.
private FileDialog dialog;
+ private String testSuiteToRun;
- private String testSuiteToRun = "";
+
+ private Action selectTestAction;
+ private Action startTestAction;
public PHPUnitView() {
}
private void setActions() {
+
final IActionBars actionBars = getViewSite().getActionBars();
IToolBarManager toolBarManager = actionBars.getToolBarManager();
- Action selectTestAction = new Action() {
+ selectTestAction = new Action() {
public void run() {
-
- testSuiteToRun = dialog.open();
+
+ testSuiteToRun = dialog.open();
+ startTestAction.setEnabled(true);
}
};
toolBarManager.add(selectTestAction);
- Action startTestAction = new Action() {
+ startTestAction = new Action() {
public void run() {
return;
startTests(testSuiteToRun);
+ //setEnabled(false);
+
} catch (IOException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
};
startTestAction.setText("Start Test");
- startTestAction.setToolTipText("Start Test Suite");
+ startTestAction.setToolTipText("Start Test Suite. Select a Test Suite first.");
startTestAction.setImageDescriptor(PHPUnitImages.DESC_RUN_TEST_SUITE);
-
+ startTestAction.setEnabled(false);
toolBarManager.add(startTestAction);
}
-/*
- * Created on Jul 31, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit;
import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ProgressBar;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
public class ProgressInfoComposite extends Composite {
-/*
- * Created on Jul 31, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit;
import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
public class ResultsInfoComposite extends Composite {
-/*
- * Created on Sep 11, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
+
public class SettingsInfoComposite extends Composite {
FileDialog dialog;
-/*
- * Created on Aug 8, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit;
import java.util.Vector;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
+
public class TestPoolContentProvider implements ITreeContentProvider {
-/*
- * Created on Aug 8, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit;
import net.sourceforge.phpeclipse.phpunit.testpool.TestCase;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
+
public class TestPoolLabelProvider extends LabelProvider {
public String getText(Object element) {
+++ /dev/null
-/*
- * Created on Jun 10, 2004
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package net.sourceforge.phpeclipse.phpunit.actions;
-
-import java.io.IOException;
-
-import net.sourceforge.phpeclipse.phpunit.PHPUnitView;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.navigator.ResourceNavigator;
-
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class RunTestsAction implements IObjectActionDelegate {
-
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // TODO Auto-generated method stub
-
- System.out.println(targetPart.getTitle());
- ResourceNavigator nav = (ResourceNavigator)targetPart;
-
- Item selectedItem = nav.getViewer().getTree().getSelection()[0];
-
- Object d = selectedItem.getData();
-//
-// try {
-//
-// IFile data = (IFile) selectedItem.getData();
-//
-// }
-// catch(Exception e) {
-//
-// e.printStackTrace();
-//
-// }
-//
-
-
-
-// Shell shell = PHPUnitPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
-//
-// if(shell instanceof IStructuredSelection) {
-//
-// Object testObj = ((IStructuredSelection) )
-// }
-//
-
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- try {
- PHPUnitView.getDefault().startTests("");
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // TODO Auto-generated method stub
-
- }
-
-}
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
+ *
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit.preferences;
import org.eclipse.jface.preference.*;
-/*
- * Created on Jul 24, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package net.sourceforge.phpeclipse.phpunit;
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
+
+package net.sourceforge.phpeclipse.phpunit.reporthandling;
import java.net.ServerSocket;
import java.net.Socket;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+import net.sourceforge.phpeclipse.phpunit.PHPUnitView;
+
+
public class ConnectionListener extends Thread {
private ServerSocket sSocket = null;
-package net.sourceforge.phpeclipse.phpunit;
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
+ *
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
+
+package net.sourceforge.phpeclipse.phpunit.reporthandling;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.net.Socket;
+import java.net.Socket;
+
+import net.sourceforge.phpeclipse.phpunit.PHPUnitView;
public class ReportListener extends Thread {
-package net.sourceforge.phpeclipse.phpunit;
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
+ *
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
+package net.sourceforge.phpeclipse.phpunit.reporthandling;
import java.io.File;
import java.io.FileInputStream;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import net.sourceforge.phpeclipse.phpunit.PHPUnitView;
+
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-/*
- * Created on Jul 31, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit.testpool;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
public class TestCase {
public static final String PASS = "PASS";
-/*
- * Created on Jul 31, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit.testpool;
import java.util.HashMap;
-
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
public class TestPool {
//private TestSuite currentParentTestSuite;
-/*
- * Created on Jul 31, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
*
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ *
+ *************************************************************************/
+
+
package net.sourceforge.phpeclipse.phpunit.testpool;
import java.util.Vector;
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+
public class TestSuite {