Search in sources :

Example 1 with PublishingRepositoryImpl

use of org.eclipse.tycho.repository.module.PublishingRepositoryImpl in project tycho by eclipse.

the class PublishProductToolTest method before.

@Before
public void before() throws Exception {
    File projectDirectory = tempManager.newFolder("projectDir");
    outputRepository = new PublishingRepositoryImpl(p2Context.getAgent(), new ReactorProjectIdentitiesStub(projectDirectory));
    interpolatorMock = mock(Interpolator.class);
    when(interpolatorMock.interpolate(anyString())).thenAnswer(new Answer<String>() {

        @Override
        public String answer(InvocationOnMock invocation) throws Throwable {
            // by default don't expand anything
            return (String) invocation.getArguments()[0];
        }
    });
}
Also used : PublishingRepositoryImpl(org.eclipse.tycho.repository.module.PublishingRepositoryImpl) InvocationOnMock(org.mockito.invocation.InvocationOnMock) ReactorProjectIdentitiesStub(org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub) Interpolator(org.eclipse.tycho.core.shared.Interpolator) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Matchers.anyString(org.mockito.Matchers.anyString) ResourceUtil.resourceFile(org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile) File(java.io.File) TychoMatchers.isFile(org.eclipse.tycho.test.util.TychoMatchers.isFile) Before(org.junit.Before)

Example 2 with PublishingRepositoryImpl

use of org.eclipse.tycho.repository.module.PublishingRepositoryImpl in project tycho by eclipse.

the class PublisherServiceTest method initSubject.

@Before
public void initSubject() throws Exception {
    File projectDirectory = tempManager.newFolder("projectDir");
    LinkedHashSet<IInstallableUnit> installableUnits = new LinkedHashSet<>();
    installableUnits.add(InstallableUnitUtil.createFeatureIU("org.eclipse.example.original_feature", "1.0.0"));
    IMetadataRepository context = new ImmutableInMemoryMetadataRepository(installableUnits);
    // TODO these publishers don't produce artifacts, so we could run without file system
    outputRepository = new PublishingRepositoryImpl(p2Context.getAgent(), new ReactorProjectIdentitiesStub(projectDirectory));
    PublisherActionRunner publisherRunner = new PublisherActionRunner(context, DEFAULT_ENVIRONMENTS, logVerifier.getLogger());
    subject = new PublisherServiceImpl(publisherRunner, DEFAULT_QUALIFIER, outputRepository);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) PublishingRepositoryImpl(org.eclipse.tycho.repository.module.PublishingRepositoryImpl) ReactorProjectIdentitiesStub(org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) IMetadataRepository(org.eclipse.equinox.p2.repository.metadata.IMetadataRepository) ResourceUtil.resourceFile(org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile) File(java.io.File) ImmutableInMemoryMetadataRepository(org.eclipse.tycho.repository.p2base.metadata.ImmutableInMemoryMetadataRepository) Before(org.junit.Before)

Aggregations

File (java.io.File)2 ResourceUtil.resourceFile (org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile)2 PublishingRepositoryImpl (org.eclipse.tycho.repository.module.PublishingRepositoryImpl)2 ReactorProjectIdentitiesStub (org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub)2 Before (org.junit.Before)2 LinkedHashSet (java.util.LinkedHashSet)1 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)1 IMetadataRepository (org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)1 Interpolator (org.eclipse.tycho.core.shared.Interpolator)1 ImmutableInMemoryMetadataRepository (org.eclipse.tycho.repository.p2base.metadata.ImmutableInMemoryMetadataRepository)1 TychoMatchers.isFile (org.eclipse.tycho.test.util.TychoMatchers.isFile)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Matchers.anyString (org.mockito.Matchers.anyString)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1