Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data object migration: Additional unit tests for value migrations
Unit tests documenting value migrations for DoList, DoSet and Map. 315763
- Loading branch information
1 parent
e5875db
commit f2657d7
Showing
3 changed files
with
193 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...org/eclipse/scout/rt/dataobject/migration/fixture/house/RoomTypesCollectionFixtureDo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright (c) 2010-2021 BSI Business Systems Integration AG. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* BSI Business Systems Integration AG - initial API and implementation | ||
*/ | ||
package org.eclipse.scout.rt.dataobject.migration.fixture.house; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import javax.annotation.Generated; | ||
|
||
import org.eclipse.scout.rt.dataobject.DoEntity; | ||
import org.eclipse.scout.rt.dataobject.DoList; | ||
import org.eclipse.scout.rt.dataobject.DoSet; | ||
import org.eclipse.scout.rt.dataobject.DoValue; | ||
import org.eclipse.scout.rt.dataobject.TypeName; | ||
import org.eclipse.scout.rt.dataobject.TypeVersion; | ||
import org.eclipse.scout.rt.dataobject.migration.fixture.version.CharlieFixtureTypeVersions.CharlieFixture_1; | ||
|
||
/** | ||
* Used for value migration tests for lists, sets and maps. | ||
*/ | ||
@TypeName("charlieFixture.RoomTypesCollectionFixture") | ||
@TypeVersion(CharlieFixture_1.class) | ||
public class RoomTypesCollectionFixtureDo extends DoEntity { | ||
|
||
public DoList<RoomTypeFixtureStringId> roomTypesList() { | ||
return doList("roomTypesList"); | ||
} | ||
|
||
public DoSet<RoomTypeFixtureStringId> roomTypesSet() { | ||
return doSet("roomTypesSet"); | ||
} | ||
|
||
public DoValue<Map<RoomTypeFixtureStringId, RoomFixtureDo>> roomTypesMap() { | ||
return doValue("roomTypesMap"); | ||
} | ||
|
||
/* ************************************************************************** | ||
* GENERATED CONVENIENCE METHODS | ||
* *************************************************************************/ | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public RoomTypesCollectionFixtureDo withRoomTypesList(Collection<? extends RoomTypeFixtureStringId> roomTypesList) { | ||
roomTypesList().updateAll(roomTypesList); | ||
return this; | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public RoomTypesCollectionFixtureDo withRoomTypesList(RoomTypeFixtureStringId... roomTypesList) { | ||
roomTypesList().updateAll(roomTypesList); | ||
return this; | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public List<RoomTypeFixtureStringId> getRoomTypesList() { | ||
return roomTypesList().get(); | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public RoomTypesCollectionFixtureDo withRoomTypesSet(Collection<? extends RoomTypeFixtureStringId> roomTypesSet) { | ||
roomTypesSet().updateAll(roomTypesSet); | ||
return this; | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public RoomTypesCollectionFixtureDo withRoomTypesSet(RoomTypeFixtureStringId... roomTypesSet) { | ||
roomTypesSet().updateAll(roomTypesSet); | ||
return this; | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public Set<RoomTypeFixtureStringId> getRoomTypesSet() { | ||
return roomTypesSet().get(); | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public RoomTypesCollectionFixtureDo withRoomTypesMap(Map<RoomTypeFixtureStringId, RoomFixtureDo> roomTypesMap) { | ||
roomTypesMap().set(roomTypesMap); | ||
return this; | ||
} | ||
|
||
@Generated("DoConvenienceMethodsGenerator") | ||
public Map<RoomTypeFixtureStringId, RoomFixtureDo> getRoomTypesMap() { | ||
return roomTypesMap().get(); | ||
} | ||
} |