Index: /ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/RestGroupServiceTest.java
===================================================================
--- /ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/RestGroupServiceTest.java	(revision 5567)
+++ /ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/RestGroupServiceTest.java	(revision 5568)
@@ -1294,4 +1294,57 @@
         assertEquals(403, cresponse.getStatus());
     }
+       
+        @Test
+    public void testGetRegisteredGroupProfilecomponentRawData() throws Exception {
+
+        System.out.println("test getRegisteredComponentAndProfileRawData");
+
+        fillUpGroupB();        
+        fillUpGroupC();
+
+        String id = ComponentDescription.COMPONENT_PREFIX + "Bcomponent-1";
+        String component = this.getAuthenticatedResource(getResource()
+                .path("/registry/components/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(component
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xs:schema"));
+        assertTrue(component.endsWith("</xs:schema>"));
+
+        component = this.getAuthenticatedResource(getResource().path("/registry/components/" + id + "/xml"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(component
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<CMD_ComponentSpec"));
+        assertTrue(component.endsWith("</CMD_ComponentSpec>"));
+        assertTrue(component.contains("xsi:schemaLocation"));
+        
+        id = ProfileDescription.PROFILE_PREFIX + "Bprofile-1";
+        String profile = this.getAuthenticatedResource(getResource()
+                .path("/registry/profiles/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(profile
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xs:schema"));
+        assertTrue(profile.endsWith("</xs:schema>"));
+
+        profile = this.getAuthenticatedResource(getResource().path("/registry/profiles/" + id + "/xml"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(profile
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<CMD_ComponentSpec"));
+        assertTrue(profile.endsWith("</CMD_ComponentSpec>"));
+        assertTrue(profile.contains("xsi:schemaLocation"));
+
+        id = ComponentDescription.COMPONENT_PREFIX + "Ccomponent-1";
+        ClientResponse resp = this.getAuthenticatedResource(getResource()
+                .path("/registry/components/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get( ClientResponse.class);
+        assertEquals(403, resp.getStatus());
+        
+        id = ProfileDescription.PROFILE_PREFIX + "Cprofile-1";
+       resp = this.getAuthenticatedResource(getResource()
+                .path("/registry/profiles/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get( ClientResponse.class);
+        assertEquals(403, resp.getStatus());
+        
+        
+    }
 
 }
Index: /ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/SanboxTest.java
===================================================================
--- /ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/SanboxTest.java	(revision 5567)
+++ /ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/SanboxTest.java	(revision 5568)
@@ -235,80 +235,54 @@
     
     @Test
-    public void testRegisterCommentInGroup() throws Exception {
-
-        System.out.println("testRegisterCommmentInGroup");
-
-        
+    public void testGetRegisteredGroupProfilecomponentRawData() throws Exception {
+
+        System.out.println("test getRegisteredComponentAndProfileRawData");
+
         fillUpGroupB();        
         fillUpGroupC();
 
-        FormDataMultiPart form = new FormDataMultiPart();        
-        String id = ProfileDescription.PROFILE_PREFIX + "Bprofile-1";
-        form.field(IComponentRegistryRestService.DATA_FORM_FIELD,
-                RegistryTestHelper.getCommentTestContentStringForProfile("comment1", id),
-                MediaType.APPLICATION_OCTET_STREAM_TYPE);
-        CommentResponse response = getAuthenticatedResource(
-                "/registry/profiles/" + id + "/comments").type(
-                MediaType.MULTIPART_FORM_DATA)
-                .post(CommentResponse.class, form);
-        assertTrue(response.isRegistered());
-        assertTrue(response.isInUserSpace());
-        Comment comment = response.getComment();
-        assertNotNull(comment);
-        assertEquals("comment1", comment.getComment());
-        assertEquals("Database test user", comment.getUserName());
-        Assert.notNull(comment.getCommentDate());
-        assertEquals(1, Long.parseLong(comment.getId()));
-
-        // User id should not be serialized!
-        assertEquals(0, comment.getUserId());
-        
-        
-        form = new FormDataMultiPart();        
-        id = ComponentDescription.COMPONENT_PREFIX + "Bcomponent-1";
-        form.field(IComponentRegistryRestService.DATA_FORM_FIELD,
-                RegistryTestHelper.getCommentTestContentStringForComponent("comment2", id),
-                MediaType.APPLICATION_OCTET_STREAM_TYPE);
-        response = getAuthenticatedResource(
-                "/registry/components/" + id + "/comments").type(
-                MediaType.MULTIPART_FORM_DATA)
-                .post(CommentResponse.class, form);
-        assertTrue(response.isRegistered());
-        assertTrue(response.isInUserSpace());
-        comment = response.getComment();
-        assertNotNull(comment);
-        assertEquals("comment2", comment.getComment());
-        assertEquals("Database test user", comment.getUserName());
-        Assert.notNull(comment.getCommentDate());
-        assertEquals(2, Long.parseLong(comment.getId()));
-
-        // User id should not be serialized!
-        assertEquals(0, comment.getUserId());
-        
-        // not my group
-        
-        form = new FormDataMultiPart();        
+        String id = ComponentDescription.COMPONENT_PREFIX + "Bcomponent-1";
+        String component = this.getAuthenticatedResource(getResource()
+                .path("/registry/components/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(component
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xs:schema"));
+        assertTrue(component.endsWith("</xs:schema>"));
+
+        component = this.getAuthenticatedResource(getResource().path("/registry/components/" + id + "/xml"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(component
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<CMD_ComponentSpec"));
+        assertTrue(component.endsWith("</CMD_ComponentSpec>"));
+        assertTrue(component.contains("xsi:schemaLocation"));
+        
+        id = ProfileDescription.PROFILE_PREFIX + "Bprofile-1";
+        String profile = this.getAuthenticatedResource(getResource()
+                .path("/registry/profiles/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(profile
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xs:schema"));
+        assertTrue(profile.endsWith("</xs:schema>"));
+
+        profile = this.getAuthenticatedResource(getResource().path("/registry/profiles/" + id + "/xml"))
+                .accept(MediaType.TEXT_XML).get(String.class).trim();
+        assertTrue(profile
+                .startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<CMD_ComponentSpec"));
+        assertTrue(profile.endsWith("</CMD_ComponentSpec>"));
+        assertTrue(profile.contains("xsi:schemaLocation"));
+
+        id = ComponentDescription.COMPONENT_PREFIX + "Ccomponent-1";
+        ClientResponse resp = this.getAuthenticatedResource(getResource()
+                .path("/registry/components/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get( ClientResponse.class);
+        assertEquals(403, resp.getStatus());
+        
         id = ProfileDescription.PROFILE_PREFIX + "Cprofile-1";
-        form.field(IComponentRegistryRestService.DATA_FORM_FIELD,
-                RegistryTestHelper.getCommentTestContentStringForProfile("comment3", id),
-                MediaType.APPLICATION_OCTET_STREAM_TYPE);
-        ClientResponse cresponse = getAuthenticatedResource(
-                "/registry/profiles/" + id + "/comments").type(
-                MediaType.MULTIPART_FORM_DATA)
-                .post(ClientResponse.class, form);
-        assertEquals(403, cresponse.getStatus());
-
-        
-        
-        form = new FormDataMultiPart();        
-        id = ComponentDescription.COMPONENT_PREFIX + "Ccomponent-1";
-        form.field(IComponentRegistryRestService.DATA_FORM_FIELD,
-                RegistryTestHelper.getCommentTestContentStringForComponent("comment4", id),
-                MediaType.APPLICATION_OCTET_STREAM_TYPE);
-        cresponse = getAuthenticatedResource(
-                "/registry/components/" + id + "/comments").type(
-                MediaType.MULTIPART_FORM_DATA)
-                .post(ClientResponse.class, form);
-        assertEquals(403, cresponse.getStatus());
+       resp = this.getAuthenticatedResource(getResource()
+                .path("/registry/profiles/" + id + "/xsd"))
+                .accept(MediaType.TEXT_XML).get( ClientResponse.class);
+        assertEquals(403, resp.getStatus());
+        
+        
     }
 
