Java 类org.testng.remote.strprotocol.SerializedMessageSender 实例源码

项目:intellij-ce-playground    文件:TestNGRunnableState.java   
public static boolean supportSerializationProtocol(TestNGConfiguration config) {
  final Project project = config.getProject();
  final GlobalSearchScope scopeToDetermineTestngIn;
  if (config.getPersistantData().getScope() == TestSearchScope.WHOLE_PROJECT) {
    scopeToDetermineTestngIn = GlobalSearchScope.allScope(project);
  }
  else {
    final Module module = config.getConfigurationModule().getModule();
    scopeToDetermineTestngIn = module != null ? GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module) 
                                              : GlobalSearchScope.allScope(project);
  }

  final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
  final PsiClass aClass = facade.findClass(SerializedMessageSender.class.getName(), scopeToDetermineTestngIn);
  if (aClass == null) return false;

  final PsiClass[] starters = facade.findClasses(RemoteTestNG.class.getName(), scopeToDetermineTestngIn);
  for (PsiClass starter : starters) {
    if (starter.findFieldByName("m_serPort", false) == null) {
      LOG.info("Multiple TestNG versions found");
      return false;
    }
  }
  return Registry.is("testng.serialized.protocol.enabled") && !TestNGVersionChecker.isVersionIncompatible(project, scopeToDetermineTestngIn);
}
项目:tools-idea    文件:TestNGRunnableState.java   
public static boolean supportSerializationProtocol(TestNGConfiguration config) {
  final Project project = config.getProject();
  final GlobalSearchScope scopeToDetermineTestngIn;
  if (config.getPersistantData().getScope() == TestSearchScope.WHOLE_PROJECT) {
    scopeToDetermineTestngIn = GlobalSearchScope.allScope(project);
  }
  else {
    scopeToDetermineTestngIn = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(config.getConfigurationModule().getModule());
  }

  final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
  final PsiClass aClass = facade.findClass(SerializedMessageSender.class.getName(), scopeToDetermineTestngIn);
  if (aClass == null) return false;

  final PsiClass[] starters = facade.findClasses(RemoteTestNG.class.getName(), scopeToDetermineTestngIn);
  for (PsiClass starter : starters) {
    if (starter.findFieldByName("m_serPort", false) == null) {
      LOG.info("Multiple TestNG versions found");
      return false;
    }
  }
  return Registry.is("testng.serialized.protocol.enabled") && !TestNGVersionChecker.isVersionIncompatible(project, scopeToDetermineTestngIn);
}
项目:testng-remote    文件:RemoteTest.java   
@Test
public void testSerialized() {
  runTest("-serport", PORT1, new SerializedMessageSender("localhost", PORT1));
}