Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2012 IBM Corporation and others.
* Copyright (c) 2004, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -24,7 +24,6 @@
import org.eclipse.ant.internal.ui.editor.text.XMLTextHover;
import org.eclipse.ant.tests.ui.editor.performance.EditorTestHelper;
import org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest;
import org.eclipse.ant.tests.ui.testplugin.ProjectCreationDecorator;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
Expand Down Expand Up @@ -359,11 +358,10 @@ public void testOpenImportViaClasspath() throws PartInitException {
*/
@Test
public void testOpenImportWithByteOrderMark() throws PartInitException {
if (ProjectCreationDecorator.isJ2SE15Compatible()) {
IFile file = getIFile("importWithByteOrderMark.xml"); //$NON-NLS-1$
AntEditor editor = (AntEditor) EditorTestHelper.openInEditor(file, "org.eclipse.ant.ui.internal.editor.AntEditor", true); //$NON-NLS-1$
assertNotNull("Should have imported target", editor.getAntModel().getTargetNode("build")); //$NON-NLS-1$ //$NON-NLS-2$
}
IFile file = getIFile("importWithByteOrderMark.xml"); //$NON-NLS-1$
AntEditor editor = (AntEditor) EditorTestHelper.openInEditor(file,
"org.eclipse.ant.ui.internal.editor.AntEditor", true); //$NON-NLS-1$
assertNotNull("Should have imported target", editor.getAntModel().getTargetNode("build")); //$NON-NLS-1$ //$NON-NLS-2$
}

private int getOffsetWithinLine(AntEditor editor, int lineNumber, int offsetInLine) throws BadLocationException {
Expand Down
1 change: 0 additions & 1 deletion ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ant.tests.ui; singleton:=true
Bundle-Version: 3.12.0.qualifier
Bundle-ClassPath: anttestsui.jar
Bundle-Activator: org.eclipse.ant.tests.ui.testplugin.AntUITestPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.ant.tests.ui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.file.Files;

import javax.xml.parsers.SAXParser;
Expand All @@ -42,6 +43,8 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
Expand Down Expand Up @@ -74,6 +77,8 @@
import org.eclipse.ui.progress.UIJob;
import org.junit.Before;
import org.junit.Rule;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
Expand Down Expand Up @@ -161,7 +166,7 @@ public static void assertProject() throws Exception {
IProject project = ProjectHelper.createProject(ProjectHelper.PROJECT_NAME);
IFolder folder = ProjectHelper.addFolder(project, "buildfiles"); //$NON-NLS-1$
ProjectHelper.addFolder(project, "launchConfigurations"); //$NON-NLS-1$
File root = AntUITestPlugin.getDefault().getFileInPlugin(ProjectHelper.TEST_BUILDFILES_DIR);
File root = getFileInPlugin(ProjectHelper.TEST_BUILDFILES_DIR);
ProjectHelper.importFilesFromDirectory(root, folder.getFullPath(), null);

ProjectHelper.createLaunchConfigurationForBoth("echoing"); //$NON-NLS-1$
Expand Down Expand Up @@ -191,6 +196,17 @@ public static void assertProject() throws Exception {
}
}

public static File getFileInPlugin(IPath path) {
try {
Bundle bundle = FrameworkUtil.getBundle(AbstractAntUITest.class);
URL installURL = bundle.getEntry("/" + path.toString()); //$NON-NLS-1$
URL localURL = FileLocator.toFileURL(installURL);
return new File(localURL.getFile());
} catch (IOException e) {
return null;
}
}

/**
* Returns the 'AntUITests' project.
*
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2013 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -17,7 +17,6 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.eclipse.ant.internal.ui.IAntUIConstants;
Expand Down Expand Up @@ -91,13 +90,6 @@ private static void addNatureToProject(IProject proj, String natureId, IProgress
proj.setDescription(description, monitor);
}

/**
* Removes an IProject.
*/
public static void delete(IProject project) throws CoreException {
project.delete(true, true, null);
}

/**
* Adds a folder to an IProject.
*/
Expand Down Expand Up @@ -135,9 +127,7 @@ private static void addFiles(File dir, List<File> collection) throws IOException
subDirs.add(file);
}
}
Iterator<File> iter = subDirs.iterator();
while (iter.hasNext()) {
File subDir = iter.next();
for (File subDir : subDirs) {
addFiles(subDir, collection);
}
}
Expand Down