Skip to content

Commit

Permalink
Merge pull request eclipse-mylyn#505 from eclipse-mylyn/504-disable-i…
Browse files Browse the repository at this point in the history
…ntegration-tests-that-need-mylynorg

Disable integration tests that need mylyn.org eclipse-mylyn#504
  • Loading branch information
gnl42 authored May 3, 2024
2 parents 37c8916 + 357225e commit dbd6e22
Show file tree
Hide file tree
Showing 20 changed files with 180 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static Test suite() {
CommonTestUtil.dumpSystemInfo(System.err);
}
TestConfiguration testConfiguration = ManagedSuite.getTestConfigurationOrCreateDefault();
testConfiguration.setLocalOnly(true); // No CI Server
TestSuite suite = new ManagedTestSuite(AllJenkinsTests.class.getName());
addTests(suite, testConfiguration);
return suite;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*******************************************************************************
* Copyright (c) 2011, 2015 Tasktop Technologies.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
* See git history
*******************************************************************************/

package org.eclipse.mylyn.commons.notifications.tests;
Expand All @@ -16,22 +17,16 @@
import org.eclipse.mylyn.commons.notifications.tests.feed.FeedReaderTest;
import org.eclipse.mylyn.commons.notifications.tests.feed.ServiceMessageManagerTest;
import org.eclipse.mylyn.commons.notifications.tests.feed.ServiceMessageTest;

import junit.framework.Test;
import junit.framework.TestSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

