public void testEmptyPackageFragmentRootLocationMemento() throws Exception { IJavaSourceLocation location = new PackageFragmentRootSourceLocation(); String memento = location.getMemento(); IJavaSourceLocation restored = new PackageFragmentRootSourceLocation(); restored.initializeFrom(memento); assertEquals("root locations should be equal", location, restored); }
public void testProjectLocationMemento() throws Exception { IJavaSourceLocation location = new JavaProjectSourceLocation(get14Project()); String memento = location.getMemento(); IJavaSourceLocation restored = new JavaProjectSourceLocation(); restored.initializeFrom(memento); assertEquals("project locations should be equal", location, restored); }
public void testDirectoryLocationMemento() throws Exception { File dir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(); IJavaSourceLocation location = new DirectorySourceLocation(dir); String memento = location.getMemento(); IJavaSourceLocation restored = new DirectorySourceLocation(); restored.initializeFrom(memento); assertEquals("directory locations should be equal", location, restored); }
public void testPackageFragmentRootLocationMemento() throws Exception { IResource res = get14Project().getProject().getFolder("src"); IPackageFragmentRoot root = get14Project().getPackageFragmentRoot(res); IJavaSourceLocation location = new PackageFragmentRootSourceLocation(root); String memento = location.getMemento(); IJavaSourceLocation restored = new PackageFragmentRootSourceLocation(); restored.initializeFrom(memento); assertEquals("root locations should be equal", location, restored); }
public void testArchiveLocationMemento() throws Exception { IVMInstall vm = JavaRuntime.getDefaultVMInstall(); IJavaSourceLocation location = new ArchiveSourceLocation( JavaRuntime.getLibraryLocations(vm)[0].getSystemLibraryPath().toOSString(), null); String memento = location.getMemento(); IJavaSourceLocation restored = new ArchiveSourceLocation(); restored.initializeFrom(memento); assertEquals("archive locations should be equal", location, restored); }