Index: continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
===================================================================
--- continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java	(revision 898653)
+++ continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java	(working copy)
@@ -224,7 +224,7 @@
         {
             getProfileService().updateProfile( profile );
             //commented
-            //fail( "no AlreadyExistsProfileException with duplicate name" );
+            fail( "no AlreadyExistsProfileException with duplicate name" );
         }
         catch ( AlreadyExistsProfileException e )
         {
@@ -232,7 +232,7 @@
         }
         Profile getted = getProfileService().getProfile( jdk1mvn205.getId() );
         assertNotNull( getted );
-        assertEquals( jdk2mvn206Name, getted.getName() );
+        assertEquals( jdk1mvn205Name, getted.getName() );
     }
 
     public void testsetJdkInProfile()
Index: continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java
===================================================================
--- continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java	(revision 898653)
+++ continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java	(working copy)
@@ -58,11 +58,11 @@
 
         // already exists check should be done in the same transaction
         // but we assume we don't have a huge load and a lot of concurrent access ;-)
-        /*if ( alreadyExistsProfileName( profile ) )
+        if ( alreadyExistsProfileName( profile ) )
         {
             throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" );
         }
-        */
+        
 
         try
         {
Index: continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
===================================================================
--- continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java	(revision 898653)
+++ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java	(working copy)
@@ -81,4 +81,17 @@
         String BUIL_ENV_NAME = getProperty( "BUIL_ENV_NAME" );
         removeBuildEnvironment( BUIL_ENV_NAME );
     }
+    @Test( dependsOnMethods = { "testDeleteBuildEnvironment" } )
+    public void testEditDuplicatedBuildEnvironment()
+    {
+        String BUIL_ENV_NAME = getProperty( "BUIL_ENV_NAME" );
+        String newName = "new_name1";
+        goToAddBuildEnvironment();
+        addBuildEnvironment(newName, new String[] {}, true );
+        goToAddBuildEnvironment();
+        addBuildEnvironment(BUIL_ENV_NAME, new String[] {}, true );
+        goToEditBuildEnvironment( newName );
+        editBuildEnvironment( BUIL_ENV_NAME, new String[] {}, false );
+        assertTextPresent( "A Build Environment with the same name already exists" );
+    }
 }
