Changeset 1861
- Timestamp:
- 04/05/12 14:22:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/ConcurrentRestServiceTest.java
r1603 r1861 3 3 import clarin.cmdi.componentregistry.impl.database.ComponentRegistryTestDatabase; 4 4 import clarin.cmdi.componentregistry.model.AbstractDescription; 5 import static clarin.cmdi.componentregistry.rest.ComponentRegistryRestService.USERSPACE_PARAM; 6 import static org.junit.Assert.assertEquals; 7 import static org.junit.Assert.fail; 8 5 import clarin.cmdi.componentregistry.model.ComponentDescription; 6 import clarin.cmdi.componentregistry.model.ProfileDescription; 7 import clarin.cmdi.componentregistry.model.RegisterResponse; 8 import com.sun.jersey.api.client.ClientResponse; 9 import com.sun.jersey.multipart.FormDataMultiPart; 9 10 import java.io.InputStream; 10 11 import java.util.ArrayList; 11 12 import java.util.Arrays; 13 import java.util.Collections; 14 import java.util.Comparator; 12 15 import java.util.List; 13 14 16 import javax.ws.rs.core.MediaType; 15 16 17 import org.junit.Before; 17 18 import org.junit.Test; 18 19 import org.junit.runner.RunWith; 19 20 import clarin.cmdi.componentregistry.model.ComponentDescription;21 import clarin.cmdi.componentregistry.model.ProfileDescription;22 import clarin.cmdi.componentregistry.model.RegisterResponse;23 24 import com.sun.jersey.api.client.ClientResponse;25 import com.sun.jersey.multipart.FormDataMultiPart;26 import java.util.Collections;27 import java.util.Comparator;28 20 import org.slf4j.Logger; 29 21 import org.slf4j.LoggerFactory; … … 33 25 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 34 26 27 import static clarin.cmdi.componentregistry.rest.ComponentRegistryRestService.USERSPACE_PARAM; 28 import static org.junit.Assert.*; 29 35 30 @RunWith(SpringJUnit4ClassRunner.class) 36 @ContextConfiguration(locations = { "/applicationContext.xml"})31 @ContextConfiguration(locations = {"/applicationContext.xml"}) 37 32 public class ConcurrentRestServiceTest extends ComponentRegistryRestServiceTestCase { 38 33 39 34 private final static Logger LOG = LoggerFactory.getLogger(ConcurrentRestServiceTest.class); 40 private int NR_OF_PROFILES = 50; 41 private int NR_OF_COMPONENTS = 50; 42 35 private int NR_OF_PROFILES = 20; 36 private int NR_OF_COMPONENTS = 20; 43 37 @Autowired 44 38 private JdbcTemplate jdbcTemplate; … … 54 48 return "classpath:applicationContext.xml"; 55 49 } 56 50 57 51 @Test 58 52 public void testConcurrentRegisterProfile() throws Exception { … … 125 119 for (int i = 0; i < size; i++) { 126 120 final boolean shouldDelete = (i % 2) == 1; 121 LOG.debug("Profile {} should be registered in {} and {}", new Object[]{i + 1000, Boolean.parseBoolean(userSpace) ? "user space" : "public space", shouldDelete ? "ALSO DELETED" : "not deleted"}); 127 122 Thread thread = createThread("/registry/profiles/", userSpace, "Test Profile" + (i + 1000), shouldDelete, RegistryTestHelper.getTestProfileContent(), errors); 128 123 ts.add(thread); … … 133 128 for (int i = 0; i < size; i++) { 134 129 final boolean shouldDelete = (i % 2) == 1; 130 LOG.debug("Component {} should be registered in {} and {}", new Object[]{i + 1000, Boolean.parseBoolean(userSpace) ? "user space" : "public space", shouldDelete ? "ALSO DELETED" : "not deleted"}); 135 131 Thread thread = createThread("/registry/components/", userSpace, "Test Component" + (i + 1000), shouldDelete, 136 132 RegistryTestHelper.getComponentTestContent(), errors);
Note: See TracChangeset
for help on using the changeset viewer.