예제 #1
0
  public static boolean isPluginEquals(Plugin p1, Plugin p2) {
    if (p1.getName() == null) {
      p1.setName("");
    }

    if (p2.getName() == null) {
      p2.setName("");
    }

    if (StringUtils.equals(p1.getArtifactId(), p2.getArtifactId())
        && StringUtils.equals(p1.getPrefix(), p2.getPrefix())
        && StringUtils.equals(p1.getName(), p2.getName())) {
      return true;
    }

    return false;
  }
  @Test
  public void testNoModelVersionForPluginGroupMetadata() throws IOException {
    DefaultMetadataHelper helper =
        new DefaultMetadataHelper(null, null) {

          @Override
          public void store(String content, String path) throws IOException {

            assertThat(content, not(containsString("modelVersion")));
          }
        };
    Plugin plugin = new Plugin();
    plugin.setName("pName");
    plugin.setArtifactId("aid");
    plugin.setPrefix("pPrefix");
    helper.gData.put("/gid", Arrays.asList(plugin));

    GroupDirMetadataProcessor processor = new GroupDirMetadataProcessor(helper);
    processor.processMetadata("/gid");
  }