Skip to content

Commit

Permalink
[ui][core][launch] Redesigned the toolbar of the MakeGood view and th…
Browse files Browse the repository at this point in the history
…e related commands so as to be able to enable/disable the current continuous testing state more simply. (Issue piece#12)
  • Loading branch information
iteman committed Jan 8, 2013
1 parent 2282dca commit d290621
Show file tree
Hide file tree
Showing 28 changed files with 342 additions and 359 deletions.
1 change: 1 addition & 0 deletions com.piece_framework.makegood.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: com.piece_framework.makegood.core,
com.piece_framework.makegood.core.continuoustesting,
com.piece_framework.makegood.core.preference,
com.piece_framework.makegood.core.result,
com.piece_framework.makegood.core.run
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import org.eclipse.core.resources.IFolder;

import com.piece_framework.makegood.core.continuoustesting.Scope;

/**
* @since 2.0.0
*/
Expand All @@ -28,8 +30,8 @@ public boolean getAutotestEnabled() {
return true;
}

public AutotestScope getAutotestScope() {
return AutotestScope.ALL_TESTS;
public Scope getAutotestScope() {
return Scope.ALL_TESTS;
}

public TestingFramework getTestingFramework() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2012 KUBO Atsuhiro <kubo@iteman.jp>,
* All rights reserved.
*
* This file is part of MakeGood.
*
* 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
*/

package com.piece_framework.makegood.core.continuoustesting;

/**
* @since 2.3.0
*/
public class ContinuousTesting {
private boolean enabled;
private Scope scope;

public ContinuousTesting(boolean enabled, Scope scope) {
setEnabled(enabled);
setScope(scope);
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public boolean isEnabled() {
return enabled;
}

public void setScope(Scope scope) {
this.scope = scope;
}

public Scope getScope() {
return scope;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/

package com.piece_framework.makegood.core;
package com.piece_framework.makegood.core.continuoustesting;

/**
* @since 1.4.0
* @since 2.3.0
*/
public enum AutotestScope {
public enum Scope {
ALL_TESTS,
LAST_TEST,
FAILED_TESTS,
NONE,
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

import org.eclipse.jface.preference.IPreferenceStore;

import com.piece_framework.makegood.core.AutotestScope;
import com.piece_framework.makegood.core.Activator;
import com.piece_framework.makegood.core.DefaultConfiguration;
import com.piece_framework.makegood.core.continuoustesting.Scope;

/**
* @since 1.4.0
Expand Down Expand Up @@ -51,29 +51,24 @@ public void setAutotestEnabled(boolean autotestEnabled) {
* @since 2.3.0
*/
public boolean getAutotestEnabled() {
String autotestScope = preferenceStore.getString(AUTOTEST_SCOPE);
if (autotestScope.equals(AutotestScope.NONE.name())) {
return false;
}

return preferenceStore.getBoolean(AUTOTEST_ENABLED);
}

/**
* @since 2.3.0
*/
public void setAutotestScope(AutotestScope autotestScope) {
public void setAutotestScope(Scope autotestScope) {
preferenceStore.setValue(AUTOTEST_SCOPE, autotestScope.name());
}

public AutotestScope getAutotestScope() {
public Scope getAutotestScope() {
String autotestScope = preferenceStore.getString(AUTOTEST_SCOPE);
if (autotestScope.equals(AutotestScope.ALL_TESTS.name())) {
return AutotestScope.ALL_TESTS;
} else if (autotestScope.equals(AutotestScope.LAST_TEST.name())) {
return AutotestScope.LAST_TEST;
} else if (autotestScope.equals(AutotestScope.FAILED_TESTS.name())) {
return AutotestScope.FAILED_TESTS;
if (autotestScope.equals(Scope.ALL_TESTS.name())) {
return Scope.ALL_TESTS;
} else if (autotestScope.equals(Scope.LAST_TEST.name())) {
return Scope.LAST_TEST;
} else if (autotestScope.equals(Scope.FAILED_TESTS.name())) {
return Scope.FAILED_TESTS;
} else {
return new DefaultConfiguration().getAutotestScope();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import org.eclipse.debug.core.ILaunchManager;

import com.piece_framework.makegood.core.AutotestScope;
import com.piece_framework.makegood.core.continuoustesting.ContinuousTesting;
import com.piece_framework.makegood.core.preference.MakeGoodPreference;

public class RuntimeConfiguration {
Expand All @@ -22,9 +22,9 @@ public class RuntimeConfiguration {
public boolean showsOnlyFailures = false;

/**
* @since 1.4.0
* @since 2.3.0
*/
private AutotestScope autotestScope;
private ContinuousTesting continuousTesting;

private static RuntimeConfiguration soleInstance;

Expand All @@ -41,27 +41,21 @@ public String getLaunchMode() {
}

private RuntimeConfiguration() {
autotestScope = new MakeGoodPreference().getAutotestScope();
MakeGoodPreference preference = new MakeGoodPreference();
continuousTesting = new ContinuousTesting(preference.getAutotestEnabled(), preference.getAutotestScope());
}

/**
* @since 1.4.0
* @since 2.3.0
*/
public boolean enablesAutotest() {
return AutotestScope.NONE != autotestScope;
public void setContinuousTesting(ContinuousTesting continuousTesting) {
this.continuousTesting = continuousTesting;
}

/**
* @since 1.4.0
* @since 2.3.0
*/
public AutotestScope getAutotestScope() {
return autotestScope;
}

/**
* @since 1.4.0
*/
public void setAutotestScope(AutotestScope autotestScope) {
this.autotestScope = autotestScope;
public ContinuousTesting getContinuousTesting() {
return continuousTesting;
}
}
12 changes: 3 additions & 9 deletions com.piece_framework.makegood.ui/OSGI-INF/l10n/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ commands.stopTestCommand.name = Stop Test
commands.rerunTestCommand.name = Rerun Test
commands.stopOnFailureCommand.name = Stop on Failure/Error
commands.debugTestCommand.name = Debug Test
commands.runAllTestsWhenFileIsSavedCommand.name = Run All Tests when File is Saved
commands.runLastTestWhenFileIsSavedCommand.name = Run Last Test when File is Saved
commands.runFailedTestsWhenFileIsSavedCommand.name = Run Failed Tests when File is Saved
commands.toggleContinuousTestingCommand.name = Enable/Disable Continuous Testing
commands.switchToUnselectedTestResultsTabCommand.name = Switch to Unselected Test Results Tab
commands.rerunFailedTestsCommand.name = Rerun Failed Tests
propertyPages.makeGood.name = MakeGood
Expand All @@ -49,11 +47,7 @@ viewActions.runAllTestsAction.label = Run All Tests
viewActions.runAllTestsAction.tooltip = Run All Tests
viewActions.debugTestAction.label = Debug Test
viewActions.debugTestAction.tooltip = Debug Test
viewActions.runAllTestsWhenFileIsSavedAction.label = Run All Tests when File is Saved
viewActions.runAllTestsWhenFileIsSavedAction.tooltip = Run All Tests when File is Saved
viewActions.runLastTestWhenFileIsSavedAction.label = Run Last Test when File is Saved
viewActions.runLastTestWhenFileIsSavedAction.tooltip = Run Last Test when File is Saved
viewActions.runFailedTestsWhenFileIsSavedAction.label = Run Failed Tests when File is Saved
viewActions.runFailedTestsWhenFileIsSavedAction.tooltip = Run Failed Tests when File is Saved
viewActions.rerunFailedTestsAction.label = Rerun Failed Tests
viewActions.rerunFailedTestsAction.tooltip = Rerun Failed Tests
viewActions.configureContinuousTestingAction.label = Configure Continuous Testing
viewActions.configureContinuousTestingAction.tooltip = Configure Continuous Testing
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ commands.stopTestCommand.name = \u30c6\u30b9\u30c8\u306e\u505c\u6b62
commands.rerunTestCommand.name = \u30c6\u30b9\u30c8\u306e\u518d\u5b9f\u884c
commands.stopOnFailureCommand.name = \u5931\u6557/\u30a8\u30e9\u30fc\u306e\u969b\u306b\u505c\u6b62\u3059\u308b
commands.debugTestCommand.name = \u30c6\u30b9\u30c8\u3092\u30c7\u30d0\u30c3\u30b0\u3059\u308b
commands.runAllTestsWhenFileIsSavedCommand.name = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
commands.runLastTestWhenFileIsSavedCommand.name = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u524d\u56de\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
commands.runFailedTestsWhenFileIsSavedCommand.name = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
commands.toggleContinuousTestingCommand.name = \u7d99\u7d9a\u7684\u30c6\u30b9\u30c8\u3092\u6709\u52b9/\u7121\u52b9\u306b\u3059\u308b
commands.switchToUnselectedTestResultsTabCommand.name = \u9078\u629e\u3055\u308c\u3066\u3044\u306a\u3044\u30c6\u30b9\u30c8\u7d50\u679c\u30bf\u30d6\u306b\u5207\u308a\u66ff\u3048\u308b
commands.rerunFailedTestsCommand.name = \u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u306e\u518d\u5b9f\u884c
propertyPages.makeGood.name = MakeGood
Expand All @@ -49,11 +47,7 @@ viewActions.runAllTestsAction.label = \u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8
viewActions.runAllTestsAction.tooltip = \u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8\u306e\u5b9f\u884c
viewActions.debugTestAction.label = \u30c6\u30b9\u30c8\u3092\u30c7\u30d0\u30c3\u30b0\u3059\u308b
viewActions.debugTestAction.tooltip = \u30c6\u30b9\u30c8\u3092\u30c7\u30d0\u30c3\u30b0\u3059\u308b
viewActions.runAllTestsWhenFileIsSavedAction.label = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
viewActions.runAllTestsWhenFileIsSavedAction.tooltip = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
viewActions.runLastTestWhenFileIsSavedAction.label = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u524d\u56de\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
viewActions.runLastTestWhenFileIsSavedAction.tooltip = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u524d\u56de\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
viewActions.runFailedTestsWhenFileIsSavedAction.label = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
viewActions.runFailedTestsWhenFileIsSavedAction.tooltip = \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u6642\u306b\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b
viewActions.rerunFailedTestsAction.label = \u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u306e\u518d\u5b9f\u884c
viewActions.rerunFailedTestsAction.tooltip = \u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u306e\u518d\u5b9f\u884c
viewActions.configureContinuousTestingAction.label = \u7d99\u7d9a\u7684\u30c6\u30b9\u30c8\u3092\u8a2d\u5b9a\u3059\u308b
viewActions.configureContinuousTestingAction.tooltip = \u7d99\u7d9a\u7684\u30c6\u30b9\u30c8\u3092\u8a2d\u5b9a\u3059\u308b
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions com.piece_framework.makegood.ui/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ MakeGoodView_Status_RelatedTestsNotFound=No tests found that are related to this
MakeGoodView_Status_TestsNotFound=No tests found.
MakeGoodView_Status_TypesNotFound=No types found in this file.
MakeGoodView_Status_TestTargetNotFound=A test target is not found.
MakeGoodView_ConfigureContinuousTestingAction_DisableContinuousTestingAction=Disabled
MakeGoodView_ConfigureContinuousTestingAction_EnableContinuousTestingAction=Enabled
MakeGoodView_ConfigureContinuousTestingAction_SelectAllTestsAsContinuousTestingScopeAction=All Tests
MakeGoodView_ConfigureContinuousTestingAction_SelectFailedTestsAsContinuousTestingScopeAction=Failed Tests
MakeGoodView_ConfigureContinuousTestingAction_SelectLastTestAsContinuousTestingScopeAction=Last Test
TestRunner_TestSessionAlreadyExists_Title=MakeGood Error
TestRunner_TestSessionAlreadyExists_Message=Cannot start a new test session since an active test session already exists.\nOnly a single test session is allowed with MakeGood.
ResultSquare_WaitingForTestRun=Waiting for a test run...
Expand Down
5 changes: 5 additions & 0 deletions com.piece_framework.makegood.ui/messages_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ MakeGoodView_Status_RelatedTestsNotFound=\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3
MakeGoodView_Status_TestsNotFound=\u30c6\u30b9\u30c8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002
MakeGoodView_Status_TypesNotFound=\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u578b\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002
MakeGoodView_Status_TestTargetNotFound=\u30c6\u30b9\u30c8\u30bf\u30fc\u30b2\u30c3\u30c8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002
MakeGoodView_ConfigureContinuousTestingAction_DisableContinuousTestingAction=\u7121\u52b9
MakeGoodView_ConfigureContinuousTestingAction_EnableContinuousTestingAction=\u6709\u52b9
MakeGoodView_ConfigureContinuousTestingAction_SelectAllTestsAsContinuousTestingScopeAction=\u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8
MakeGoodView_ConfigureContinuousTestingAction_SelectFailedTestsAsContinuousTestingScopeAction=\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8
MakeGoodView_ConfigureContinuousTestingAction_SelectLastTestAsContinuousTestingScopeAction=\u524d\u56de\u306e\u30c6\u30b9\u30c8
TestRunner_TestSessionAlreadyExists_Title=MakeGood \u30a8\u30e9\u30fc
TestRunner_TestSessionAlreadyExists_Message=\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30c6\u30b9\u30c8\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u3059\u3067\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3001\u65b0\u3057\u3044\u30c6\u30b9\u30c8\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u958b\u59cb\u3067\u304d\u307e\u305b\u3093\u3002\nMakeGood \u3067\u306f\u5358\u4e00\u306e\u30c6\u30b9\u30c8\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u307f\u304c\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u3059\u3002
ResultSquare_WaitingForTestRun=\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u3092\u5f85\u3063\u3066\u3044\u307e\u3059...
Expand Down

0 comments on commit d290621

Please sign in to comment.