diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowWidgetInfoPanel.form b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowWidgetInfoPanel.form index 780cda9112f1..bb9756e72a82 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowWidgetInfoPanel.form +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowWidgetInfoPanel.form @@ -5,7 +5,9 @@ - + + + @@ -45,7 +47,9 @@ - + + + @@ -54,6 +58,7 @@ + diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowsWidget.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowsWidget.java index 04138d7a4c56..c3b21e85047f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowsWidget.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToolWindowsWidget.java @@ -316,9 +316,9 @@ class ToolWindowsWidget extends JLabel implements CustomStatusBarWidget, StatusB GraphicsUtil.setupAAPainting(g); ((Graphics2D)g).setPaint(new GradientPaint(0, 0, new JBColor(new Color(77, 143, 253), new Color(52, 74, 100)), 0, getHeight(), new JBColor(new Color(71, 135, 237), new Color(38, 53, 73)))); - g.fillRoundRect(0,0,getWidth(), getHeight(), 5,5); + g.fillRoundRect(0,0,getWidth()-1, getHeight()-1, 5,5); g.setColor(new JBColor(new Color(48, 121, 237), new Color(87, 93, 101))); - g.drawRoundRect(0,0,getWidth(), getHeight(), 5,5); + g.drawRoundRect(0,0,getWidth()-1, getHeight()-1, 5,5); } }; } diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/BooleanParameter.html b/plugins/InspectionGadgets/src/inspectionDescriptions/BooleanParameter.html index bb138c1a4ca8..5653cdab465c 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/BooleanParameter.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/BooleanParameter.html @@ -1,10 +1,14 @@ -It's almost always a mistake to add a boolean parameter to a public method (part of an API). When reading code using such a method -it can be difficult to decipher what the boolean stands for without looking at the source or documentation. This is also known as -the boolean trap. The boolean parameter can often -be profitably replaced with an enum +It's almost always a mistake to add a boolean parameter to a public method (part of an API) if that method is not a setter. +When reading code using such a method, it can be difficult to decipher what the boolean stands for without looking at +the source or documentation. +This problem is also known as the boolean trap. +The boolean parameter can often be profitably replaced with an enum +

Use the option below to only warn when a method contains more than one boolean parameter. +

