Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phpunit testing #4994

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f47e241
Initial support for PHPUnit testing.
Feb 21, 2017
37edc7a
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Feb 21, 2017
36cf57d
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Feb 22, 2017
e737008
Added improvements for exceptions handling and presentation model.
Feb 28, 2017
842e7a7
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Mar 7, 2017
b0a3dd6
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Mar 9, 2017
6b1046c
Improved test results presentation model and tests execution rules.
Mar 14, 2017
930bf55
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Mar 14, 2017
74d2f38
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Apr 10, 2017
f86f267
Small fixup after merge with master.
Apr 18, 2017
ec99ebb
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Apr 19, 2017
516ed51
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
May 3, 2017
e5a8160
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
May 3, 2017
f2b902a
Added combined printer file that conforms different PHPUnit versions.
May 9, 2017
af334cb
Fixed possible NPE issue while opening PHPUnit test case source file.
May 9, 2017
29ea027
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
May 9, 2017
709db59
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
May 31, 2017
4e0186f
Bump up PHPUnit plug-ins version to 5.12.0.
May 31, 2017
47da1cd
Small fixup after merge with master.
May 31, 2017
8de852a
Format code to be in line with Che code conventions.
Jun 2, 2017
c84de15
Merge remote-tracking branch 'origin/master' into 'phpunit-testing'
Jun 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assembly/assembly-ide-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-junit-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-phpunit-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-testng-ide</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions assembly/assembly-wsagent-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-junit-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-phpunit-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-testng-server</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.eclipse.che.api.testing.server.listener.OutputTestListener;
import org.eclipse.che.api.testing.shared.TestCase;
import org.eclipse.che.api.testing.shared.TestResult;
import org.eclipse.che.api.testing.shared.dto.TestResultDto;
import org.eclipse.che.api.testing.shared.dto.TestResultRootDto;
import org.eclipse.che.dto.server.DtoFactory;
import org.eclipse.che.plugin.testing.classpath.server.TestClasspathProvider;
import org.eclipse.che.plugin.testing.classpath.server.TestClasspathRegistry;
Expand Down Expand Up @@ -542,4 +544,16 @@ private TestResult run3xTestClasses(Class< ? >... classes) throws Exception {
dtoResult.setTestCases(testList);
return dtoResult;
}

@Override
public TestResultRootDto runTests(Map<String, String> testParameters) throws Exception {
// New API - Not supported yet
return null;
}

@Override
public List<TestResultDto> getTestResults(List<String> testResultsPath) {
// New API - Not supported yet
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.eclipse.che.api.testing.server.listener.OutputTestListener;
import org.eclipse.che.api.testing.shared.TestCase;
import org.eclipse.che.api.testing.shared.TestResult;
import org.eclipse.che.api.testing.shared.dto.TestResultDto;
import org.eclipse.che.api.testing.shared.dto.TestResultRootDto;
import org.eclipse.che.dto.server.DtoFactory;
import org.eclipse.che.plugin.testing.classpath.server.TestClasspathProvider;
import org.eclipse.che.plugin.testing.classpath.server.TestClasspathRegistry;
Expand Down Expand Up @@ -350,4 +352,16 @@ private TestResult runTestClasses(String projectAbsolutePath, Class< ? >... clas
}
});
}

@Override
public TestResultRootDto runTests(Map<String, String> testParameters) throws Exception {
// New API - Not supported yet
return null;
}

