[ http://jira.codehaus.org/browse/MNG-1509?page=comments#action_53420 ] 

Bernd Bohmann commented on MNG-1509:
------------------------------------

Added more Testcases to DefaultProfileManagerTest.java m unfortunately they are 
os depend (my os is unix):

public void testOsActivationNotFamilyProfile() throws ProfileActivationException
      {
          Profile osActivated = new Profile();
          osActivated.setId("os-profile");

          Activation osActivation = new Activation();

          ActivationOS activationOS = new ActivationOS();

          activationOS.setFamily("!windows");

          osActivation.setOs(activationOS);

          osActivated.setActivation(osActivation);

          ProfileManager profileManager = new 
DefaultProfileManager(getContainer());

          profileManager.addProfile(osActivated);

          List active = profileManager.getActiveProfiles();

          assertNotNull( active );
          assertEquals( 1, active.size() );
      }

   public void testOsActivationFamilyProfile() throws ProfileActivationException
      {
          Profile osActivated = new Profile();
          osActivated.setId("os-profile");

          Activation osActivation = new Activation();

          ActivationOS activationOS = new ActivationOS();

          activationOS.setFamily("unix");

          osActivation.setOs(activationOS);

          osActivated.setActivation(osActivation);

          ProfileManager profileManager = new 
DefaultProfileManager(getContainer());

          profileManager.addProfile(osActivated);

          List active = profileManager.getActiveProfiles();

          assertNotNull( active );
          assertEquals( 1, active.size() );
      }

  public void testOsActivationWrongFamilyProfile() throws 
ProfileActivationException
       {
           Profile osActivated = new Profile();
           osActivated.setId("os-profile");

           Activation osActivation = new Activation();

           ActivationOS activationOS = new ActivationOS();

           activationOS.setFamily("!unix");

           osActivation.setOs(activationOS);

           osActivated.setActivation(osActivation);

           ProfileManager profileManager = new 
DefaultProfileManager(getContainer());

           profileManager.addProfile(osActivated);

           List active = profileManager.getActiveProfiles();

           assertNotNull( active );
           assertEquals( 0, active.size() );
       }

All these tests runs without a failure.

How can i ensure that this version is used by maven?



> Profile activation by os doesn't work
> -------------------------------------
>
>          Key: MNG-1509
>          URL: http://jira.codehaus.org/browse/MNG-1509
>      Project: Maven 2
>         Type: Bug

>   Components: Inheritence and Interpolation
>     Versions: 2.0
>  Environment: Ubuntu 5.10 maven 2.0
>     Reporter: Bernd Bohmann
>     Assignee: John Casey
>      Fix For: 2.0.1
>  Attachments: DefaultProfileManagerTest.java.patch, 
> OperatingSystemProfileActivator.java.patch, 
> OperatingSystemProfileActivator.java.patch, components.xml.patch
>
>
> Profile activation by os doesn't work.
> OperatingSystemProfileActivator is missing in components.xml.
> Implementation of OperatingSystemProfileActivator.isActive is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to