use of org.eclipse.linuxtools.internal.rpm.createrepo.CreaterepoProject in project linuxtools by eclipse.
the class CreaterepoProjectTest method testGetRPMs.
/**
* Test if getting the RPMs is successful.
*
* @throws CoreException
* @throws IOException
*/
@Test
public void testGetRPMs() throws CoreException, IOException {
CreaterepoProject createrepoProject = new CreaterepoProject(project);
URL rpmURL = FileLocator.find(FrameworkUtil.getBundle(CreaterepoProjectTest.class), new Path(TEST_RPM_LOC1), null);
File rpmFile = new File(FileLocator.toFileURL(rpmURL).getPath());
createrepoProject.importRPM(rpmFile);
rpmURL = FileLocator.find(FrameworkUtil.getBundle(CreaterepoProjectTest.class), new Path(TEST_RPM_LOC2), null);
rpmFile = new File(FileLocator.toFileURL(rpmURL).getPath());
createrepoProject.importRPM(rpmFile);
List<IResource> rpms = createrepoProject.getRPMs();
assertEquals(2, rpms.size());
}
use of org.eclipse.linuxtools.internal.rpm.createrepo.CreaterepoProject in project linuxtools by eclipse.
the class CreaterepoProjectTest method testInitializeNoRepoFileSpecfied.
/**
* Test if initializing createrepo project is successful
* without specifying .repo file.
*
* @throws CoreException
*/
@Test
public void testInitializeNoRepoFileSpecfied() throws CoreException {
// repo file will be found rather than initialized
CreaterepoProject createrepoProject = new CreaterepoProject(project);
// content folder is defined, but not created (wizard does that)
assertNotNull(createrepoProject.getContentFolder());
assertFalse(createrepoProject.getContentFolder().exists());
// repo file is found and exists
assertNotNull(createrepoProject.getRepoFile());
assertTrue(createrepoProject.getRepoFile().exists());
assertEquals(ICreaterepoTestConstants.REPO_NAME, createrepoProject.getRepoFile().getName());
}
Aggregations