+New in 13 \ No newline at end of file diff --git a/plugins/github/github.iml b/plugins/github/github.iml index ea922cfeadc6..50d0f799fcc2 100644 --- a/plugins/github/github.iml +++ b/plugins/github/github.iml @@ -20,6 +20,8 @@ + + diff --git a/plugins/github/src/META-INF/plugin.xml b/plugins/github/src/META-INF/plugin.xml index 86240aa4e428..4af448e9e741 100644 --- a/plugins/github/src/META-INF/plugin.xml +++ b/plugins/github/src/META-INF/plugin.xml @@ -19,6 +19,7 @@ + diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubOpenInBrowserAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubOpenInBrowserAction.java index 4399bae08cf7..5729c98b598b 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubOpenInBrowserAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubOpenInBrowserAction.java @@ -92,10 +92,20 @@ public class GithubOpenInBrowserAction extends DumbAwareAction { public void actionPerformed(final AnActionEvent e) { final Project project = e.getData(PlatformDataKeys.PROJECT); final VirtualFile virtualFile = e.getData(PlatformDataKeys.VIRTUAL_FILE); + final Editor editor = e.getData(PlatformDataKeys.EDITOR); if (virtualFile == null || project == null || project.isDisposed()) { return; } + String urlToOpen = getGithubUrl(project, virtualFile, editor); + if (urlToOpen != null) { + BrowserUtil.launchBrowser(urlToOpen); + } + } + + @Nullable + public static String getGithubUrl(@NotNull Project project, @NotNull VirtualFile virtualFile, @Nullable Editor editor) { + GitRepositoryManager manager = GitUtil.getRepositoryManager(project); final GitRepository repository = manager.getRepositoryForFile(virtualFile); if (repository == null) { @@ -104,13 +114,13 @@ public class GithubOpenInBrowserAction extends DumbAwareAction { details.append(repo.getPresentableUrl()).append("; "); } GithubNotifications.showError(project, CANNOT_OPEN_IN_BROWSER, "Can't find git repository", details.toString()); - return; + return null; } final String githubRemoteUrl = GithubUtil.findGithubRemoteUrl(repository); if (githubRemoteUrl == null) { GithubNotifications.showError(project, CANNOT_OPEN_IN_BROWSER, "Can't find github remote"); - return; + return null; } final String rootPath = repository.getRoot().getPath(); @@ -118,25 +128,28 @@ public class GithubOpenInBrowserAction extends DumbAwareAction { if (!path.startsWith(rootPath)) { GithubNotifications .showError(project, CANNOT_OPEN_IN_BROWSER, "File is not under repository root", "Root: " + rootPath + ", file: " + path); - return; + return null; } String branch = getBranchNameOnRemote(project, repository); if (branch == null) { - return; + return null; } String relativePath = path.substring(rootPath.length()); - String urlToOpen = makeUrlToOpen(e, relativePath, branch, githubRemoteUrl); + String urlToOpen = makeUrlToOpen(editor, relativePath, branch, githubRemoteUrl); if (urlToOpen == null) { GithubNotifications.showError(project, CANNOT_OPEN_IN_BROWSER, "Can't create properly url", githubRemoteUrl); - return; + return null; } - BrowserUtil.launchBrowser(urlToOpen); + + return urlToOpen; } @Nullable - private static String makeUrlToOpen(@NotNull AnActionEvent e, @NotNull String relativePath, @NotNull String branch, + private static String makeUrlToOpen(@Nullable Editor editor, + @NotNull String relativePath, + @NotNull String branch, @NotNull String githubRemoteUrl) { final StringBuilder builder = new StringBuilder(); final String githubRepoUrl = GithubUrlUtil.makeGithubRepoUrlFromRemoteUrl(githubRemoteUrl); @@ -145,7 +158,6 @@ public class GithubOpenInBrowserAction extends DumbAwareAction { } builder.append(githubRepoUrl).append("/blob/").append(branch).append(relativePath); - final Editor editor = e.getData(PlatformDataKeys.EDITOR); if (editor != null && editor.getDocument().getLineCount() >= 1) { // lines are counted internally from 0, but from 1 on github SelectionModel selectionModel = editor.getSelectionModel(); diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShowCommitInBrowserAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShowCommitInBrowserAction.java index 1dc7aad02064..6795c6713426 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubShowCommitInBrowserAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShowCommitInBrowserAction.java @@ -32,7 +32,7 @@ import org.jetbrains.plugins.github.util.GithubUtil; abstract class GithubShowCommitInBrowserAction extends DumbAwareAction { public GithubShowCommitInBrowserAction() { - super("Open in Browser", "Open the selected commit in browser", GithubIcons.Github_icon); + super("Open op GitHub", "Open the selected commit in browser", GithubIcons.Github_icon); } protected static void openInBrowser(Project project, GitRepository repository, String revisionHash) { diff --git a/plugins/github/src/org/jetbrains/plugins/github/api/GithubApiUtil.java b/plugins/github/src/org/jetbrains/plugins/github/api/GithubApiUtil.java index ba7a8cdbea8d..2f634d08b939 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/api/GithubApiUtil.java +++ b/plugins/github/src/org/jetbrains/plugins/github/api/GithubApiUtil.java @@ -135,7 +135,7 @@ public class GithubApiUtil { @Nullable final String requestBody, @NotNull final Collection

headers, @NotNull final HttpVerb verb) throws IOException { - HttpClient client = getHttpClient(auth.getBasicAuth()); + HttpClient client = getHttpClient(auth.getBasicAuth(), auth.isUseProxy()); return GithubSslSupport.getInstance() .executeSelfSignedCertificateAwareRequest(client, uri, new ThrowableConvertor() { @Override @@ -173,7 +173,7 @@ public class GithubApiUtil { } @NotNull - private static HttpClient getHttpClient(@Nullable GithubAuthData.BasicAuth basicAuth) { + private static HttpClient getHttpClient(@Nullable GithubAuthData.BasicAuth basicAuth, boolean useProxy) { final HttpClient client = new HttpClient(); HttpConnectionManagerParams params = client.getHttpConnectionManager().getParams(); params.setConnectionTimeout(CONNECTION_TIMEOUT); //set connection timeout (how long it takes to connect to remote host) @@ -182,7 +182,7 @@ public class GithubApiUtil { client.getParams().setContentCharset("UTF-8"); // Configure proxySettings if it is required final HttpConfigurable proxySettings = HttpConfigurable.getInstance(); - if (proxySettings.USE_HTTP_PROXY && !StringUtil.isEmptyOrSpaces(proxySettings.PROXY_HOST)) { + if (useProxy && proxySettings.USE_HTTP_PROXY && !StringUtil.isEmptyOrSpaces(proxySettings.PROXY_HOST)) { client.getHostConfiguration().setProxy(proxySettings.PROXY_HOST, proxySettings.PROXY_PORT); if (proxySettings.PROXY_AUTHENTICATION) { client.getState().setProxyCredentials(AuthScope.ANY, new UsernamePasswordCredentials(proxySettings.PROXY_LOGIN, diff --git a/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubWebBrowserUrlProvider.java b/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubWebBrowserUrlProvider.java new file mode 100644 index 000000000000..3ae08d0563fd --- /dev/null +++ b/plugins/github/src/org/jetbrains/plugins/github/extensions/GithubWebBrowserUrlProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.plugins.github.extensions; + +import com.intellij.ide.browsers.Url; +import com.intellij.ide.browsers.UrlImpl; +import com.intellij.ide.browsers.WebBrowserUrlProvider; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.plugins.github.GithubOpenInBrowserAction; + +/** + * @author Aleksey Pivovarov + */ +public class GithubWebBrowserUrlProvider extends WebBrowserUrlProvider { + @Nullable + @Override + public Url getUrl(@NotNull PsiElement element, @NotNull PsiFile psiFile, @NotNull VirtualFile virtualFile) throws BrowserException { + String url = GithubOpenInBrowserAction.getGithubUrl(element.getProject(), virtualFile, null); + return new UrlImpl(url, "https", null, null, null); + } + + @Nullable + @Override + public String getOpenInBrowserActionText(@NotNull PsiFile file) { + return "Open on GitHub"; + } +} diff --git a/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepository.java b/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepository.java index 4f4626680673..3d337c289c56 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepository.java +++ b/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepository.java @@ -269,7 +269,7 @@ public class GithubRepository extends BaseRepositoryImpl { } private GithubAuthData getAuthData() { - return GithubAuthData.createTokenAuth(getUrl(), getToken()); + return GithubAuthData.createTokenAuth(getUrl(), getToken(), isUseProxy()); } @Override diff --git a/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java b/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java index fe6344986db8..2a83c85a2d1f 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java +++ b/plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepositoryEditor.java @@ -1,16 +1,16 @@ package org.jetbrains.plugins.github.tasks; import com.intellij.openapi.progress.ProgressIndicator; -import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; import com.intellij.tasks.config.BaseRepositoryEditor; import com.intellij.ui.DocumentAdapter; import com.intellij.ui.components.JBLabel; +import com.intellij.ui.components.JBTextField; import com.intellij.util.Consumer; import com.intellij.util.ThrowableConvertor; import com.intellij.util.ui.FormBuilder; +import com.intellij.util.ui.GridBag; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.github.util.GithubAuthData; @@ -31,25 +31,29 @@ import java.io.IOException; * @author Dennis.Ushakov */ public class GithubRepositoryEditor extends BaseRepositoryEditor { - private JTextField myToken; - private JTextField myRepoName; - private JTextField myRepoAuthor; + private MyTextField myHost; + private MyTextField myRepoAuthor; + private MyTextField myRepoName; + private MyTextField myToken; private JButton myTokenButton; - private JBLabel myRepoAuthorLabel; - private JBLabel myRepoLabel; + private JBLabel myHostLabel; + private JBLabel myRepositoryLabel; private JBLabel myTokenLabel; public GithubRepositoryEditor(final Project project, final GithubRepository repository, Consumer changeListener) { super(project, repository, changeListener); - myUserNameText.setVisible(false); + myUrlLabel.setVisible(false); + myURLText.setVisible(false); myUsernameLabel.setVisible(false); - myPasswordText.setVisible(false); + myUserNameText.setVisible(false); myPasswordLabel.setVisible(false); + myPasswordText.setVisible(false); myUseHttpAuthenticationCheckBox.setVisible(false); - myToken.setText(repository.getToken()); + myHost.setText(repository.getUrl()); myRepoAuthor.setText(repository.getRepoAuthor()); myRepoName.setText(repository.getRepoName()); + myToken.setText(repository.getToken()); DocumentListener buttonUpdater = new DocumentAdapter() { @Override @@ -58,29 +62,36 @@ public class GithubRepositoryEditor extends BaseRepositoryEditor
- + @@ -8,25 +8,9 @@ - - - - - - - - - - - - - - - - - + @@ -39,38 +23,23 @@ - - - - - - - - - - - - - - - - - + - + + - + @@ -78,10 +47,110 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java b/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java index b1f08bcaf93f..365fa2f36b2b 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java +++ b/plugins/github/src/org/jetbrains/plugins/github/ui/GithubSettingsPanel.java @@ -22,6 +22,7 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.DocumentAdapter; import com.intellij.ui.HyperlinkAdapter; +import com.intellij.ui.components.JBLabel; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.github.util.GithubAuthData; @@ -35,6 +36,8 @@ import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.event.HyperlinkEvent; +import javax.swing.text.Document; +import javax.swing.text.PlainDocument; import java.awt.*; import java.awt.event.*; import java.io.IOException; @@ -54,12 +57,13 @@ public class GithubSettingsPanel { private JTextField myLoginTextField; private JPasswordField myPasswordField; + private JPasswordField myTokenField; private JTextPane mySignupTextField; private JPanel myPane; private JButton myTestButton; private JTextField myHostTextField; private ComboBox myAuthTypeComboBox; - private JLabel myLoginLabel; + private JPanel myCardPanel; private boolean myCredentialsModified; @@ -84,18 +88,18 @@ public class GithubSettingsPanel { try { GithubUser user = GithubUtil.checkAuthData(getAuthData()); if (GithubAuthData.AuthType.TOKEN.equals(getAuthType())) { - GithubNotifications.showInfoDialog(myPane, "Connection successful for user " + user.getLogin(), "Success"); + GithubNotifications.showInfoDialog(myPane, "Success", "Connection successful for user " + user.getLogin()); } else { - GithubNotifications.showInfoDialog(myPane, "Connection successful", "Success"); + GithubNotifications.showInfoDialog(myPane, "Success", "Connection successful"); } } catch (GithubAuthenticationException ex) { - GithubNotifications.showErrorDialog(myPane, "Can't login using given credentials: " + ex.getMessage(), "Login Failure"); + GithubNotifications.showErrorDialog(myPane, "Login Failure", "Can't login using given credentials: " + ex.getMessage()); } catch (IOException ex) { LOG.info(ex); - GithubNotifications.showErrorDialog(myPane, "Can't login: " + GithubUtil.getErrorTextFromException(ex), "Login Failure"); + GithubNotifications.showErrorDialog(myPane, "Login Failure", "Can't login: " + GithubUtil.getErrorTextFromException(ex)); } } }); @@ -137,14 +141,11 @@ public class GithubSettingsPanel { if (e.getStateChange() == ItemEvent.SELECTED) { String item = e.getItem().toString(); if (AUTH_PASSWORD.equals(item)) { - myLoginLabel.setVisible(true); - myLoginTextField.setVisible(true); + ((CardLayout)myCardPanel.getLayout()).show(myCardPanel, AUTH_PASSWORD); } else if (AUTH_TOKEN.equals(item)) { - myLoginLabel.setVisible(false); - myLoginTextField.setVisible(false); + ((CardLayout)myCardPanel.getLayout()).show(myCardPanel, AUTH_TOKEN); } - myPane.validate(); erasePassword(); } } @@ -240,5 +241,10 @@ public class GithubSettingsPanel { public void resetCredentialsModification() { myCredentialsModified = false; } -} + private void createUIComponents() { + Document doc = new PlainDocument(); + myPasswordField = new JPasswordField(doc, null, 0); + myTokenField = new JPasswordField(doc, null, 0); + } +} diff --git a/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java b/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java index 5de9a65b6de9..63e93a6e230e 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java +++ b/plugins/github/src/org/jetbrains/plugins/github/util/GithubAuthData.java @@ -36,15 +36,19 @@ public class GithubAuthData { @NotNull private final String myHost; @Nullable private final BasicAuth myBasicAuth; @Nullable private final TokenAuth myTokenAuth; + private final boolean myUseProxy; + private GithubAuthData(@NotNull AuthType authType, @NotNull String host, @Nullable BasicAuth basicAuth, - @Nullable TokenAuth tokenAuth) { + @Nullable TokenAuth tokenAuth, + boolean useProxy) { myAuthType = authType; myHost = host; myBasicAuth = basicAuth; myTokenAuth = tokenAuth; + myUseProxy = useProxy; } public static GithubAuthData createAnonymous() { @@ -52,15 +56,19 @@ public class GithubAuthData { } public static GithubAuthData createAnonymous(@NotNull String host) { - return new GithubAuthData(AuthType.ANONYMOUS, host, null, null); + return new GithubAuthData(AuthType.ANONYMOUS, host, null, null, true); } public static GithubAuthData createBasicAuth(@NotNull String host, @NotNull String login, @NotNull String password) { - return new GithubAuthData(AuthType.BASIC, host, new BasicAuth(login, password), null); + return new GithubAuthData(AuthType.BASIC, host, new BasicAuth(login, password), null, true); } public static GithubAuthData createTokenAuth(@NotNull String host, @NotNull String token) { - return new GithubAuthData(AuthType.TOKEN, host, null, new TokenAuth(token)); + return new GithubAuthData(AuthType.TOKEN, host, null, new TokenAuth(token), true); + } + + public static GithubAuthData createTokenAuth(@NotNull String host, @NotNull String token, boolean useProxy) { + return new GithubAuthData(AuthType.TOKEN, host, null, new TokenAuth(token), useProxy); } @NotNull @@ -83,6 +91,10 @@ public class GithubAuthData { return myTokenAuth; } + public boolean isUseProxy() { + return myUseProxy; + } + public static class BasicAuth { @NotNull private final String myLogin; @NotNull private final String myPassword; diff --git a/plugins/groovy/src/META-INF/plugin.xml b/plugins/groovy/src/META-INF/plugin.xml index 2a1d2767e6e9..a07501b10569 100644 --- a/plugins/groovy/src/META-INF/plugin.xml +++ b/plugins/groovy/src/META-INF/plugin.xml @@ -97,6 +97,7 @@ + diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/geb/GebTestNGTestMemberContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/geb/GebTestNGTestMemberContributor.java new file mode 100644 index 000000000000..627197ea3fdb --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/geb/GebTestNGTestMemberContributor.java @@ -0,0 +1,45 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.plugins.groovy.geb; + +import com.intellij.psi.PsiClass; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiType; +import com.intellij.psi.ResolveState; +import com.intellij.psi.scope.PsiScopeProcessor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.plugins.groovy.lang.resolve.NonCodeMembersContributor; + +/** + * @author zolotov + */ +public class GebTestNGTestMemberContributor extends NonCodeMembersContributor { + + @Override + protected String getParentClassName() { + return "geb.testng.GebTest"; + } + + @Override + public void processDynamicElements(@NotNull PsiType qualifierType, + PsiClass aClass, + PsiScopeProcessor processor, + PsiElement place, + ResolveState state) { + GebUtil.contributeMembersInsideTest(processor, place, state); + } + +} diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/geb/GebTestsTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/geb/GebTestsTest.groovy index c733fcf74295..81008c72449b 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/geb/GebTestsTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/geb/GebTestsTest.groovy @@ -43,6 +43,18 @@ class FooTest extends geb.junit4.GebReportingTest { } } +""") + + TestUtils.checkCompletionContains(myFixture, "\$()", "to()", "go()", "currentWindow", "verifyAt()", "title") + } + + void testTestNGTestMemberCompletion() { + myFixture.configureByText("FooTest.groovy", """ +class FooTest extends geb.testng.GebReportingTest { + def testFoo() { + + } +} """) TestUtils.checkCompletionContains(myFixture, "\$()", "to()", "go()", "currentWindow", "verifyAt()", "title") diff --git a/plugins/groovy/testdata/mockGeb/geb-testng-0.7.2.jar b/plugins/groovy/testdata/mockGeb/geb-testng-0.7.2.jar new file mode 100644 index 000000000000..c61f665bb38c Binary files /dev/null and b/plugins/groovy/testdata/mockGeb/geb-testng-0.7.2.jar differ diff --git a/resources/resources.iml b/resources/resources.iml index 1f8b3f27d2df..8299c81e550a 100644 --- a/resources/resources.iml +++ b/resources/resources.iml @@ -12,6 +12,7 @@ +