@Override
public List<TestResultDto> getTestResults(List<String> testResultsPath) {
// New API - Not supported yet
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2017 Codenvy, S.A.
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:
Rogue Wave Software, Inc. - initial API and implementation

-->
<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>
<artifactId>che-plugin-testing-phpunit</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>5.14.0-SNAPSHOT</version>
</parent>
<artifactId>che-plugin-testing-phpunit-ide</artifactId>
<name>Che Plugin :: PHP Testing :: PHPUnit IDE</name>
<dependencies>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-commons-gwt</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-app</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-ide</artifactId>
</dependency>
<dependency>
<groupId>org.vectomatic</groupId>
<artifactId>lib-gwt-svg</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2016 Rogue Wave Software, Inc.
* 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:
* Rogue Wave Software, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.testing.phpunit.ide;

import org.eclipse.che.ide.api.extension.ExtensionGinModule;
import org.eclipse.che.plugin.testing.ide.TestAction;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.inject.client.multibindings.GinMultibinder;

/**
* PHPUnit Gin module.
*
* @author Bartlomiej Laczkowski
*/
@ExtensionGinModule
public class PHPUnitGinModule extends AbstractGinModule {
@Override
protected void configure() {
GinMultibinder.newSetBinder(binder(), TestAction.class).addBinding().to(PHPUnitTestActionGroup.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*******************************************************************************
* Copyright (c) 2016 Rogue Wave Software, Inc.
* 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:
* Rogue Wave Software, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.testing.phpunit.ide;

import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.action.DefaultActionGroup;
import org.eclipse.che.ide.api.keybinding.KeyBindingAgent;
import org.eclipse.che.plugin.testing.ide.TestAction;
import org.eclipse.che.plugin.testing.phpunit.ide.action.PHPRunContainerTestAction;
import org.eclipse.che.plugin.testing.phpunit.ide.action.PHPRunScriptTestAction;
import org.eclipse.che.plugin.testing.phpunit.ide.action.PHPRunScriptTestEditorAction;

import com.google.inject.Inject;

/**
* PHPUnit test action implementation.
*
* @author Bartlomiej Laczkowski
*/
public class PHPUnitTestActionGroup implements TestAction {

private final Action runScriptTestAction;
private final Action runScriptTestEditorAction;
private final Action runContainerTestAction;

@Inject
public PHPUnitTestActionGroup(ActionManager actionManager,
PHPRunScriptTestAction runScriptTestAction,
PHPRunScriptTestEditorAction runScriptTestEditorAction,
PHPRunContainerTestAction runContainerTestAction,
KeyBindingAgent keyBinding) {
actionManager.registerAction("PHPRunScriptTestAction", runScriptTestAction);
actionManager.registerAction("PHPRunScriptTestEditorAction", runScriptTestEditorAction);
actionManager.registerAction("PHPRunContainerTestAction", runContainerTestAction);
this.runScriptTestAction = runScriptTestAction;
this.runScriptTestEditorAction = runScriptTestEditorAction;
this.runContainerTestAction = runContainerTestAction;
}

@Override
public void addMainMenuItems(DefaultActionGroup testMainMenu) {
testMainMenu.add(runScriptTestEditorAction);
testMainMenu.add(runContainerTestAction);
}

@Override
public void addContextMenuItems(DefaultActionGroup testContextMenu) {
testContextMenu.add(runScriptTestAction);
testContextMenu.add(runContainerTestAction);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*******************************************************************************
* Copyright (c) 2016 Rogue Wave Software, Inc.
* 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:
* Rogue Wave Software, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.testing.phpunit.ide;

import com.google.gwt.i18n.client.Messages;

/**
* Localization constants. Interface to represent the constants defined in resource bundle: 'PHPUnitTestLocalizationConstant.properties'.
*
* @author Bartlomiej Laczkowski
*/
public interface PHPUnitTestLocalizationConstant extends Messages {

@Key("action.runScript.title")
String actionRunScriptTitle();

@Key("action.runScript.description")
String actionRunScriptDescription();

@Key("action.runContainer.title")
String actionRunContainerTitle();

@Key("action.runContainer.description")
String actionRunContainerDescription();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2016 Rogue Wave Software, Inc.
* 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:
* Rogue Wave Software, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.testing.phpunit.ide;

import org.vectomatic.dom.svg.ui.SVGResource;

import com.google.gwt.resources.client.ClientBundle;

/**
* PHPUnit ide part resources.
*
* @author Bartlomiej Laczkowski
*/
public interface PHPUnitTestResources extends ClientBundle {

@Source("org/eclipse/che/plugin/testing/phpunit/ide/svg/test.svg")
SVGResource testIcon();

}
Loading