Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-01-30 08:28:42 +0000
committerAlexander Kurtakov2018-01-30 08:28:42 +0000
commit8d990a7a055c3b929818fb4cb3b8cc5525b75b52 (patch)
tree6ba5b137d6db79214308b20f287e6dafbaa46640 /bundles/org.eclipse.equinox.p2.tests
parentd8c703314ff500c8933466044d4e90a91001217b (diff)
downloadrt.equinox.p2-8d990a7a055c3b929818fb4cb3b8cc5525b75b52.tar.gz
rt.equinox.p2-8d990a7a055c3b929818fb4cb3b8cc5525b75b52.tar.xz
rt.equinox.p2-8d990a7a055c3b929818fb4cb3b8cc5525b75b52.zip
Bug 530486 - Remove useless thrown exceptions.I20180130-2000
Change-Id: Ieb5178a2eecbeaab88afd5e00bc3806bc615c7ae Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java26
2 files changed, 37 insertions, 16 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
index 83c44ed84..7ac211dbd 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2017 IBM Corporation and others.
+ * Copyright (c) 2007, 2018 IBM Corporation and others.
* 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
@@ -10,21 +10,34 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.engine;
-import java.io.*;
-import java.util.*;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.Map.Entry;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.equinox.internal.p2.engine.*;
+import org.eclipse.equinox.internal.p2.engine.ISurrogateProfileHandler;
+import org.eclipse.equinox.internal.p2.engine.Profile;
+import org.eclipse.equinox.internal.p2.engine.ProfileParser;
+import org.eclipse.equinox.internal.p2.engine.ProfileWriter;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.query.*;
+import org.eclipse.equinox.p2.query.Collector;
+import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.osgi.framework.BundleContext;
-import org.xml.sax.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
* Simple test of the engine API.
@@ -160,7 +173,7 @@ public class ProfileTest extends AbstractProvisioningTest {
class ProfileStringWriter extends ProfileWriter {
- public ProfileStringWriter(ByteArrayOutputStream stream) throws IOException {
+ public ProfileStringWriter(ByteArrayOutputStream stream) {
super(stream, new ProcessingInstruction[] {ProcessingInstruction.makeTargetVersionInstruction(PROFILE_TEST_TARGET, PROFILE_TEST_VERSION)});
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java
index ad97decb2..47d5bcbe1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2017 Sonatype, Inc. and others.
+ * Copyright (c) 2011, 2018 Sonatype, Inc. and others.
* 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
@@ -10,15 +10,23 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.metadata.repository;
-import java.io.*;
-import java.util.*;
-import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import junit.framework.TestCase;
-import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.MetadataFactory;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.io.IUDeserializer;
import org.eclipse.equinox.p2.metadata.io.IUSerializer;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
public class StandaloneSerializationTest extends TestCase {
public void testNothingToWrite() {
@@ -38,7 +46,7 @@ public class StandaloneSerializationTest extends TestCase {
}
}
- public void testNoContent() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException {
+ public void testNoContent() {
//Write file w/o content
File f = null;
try {
@@ -71,7 +79,7 @@ public class StandaloneSerializationTest extends TestCase {
f.delete();
}
- public void testWritingThenLoading() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException {
+ public void testWritingThenLoading() {
MetadataFactory.InstallableUnitDescription iu = new MetadataFactory.InstallableUnitDescription();
iu.setId("foo");
iu.setVersion(Version.create("1.0.0"));

Back to the top