Package ru.aristar.jnuget.files.nuspec

Examples of ru.aristar.jnuget.files.nuspec.NuspecFile


        MavenStylePackageSource packageSource = new MavenStylePackageSource(testFolder);
        //WHEN
        Collection<MavenNupkg> nupkgs = packageSource.getPackages("NUnit");
        //THEN
        assertThat("Пакет найден", nupkgs.size(), equalTo(1));
        NuspecFile result = nupkgs.iterator().next().getNuspecFile();
        assertNotNull("Спецификация пакета", result);
        assertEquals("Идентификатор пакета", "NUnit", result.getId());
        assertEquals("Версия пакета", Version.parse("2.5.9.10348"), result.getVersion());
    }
View Full Code Here


    public void testGetNuspecTmpFile() throws Exception {
        //GIVEN
        try (InputStream inputStream = this.getClass().getResourceAsStream("/NUnit.2.5.9.10348.nupkg")) {
            //WHEN
            TempNupkgFile nupkgFile = new TempNupkgFile(inputStream);
            NuspecFile nuspecFile = nupkgFile.getNuspecFile();
            //THEN
            assertNotNull("Спецификация пакета", nuspecFile);
            assertEquals("Описание пакета", "Пакет модульного тестирования", nuspecFile.getDescription());
            assertEquals("Идентификатор пакета", "NUnit", nuspecFile.getId());
            assertEquals("Версия пакета", Version.parse("2.5.9.10348"), nuspecFile.getVersion());
        }
    }
View Full Code Here

    public void testFindSharpDevelopQueryExecute() throws NugetFormatException {
        //GIVEN
        QueryLexer lexer = new QueryLexer();
        //Пакеты
        Nupkg firstPackage = context.mock(Nupkg.class, "first.package");
        NuspecFile firstNuspec = context.mock(NuspecFile.class, "first.nuspec");
        Nupkg secondPackage = context.mock(Nupkg.class, "second.package");
        NuspecFile secondNuspec = context.mock(NuspecFile.class, "second.nuspec");

        //Источник пакетов
        @SuppressWarnings("unchecked")
        PackageSource<? extends Nupkg> packageSource = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
View Full Code Here

    public void testFindSharpDevelopQueryFilter() throws NugetFormatException {
        //GIVEN
        QueryLexer lexer = new QueryLexer();
        //Пакеты
        Nupkg firstPackage = context.mock(Nupkg.class, "first.package");
        NuspecFile firstNuspec = context.mock(NuspecFile.class, "first.nuspec");
        Nupkg secondPackage = context.mock(Nupkg.class, "second.package");
        NuspecFile secondNuspec = context.mock(NuspecFile.class, "second.nuspec");

        //Источник пакетов
        @SuppressWarnings("unchecked")
        PackageSource<? extends Nupkg> packageSource = context.mock(PackageSource.class);
        Expectations expectations = new Expectations();
View Full Code Here

     */
    @Test
    public void testConvertNuspecToEntryProperties() throws NugetFormatException {
        //GIVEN
        InputStream inputStream = this.getClass().getResourceAsStream("/nuspec/NUnit.nuspec.xml");
        NuspecFile nuspecFile = NuspecFile.Parse(inputStream);
        EntryProperties properties = new EntryProperties();
        //WHEN       
        properties.setNuspec(nuspecFile);
        //THEN
        assertEquals("Версия пакета", new Version(2, 5, 9, "10348"), properties.getVersion());
View Full Code Here

     */
    @Test
    public void testConvertNuspecWithDependencies() throws Exception {
        //GIVEN
        InputStream inputStream = this.getClass().getResourceAsStream("/nuspec/Dependencies.nuspec.xml");
        NuspecFile nuspecFile = NuspecFile.Parse(inputStream);
        EntryProperties properties = new EntryProperties();
        //WHEN       
        properties.setNuspec(nuspecFile);
        //THEN
        assertEquals("Зависимости пакета", "NLog:2.0.0.2000", properties.getDependencies());
View Full Code Here

     * @param entry RSS сообщение с данными пакета
     * @throws NugetFormatException ошибка в формате RSS сообщения
     */
    public RemoteNupkg(PackageEntry entry) throws NugetFormatException {
        try {
            this.nuspec = new NuspecFile(entry);
            this.hash = Hash.parse(entry.getProperties().getPackageHash());
            this.sourceUri = new URI(entry.getContent().getSrc());
            this.size = entry.getProperties().getPackageSize();
            this.updated = entry.getUpdated();
        } catch (URISyntaxException e) {
View Full Code Here

TOP

Related Classes of ru.aristar.jnuget.files.nuspec.NuspecFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.