Changeset 524
- Timestamp:
- 09/20/08 13:20:50 (5 years ago)
- Location:
- trunk
- Files:
-
- 21 modified
-
mpdb-test-client/test/edu/rpi/metpetdb/client/MpDbTestCase.java (modified) (2 diffs)
-
mpdb-test-client/test/edu/rpi/metpetdb/client/ui/chemical/analysis/SaveChemicalAnalysisTest.java (modified) (4 diffs)
-
mpdb-test-client/test/edu/rpi/metpetdb/client/ui/sample/LoadSampleTest.java (modified) (3 diffs)
-
mpdb-test-client/test/edu/rpi/metpetdb/client/ui/sample/SampleDetailsTest.java (modified) (5 diffs)
-
mpdb-test-client/test/edu/rpi/metpetdb/client/ui/sample/SaveSampleTest.java (modified) (8 diffs)
-
mpdb-test-client/test/edu/rpi/metpetdb/client/ui/subsample/SubsampleDetailsTest.java (modified) (7 diffs)
-
mpdb-test-server/test-data/test-client-data.xml (modified) (1 diff)
-
mpdb-test-server/test-data/test-database.dtd (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/DatabaseTestCase.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/SetupDatabaseForClient.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/bulk/upload/sample/BulkUploadTest.java (modified) (2 diffs)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/dao/MineralDaoTest.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/dao/SampleDaoTest.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/dao/SubsampleDaoTest.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/dao/UserDaoTest.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/model/SampleCloneTest.java (modified) (2 diffs)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/search/HibernateSearchTest.java (modified) (14 diffs)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/search/SampleSearch.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/search/SearchFilters.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/search/SearchMinerals.java (modified) (1 diff)
-
mpdb-test-server/test/edu/rpi/metpetdb/server/search/SearchOxidesAndElements.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/mpdb-test-client/test/edu/rpi/metpetdb/client/MpDbTestCase.java
r471 r524 3 3 import com.google.gwt.junit.client.GWTTestCase; 4 4 5 import edu.rpi.metpetdb.client.model.Sample DTO;6 import edu.rpi.metpetdb.client.model.Subsample DTO;7 import edu.rpi.metpetdb.client.model.User DTO;5 import edu.rpi.metpetdb.client.model.Sample; 6 import edu.rpi.metpetdb.client.model.Subsample; 7 import edu.rpi.metpetdb.client.model.User; 8 8 9 9 public abstract class MpDbTestCase extends GWTTestCase { 10 10 11 private User DTOowner;12 private Sample DTOsample;13 private Subsample DTOsubsample;11 private User owner; 12 private Sample sample; 13 private Subsample subsample; 14 14 15 15 public String getModuleName() { … … 23 23 */ 24 24 public void gwtSetUp() { 25 owner = new User DTO();25 owner = new User(); 26 26 owner.setId(1); 27 27 28 sample = new Sample DTO();28 sample = new Sample(); 29 29 sample.setId(1); 30 30 sample.setOwner(owner); 31 31 32 subsample = new Subsample DTO();32 subsample = new Subsample(); 33 33 subsample.setId(1); 34 34 subsample.setSample(sample); 35 35 } 36 36 37 public User DTOgetUser() {37 public User getUser() { 38 38 return owner; 39 39 } 40 40 41 public Sample DTOgetSample() {41 public Sample getSample() { 42 42 return sample; 43 43 } 44 44 45 public Subsample DTOgetSubsample() {45 public Subsample getSubsample() { 46 46 return subsample; 47 47 } -
trunk/mpdb-test-client/test/edu/rpi/metpetdb/client/ui/chemical/analysis/SaveChemicalAnalysisTest.java
r471 r524 6 6 import edu.rpi.metpetdb.client.MpDbTestCase; 7 7 import edu.rpi.metpetdb.client.TestServerOp; 8 import edu.rpi.metpetdb.client.model.ChemicalAnalysis DTO;9 import edu.rpi.metpetdb.client.model.ChemicalAnalysisElement DTO;10 import edu.rpi.metpetdb.client.model.ChemicalAnalysisOxide DTO;11 import edu.rpi.metpetdb.client.model.Element DTO;12 import edu.rpi.metpetdb.client.model.Oxide DTO;8 import edu.rpi.metpetdb.client.model.ChemicalAnalysis; 9 import edu.rpi.metpetdb.client.model.ChemicalAnalysisElement; 10 import edu.rpi.metpetdb.client.model.ChemicalAnalysisOxide; 11 import edu.rpi.metpetdb.client.model.Element; 12 import edu.rpi.metpetdb.client.model.Oxide; 13 13 import edu.rpi.metpetdb.client.ui.MpDb; 14 14 … … 17 17 private static final String SPOT_ID = String.valueOf(System 18 18 .currentTimeMillis()); 19 private ChemicalAnalysis DTOchemicalAnalysis;19 private ChemicalAnalysis chemicalAnalysis; 20 20 21 21 @Override 22 22 public void gwtSetUp() { 23 chemicalAnalysis = new ChemicalAnalysis DTO();23 chemicalAnalysis = new ChemicalAnalysis(); 24 24 chemicalAnalysis.setSubsample(getSubsample()); 25 25 chemicalAnalysis.setSpotId(SPOT_ID); 26 26 chemicalAnalysis.setLargeRock(Boolean.TRUE); 27 27 28 final Set<ChemicalAnalysisElement DTO> elements = new HashSet<ChemicalAnalysisElementDTO>();29 final ChemicalAnalysisElement DTO element = new ChemicalAnalysisElementDTO();30 final Element DTO e = new ElementDTO();28 final Set<ChemicalAnalysisElement> elements = new HashSet<ChemicalAnalysisElement>(); 29 final ChemicalAnalysisElement element = new ChemicalAnalysisElement(); 30 final Element e = new Element(); 31 31 e.setId((short) 1); 32 32 element.setElement(e); … … 34 34 elements.add(element); 35 35 36 final Set<ChemicalAnalysisOxide DTO> oxides = new HashSet<ChemicalAnalysisOxideDTO>();37 final ChemicalAnalysisOxide DTO oxide = new ChemicalAnalysisOxideDTO();38 final Oxide DTO o = new OxideDTO();36 final Set<ChemicalAnalysisOxide> oxides = new HashSet<ChemicalAnalysisOxide>(); 37 final ChemicalAnalysisOxide oxide = new ChemicalAnalysisOxide(); 38 final Oxide o = new Oxide(); 39 39 o.setOxideId((short) 1); 40 40 oxide.setOxide(o); … … 49 49 */ 50 50 public void testSaveChemicalAnalysis() { 51 new TestServerOp<ChemicalAnalysis DTO>(this) {51 new TestServerOp<ChemicalAnalysis>(this) { 52 52 public void begin() { 53 53 MpDb.chemicalAnalysis_svc.save(chemicalAnalysis, this); 54 54 } 55 55 56 public void onSuccess(final ChemicalAnalysis DTOs) {56 public void onSuccess(final ChemicalAnalysis s) { 57 57 assertEquals(s.getSpotId(), chemicalAnalysis.getSpotId()); 58 58 assertEquals(s.getElements().size(), 1); -
trunk/mpdb-test-client/test/edu/rpi/metpetdb/client/ui/sample/LoadSampleTest.java
r479 r524 4 4 import edu.rpi.metpetdb.client.TestServerOp; 5 5 import edu.rpi.metpetdb.client.error.dao.SampleNotFoundException; 6 import edu.rpi.metpetdb.client.model.Sample DTO;6 import edu.rpi.metpetdb.client.model.Sample; 7 7 import edu.rpi.metpetdb.client.ui.MpDb; 8 8 … … 16 16 */ 17 17 public void testLoadSample() { 18 new TestServerOp<Sample DTO>(this) {18 new TestServerOp<Sample>(this) { 19 19 public void begin() { 20 20 MpDb.sample_svc.details(SAMPLE_ID, this); 21 21 } 22 22 23 public void onSuccess(final Sample DTOsample) {23 public void onSuccess(final Sample sample) { 24 24 assertEquals(SAMPLE_ID, sample.getId()); 25 25 finishTest(); … … 33 33 */ 34 34 public void testLoadSampleFail() { 35 new TestServerOp<Sample DTO>(this) {35 new TestServerOp<Sample>(this) { 36 36 public void begin() { 37 37 MpDb.sample_svc.details(SAMPLE_FAIL_ID, this); 38 38 } 39 39 40 public void onSuccess(final Sample DTOs) {40 public void onSuccess(final Sample s) { 41 41 fail("testLoadSampleFail failed, expected an exception"); 42 42 } -
trunk/mpdb-test-client/test/edu/rpi/metpetdb/client/ui/sample/SampleDetailsTest.java
r251 r524 6 6 import edu.rpi.metpetdb.client.MpDbTestCase; 7 7 import edu.rpi.metpetdb.client.TestServerOp; 8 import edu.rpi.metpetdb.client.model.Sample DTO;8 import edu.rpi.metpetdb.client.model.Sample; 9 9 import edu.rpi.metpetdb.client.paging.PaginationParameters; 10 10 import edu.rpi.metpetdb.client.paging.Results; … … 24 24 p.setParameter("alias"); 25 25 26 new TestServerOp<Results<Sample DTO>>(this) {26 new TestServerOp<Results<Sample>>(this) { 27 27 public void begin() { 28 28 MpDb.sample_svc.all(p, this); 29 29 } 30 30 31 public void onSuccess(final Results<Sample DTO> results) {32 final List<Sample DTO> l = results.getList();31 public void onSuccess(final Results<Sample> results) { 32 final List<Sample> l = results.getList(); 33 33 final String[] aliases = { 34 34 "1", "3", "4", "5", "6" … … 38 38 // Verify the order, also verifies we got the right ones 39 39 for (int i = 0; i < l.size(); ++i) { 40 final Sample DTOs = l.get(i);40 final Sample s = l.get(i); 41 41 assertEquals(aliases[i], s.getAlias()); 42 42 if (i + 1 < l.size()) { … … 61 61 p.setFirstResult(0); 62 62 p.setParameter("alias"); 63 new TestServerOp<Results<Sample DTO>>(this) {63 new TestServerOp<Results<Sample>>(this) { 64 64 public void begin() { 65 65 MpDb.sample_svc.allPublicSamples(p, this); 66 66 } 67 67 68 public void onSuccess(final Results<Sample DTO> results) {69 final List<Sample DTO> l = results.getList();68 public void onSuccess(final Results<Sample> results) { 69 final List<Sample> l = results.getList(); 70 70 // verify they are all public 71 final Iterator<Sample DTO> itr = l.iterator();71 final Iterator<Sample> itr = l.iterator(); 72 72 while (itr.hasNext()) { 73 final Sample DTO s = (SampleDTO) itr.next();73 final Sample s = (Sample) itr.next(); 74 74 System.out.println(s.toString()); 75 75 assertTrue(s.isPublicData()); … … 91 91 p.setFirstResult(0); 92 92 p.setParameter("alias"); 93 new TestServerOp<Results<Sample DTO>>(this) {93 new TestServerOp<Results<Sample>>(this) { 94 94 public void begin() { 95 95 MpDb.sample_svc.allSamplesForUser(p, getUser().getId(), this); 96 96 } 97 97 98 public void onSuccess(final Results<Sample DTO> results) {99 final List<Sample DTO> l = results.getList();98 public void onSuccess(final Results<Sample> results) { 99 final List<Sample> l = results.getList(); 100 100 // verify they are all public 101 final Iterator<Sample DTO> itr = l.iterator();101 final Iterator<Sample> itr = l.iterator(); 102 102 while (itr.hasNext()) { 103 final Sample DTO s = (SampleDTO) itr.next();103 final Sample s = (Sample) itr.next(); 104 104 System.out.println(s.toString()); 105 105 assertEquals(s.getOwner(), getUser()); -
trunk/mpdb-test-client/test/edu/rpi/metpetdb/client/ui/sample/SaveSampleTest.java
r487 r524 6 6 import edu.rpi.metpetdb.client.error.validation.InvalidSESARNumberException; 7 7 import edu.rpi.metpetdb.client.error.validation.PropertyRequiredException; 8 import edu.rpi.metpetdb.client.model.RockType DTO;9 import edu.rpi.metpetdb.client.model.Sample DTO;8 import edu.rpi.metpetdb.client.model.RockType; 9 import edu.rpi.metpetdb.client.model.Sample; 10 10 import edu.rpi.metpetdb.client.ui.MpDb; 11 11 … … 25 25 private static final double LATITUDE = 1; 26 26 private static final double LONGITUDE = 1; 27 private static RockType DTOROCK_TYPE;27 private static RockType ROCK_TYPE; 28 28 private static final String ALIAS = String.valueOf(System 29 29 .currentTimeMillis()); 30 private Sample DTOsample;30 private Sample sample; 31 31 private static int ROTATING_SAMPLE_ID = 200; 32 32 … … 34 34 public void gwtSetUp() { 35 35 super.gwtSetUp(); 36 ROCK_TYPE = new RockType DTO();36 ROCK_TYPE = new RockType(); 37 37 ROCK_TYPE.setRockType("gentoo"); 38 38 39 sample = new Sample DTO();39 sample = new Sample(); 40 40 sample.setSesarNumber(SESAR_NUMBER); 41 41 sample.setLatitude(LATITUDE); … … 51 51 */ 52 52 public void testSaveSample() { 53 new TestServerOp<Sample DTO>(this) {53 new TestServerOp<Sample>(this) { 54 54 public void begin() { 55 55 MpDb.sample_svc.save(sample, this); 56 56 } 57 57 58 public void onSuccess(final Sample DTOs) {58 public void onSuccess(final Sample s) { 59 59 assertEquals(s, sample); 60 60 finishTest(); … … 66 66 public void testSaveSampleFailSesarNumber() { 67 67 sample.setSesarNumber("error1234"); 68 new TestServerOp<Sample DTO>(this) {68 new TestServerOp<Sample>(this) { 69 69 public void begin() { 70 70 MpDb.sample_svc.save(sample, this); 71 71 } 72 72 73 public void onSuccess(final Sample DTOs) {73 public void onSuccess(final Sample s) { 74 74 fail("testSaveSampleFailSesarNumber failed, expected an exception"); 75 75 } … … 93 93 public void testSaveSampleFailLocation() { 94 94 sample.setLocation(null); 95 new TestServerOp<Sample DTO>(this) {95 new TestServerOp<Sample>(this) { 96 96 public void begin() { 97 97 MpDb.sample_svc.save(sample, this); 98 98 } 99 99 100 public void onSuccess(final Sample DTOs) {100 public void onSuccess(final Sample s) { 101 101 fail("testSaveSampleFailLatitude failed, expected an exception"); 102 102 } … … 118 118 public void testSaveSampleFailAlias() { 119 119 sample.setAlias(null); 120 new TestServerOp<Sample DTO>(this) {120 new TestServerOp<Sample>(this) { 121 121 public void begin() { 122 122 MpDb.sample_svc.save(sample, this); 123 123 } 124 124 125 public void onSuccess(final Sample DTOs) {125 public void onSuccess(final Sample s) { 126 126 fail("testSaveSampleFailAlias failed, expected an exception"); 127 127 } … … 142 142 public void testSaveSampleFailOwner() { 143 143 sample.setOwner(null); 144 new TestServerOp<Sample DTO>(this) {144 new TestServerOp<Sample>(this) { 145 145 public void begin() { 146 146 MpDb.sample_svc.save(sample, this); 147 147 } 148 148 149 public void onSuccess(final Sample DTOs) {149 public void onSuccess(final Sample s) { 150 150 fail("testSaveSampleFailOwner failed, expected an exception"); 151 151 } -
trunk/mpdb-test-client/test/edu/rpi/metpetdb/client/ui/subsample/SubsampleDetailsTest.java
r487 r524 8 8 import edu.rpi.metpetdb.client.VoidTestServerOp; 9 9 import edu.rpi.metpetdb.client.error.ValidationException; 10 import edu.rpi.metpetdb.client.model.Subsample DTO;11 import edu.rpi.metpetdb.client.model.SubsampleType DTO;10 import edu.rpi.metpetdb.client.model.Subsample; 11 import edu.rpi.metpetdb.client.model.SubsampleType; 12 12 import edu.rpi.metpetdb.client.paging.PaginationParameters; 13 13 import edu.rpi.metpetdb.client.paging.Results; … … 18 18 private static final long SUBSAMPLE_ID = 2; 19 19 private static final String NAME = "loller skater"; 20 private static SubsampleType DTOTYPE;20 private static SubsampleType TYPE; 21 21 22 22 @Override 23 23 public void gwtSetUp() { 24 24 super.gwtSetUp(); 25 TYPE = new SubsampleType DTO();25 TYPE = new SubsampleType(); 26 26 TYPE.setSubsampleType("linux"); 27 27 … … 33 33 */ 34 34 public void testSaveSubsample() { 35 final Subsample DTO s = new SubsampleDTO();35 final Subsample s = new Subsample(); 36 36 s.setSample(getSample()); 37 37 s.setName(NAME); 38 38 s.setSubsampleType(TYPE); 39 new TestServerOp<Subsample DTO>(this) {39 new TestServerOp<Subsample>(this) { 40 40 public void begin() { 41 41 MpDb.subsample_svc.save(s, this); 42 42 } 43 43 44 public void onSuccess(final Subsample DTOsubsample) {44 public void onSuccess(final Subsample subsample) { 45 45 assertEquals(subsample.getName(), NAME); 46 46 assertEquals(subsample.getSubsampleType(), TYPE); … … 55 55 */ 56 56 public void testSaveSubsampleFailName() { 57 final Subsample DTO s = new SubsampleDTO();57 final Subsample s = new Subsample(); 58 58 s.setSample(getSample()); 59 59 s.setSubsampleType(TYPE); 60 new TestServerOp<Subsample DTO>(this) {60 new TestServerOp<Subsample>(this) { 61 61 public void begin() { 62 62 MpDb.subsample_svc.save(s, this); 63 63 } 64 64 65 public void onSuccess(final Subsample DTOsubsample) {65 public void onSuccess(final Subsample subsample) { 66 66 fail("failed verifying constraints"); 67 67 finishTest(); … … 83 83 */ 84 84 public void testLoadSubsample() { 85 new TestServerOp<Subsample DTO>(this) {85 new TestServerOp<Subsample>(this) { 86 86 public void begin() { 87 87 MpDb.subsample_svc.details(SUBSAMPLE_ID, this); 88 88 } 89 89 90 public void onSuccess(final Subsample DTOsubsample) {90 public void onSuccess(final Subsample subsample) { 91 91 assertEquals(SUBSAMPLE_ID, subsample.getId()); 92 92 finishTest(); … … 119 119 p.setParameter("name"); 120 120 121 new TestServerOp<Results<Subsample DTO>>(this) {121 new TestServerOp<Results<Subsample>>(this) { 122 122 public void begin() { 123 123 MpDb.subsample_svc.all(p, getSample().getId(), this); 124 124 } 125 125 126 public void onSuccess(final Results<Subsample DTO> results) {127 final List<Subsample DTO> l = results.getList();126 public void onSuccess(final Results<Subsample> results) { 127 final List<Subsample> l = results.getList(); 128 128 final String[] names = { 129 129 "1", "3", "4", "5" … … 132 132 assertEquals(5, results.getCount()); 133 133 // Verify the order, also verifies we got the right ones 134 final Iterator<Subsample DTO> itr = l.iterator();134 final Iterator<Subsample> itr = l.iterator(); 135 135 // Start with 2 beause 1 was deleted 136 136 int count = 0; 137 137 while (itr.hasNext()) { 138 final Subsample DTOs = itr.next();138 final Subsample s = itr.next(); 139 139 assertEquals(names[count], s.getName()); 140 140 ++count; -
trunk/mpdb-test-server/test-data/test-client-data.xml
r490 r524 2 2 <!DOCTYPE dataset SYSTEM "test-data/test-database.dtd"> 3 3 <dataset> 4 <users user_id="1" version="1" name="anthony" password="" email="watera2@cs.rpi.edu"/>5 <users user_id="2" version="1" name="matt" password="" email="fyffem@cs.rpi.edu"></users>4 <users user_id="1" enabled="Y" version="1" name="anthony" password="" email="watera2@cs.rpi.edu"/> 5 <users user_id="2" enabled="Y" version="1" name="matt" password="" email="fyffem@cs.rpi.edu"></users> 6 6 <rock_type rock_type_id="1" rock_type="gentoo" /> 7 7 <subsample_type subsample_type_id="1" subsample_type="linux" /> -
trunk/mpdb-test-server/test-data/test-database.dtd
r490 r524 354 354 institution CDATA #IMPLIED 355 355 reference_email CDATA #IMPLIED 356 enabled CDATA #REQUIRED 356 357 > 357 358 -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/DatabaseTestCase.java
r471 r524 13 13 14 14 import edu.rpi.metpetdb.client.error.NoSuchObjectException; 15 import edu.rpi.metpetdb. server.model.MObject;15 import edu.rpi.metpetdb.client.model.MObject; 16 16 17 17 public class DatabaseTestCase extends TestCase { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/SetupDatabaseForClient.java
r479 r524 16 16 import org.dbunit.operation.DatabaseOperation; 17 17 import org.hibernate.Session; 18 import org.hibernate.Transaction;19 18 20 19 /** -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/bulk/upload/sample/BulkUploadTest.java
r489 r524 11 11 12 12 import edu.rpi.metpetdb.client.error.InvalidFormatException; 13 import edu.rpi.metpetdb.client.model.SampleDTO; 13 import edu.rpi.metpetdb.client.model.Sample; 14 import edu.rpi.metpetdb.client.model.User; 14 15 import edu.rpi.metpetdb.server.DataStore; 15 16 import edu.rpi.metpetdb.server.DatabaseTestCase; 16 17 import edu.rpi.metpetdb.server.InitDatabase; 17 18 import edu.rpi.metpetdb.server.bulk.upload.SampleParser; 18 import edu.rpi.metpetdb.server.model.User;19 19 20 20 public class BulkUploadTest extends DatabaseTestCase { … … 72 72 sp.parse(); 73 73 74 final List<Sample DTO> samples = sp.getSamples();74 final List<Sample> samples = sp.getSamples(); 75 75 76 76 } catch (final IOException ioe) { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/dao/MineralDaoTest.java
r503 r524 10 10 import org.junit.Test; 11 11 12 import edu.rpi.metpetdb.client.model.Mineral; 12 13 import edu.rpi.metpetdb.server.DataStore; 13 import edu.rpi.metpetdb.server.model.Mineral;14 14 15 15 public class MineralDaoTest extends TestCase { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/dao/SampleDaoTest.java
r487 r524 7 7 8 8 import edu.rpi.metpetdb.client.error.NoSuchObjectException; 9 import edu.rpi.metpetdb.client.model.Sample; 9 10 import edu.rpi.metpetdb.server.DatabaseTestCase; 10 11 import edu.rpi.metpetdb.server.InitDatabase; 11 import edu.rpi.metpetdb.server.model.Sample;12 12 13 13 public class SampleDaoTest extends DatabaseTestCase { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/dao/SubsampleDaoTest.java
r487 r524 4 4 5 5 import edu.rpi.metpetdb.client.error.NoSuchObjectException; 6 import edu.rpi.metpetdb.client.model.Subsample; 6 7 import edu.rpi.metpetdb.server.DatabaseTestCase; 7 import edu.rpi.metpetdb.server.model.Subsample;8 8 9 9 public class SubsampleDaoTest extends DatabaseTestCase { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/dao/UserDaoTest.java
r484 r524 4 4 import org.junit.Test; 5 5 6 import edu.rpi.metpetdb.client.model.User; 6 7 import edu.rpi.metpetdb.server.DatabaseTestCase; 7 8 import edu.rpi.metpetdb.server.InitDatabase; 8 import edu.rpi.metpetdb.server.model.User;9 9 10 10 -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/model/SampleCloneTest.java
r206 r524 7 7 8 8 import edu.rpi.metpetdb.client.error.NoSuchObjectException; 9 import edu.rpi.metpetdb.client.model.Sample DTO;9 import edu.rpi.metpetdb.client.model.Sample; 10 10 import edu.rpi.metpetdb.server.DatabaseTestCase; 11 11 import edu.rpi.metpetdb.server.InitDatabase; … … 35 35 hbm.setClassMapper(cloneMapper); 36 36 37 final Sample DTO sampleDTO = (SampleDTO) hbm.clone(sample);38 assertEquals(sample .getLocation(), sampleDTO.getLocation());37 final Sample sample2 = (Sample) hbm.clone(sample); 38 assertEquals(sample2.getLocation(), sample.getLocation()); 39 39 } 40 40 -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/search/HibernateSearchTest.java
r499 r524 26 26 27 27 import edu.rpi.metpetdb.client.model.DateSpan; 28 import edu.rpi.metpetdb.client.model.ElementDTO; 29 import edu.rpi.metpetdb.client.model.OxideDTO; 30 import edu.rpi.metpetdb.client.model.RockTypeDTO; 31 import edu.rpi.metpetdb.client.model.SearchElementDTO; 32 import edu.rpi.metpetdb.client.model.SearchOxideDTO; 33 import edu.rpi.metpetdb.client.model.SearchSampleDTO; 34 import edu.rpi.metpetdb.client.model.UserDTO; 28 import edu.rpi.metpetdb.client.model.Element; 29 import edu.rpi.metpetdb.client.model.Oxide; 30 import edu.rpi.metpetdb.client.model.RockType; 31 import edu.rpi.metpetdb.client.model.Sample; 32 import edu.rpi.metpetdb.client.model.SearchElement; 33 import edu.rpi.metpetdb.client.model.SearchOxide; 34 import edu.rpi.metpetdb.client.model.SearchSample; 35 import edu.rpi.metpetdb.client.model.User; 35 36 import edu.rpi.metpetdb.client.model.properties.SearchProperty; 36 37 import edu.rpi.metpetdb.client.model.properties.SearchSampleProperty; 37 38 import edu.rpi.metpetdb.server.DatabaseTestCase; 38 39 import edu.rpi.metpetdb.server.InitDatabase; 39 import edu.rpi.metpetdb.server.model.Sample;40 import edu.rpi.metpetdb.server.model.User;41 40 42 41 public class HibernateSearchTest extends DatabaseTestCase { … … 192 191 @Test 193 192 public void testSearchSampleSearch() { 194 final SearchSample DTO searchSamp = new SearchSampleDTO();193 final SearchSample searchSamp = new SearchSample(); 195 194 196 195 // searchSamp.setSesarNumber("000000000"); 197 196 searchSamp.setAlias("1"); 198 final RockType DTO rockType1 = new RockTypeDTO();197 final RockType rockType1 = new RockType(); 199 198 rockType1.setRockType("logitech"); 200 final RockType DTO rockType2 = new RockTypeDTO();199 final RockType rockType2 = new RockType(); 201 200 rockType2.setRockType("rockie rock"); 202 201 searchSamp.addPossibleRockType(rockType1); … … 306 305 @Test 307 306 public void testPublicOrUserSamples() { 308 final User DTO testUser = new UserDTO();307 final User testUser = new User(); 309 308 testUser.setId(2); 310 309 testUser.setName("matt"); … … 346 345 @Test 347 346 public void testSampleFilteringByUserWithDates() { 348 final User DTO testUser = new UserDTO();347 final User testUser = new User(); 349 348 testUser.setId(2); 350 349 testUser.setName("matt"); … … 396 395 @Test 397 396 public void testOxideSearch(){ 398 final SearchSample DTO searchSamp = new SearchSampleDTO();399 Oxide DTO tempOxide = new OxideDTO();397 final SearchSample searchSamp = new SearchSample(); 398 Oxide tempOxide = new Oxide(); 400 399 tempOxide.setSpecies("al2o3"); 401 400 searchSamp.addOxide(tempOxide, 10f, 16f); … … 424 423 if (((Set) methodResult).size() > 0) { 425 424 final BooleanQuery setQuery = new BooleanQuery(); 426 for (SearchOxide DTO o : (Set<SearchOxideDTO>) methodResult) {425 for (SearchOxide o : (Set<SearchOxide>) methodResult) { 427 426 final RangeFilter rangeFilter = new RangeFilter("subsample_chemicalAnalysis_oxides_amount", NumberUtils.float2sortableStr(o.getLowerBound()), NumberUtils.float2sortableStr(o.getUpperBound()),true, true); 428 427 final TermQuery oxideQuery = new TermQuery(new Term("subsample_chemicalAnalysis_oxides_oxide_species", o.getSpecies())); … … 437 436 if (((Set) methodResult).size() > 0) { 438 437 final BooleanQuery setQuery = new BooleanQuery(); 439 for (SearchElement DTO o : (Set<SearchElementDTO>) methodResult) {438 for (SearchElement o : (Set<SearchElement>) methodResult) { 440 439 final RangeFilter rangeFilter = new RangeFilter("subsample_chemicalAnalysis_elements_amount", NumberUtils.float2sortableStr(o.getLowerBound()), NumberUtils.float2sortableStr(o.getUpperBound()),true, true); 441 440 final TermQuery elementQuery = new TermQuery(new Term("subsample_chemicalAnalysis_elements_element_symbol", o.getElementSymbol())); … … 464 463 @Test 465 464 public void testElementSearch(){ 466 final SearchSample DTO searchSamp = new SearchSampleDTO();467 Element DTO tempElement = new ElementDTO();465 final SearchSample searchSamp = new SearchSample(); 466 Element tempElement = new Element(); 468 467 tempElement.setSymbol("al"); 469 468 searchSamp.addElement(tempElement, 4.9f, 12.0f); … … 492 491 if (((Set) methodResult).size() > 0) { 493 492 final BooleanQuery setQuery = new BooleanQuery(); 494 for (SearchOxide DTO o : (Set<SearchOxideDTO>) methodResult) {493 for (SearchOxide o : (Set<SearchOxide>) methodResult) { 495 494 final RangeFilter rangeFilter = new RangeFilter("subsample_chemicalAnalysis_oxides_amount", NumberUtils.float2sortableStr(o.getLowerBound()), NumberUtils.float2sortableStr(o.getUpperBound()),true, true); 496 495 final TermQuery oxideQuery = new TermQuery(new Term("subsample_chemicalAnalysis_oxides_oxide_species", o.getSpecies())); … … 505 504 if (((Set) methodResult).size() > 0) { 506 505 final BooleanQuery setQuery = new BooleanQuery(); 507 for (SearchElement DTO o : (Set<SearchElementDTO>) methodResult) {506 for (SearchElement o : (Set<SearchElement>) methodResult) { 508 507 final RangeFilter rangeFilter = new RangeFilter("subsample_chemicalAnalysis_elements_amount", NumberUtils.float2sortableStr(o.getLowerBound()), NumberUtils.float2sortableStr(o.getUpperBound()),true, true); 509 508 final TermQuery elementQuery = new TermQuery(new Term("subsample_chemicalAnalysis_elements_element_symbol", o.getElementSymbol())); … … 533 532 public void testSampleSearch() { 534 533 // In the actual search, we will receive User information as a parameter 535 final User DTO testUser = new UserDTO();534 final User testUser = new User(); 536 535 testUser.setId(2); 537 536 testUser.setName("matt"); … … 539 538 540 539 // In the actual search, we will receive search criteria as a 541 // SearchSample DTO542 final SearchSample DTO searchSamp = new SearchSampleDTO();540 // SearchSample 541 final SearchSample searchSamp = new SearchSample(); 543 542 // searchSamp.setAlias("1"); 544 /* final RockType DTO rockType1 = new RockTypeDTO();543 /* final RockType rockType1 = new RockType(); 545 544 rockType1.setRockType("type 2"); 546 final RockType DTO rockType2 = new RockTypeDTO();545 final RockType rockType2 = new RockType(); 547 546 rockType2.setRockType("type 3"); 548 547 searchSamp.addPossibleRockType(rockType1); 549 548 searchSamp.addPossibleRockType(rockType2); 550 */ Oxide DTO tempOxide = new OxideDTO();549 */ Oxide tempOxide = new Oxide(); 551 550 tempOxide.setSpecies("al2o3"); 552 551 searchSamp.addOxide(tempOxide, 9f, 17f); … … 605 604 if (((Set) methodResult).size() > 0) { 606 605 final BooleanQuery setQuery = new BooleanQuery(); 607 for (SearchOxide DTO o : (Set<SearchOxideDTO>) methodResult) {606 for (SearchOxide o : (Set<SearchOxide>) methodResult) { 608 607 final RangeFilter rangeFilter = new RangeFilter("subsample_chemicalAnalysis_oxides_amount", NumberUtils.float2sortableStr(o.getLowerBound()), NumberUtils.float2sortableStr(o.getUpperBound()),true, true); 609 608 final TermQuery oxideQuery = new TermQuery(new Term("subsample_chemicalAnalysis_oxides_oxide_species", o.getSpecies())); … … 618 617 if (((Set) methodResult).size() > 0) { 619 618 final BooleanQuery setQuery = new BooleanQuery(); 620 for (SearchElement DTO o : (Set<SearchElementDTO>) methodResult) {619 for (SearchElement o : (Set<SearchElement>) methodResult) { 621 620 final RangeFilter rangeFilter = new RangeFilter("subsample_chemicalAnalysis_elements_amount", NumberUtils.float2sortableStr(o.getLowerBound()), NumberUtils.float2sortableStr(o.getUpperBound()),true, true); 622 621 final TermQuery elementQuery = new TermQuery(new Term("subsample_chemicalAnalysis_elements_element_symbol", o.getElementSymbol())); -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/search/SampleSearch.java
r484 r524 2 2 3 3 import java.util.Iterator; 4 import java.util.LinkedList;5 4 import java.util.List; 6 5 7 import org.hibernate.Query;8 6 import org.hibernate.Session; 9 7 import org.junit.Test; 10 8 11 9 import edu.rpi.metpetdb.client.error.NoSuchObjectException; 12 import edu.rpi.metpetdb.client.model. AttributeDTO;10 import edu.rpi.metpetdb.client.model.User; 13 11 import edu.rpi.metpetdb.server.DatabaseTestCase; 14 12 import edu.rpi.metpetdb.server.InitDatabase; 15 import edu.rpi.metpetdb.server.model.User;16 13 17 14 //TODO make some generic methods in databasetestcase -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/search/SearchFilters.java
r484 r524 13 13 import org.postgis.Polygon; 14 14 15 import edu.rpi.metpetdb.client.model.Sample; 15 16 import edu.rpi.metpetdb.server.DatabaseTestCase; 16 17 import edu.rpi.metpetdb.server.InitDatabase; 17 import edu.rpi.metpetdb.server.model.Sample;18 18 19 19 public class SearchFilters extends DatabaseTestCase { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/search/SearchMinerals.java
r476 r524 11 11 import org.junit.Test; 12 12 13 import edu.rpi.metpetdb.client.model.Mineral; 14 import edu.rpi.metpetdb.client.model.Sample; 15 import edu.rpi.metpetdb.client.model.SampleMineral; 13 16 import edu.rpi.metpetdb.server.DatabaseTestCase; 14 17 import edu.rpi.metpetdb.server.InitDatabase; 15 import edu.rpi.metpetdb.server.model.Mineral;16 import edu.rpi.metpetdb.server.model.Sample;17 import edu.rpi.metpetdb.server.model.SampleMineral;18 18 19 19 public class SearchMinerals extends DatabaseTestCase { -
trunk/mpdb-test-server/test/edu/rpi/metpetdb/server/search/SearchOxidesAndElements.java
r480 r524 16 16 import org.junit.Test; 17 17 18 import edu.rpi.metpetdb.client.model.Sample; 18 19 import edu.rpi.metpetdb.server.DatabaseTestCase; 19 20 import edu.rpi.metpetdb.server.InitDatabase; 20 import edu.rpi.metpetdb.server.model.Sample;21 21 22 22 public class SearchOxidesAndElements extends DatabaseTestCase {
