当前位置: 首页>>代码示例>>Java>>正文


Java BuildNumber.fromString方法代码示例

本文整理汇总了Java中com.intellij.openapi.util.BuildNumber.fromString方法的典型用法代码示例。如果您正苦于以下问题:Java BuildNumber.fromString方法的具体用法?Java BuildNumber.fromString怎么用?Java BuildNumber.fromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.util.BuildNumber的用法示例。


在下文中一共展示了BuildNumber.fromString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testNewChannelAppears

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testNewChannelAppears() {
  // assume user has version 9 eap subscription (default or selected)
  // and new channel appears - eap of version 10 is there
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.RELEASE);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.627"), InfoReader.read("idea-newChannel-release.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNull(update);

  UpdateChannel newChannel = result.getChannelToPropose();
  assertNotNull(newChannel);
  assertEquals("IDEA10EAP", newChannel.getId());
  assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UpdateStrategyTest.java

示例2: testNewChannelAndNewBuildAppear

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testNewChannelAndNewBuildAppear() {
  // assume user has version 9 eap subscription (default or selected)
  // and new channels appears - eap of version 10 is there
  // and new build withing old channel appears also
  // we need to show only one dialog
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.429"), InfoReader.read("idea-newChannel.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNotNull(update);
  assertEquals("95.627", update.getNumber().toString());

  UpdateChannel newChannel = result.getChannelToPropose();
  assertNotNull(newChannel);
  assertEquals("IDEA10EAP", newChannel.getId());
  assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:UpdateStrategyTest.java

示例3: testChannelWithCurrentStatusPreferred

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testChannelWithCurrentStatusPreferred() {
  BuildNumber currentBuild = BuildNumber.fromString("IU-139.658");
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(14, currentBuild, InfoReader.read("idea-patchAvailable.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());

  UpdateChannel channel = result.getUpdatedChannel();
  assertNotNull(channel);
  assertEquals(ChannelStatus.EAP, channel.getStatus());

  BuildInfo selectedChannel = result.getNewBuildInSelectedChannel();
  assertNotNull(selectedChannel);
  assertNotNull(selectedChannel.findPatchForBuild(currentBuild));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UpdateStrategyTest.java

示例4: testNewChannelAppears

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public void testNewChannelAppears() {
  // assume user has version 9 eap subscription (default or selected)
  // and new channel appears - eap of version 10 is there
  final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.RELEASE);
  //first time load
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.627"), UpdatesInfoXppParserTest.InfoReader.read("idea-newChannel-release.xml"), settings);


  final CheckForUpdateResult result = strategy.checkForUpdates();
  Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());
  final BuildInfo update = result.getNewBuildInSelectedChannel();
  Assert.assertNull(update);

  final UpdateChannel newChannel = result.getChannelToPropose();
  Assert.assertNotNull(newChannel);
  Assert.assertEquals("IDEA10EAP", newChannel.getId());
  Assert.assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:UpdateStrategyTest.java

示例5: testNewChannelAndNewBuildAppear

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public void testNewChannelAndNewBuildAppear() {
  //assume user has version 9 eap subscription (default or selected)
  //and new channels appears - eap of version 10 is there
  //and new build withing old channel appears also
  //we need to show only one dialog
  final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  //first time load
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.429"), UpdatesInfoXppParserTest.InfoReader.read("idea-newChannel.xml"), settings);

  final CheckForUpdateResult result = strategy.checkForUpdates();
  Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());
  final BuildInfo update = result.getNewBuildInSelectedChannel();
  Assert.assertNotNull(update);
  Assert.assertEquals("95.627", update.getNumber().toString());

  final UpdateChannel newChannel = result.getChannelToPropose();
  Assert.assertNotNull(newChannel);
  Assert.assertEquals("IDEA10EAP", newChannel.getId());
  Assert.assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:UpdateStrategyTest.java

示例6: BuildInfo

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public BuildInfo(Element node) {
  myNumber = BuildNumber.fromString(node.getAttributeValue("number"));

  String apiVersion = node.getAttributeValue("apiVersion");
  if (apiVersion != null) {
    myApiVersion = BuildNumber.fromString(apiVersion, myNumber.getProductCode());
  }
  else {
    myApiVersion = myNumber;
  }

  myVersion = node.getAttributeValue("version");

  Element messageTag = node.getChild("message");
  myMessage = messageTag != null ? messageTag.getValue() : "";

  Date releaseDate = null;
  final String date = node.getAttributeValue("releaseDate");
  if (date != null) {
    try {
      releaseDate = new SimpleDateFormat("yyyyMMdd", Locale.US).parse(date);
    }
    catch (ParseException e) {
      Logger.getInstance(BuildInfo.class).info("Failed to parse build release date " + date);
    }
  }
  myReleaseDate = releaseDate;

  myPatches = new ArrayList<PatchInfo>();
  for (Object patchNode : node.getChildren("patch")) {
    myPatches.add(new PatchInfo((Element)patchNode));
  }
  
  myButtons = new ArrayList<ButtonInfo>();
  for (Object buttonNode : node.getChildren("button")) {
    myButtons.add(new ButtonInfo((Element) buttonNode));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:BuildInfo.java

示例7: PatchInfo

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public PatchInfo(Element node) {
  myFromBuild = BuildNumber.fromString(node.getAttributeValue("from"));
  mySize = node.getAttributeValue("size");

  String excluded = node.getAttributeValue("exclusions");
  if (excluded != null) {
    myExcludedOSes.addAll(ContainerUtil.map(StringUtil.split(excluded, ","), new Function<String, String>() {
      @Override
      public String fun(String s) {
        return s.trim();
      }
    }));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PatchInfo.java

示例8: testOnlyCompatiblePluginsAreChecked

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public void testOnlyCompatiblePluginsAreChecked() throws Exception {
  final LinkedHashMap<PluginId, PluginDownloader> toUpdate = new LinkedHashMap<PluginId, PluginDownloader>();
  final IdeaPluginDescriptor[] descriptors = new IdeaPluginDescriptor[] {loadDescriptor("plugin1.xml"), loadDescriptor("plugin2.xml")};

  final BuildNumber currentBuildNumber = BuildNumber.fromString("IU-142.100");
  for (IdeaPluginDescriptor descriptor : descriptors) {
    UpdateChecker.checkAndPrepareToInstall(PluginDownloader.createDownloader(descriptor, null, currentBuildNumber), new InstalledPluginsState(),
                                           toUpdate, new ArrayList<IdeaPluginDescriptor>(), null);
  }
  Assert.assertEquals("Found: " + toUpdate.size(), 1, toUpdate.size());
  final PluginDownloader downloader = toUpdate.values().iterator().next();
  Assert.assertNotNull(downloader);
  Assert.assertEquals("0.1", downloader.getPluginVersion());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:UpdatePluginsFromCustomRepositoryTest.java

示例9: testWithUndefinedSelection

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testWithUndefinedSelection() {
  // could be if somebody used before previous version of IDEA
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-98.520"), InfoReader.read("idea-same.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  assertNull(result.getNewBuildInSelectedChannel());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:UpdateStrategyTest.java

示例10: testWithUserSelection

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testWithUserSelection() {
  // assume user has version 9 eap - and used eap channel - we want to introduce new eap
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.429"), InfoReader.read("idea-new9eap.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNotNull(update);
  assertEquals("95.627", update.getNumber().toString());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:UpdateStrategyTest.java

示例11: testIgnore

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testIgnore() {
  // assume user has version 9 eap - and used eap channel - we want to introduce new eap
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP, "95.627", "98.620");
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.429"), InfoReader.read("idea-new9eap.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNull(update);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:UpdateStrategyTest.java

示例12: testNewChannelWithOlderBuild

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
@Test
public void testNewChannelWithOlderBuild() {
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(10, BuildNumber.fromString("IU-107.80"), InfoReader.read("idea-newChannel.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNull(update);

  UpdateChannel newChannel = result.getChannelToPropose();
  assertNull(newChannel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:UpdateStrategyTest.java

示例13: checkPluginCompatibility

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public void checkPluginCompatibility() {
  String pluginProductBuildString = readProductBuildTxt();
  if (Strings.isNullOrEmpty(pluginProductBuildString)) {
    return;
  }
  // Dev mode?
  if (pluginProductBuildString.equals("PRODUCT_BUILD")) {
    return;
  }
  BuildNumber pluginProductBuild = BuildNumber.fromString(pluginProductBuildString);
  if (pluginProductBuild == null) {
    LOG.warn("Invalid META-INF/product-build.txt");
    return;
  }

  if (!isCompatible(pluginProductBuild)) {
    String message =
        Joiner.on(' ')
            .join(
                "Invalid Android Studio version for the ASwB plugin.",
                "Android Studio version: " + ApplicationInfo.getInstance().getBuild(),
                "Compatible version: " + pluginProductBuild,
                "Please update the ASwB plugin from the plugin manager.");
    NOTIFICATION_GROUP.createNotification(message, MessageType.ERROR).notify(null);
    LOG.warn(message);
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:28,代码来源:PluginCompatibilityEnforcer.java

示例14: BuildInfo

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public BuildInfo(Element node) {
  myNumber = BuildNumber.fromString(node.getAttributeValue("number"));
  myVersion = node.getAttributeValue("version");

  Date releaseDate = null;
  String date = node.getAttributeValue("date");
  if (date != null) {
    try {
      releaseDate = new SimpleDateFormat("dd.MM.yyyy").parse(date);
    }
    catch (ParseException e) {
      LOG.info("Failed to parse build release date " + date);
    }
  }
  myReleaseDate = releaseDate;

  myPatches = new ArrayList<PatchInfo>();
  for (Object patchNode : node.getChildren("patch")) {
    myPatches.add(new PatchInfo((Element)patchNode));
  }
  
  myButtons = new ArrayList<ButtonInfo>();
  for (Object buttonNode : node.getChildren("button")) {
    myButtons.add(new ButtonInfo((Element) buttonNode));
  }

  Element messageTag = node.getChild("message");
  myMessage = messageTag != null ? messageTag.getValue() : "";
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:BuildInfo.java

示例15: PatchInfo

import com.intellij.openapi.util.BuildNumber; //导入方法依赖的package包/类
public PatchInfo(Element node) {
  myFromBuild = BuildNumber.fromString(node.getAttributeValue("from"));
  mySize = node.getAttributeValue("size");
  
  String excluded = node.getAttributeValue("exclusions");
  if (excluded != null) {
    myExcludedOSes.addAll(ContainerUtil.map(StringUtil.split(excluded, ","), new Function<String, String>() {
      @Override
      public String fun(String s) {
        return s.trim();
      }
    }));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:PatchInfo.java


注:本文中的com.intellij.openapi.util.BuildNumber.fromString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。