예제 #1
0
파일: test.cpp 프로젝트: akostrikov/ATCD
int ACE_TMAIN (int argc, ACE_TCHAR * argv[])
{
    try
    {
        if (argc < 1)
        {
            ACE_ERROR ((LM_ERROR,
                        ACE_TEXT ("Incorrect count of arguments. ")
                        ACE_TEXT ("Path to deployment plan has not been specified.\n")));
            return 1;
        }
        DAnCE::Config_Handlers::XML_File_Intf file (argv[1]);
        file.add_search_path (ACE_TEXT ("DANCE_ROOT"), ACE_TEXT ("/docs/schema/"));
        file.add_search_path (ACE_TEXT ("CIAO_ROOT"), ACE_TEXT ("/docs/schema/"));
        file.add_search_path (ACE_TEXT ("TAO_ROOT"), ACE_TEXT ("/docs/schema/"));
        Deployment::DeploymentPlan * plan = file.release_plan();
        Deployment::DnC_Dump::dump (*plan);
        delete plan;
    }
    catch (const CORBA::Exception& ex)
    {
        ex._tao_print_exception ("DAnCE_DeploymentPlanDump::main\n");
        return -1;
    }
    catch (...)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception\n")));
        return 1;
    }

    return 0;
}
예제 #2
0
파일: test.cpp 프로젝트: DOCGroup/DAnCE
int ACE_TMAIN (int argc, ACE_TCHAR * argv[])
{
  DANCE_DISABLE_TRACE ();

  try
    {
      DAnCE::Logger_Service
        *dlf = ACE_Dynamic_Service<DAnCE::Logger_Service>::instance ("DAnCE_Logger");

      if (dlf)
        {
          dlf->init (argc, argv);
        }

      if (argc < 1)
        {
          ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect count of arguments. Path to deployment plan has not been specified.\n")));
          return 1;
        }

      DAnCE::Config_Handlers::XML_File_Intf file (argv[1]);
      file.add_search_path (ACE_TEXT ("DANCE_ROOT"), ACE_TEXT ("/docs/schema/"));
      file.add_search_path (ACE_TEXT ("CIAO_ROOT"), ACE_TEXT ("/docs/schema/"));
      file.add_search_path (ACE_TEXT ("TAO_ROOT"), ACE_TEXT ("/docs/schema/"));
      ::Deployment::DeploymentPlan *plan = file.release_plan ();
      if (plan)
        {
          ACE_ERROR ((LM_ERROR, "ERROR : No errors were found in plan <%C>\n",
                    argv[1]));
          return 1;
        }
    }
  catch (const DAnCE::Config_Handlers::Config_Error &ex)
    {
      DANCE_ERROR (DANCE_LOG_EMERGENCY,
                   (LM_ERROR,
                    "Caught config error while parsing XML into IDL: %C:%C\n",
                    ex.name_.c_str (), ex.error_.c_str ()));
    }
  catch (...)
    {
      ACE_ERROR ((LM_ERROR,
                "ERROR: Unexpected exception caught while parsing plan <%C>\n",
                argv[1]));
      return 1;
    }
  ACE_DEBUG ((LM_DEBUG, "OK: Problems were found in <%C>\n",
              argv[1]));
  return 0;
}
예제 #3
0
int ACE_TMAIN (int argc, ACE_TCHAR * argv[])
{
    try
    {
        if (argc < 1)
        {
            ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect count of arguments. Path to deployment plan has not been specified.\n")));
            return 1;
        }
        //parsing plan
        DAnCE::Config_Handlers::XML_File_Intf file (argv[1]);
        file.add_search_path (ACE_TEXT ("DANCE_ROOT"), ACE_TEXT ("/docs/schema/"));
        file.add_search_path (ACE_TEXT ("CIAO_ROOT"), ACE_TEXT ("/docs/schema/"));
        file.add_search_path (ACE_TEXT ("TAO_ROOT"), ACE_TEXT ("/docs/schema/"));
        auto_ptr<Deployment::DeploymentPlan>  plan (file.release_plan());

        //check instance references to corresponding implementations
        for ( ::CORBA::ULong i = 0; i < plan->instance.length(); i++)
        {
            if (plan->instance[i].implementationRef > plan->implementation.length() - 1)
            {
                ACE_ERROR ((LM_ERROR,
                            ACE_TEXT ("incorrect implementationRef in instance %C.\n"), plan->instance[i].name.in()));
                return 1;
            }
        }

        //check artifact reference for implementations of Home objects
        for ( ::CORBA::ULong i = 0; i < plan->implementation.length(); i++)
        {
            if (plan->implementation[i].artifactRef.length() > 0)
            {
                if (plan->implementation[i].artifactRef[0] > plan->artifact.length() - 1)
                {
                    ACE_ERROR ((LM_ERROR,
                                ACE_TEXT ("incorrect artifactRef in the implementation %C.\n"), plan->implementation[i].name.in()));
                    return 1;
                }
            }
        }
    }
    catch (...)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception")));
        return 1;
    }

    return 0;
}