/**
* @author Steffen Pingel
*/
@RunWith(Suite.class)
@SuiteClasses({ NotificationEnvironmentTest.class, FeedReaderTest.class, ServiceMessageManagerTest.class,
ServiceMessageTest.class })
public class AllNotificationsTests {

public static Test suite() {
TestSuite suite = new TestSuite(AllNotificationsTests.class.getName());
suite.addTestSuite(NotificationEnvironmentTest.class);
suite.addTestSuite(FeedReaderTest.class);
suite.addTestSuite(ServiceMessageManagerTest.class);
suite.addTestSuite(ServiceMessageTest.class);
return suite;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
*
* Tasktop Technologies - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.commons.notifications.tests.core;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
Expand All @@ -28,15 +33,15 @@
import org.eclipse.mylyn.commons.notifications.core.NotificationEnvironment;
import org.eclipse.mylyn.internal.commons.notifications.feed.FeedEntry;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Version;

import junit.framework.TestCase;

/**
* @author Steffen Pingel
*/
@SuppressWarnings("nls")
public class NotificationEnvironmentTest extends TestCase {
public class NotificationEnvironmentTest {

private class StubEntry extends FeedEntry implements IAdaptable, IFilterable {

Expand Down Expand Up @@ -75,8 +80,8 @@ public <T> T getAdapter(Class<T> adapter) {

Set<String> installedFeatures;

@Override
protected void setUp() throws Exception {
@Before
public void setUp() throws Exception {
installedFeatures = new HashSet<>();
System.setProperty("EnvironmentTest", "2");
environment = new NotificationEnvironment() {
Expand All @@ -87,12 +92,14 @@ public Set<String> getInstalledFeatures(IProgressMonitor monitor) {
};
}

@Test
public void testGetRuntimeVersion() {
Version runtimeVersion = environment.getRuntimeVersion();
assertTrue("Expected value between 11.0-18.0, got " + runtimeVersion,
new VersionRange("[11.0.0,18.0.0)").isIncluded(runtimeVersion));
assertTrue("Expected value between 11.0-25.0, got " + runtimeVersion,
new VersionRange("[11.0.0,25.0.0)").isIncluded(runtimeVersion));
}

@Test
public void testGetPlatformVersion() {
Version platformVersion = environment.getPlatformVersion();
if (Platform.isRunning()) {
Expand All @@ -103,16 +110,18 @@ public void testGetPlatformVersion() {
}
}

@Test
public void testGetFrameworkVersion() {
Version frameworkVersion = environment.getFrameworkVersion();
if (Platform.isRunning()) {
assertTrue("Expected value > 3.6, got " + frameworkVersion,
new VersionRange("3.6.0").isIncluded(frameworkVersion));
assertTrue("Expected value > 4.0, got " + frameworkVersion,
new VersionRange("4.0.0").isIncluded(frameworkVersion));
} else {
assertEquals(CoreUtil.getFrameworkVersion(), frameworkVersion);
}
}

@Test
public void testMatchesFrameworkVersion() {
Map<String, String> values = new HashMap<>();
assertTrue(environment.matches(new StubEntry(values), null));
Expand All @@ -124,6 +133,7 @@ public void testMatchesFrameworkVersion() {
assertTrue(environment.matches(new StubEntry(values), null));
}

@Test
public void testMatchesRequires() {
Map<String, String> values = new HashMap<>();
values.put("requires", "org.eclipse.mylyn");
Expand All @@ -133,6 +143,7 @@ public void testMatchesRequires() {
assertTrue(environment.matches(new StubEntry(values), null));
}

@Test
public void testMatchesConflicts() {
Map<String, String> values = new HashMap<>();
values.put("conflicts", "org.eclipse.mylyn");
Expand All @@ -142,6 +153,7 @@ public void testMatchesConflicts() {
assertFalse(environment.matches(new StubEntry(values), null));
}

@Test
public void testMatchesRequiresConflicts() {
Map<String, String> values = new HashMap<>();
values.put("requires", "org.eclipse.mylyn");
Expand All @@ -155,6 +167,7 @@ public void testMatchesRequiresConflicts() {
assertFalse(environment.matches(new StubEntry(values), null));
}

@Test
public void testMatchesFilter() {
Map<String, String> values = new HashMap<>();
values.put("filter", "(EnvironmentTest<=1)");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
/*******************************************************************************
* Copyright (c) 2010, 2024 Tasktop Technologies and others.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.commons.notifications.tests.feed;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.net.HttpURLConnection;

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.commons.notifications.feed.ServiceMessageManager;
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
import org.eclipse.mylyn.internal.commons.notifications.feed.ServiceMessage;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import junit.framework.TestCase;

/**
* @author Robert Elves
*/
@SuppressWarnings("nls")
public class ServiceMessageManagerTest extends TestCase {
public class ServiceMessageManagerTest {

private static final String MESSAGE_XML_URL = "http://mylyn.org/message.xml";

@Override
@Before
public void setUp() {
if (CommonTestUtil.fixProxyConfiguration()) {
CommonTestUtil.dumpSystemInfo(System.err);
}
}

@Test
@Ignore("No CI Server")
public void testRetrievingMessage() throws Exception {
ServiceMessageManager manager = new ServiceMessageManager(MESSAGE_XML_URL, "", "", 0l);
int status = manager.refresh(new NullProgressMonitor());
Expand All @@ -53,6 +59,8 @@ public void testRetrievingMessage() throws Exception {
assertEquals("dialog_messasge_info_image", message.getImage());
}

@Test
@Ignore("No CI Server")
public void testETag() throws Exception {
ServiceMessageManager manager = new ServiceMessageManager(MESSAGE_XML_URL, "", "", 0l);
int status = manager.refresh(new NullProgressMonitor());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Tasktop Technologies and others.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
Expand Down Expand Up @@ -136,6 +136,7 @@ public void testCertificateAuthenticationCertificateReset() throws Exception {
}

@Test(expected = SSLException.class)
@Ignore("No CI Server")
public void testCertificateAuthenticationNoCertificate() throws Exception {
if (!CommonTestUtil.isHttpsProxyBroken()) {
System.err.println(
Expand All @@ -159,6 +160,7 @@ public void testCertificateAuthenticationNoCertificate() throws Exception {
}

@Test
@Ignore("No CI Server")
public void testExecuteGet() throws IOException {
RepositoryLocation location = new RepositoryLocation("http://mylyn.org");
CommonHttpClient client = new CommonHttpClient(location);
Expand All @@ -172,6 +174,7 @@ protected Integer doProcess(CommonHttpResponse response, IOperationMonitor monit
}

@Test
@Ignore("No CI Server")
public void testGetRequest() throws Exception {
RepositoryLocation location = new RepositoryLocation();
location.setUrl("http://mylyn.org/");
Expand All @@ -187,6 +190,7 @@ public void testGetRequest() throws Exception {
}

@Test
@Ignore("No CI Server")
public void testHttpAuthenticationTypeHttp() throws Exception {
RepositoryLocation location = new RepositoryLocation();
location.setUrl("http://mylyn.org/");
Expand All @@ -205,6 +209,7 @@ public void testHttpAuthenticationTypeHttp() throws Exception {
}

@Test
@Ignore("No CI Server")
public void testHttpAuthenticationTypeRepository() throws Exception {
RepositoryLocation location = new RepositoryLocation();
location.setUrl("http://mylyn.org/");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2013, 2024 Tasktop Technologies and others.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
Expand All @@ -30,6 +30,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

/**
Expand Down Expand Up @@ -73,6 +74,7 @@ public void tearDown() {
}

@Test
@Ignore("No CI Server")
public void testCancel() throws Exception {
monitor.setCanceled(true);
InputStream in = response.getResponseEntityAsStream();
Expand All @@ -86,6 +88,7 @@ public void testCancel() throws Exception {
}

@Test
@Ignore("No CI Server")
public void testCancelAfterRead() throws Exception {
InputStream in = response.getResponseEntityAsStream();
in.read();
Expand Down
Loading

0 comments on commit dbd6e22

Please sign in to comment.