Examples of SymbolicName


Examples of org.evolizer.versioncontrol.cvs.importer.parser.helper_entities.SymbolicName

                       
            assertTrue(revisions1.contains(entry1));
            assertTrue(revisions1.contains(entry2));
           
            List<SymbolicName> symbolicNames1 = currentLogEntry.getSymbolicNames();
            assertTrue(symbolicNames1.contains(new SymbolicName("v20040427", "1.2")));
            assertTrue(symbolicNames1.contains(new SymbolicName("v20040420", "1.2")));
           
            pass = SECOND;
            break;
        case SECOND:
            //Check if the ordinary fields are filled correctly:
            assertEquals(
                    "/home/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.java",
                    currentLogEntry.getRcsFile());
            assertEquals(
                    "compare/org/eclipse/compare/internal/merge/MergeMessages.java",
                    currentLogEntry.getWorkingFile());
            assertEquals("1.2", currentLogEntry.getHead());
            assertNull(currentLogEntry.getBranch());
          
            //Check if the collections are filled correctly:
            assertEquals(4, currentLogEntry.getTotalRevisions());
            assertEquals(4, currentLogEntry.getSelectedRevisions());
            assertEquals(7, currentLogEntry.getSymbolicNames().size());
           
            RevisionEntry entry3 = buildRevisionEntry1OfLogEntry2();
            RevisionEntry entry4 = buildRevisionEntry("1.2","2004/04/18 18:13:56","jetter","Exp","Rage against the Machine.",24,94);
            RevisionEntry entry5 = buildRevisionEntry("1.1.2.1","2004/04/18 19:13:50","someone","dead","tryed something",94,0);
            RevisionEntry entry6 = buildRevisionEntry("1.1.4.1","2004/04/18 19:23:56","tree","Exp","tryed something else",14,44);
            List<RevisionEntry> revisions2 = currentLogEntry.getRevisionEntries();
            assertTrue(revisions2.contains(entry3));
            assertTrue(revisions2.contains(entry4));
            assertTrue(revisions2.contains(entry5));
            assertTrue(revisions2.contains(entry6));
           
            List<SymbolicName> symbolicNames2 = currentLogEntry.getSymbolicNames();
            assertTrue(symbolicNames2.contains(new SymbolicName("v20040503", "1.1")));
            assertTrue(symbolicNames2.contains(new SymbolicName("v20040427", "1.1")));
            assertTrue(symbolicNames2.contains(new SymbolicName("v20040420", "1.1")));
            assertTrue(symbolicNames2.contains(new SymbolicName("Another_Branch_of_a_tree","1.2.0.4")));
            assertTrue(symbolicNames2.contains(new SymbolicName("Root_Another_Branch_of_a_tree","1.2")));
            assertTrue(symbolicNames2.contains(new SymbolicName("Branch_of_a_tree","1.2.0.2")));
            assertTrue(symbolicNames2.contains(new SymbolicName("Root_Branch_of_a_tree","1.2")));
           
            pass = THIRD;
            break;
        case THIRD:
            //Check if the ordinary fields are filled correctly:
            assertEquals(
                    "/home/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.properties",
                    currentLogEntry.getRcsFile());
            assertEquals(
                    "compare/org/eclipse/compare/internal/merge/MergeMessages.properties",
                    currentLogEntry.getWorkingFile());
            assertEquals("1.3", currentLogEntry.getHead());
            assertNull(currentLogEntry.getBranch());
           
            //Check if the collections are filled correctly:
            assertEquals(5, currentLogEntry.getTotalRevisions());
            assertEquals(5, currentLogEntry.getSelectedRevisions());
            assertEquals(5, currentLogEntry.getSymbolicNames().size());
           
            RevisionEntry entry7 = buildRevisionEntry1OfLogEntry3();
            RevisionEntry entry8 = buildRevisionEntry2OfLogEntry3();
            RevisionEntry entry9 = buildRevisionEntry3OfLogEntry3();
            RevisionEntry entry10 = buildRevisionEntry("1.2.2.2","2005/03/15 18:54:22","petrov","Exp","We like to move it, move it...We like to move it, move it! Move it!\nLets start again!",25,85);
            RevisionEntry entry11 = buildRevisionEntry("1.2.2.1","2005/03/16 19:54:22","baum","Exp","Geh leveln!",65,83);
            List<RevisionEntry> revisions3 = currentLogEntry.getRevisionEntries();
            assertTrue(revisions3.contains(entry7));
            assertTrue(revisions3.contains(entry8));
            assertTrue(revisions3.contains(entry9));
            assertTrue(revisions3.contains(entry10));
            assertTrue(revisions3.contains(entry11));
           
            List<SymbolicName> symbolicNames3 = currentLogEntry.getSymbolicNames();
            assertTrue(symbolicNames3.contains(new SymbolicName("v20040503", "1.3")));
            assertTrue(symbolicNames3.contains(new SymbolicName("v20040427", "1.2")));
            assertTrue(symbolicNames3.contains(new SymbolicName("v20040420", "1.1")));
            assertTrue(symbolicNames3.contains(new SymbolicName("Branch_of_a_tree", "1.2.0.2")));
            assertTrue(symbolicNames3.contains(new SymbolicName("Root_Branch_of_a_tree","1.2")));
            break;           
        default:
            fail("Invalid test.");
        }
        assertEquals(currentLogEntry.getSelectedRevisions(), currentLogEntry
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

    Map<String, Map<String, String>> map = OSGiHeader.parseHeader(header);
    if (map.size() != 1)
      throw new IllegalArgumentException("Invalid format for Bundle-SymbolicName header.");

    Entry<String, Map<String, String>> entry = map.entrySet().iterator().next();
    return new SymbolicName(entry.getKey(), entry.getValue());
  }
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

    default:
      type = Namespaces.RESOURCE_TYPE_PLAIN_JAR;
      break;
    }

    SymbolicName bsn = Util.getSymbolicName(resource);
    boolean singleton = Boolean.TRUE.toString().equalsIgnoreCase(bsn.getAttributes().get(Constants.SINGLETON_DIRECTIVE + ":"));

    Version version = Util.getVersion(resource);

    Builder builder = new Builder().setNamespace(Namespaces.NS_IDENTITY).addAttribute(Namespaces.NS_IDENTITY, bsn.getName()).addAttribute(Namespaces.ATTR_IDENTITY_TYPE, type)
        .addAttribute(Namespaces.ATTR_VERSION, version);
    if (singleton)
      builder.addDirective(Namespaces.DIRECTIVE_SINGLETON, Boolean.TRUE.toString());
    caps.add(builder.buildCapability());
  }
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

    Attributes attribs = resource.getManifest().getMainAttributes();
    if (attribs.getValue(Constants.FRAGMENT_HOST) != null)
      return;

    SymbolicName bsn = Util.getSymbolicName(resource);
    Version version = Util.getVersion(resource);

    bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getName()).addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
    hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getName()).addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);

    for (Entry<String, String> attribEntry : bsn.getAttributes().entrySet()) {
      String key = attribEntry.getKey();
      if (key.endsWith(":")) {
        String directiveName = key.substring(0, key.length() - 1);
        if (Constants.FRAGMENT_ATTACHMENT_DIRECTIVE.equalsIgnoreCase(directiveName)) {
          if (Constants.FRAGMENT_ATTACHMENT_NEVER.equalsIgnoreCase(attribEntry.getValue()))
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

          else
            builder.addAttribute(key, attribEntry.getValue());
        }
      }

      SymbolicName bsn = Util.getSymbolicName(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getName());
      Version bundleVersion = Util.getVersion(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, bundleVersion);

      caps.add(builder.buildCapability());
    }
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

    default:
      type = Namespaces.RESOURCE_TYPE_PLAIN_JAR;
      break;
    }
   
    SymbolicName bsn = Util.getSymbolicName(resource);
    boolean singleton = Boolean.TRUE.toString().equalsIgnoreCase(bsn.getAttributes().get(Constants.SINGLETON_DIRECTIVE + ":"));
   
    Version version = Util.getVersion(resource);
   
    Builder builder = new Builder()
        .setNamespace(Namespaces.NS_IDENTITY)
        .addAttribute(Namespaces.NS_IDENTITY, bsn.getName())
        .addAttribute(Namespaces.ATTR_IDENTITY_TYPE, type)
        .addAttribute(Namespaces.ATTR_VERSION, version);
    if (singleton)
      builder.addDirective(Namespaces.DIRECTIVE_SINGLETON, Boolean.TRUE.toString());
    caps.add(builder.buildCapability());
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

   
    Attributes attribs = resource.getManifest().getMainAttributes();
    if (attribs.getValue(Constants.FRAGMENT_HOST) != null)
      return;
   
    SymbolicName bsn = Util.getSymbolicName(resource);
    Version version = Util.getVersion(resource);
   
    bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getName())
      .addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
    hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getName())
      .addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
   
    for (Entry<String, String> attribEntry : bsn.getAttributes().entrySet()) {
      String key = attribEntry.getKey();
      if (key.endsWith(":")) {
        String directiveName = key.substring(0, key.length() - 1);
        if (Constants.FRAGMENT_ATTACHMENT_DIRECTIVE.equalsIgnoreCase(directiveName)) {
          if (Constants.FRAGMENT_ATTACHMENT_NEVER.equalsIgnoreCase(attribEntry.getValue()))
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

    Map<String, Map<String, String>> map = OSGiHeader.parseHeader(header);
    if (map.size() != 1)
      throw new IllegalArgumentException("Invalid format for Bundle-SymbolicName header.");

    Entry<String, Map<String, String>> entry = map.entrySet().iterator().next();
    return new SymbolicName(entry.getKey(), entry.getValue());
  }
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

          else
            builder.addAttribute(key, attribEntry.getValue());
        }
      }
     
      SymbolicName bsn = Util.getSymbolicName(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getName());
      Version bundleVersion = Util.getVersion(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, bundleVersion);
     
      caps.add(builder.buildCapability());
    }
View Full Code Here

Examples of org.osgi.service.indexer.impl.types.SymbolicName

  public void setKnownBundlesExtra(Properties extras) {
    this.extraProperties = extras;
  }
 
  public void analyzeResource(Resource resource, List<Capability> caps, List<Requirement> reqs) throws Exception {
    SymbolicName resourceName = Util.getSymbolicName(resource);
   
    for (Enumeration<?> names = defaultProperties.propertyNames(); names.hasMoreElements(); ) {
      String propName = (String) names.nextElement();
      processPropertyName(resource, caps, reqs, resourceName, propName, defaultProperties);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.