Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
9,400 | String (@NotNull String s) { return URLEncoder.encode(s, StandardCharsets.UTF_8); } | encodeUrl |
9,401 | HttpClient () { if (!myClientConfigured) { configureHttpClient(myClient); myClientConfigured = true; } return myClient; } | getHttpClient |
9,402 | HttpClient () { HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager()); configureHttpClient(client); return client; } | createClient |
9,403 | void () { myClientConfigured = false; } | reconfigureClient |
9,404 | void (HttpClient client) { client.getParams().setConnectionManagerTimeout(3000); client.getParams().setSoTimeout(TaskSettings.getInstance().CONNECTION_TIMEOUT); if (isUseProxy()) { HttpConfigurable proxy = HttpConfigurable.getInstance(); client.getHostConfiguration().setProxy(proxy.PROXY_HOST, proxy.PROXY_PORT); if (proxy.PROXY_AUTHENTICATION && proxy.getProxyLogin() != null) { AuthScope authScope = new AuthScope(proxy.PROXY_HOST, proxy.PROXY_PORT); Credentials credentials = getCredentials(proxy.getProxyLogin(), proxy.getPlainProxyPassword(), proxy.PROXY_HOST); client.getState().setProxyCredentials(authScope, credentials); } } if (isUseHttpAuthentication()) { client.getParams().setCredentialCharset("UTF-8"); client.getParams().setAuthenticationPreemptive(true); client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(getUsername(), getPassword())); } else { client.getState().clearCredentials(); client.getParams().setAuthenticationPreemptive(false); } } | configureHttpClient |
9,405 | Credentials (@NotNull String login, String password, String host) { int domainIndex = login.indexOf("\\"); if (domainIndex > 0) { // if the username is in the form "user\domain" // then use NTCredentials instead of UsernamePasswordCredentials String domain = login.substring(0, domainIndex); if (login.length() > domainIndex + 1) { String user = login.substring(domainIndex + 1); return new NTCredentials(user, password, host, domain); } else { return null; } } else { return new UsernamePasswordCredentials(login, password); } } | getCredentials |
9,406 | void (HttpMethod method) { } | configureHttpMethod |
9,407 | void (boolean useProxy) { if (useProxy != isUseProxy()) { super.setUseProxy(useProxy); reconfigureClient(); } } | setUseProxy |
9,408 | void (boolean useHttpAuthentication) { if (useHttpAuthentication != isUseHttpAuthentication()) { super.setUseHttpAuthentication(useHttpAuthentication); reconfigureClient(); } } | setUseHttpAuthentication |
9,409 | void (String password) { myPasswordLoaded = true; if (!Objects.equals(password, getPassword())) { super.setPassword(password); reconfigureClient(); } } | setPassword |
9,410 | void (String username) { if (!username.equals(getUsername())) { super.setUsername(username); reconfigureClient(); } } | setUsername |
9,411 | String () { return "javaDebugger"; } | getId |
9,412 | String () { return TaskBundle.message("java.debugger.breakpoints"); } | getDescription |
9,413 | BreakpointManager (@NotNull Project project) { return DebuggerManagerEx.getInstanceEx(project).getBreakpointManager(); } | getBreakpointManager |
9,414 | void (@NotNull Project project) { final BreakpointManager breakpointManager = getBreakpointManager(project); for (final Breakpoint breakpoint : breakpointManager.getBreakpoints()) { ApplicationManager.getApplication().runWriteAction(() -> breakpointManager.removeBreakpoint(breakpoint)); } } | clearContext |
9,415 | void (Task... tasks) { myTasks = tasks; } | setTasks |
9,416 | BaseRepository () { return this; } | clone |
9,417 | Task (@NotNull final String id) { return ContainerUtil.find(myTasks, task -> id.equals(task.getId())); } | findTask |
9,418 | boolean () { return true; } | isConfigured |
9,419 | String () { return "Test"; } | getName |
9,420 | Icon () { return AllIcons.FileTypes.Unknown; } | getIcon |
9,421 | TaskRepositoryEditor (TestRepository repository, Project project, Consumer<? super TestRepository> changeListener) { return new BaseRepositoryEditor<>(project, repository, repository1 -> { }); } | createEditor |
9,422 | TaskRepository () { return new TestRepository(); } | createRepository |
9,423 | Class<TestRepository> () { return TestRepository.class; } | getRepositoryClass |
9,424 | void () { SwitchTaskAction combo = null; ActionGroup group = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_MAIN_TOOLBAR); ActionToolbarImpl toolbar = (ActionToolbarImpl)ActionManager.getInstance().createActionToolbar(ActionPlaces.MAIN_TOOLBAR, group, true); AnAction[] children = group.getChildren(TestActionEvent.createTestEvent()); for (AnAction child : children) { if (child instanceof ActionGroup) { AnAction[] actions = ((ActionGroup)child).getChildren(TestActionEvent.createTestEvent()); for (AnAction action : actions) { if (action instanceof SwitchTaskAction) { combo = (SwitchTaskAction)action; } } } } List<AnAction> actions = Utils.expandActionGroup( group, new PresentationFactory(), DataContext.EMPTY_CONTEXT, ActionPlaces.MAIN_TOOLBAR); assertFalse(actions.contains(combo)); TaskManager manager = TaskManager.getManager(getProject()); LocalTask defaultTask = manager.getActiveTask(); assertTrue(defaultTask.isDefault()); assertEquals(defaultTask.getCreated(), defaultTask.getUpdated()); toolbar.updateActionsImmediately(); Presentation presentation = doTest(combo, toolbar); assertFalse(presentation.isVisible()); assertNull(presentation.getClientProperty(CustomComponentAction.COMPONENT_KEY)); try { TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = true; presentation = doTest(combo, toolbar); assertTrue(presentation.isVisible()); } finally { TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = false; } LocalTask task = manager.createLocalTask("test"); manager.activateTask(task, false); TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = true; presentation = doTest(combo, toolbar); assertTrue(presentation.isVisible()); assertTrue(presentation.isEnabled()); PlatformTestUtil.waitForFuture(toolbar.updateActionsAsync()); JComponent component = presentation.getClientProperty(CustomComponentAction.COMPONENT_KEY); assertNotNull(component); assertTrue(component.isVisible()); assertTrue(component.isEnabled()); manager.activateTask(defaultTask, false); task = manager.getActiveTask(); assertTrue(task.isDefault()); presentation = doTest(combo, toolbar); if (!presentation.isVisible()) { LocalTask activeTask = manager.getActiveTask(); System.out.println(activeTask); System.out.println(activeTask.getCreated()); System.out.println(activeTask.getUpdated()); fail(); } } | testTaskComboVisible |
9,425 | void () { String summary = "foo_bar"; TaskManager.getManager(getProject()).activateTask(new LocalTaskImpl("", summary), false); TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = true; AnActionEvent event = TestActionEvent.createTestToolbarEvent(null); new SwitchTaskAction().update(event); assertEquals(summary, event.getPresentation().getText()); } | testUnderscore |
9,426 | Presentation (AnAction action, ActionToolbarImpl toolbar) { AnActionEvent event = TestActionEvent.createTestToolbarEvent(toolbar.getPresentation(action)); action.update(event); return event.getPresentation(); } | doTest |
9,427 | void () { final Ref<Integer> count = Ref.create(0); myTaskManager.addTaskListener(new TaskListenerAdapter() { @Override public void taskActivated(@NotNull LocalTask task) { count.set(count.get() + 1); } }, getTestRootDisposable()); myTaskManager.activateTask(myTaskManager.createLocalTask("foo"), false); assertEquals(1, count.get().intValue()); myTaskManager.activateTask(myTaskManager.createLocalTask("bar"), false); assertEquals(2, count.get().intValue()); } | testTaskSwitch |
9,428 | void (@NotNull LocalTask task) { count.set(count.get() + 1); } | taskActivated |
9,429 | void () { final Ref<Notification> notificationRef = new Ref<>(); getProject().getMessageBus().connect(getTestRootDisposable()).subscribe(Notifications.TOPIC, new Notifications() { @Override public void notify(@NotNull Notification notification) { notificationRef.set(notification); } }); TestRepository repository = new TestRepository() { @Override public Task[] getIssues(@Nullable String query, int max, long since) throws Exception { throw new Exception(); } }; myTaskManager.setRepositories(Collections.singletonList(repository)); myTaskManager.updateIssues(null); assertNull(notificationRef.get()); TaskSearchSupport.getRepositoriesTasks(getProject(), "", 0, 100, true, false, new EmptyProgressIndicator()); assertNotNull(notificationRef.get()); } | testNotifications |
9,430 | void (@NotNull Notification notification) { notificationRef.set(notification); } | notify |
9,431 | void () { TaskRepository repository = new YouTrackRepository(new YouTrackRepositoryType()); repository.setShared(true); myTaskManager.setRepositories(Collections.singletonList(repository)); TaskProjectConfiguration configuration = getProject().getService(TaskProjectConfiguration.class); TaskProjectConfiguration state = configuration.getState(); assertNotNull(state); assertEquals(1, state.servers.size()); Element element = XmlSerializer.serialize(state); configuration.servers.clear(); myTaskManager.setRepositories(Collections.emptyList()); configuration.loadState(XmlSerializer.deserialize(element, TaskProjectConfiguration.class)); assertEquals(1, state.servers.size()); myTaskManager.callProjectOpened(); TaskRepository[] repositories = myTaskManager.getAllRepositories(); assertEquals(1, repositories.length); assertTrue(repositories[0].isShared()); } | testSharedServers |
9,432 | void () { TaskRepository repository = new YouTrackRepository(new YouTrackRepositoryType()); repository.setShared(true); myTaskManager.setRepositories(Collections.singletonList(repository)); myTaskManager.setRepositories(Collections.emptyList()); TaskProjectConfiguration configuration = getProject().getService(TaskProjectConfiguration.class); assertEquals(0, configuration.getState().servers.size()); } | testRemoveShared |
9,433 | void () { final Ref<Boolean> stopper = new Ref<>(Boolean.FALSE); TestRepository repository = new TestRepository(new LocalTaskImpl("foo", "bar")) { @Override public Task[] getIssues(@Nullable String query, int max, long since) throws Exception { if (stopper.get()) throw new Exception(); return super.getIssues(query, max, since); } }; myTaskManager.setRepositories(Collections.singletonList(repository)); List<Task> issues = myTaskManager.getIssues(""); assertEquals(1, issues.size()); stopper.set(Boolean.TRUE); TaskSearchSupport.getRepositoriesTasks(getProject(), "", 0, 100, true, false, new EmptyProgressIndicator()); assertEquals(1, issues.size()); } | testIssuesCacheSurvival |
9,434 | void () { TestRepository repository = new TestRepository(); int historyLength = myTaskManager.getState().taskHistoryLength; for (int i = 0; i < historyLength + 100; i++) { myTaskManager.addTask(new TaskTestUtil.TaskBuilder(Integer.toString(i), "", repository).withClosed(true)); } assertEquals(historyLength, myTaskManager.getLocalTasks().size()); assertEquals(Integer.toString(historyLength + 100 - 1), myTaskManager.getLocalTasks().get(historyLength - 1).getId()); } | testTaskHistoryLength |
9,435 | void () { TaskTestUtil.TaskBuilder task = new TaskTestUtil.TaskBuilder("IDEA-666", "Bad news", null); TaskManagerImpl taskManager = myTaskManager; assertEquals("IDEA-666", taskManager.suggestBranchName(task)); String format = taskManager.getState().branchNameFormat; try { taskManager.getState().branchNameFormat = "feature/{id}"; assertEquals("feature/IDEA-666", taskManager.suggestBranchName(task)); taskManager.getState().branchNameFormat = "{id}_{summary}"; assertEquals("IDEA-666_Bad-news", taskManager.suggestBranchName(task)); } finally { taskManager.getState().branchNameFormat = format; } } | testBranchNameSuggestion |
9,436 | void () { String url = "http://server/foo"; myTaskManager.addTask(new TaskTestUtil.TaskBuilder("foo", "summary", null).withIssueUrl(url)); TaskManagerImpl.Config config = getConfig(); LocalTaskImpl task = config.tasks.get(1); assertEquals(url, task.getIssueUrl()); } | testPreserveTaskUrl |
9,437 | void () { TestRepository repository = new TestRepository(); repository.setUrl("http://server"); myTaskManager.setRepositories(Collections.singletonList(repository)); TaskTestUtil.TaskBuilder issue = new TaskTestUtil.TaskBuilder("foo", "summary", repository).withIssueUrl(repository.getUrl() + "/foo"); myTaskManager.activateTask(issue, false); TaskManagerImpl.Config config = getConfig(); myTaskManager.loadState(config); assertEquals(repository, myTaskManager.getActiveTask().getRepository()); } | testRestoreRepository |
9,438 | void () { LocalTaskImpl task = new LocalTaskImpl("007", ""); LocalTaskImpl copy = new LocalTaskImpl(task); copy.setSummary("foo"); assertEquals("foo", copy.getPresentableName()); } | testCopyPresentableName |
9,439 | void () { TaskManagerImpl.Config config = getConfig(); config.branchNameFormat = "{id}"; config.changelistNameFormat = "{id} {summary}"; myTaskManager.loadState(config); assertEquals("${id}", myTaskManager.getState().branchNameFormat); assertEquals("${id} ${summary}", myTaskManager.getState().changelistNameFormat); } | testUpdateToVelocity |
9,440 | void () { TestRepository repository = new TestRepository(); repository.setUrl("http://server"); repository.setUsername("me"); String password = "foo"; repository.setEncodedPassword(PasswordUtil.encodePassword(password)); repository.initializeRepository(); assertEquals(password, repository.getPassword()); assertNull(repository.getEncodedPassword()); } | testPasswordMigration |
9,441 | void (@NotNull Task t1, @NotNull Task t2) { assertTrue(TaskUtil.tasksEqual(t1, t2)); } | assertTasksEqual |
9,442 | void (@NotNull List<? extends Task> t1, @NotNull List<? extends Task> t2) { assertTrue(TaskUtil.tasksEqual(t1, t2)); } | assertTasksEqual |
9,443 | void (Task @NotNull [] t1, Task @NotNull [] t2) { assertTrue(TaskUtil.tasksEqual(t1, t2)); } | assertTasksEqual |
9,444 | TaskBuilder (@Nullable String description) { myDescription = description; return this; } | withDescription |
9,445 | TaskBuilder (@Nullable String issueUrl) { myIssueUrl = issueUrl; return this; } | withIssueUrl |
9,446 | TaskBuilder (Comment @NotNull ... comments) { myComments = comments; return this; } | withComments |
9,447 | TaskBuilder (boolean isClosed) { myClosed = isClosed; return this; } | withClosed |
9,448 | TaskBuilder (boolean isIssue) { myIssue = isIssue; return this; } | withIssue |
9,449 | TaskBuilder (@Nullable Date updated) { myUpdated = updated; return this; } | withUpdated |
9,450 | TaskBuilder (@NotNull String updated) { return withUpdated(TaskUtil.parseDate(updated)); } | withUpdated |
9,451 | TaskBuilder (@Nullable Date created) { myCreated = created; return this; } | withCreated |
9,452 | TaskBuilder (@NotNull String created) { return withCreated(TaskUtil.parseDate(created)); } | withCreated |
9,453 | TaskBuilder (@NotNull TaskType type) { myType = type; return this; } | withType |
9,454 | TaskBuilder (@Nullable TaskState state) { myState = state; return this; } | withState |
9,455 | TaskBuilder (@Nullable Icon icon) { myIcon = icon; return this; } | withIcon |
9,456 | String () { return myId; } | getId |
9,457 | String () { return mySummary; } | getSummary |
9,458 | String () { return myDescription; } | getDescription |
9,459 | Icon () { return myIcon == null? myRepository.getIcon() : myIcon; } | getIcon |
9,460 | TaskType () { return myType; } | getType |
9,461 | TaskState () { return myState; } | getState |
9,462 | Date () { return myUpdated; } | getUpdated |
9,463 | Date () { return myCreated; } | getCreated |
9,464 | boolean () { return myClosed; } | isClosed |
9,465 | boolean () { return myIssue; } | isIssue |
9,466 | String () { return myIssueUrl; } | getIssueUrl |
9,467 | TaskRepository () { return myRepository; } | getRepository |
9,468 | void () { myTaskManager.loadState(new TaskManagerImpl.Config()); } | testEmptyState |
9,469 | Couple<Integer> () { // semi-unique duration as timeSpend // should be no longer than 8 hours in total, because it's considered as one full day final int minutes = (int)(System.currentTimeMillis() % 240) + 1; return Couple.of(minutes / 60, minutes % 60); } | generateWorkItemDuration |
9,470 | void () { doTest("<caret>", "TEST-001 Test task<caret>"); } | testTaskCompletion |
9,471 | void () { doTest("TEST-<caret>", "TEST-001 Test task<caret>"); } | testPrefix |
9,472 | void () { doTest("my TEST-<caret>", "my TEST-001 Test task<caret>"); } | testSecondWord |
9,473 | void () { configureFile("TEST-0<caret>"); configureRepository(new LocalTaskImpl("TEST-001", "Test task"), new LocalTaskImpl("TEST-002", "Test task 2")); LookupElement[] elements = myFixture.complete(CompletionType.BASIC); assertNotNull(elements); assertEquals(2, elements.length); } | testNumberCompletion |
9,474 | void () { configureFile("<caret>"); configureRepository(new LocalTaskImpl("TEST-002", "Test task 2"), new LocalTaskImpl("TEST-003", "Test task 1"), new LocalTaskImpl("TEST-001", "Test task 1"), new LocalTaskImpl("TEST-004", "Test task 1") ); getManager().updateIssues(null); List<Task> issues = getManager().getCachedIssues(); // assertEquals("TEST-002", issues.get(0).getSummary()); myFixture.complete(CompletionType.BASIC); assertEquals(Arrays.asList("TEST-002", "TEST-003", "TEST-001", "TEST-004"), myFixture.getLookupElementStrings()); } | testKeepOrder |
9,475 | void () { doTest(" <caret> my", " TEST-001 Test task my"); } | testSIOOBE |
9,476 | void (String text, final String after) { configureFile(text); final TestRepository repository = configureRepository(); repository.setTasks(new LocalTaskImpl("TEST-001", "Test task") { @Override public TaskRepository getRepository() { return repository; } @Override public boolean isIssue() { return true; } }); myFixture.completeBasic(); myFixture.checkResult(after); } | doTest |
9,477 | TaskRepository () { return repository; } | getRepository |
9,478 | boolean () { return true; } | isIssue |
9,479 | void (String text) { PsiFile psiFile = myFixture.configureByText("test.txt", text); Document document = myFixture.getDocument(psiFile); final Project project = getProject(); TextFieldWithAutoCompletion.installCompletion(document, project, new TaskAutoCompletionListProvider(project), false); CommitMessage commitMessage = new CommitMessage(project); Disposer.register(getTestRootDisposable(), commitMessage); document.putUserData(CommitMessage.DATA_KEY, commitMessage); } | configureFile |
9,480 | TestRepository (LocalTaskImpl... tasks) { TaskManagerImpl manager = getManager(); TestRepository repository = new TestRepository(tasks); manager.setRepositories(Arrays.asList(repository)); manager.getState().updateEnabled = false; return repository; } | configureRepository |
9,481 | TaskManagerImpl () { return (TaskManagerImpl)TaskManager.getManager(getProject()); } | getManager |
9,482 | void (@NotNull Date expected, @NotNull String formattedDate) { Date parsed = TaskUtil.parseDate(formattedDate); assertEquals(expected, parsed); } | compareDates |
9,483 | void () { assertNull(myRepository.createCancellableConnection().call()); myRepository.setPassword("illegal password"); final Exception error = myRepository.createCancellableConnection().call(); assertNotNull(error); assertTrue(error.getMessage().contains("Unauthorized")); } | testTestConnection |
9,484 | void (@NotNull String message, @NotNull Collection<? extends TrelloModel> objects, String @NotNull ... names) { assertEquals(message, ContainerUtil.newHashSet(names), ContainerUtil.map2Set(objects, (Function<TrelloModel, String>)model -> model.getName())); } | assertObjectsNamed |
9,485 | void () { final TrelloRepository repository = new TrelloRepository(new TrelloRepositoryType()); final TrelloBoard board = new TrelloBoard(); // Otherwise it will be replaced by TrelloRepository.UNSPECIFIED_BOARD excluded from serialization board.setId("realID"); repository.setCurrentBoard(board); final TrelloList list = new TrelloList(); list.setId("realID"); repository.setCurrentList(list); repository.setCurrentUser(new TrelloUser()); XmlSerializer.serialize(repository); } | testSerialization |
9,486 | void (@NotNull Task task) { assertEquals("Started story", task.getSummary()); assertEquals("Description.", task.getDescription()); assertFalse(task.isClosed()); assertNull(task.getState()); // Not yet supported assertEmpty(task.getComments()); assertEquals("https://www.pivotaltracker.com/story/show/163682205", task.getIssueUrl()); assertEquals("#" + STARTED_STORY_ID, task.getPresentableId()); assertEquals(STARTED_STORY_ID, task.getNumber()); assertEquals(INTEGRATION_TESTS_PROJECT_ID + "-" + STARTED_STORY_ID, task.getId()); // Checking getUpdated() is to brittle assertEquals(TaskUtil.parseDate("2019-02-03T13:34:15Z"), task.getCreated()); } | checkStartedStoryTaskProperties |
9,487 | void () { final String token = "secret"; myRepository.setPassword(token); final Element serialized = XmlSerializer.serialize(myRepository); final String configContent = JDOMUtil.write(serialized); assertFalse(configContent.contains(token)); } | testApiTokenNotStoredInSettings |
9,488 | void () { assumeServerAccessible(JIRA_5_TEST_SERVER_URL); myRepository.setUsername("german"); myRepository.setUsername("wrong password"); //noinspection ConstantConditions final Exception exception = myRepository.createCancellableConnection().call(); assertNotNull(exception); assertEquals(TaskBundle.message("failure.login"), exception.getMessage()); } | testLogin |
9,489 | void () { assumeServerAccessible(JIRA_5_TEST_SERVER_URL); myRepository.setSearchQuery("foo < bar"); try { myRepository.getIssues("", 50, 0); fail(); } catch (Exception e) { assertEquals("Request failed. Reason: \"Field 'foo' does not exist or you do not have permission to view it.\"", e.getMessage()); } } | testExtractedErrorMessage |
9,490 | void () { assertEquals("6.1.9", new JiraVersion("6.1-OD-09-WN").toString()); assertEquals("5.0.6", new JiraVersion("5.0.6").toString()); assertEquals("4.4.5", new JiraVersion("4.4.5").toString()); } | testParseVersionNumbers |
9,491 | void (@NotNull String baseUrl) { GetMethod method = new GetMethod(baseUrl + "/rest/api/latest/serverInfo"); boolean accessible = false; try { accessible = myRepository.getHttpClient().executeMethod(method) == 200; Assume.assumeTrue("Server '" + myRepository.getUrl() + "' is inaccessible", accessible); } catch (IOException e) { ExternalResourcesChecker.reportUnavailability(baseUrl, e); } finally { if (!accessible) { try { LOG.warn( "Response from " + method.getURI() + ":\n" + method.getStatusCode() + " " + method.getStatusText() + "\n" + StringUtil.join(Arrays.asList(method.getResponseHeaders()), "") + "\n" + method.getResponseBodyAsString() ); } catch (Exception e) { LOG.warn("Failed to log response", e); } } } } | assumeServerAccessible |
9,492 | void () { myRepository.setPassword("wrong-password"); try { //noinspection ConstantConditions final Exception exception = myRepository.createCancellableConnection().call(); assertNotNull("Test connection must fail when wrong credentials are specified", exception); } catch (Exception e) { assertEquals(TaskBundle.message("failure.login"), e.getMessage()); } } | testCredentialsCheck |
9,493 | void () { myRepository.setUrl(REDMINE_2_0_TEST_SERVER_URL + "/projects/prj-1"); try { //noinspection ConstantConditions final Exception exception = myRepository.createCancellableConnection().call(); assertNotNull("Test connection must fail when project-specific URL is specified", exception); } catch (Exception e) { assertEquals(TaskBundle.message("failure.login"), e.getMessage()); } } | testProjectSpecificUrlCheck |
9,494 | void () { myRepository.setCurrentProject(RedmineRepository.UNSPECIFIED_PROJECT); final List<Element> options = XmlSerializer.serialize(myRepository).getChildren("option"); final String serializedId = StreamEx.of(options) .findFirst(elem -> "currentProject".equals(elem.getAttributeValue("name"))) .map(elem -> elem.getChild("RedmineProject")) .map(elem -> elem.getAttributeValue("id")) .orElse(null); assertEquals("-1", serializedId); } | testUnspecifiedProjectIdSerialized |
9,495 | GenericRepository (GenericRepositoryType genericType) { return (GenericRepository)genericType.new AssemblaRepository().createRepository(); } | createRepository |
9,496 | void () { final LighthouseRepository repository = new LighthouseRepository(new LighthouseRepositoryType()); // We need to save something different from the defaults apart from transient password/token, // otherwise XmlSerializer.serialize(...) returns null. repository.setUrl("https://test.lighthouseapp.com"); final String apiToken = "secret"; repository.setPassword(apiToken); final Element serialized = XmlSerializer.serialize(repository); final String settingsContent = JDOMUtil.write(serialized); assertFalse(settingsContent.contains(apiToken)); } | testApiTokenNotStoredInSettings |
9,497 | void () { MantisRepository repository = new MantisRepository(); repository.setCurrentProject(new MantisProject()); repository.setCurrentFilter(new MantisFilter()); XmlSerializer.serialize(repository); } | testSerialization |
9,498 | GenericRepository (GenericRepositoryType genericType) { return (GenericRepository)genericType.new AsanaRepository().createRepository(); } | createRepository |
9,499 | GenericRepository (GenericRepositoryType genericType) { return (GenericRepository)genericType.new SprintlyRepository().createRepository(); } | createRepository |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.