Package com.tuenti.supernanny.repo.index

Examples of com.tuenti.supernanny.repo.index.IndexReader$KeyValue


        } catch (FileNotFoundException f) {
          throw new SuperNannyError("Can't find index file " + urlgz + " or " + urlplain);
        }
      }

      IndexReader indexReader = new IndexReader(in);
      setArtifacts(indexReader.parse());
      in.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


public class IndexTest {
  @Test
  public void testIndex() throws IOException {
    BufferedReader bufferedReader = new BufferedReader(new FileReader(new File("./testData/index1.txt")));
    IndexReader ir = new IndexReader(bufferedReader);
    List<ArchiveArtifact> artifacts = ir.parse();

    Assert.assertEquals(4, artifacts.size());
   
    ArchiveArtifact a = artifacts.get(0);
    Assert.assertEquals("libphonenumber", a.getName());
View Full Code Here

        return RepositoryType.TARBZ2;
      }
    };
    BufferedReader bufferedReader = new BufferedReader(new FileReader(new File(
        "testData/index2.txt")));
    IndexReader ir = new IndexReader(bufferedReader);
    List<ArchiveArtifact> artifacts = ir.parse();
    repo.setArtifacts(artifacts);
    RepoProvider provider = injector.getInstance(RepoProvider.class);
    provider.addRepo(RepositoryType.TARBZ2, "http://localhost", repo);
  }
View Full Code Here

        // Check host license properties to see if specified feature is supported by the license.
        for (KeyAnyValue prop : props) {
            String key = prop.getKey();
            if (key.equalsIgnoreCase(LICENSE_INFO_FEATURE)) {
                KeyValue propValue = (KeyValue)prop.getValue();
                if (propValue.getKey().equalsIgnoreCase(featureKey)) {
                    featureSupported = true;
                    break;
                }
            }
        }
View Full Code Here

        // Check host license properties to see if specified feature is supported by the license.
        for (KeyAnyValue prop : props) {
            String key = prop.getKey();
            if (key.equalsIgnoreCase(LICENSE_INFO_FEATURE)) {
                KeyValue propValue = (KeyValue)prop.getValue();
                if (propValue.getKey().equalsIgnoreCase(featureKey)) {
                    featureSupported = true;
                    break;
                }
            }
        }
View Full Code Here

        Map.Entry entry = new DefaultMapEntry(key, value);
        assertSame(key, entry.getKey());
        assertSame(value, entry.getValue());

        // 2. test pair constructor
        KeyValue pair = new DefaultKeyValue(key, value);
        assertSame(key, pair.getKey());
        assertSame(value, pair.getValue());

        // 3. test copy constructor
        Map.Entry entry2 = new DefaultMapEntry(entry);
        assertSame(key, entry2.getKey());
        assertSame(value, entry2.getValue());
View Full Code Here

        Map.Entry entry = new UnmodifiableMapEntry(key, value);
        assertSame(key, entry.getKey());
        assertSame(value, entry.getValue());

        // 2. test pair constructor
        KeyValue pair = new DefaultKeyValue(key, value);
        entry = new UnmodifiableMapEntry(pair);
        assertSame(key, entry.getKey());
        assertSame(value, entry.getValue());

        // 3. test copy constructor
View Full Code Here

TOP

Related Classes of com.tuenti.supernanny.repo.index.IndexReader$KeyValue

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.